From: arnd@arndb•de (Arnd Bergmann)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 6/7] ARM: pxa: enable pinmux mapping in zylonite
Date: Sat, 26 Nov 2011 03:53:35 +0000 [thread overview]
Message-ID: <201111260353.36899.arnd@arndb.de> (raw)
In-Reply-To: <1322262544-7854-7-git-send-email-haojian.zhuang@marvell.com>
On Friday 25 November 2011, Haojian Zhuang wrote:
> Remove MFP operation in zylonite. Use pinmux mapping instead.
>
> Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell•com>
> ---
> arch/arm/mach-pxa/Kconfig | 1 +
> arch/arm/mach-pxa/devices.c | 15 ++
> arch/arm/mach-pxa/devices.h | 1 +
> arch/arm/mach-pxa/include/mach/zylonite.h | 2 +
> arch/arm/mach-pxa/pxa3xx.c | 1 +
> arch/arm/mach-pxa/zylonite.c | 6 +
> arch/arm/mach-pxa/zylonite_pxa300.c | 298 +++++++++++------------------
> arch/arm/mach-pxa/zylonite_pxa320.c | 211 +++++----------------
> 8 files changed, 183 insertions(+), 352 deletions(-)
This looks quite nice overall, but there is one thing that made me wonder if there
should be a better way to express it:
> +#define COMMON_PINMUX_MAP() \
> + { \
> + .name = "uart2", \
> + .ctrl_dev_name = "pinctrl.0", \
> + .function = "uart2", \
> + .dev_name = "pxa2xx-uart.2", \
> + .group = "stuart1", \
> + .hog_on_boot = true, \
> + }, { \
> + .name = "key", \
> + .ctrl_dev_name = "pinctrl.0", \
> + .function = "key", \
> + .dev_name = "pxa27x-keyboard", \
> + .group = "key0", \
> + .hog_on_boot = true, \
> + }, { \
> + .name = "mmc1", \
> + .ctrl_dev_name = "pinctrl.0", \
> + .function = "mmc1", \
> + .group = "mmc1_0", \
> + .hog_on_boot = true, \
> + }, \
> + PINMUX_MAP_PRIMARY_SYS_HOG("mmc2", "mmc2"), \
> + PINMUX_MAP_PRIMARY_SYS_HOG("usbh", "usbh"), \
> + PINMUX_MAP_PRIMARY_SYS_HOG("ac97", "ac97"), \
> + PINMUX_MAP_PRIMARY_SYS_HOG("smc", "smc"), \
> + PINMUX_MAP_PRIMARY("pwm3", "pwm3", "pxa27x-pwm.1"), \
> + PINMUX_MAP_PRIMARY("uart1", "uart1", "pxa2xx-uart.1"), \
> + PINMUX_MAP_PRIMARY("ssp3", "ssp3", "pxa27x-ssp.2"), \
> + PINMUX_MAP_PRIMARY("lcd", "lcd", "pxa2xx-fb"), \
> + PINMUX_MAP_PRIMARY("i2c", "i2c", "pxa2xx-i2c.0")
> +
> +static struct pinmux_map pxa300_pmx_map[] = {
> + COMMON_PINMUX_MAP(),
> + {
> + .name = "uart0",
> + .ctrl_dev_name = "pinctrl.0",
> + .function = "uart0",
> + .dev_name = "pxa2xx-uart.0",
> + .group = "ffuart0",
> + },
> };
I think we should not be forced to use macros like this in order to extend a common
pinmux mapping. Unfortunately, I can't see an easy way to do it differently
with the pinmux core, but it might not be too late to extend the interfaces now.
I also noticed that the pinmux_map arrays are not marked __initdata, because
it gets referenced later. This means that in a kernel that supports many machines,
we also have to keep all pinmux configurations around at runtime.
Linus, what do you think about changing the pinmux_register_mappings function
to make a copy of the data in order to let the platform code mark the data as
__initdata, and to allow appending the maps at boot time so that the above
can become two arrays that are registered individually?
> /* GPIO pin assignment */
> - gpio_eth_irq = mfp_to_gpio(MFP_PIN_GPIO9);
> + gpio_eth_irq = 90;
> +#if 0
> + /* FIXME: can't support additional gpio pins */
> gpio_debug_led1 = mfp_to_gpio(MFP_PIN_GPIO1_2);
> gpio_debug_led2 = mfp_to_gpio(MFP_PIN_GPIO4_2);
> +#endif
If I read this correctly, your comment here refers to a different aspect of the
same problem, not being able to amend the mapping at a later point.
Arnd
next prev parent reply other threads:[~2011-11-26 3:53 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-25 23:08 [PATCH 0/7] pinctrl: enable pxa pinmux Haojian Zhuang
2011-11-25 23:08 ` [PATCH 1/7] pinctrl: enable pxa3xx pinmux Haojian Zhuang
2011-11-28 9:08 ` Linus Walleij
2011-11-28 9:50 ` Haojian Zhuang
2011-11-28 13:17 ` Linus Walleij
2011-11-28 13:23 ` Haojian Zhuang
2011-11-29 14:46 ` Arnd Bergmann
2011-11-29 15:36 ` Haojian Zhuang
2011-11-29 16:04 ` Arnd Bergmann
2011-11-28 20:21 ` Stephen Warren
2011-11-29 2:31 ` Eric Miao
2011-11-29 8:39 ` Linus Walleij
2011-11-29 8:56 ` Haojian Zhuang
2011-11-30 12:00 ` Linus Walleij
2011-11-25 23:08 ` [PATCH 2/7] gpio: make pxa gpio depend on pinmux Haojian Zhuang
2011-11-28 9:09 ` Linus Walleij
2011-11-25 23:09 ` [PATCH 3/7] ARM: pxa: enable pinmux in pxa pwm Haojian Zhuang
2011-11-28 9:18 ` Linus Walleij
2011-11-28 12:49 ` Russell King - ARM Linux
2011-11-25 23:09 ` [PATCH 4/7] tty: serial: support pinmux in pxa serial Haojian Zhuang
2011-11-28 9:15 ` Linus Walleij
2011-11-30 11:04 ` Greg KH
2011-11-25 23:09 ` [PATCH 5/7] fb: pxa: support pinmux operation Haojian Zhuang
2011-11-28 9:19 ` Linus Walleij
2011-12-02 21:53 ` Florian Tobias Schandinat
2011-12-05 13:07 ` Linus Walleij
2011-11-25 23:09 ` [PATCH 6/7] ARM: pxa: enable pinmux mapping in zylonite Haojian Zhuang
2011-11-26 3:53 ` Arnd Bergmann [this message]
2011-11-26 4:45 ` Haojian Zhuang
2011-11-28 9:32 ` Linus Walleij
2011-11-25 23:09 ` [PATCH 7/7] ARM: mmp: enable pinmux on ttc dkb Haojian Zhuang
2011-11-28 9:22 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201111260353.36899.arnd@arndb.de \
--to=arnd@arndb$(echo .)de \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox