[PATCH 6/7] ARM: pxa: enable pinmux mapping in zylonite

Linus Walleij linus.walleij at linaro.org
Mon Nov 28 04:32:06 EST 2011


On Sat, Nov 26, 2011 at 4:53 AM, Arnd Bergmann <arnd at arndb.de> wrote:
> On Friday 25 November 2011, Haojian Zhuang wrote:
>> Remove MFP operation in zylonite. Use pinmux mapping instead.
>>
>> +#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.

No problem at all, if I just get a patch to extend the mapping with whatever
is needed to use large common subsets I'll review/merge, it looks pretty
useful for PXA.

> 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?

It's a bit costly since it involves making deep copies of structs
that in turn contain a few strings each, leading to a lot of kstrdup()
happening for a large map, but I'll propose something for the single
in-kernel user so we can see how it looks.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list