From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/7] pinctrl: enable pxa3xx pinmux
Date: Tue, 29 Nov 2011 14:46:41 +0000 [thread overview]
Message-ID: <201111291446.41815.arnd@arndb.de> (raw)
In-Reply-To: <CAN1soZxhZUDhyTde2=PEzzZzar7EowHd=YSfXMXXjtjGQbqO1w@mail.gmail.com>
On Monday 28 November 2011, Haojian Zhuang wrote:
>
> How about define cpu_is_pxa3xx() in both arch-pxa and arch-mmp? Maybe
> it could be simpler. Since we have similar issue in gpio driver too.
That would work, but I think the solution that Linus suggested is cleaner.
My preferred solution would be to make the detection data driven instead
of coded into the probe function. What I mean with this is to have
the four versions use a fixed data structure like this:
static const struct pxa3xx_pinmux_info pxa300_pinmux = {
.cpuid = PINMUX_PXA300,
.grp = pxa300_pin_groups,
.func = pxa300_pmx_functions,
.num_grps = ARRAY_SIZE(pxa300_pin_groups),
.num_funcs = ARRAY_SIZE(pxa300_pmx_functions),
.desc = &pxa300_pctrl_desc,
.range = pxa300_gpio_ranges,
.range_num = ARRAY_SIZE(pxa300_gpio_ranges),
};
static const struct pxa3xx_pinmux_info pxa310_pinmux = {
.cpuid = PINMUX_PXA320,
.grp = pxa310_pin_groups,
.func = pxa310_pmx_functions,
.num_grps = ARRAY_SIZE(pxa310_pin_groups),
.num_funcs = ARRAY_SIZE(pxa310_pmx_functions),
.desc = &pxa310_pctrl_desc,
.range = pxa310_gpio_ranges,
.range_num = ARRAY_SIZE(pxa310_gpio_ranges),
};
static const struct pxa3xx_pinmux_info pxa320_pinmux = {
...
};
static struct platform_device_id pxa3xx_pinmux_ids = {
{ .name = "pxa300-pinmux", .id = (unsigned long)&pxa300_pinmux, },
{ .name = "pxa310-pinmux", .id = (unsigned long)&pxa310_pinmux, },
{ .name = "pxa320-pinmux", .id = (unsigned long)&pxa320_pinmux, },
{ .name = "pxa910-pinmux", .id = (unsigned long)&pxa910_pinmux, },
};
static struct platform_driver pxa3xx_pinmux_driver = {
.driver = {
.owner = THIS_MODULE,
},
.id_entry = pxa3xx_pinmux_ids,
.probe = pxa3xx_pinmux_probe,
.remove = __devexit_p(pxa3xx_pinmux_remove),
};
Then you can look at the pxa3xx_pinmux_info pointer in the probe function
and do whatever else is necessary.
Another entirely different approach would be to split the driver into
multiple files, one for each soc plus one for the common parts, so you
just build the parts you need for the configuration.
Arnd
next prev parent reply other threads:[~2011-11-29 14:46 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 [this message]
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
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=201111291446.41815.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.