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 16:04:55 +0000 [thread overview]
Message-ID: <201111291604.55273.arnd@arndb.de> (raw)
In-Reply-To: <CAN1soZwe03c485uYTps5ixBrx_4q=JrcTA7VwkcqrT99hZCJzA@mail.gmail.com>
On Tuesday 29 November 2011, Haojian Zhuang wrote:
> > 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, },
> > };
> It's cleaner. And I'm considering to extend pxa3xx_pinmux_info. I'll
> also add pointers to pads[] and mfpr[]. Since pads[] and mfpr[] are
> large, more silicons are supported and more memory space is occupied.
> So I'll define pads[] and mfpr[] as __initdata and copy them into
> pxa3xx_pinmux_info structure. So I'll use both your solution and
> memcopy in probe().
Ok. However, I think it needs to be __devinitdata if the platform
device might be added after the pinmux driver is added.
> > 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.
> >
> Is it OK to define pinmux-pxa3xx.c, pinmux-pxa300.c, ...? I'll append
> 8 files since I have 7 silicons.
I think it's ok, but it's your decision if you think it's too much.
You could also end up with fewer than 8 files if you group a few
socs together in case they are almost identical, but keep them
apart from the somewhat more different ones.
I would not recommend having one file per soc if that ends up duplicating
a lot of code that would otherwise be shared, but I think separate
modules would be preferred if you can make all the shared code end
up in the shared file and each individual driver get linked in only
when the configuration for that soc is enabled.
One more clarification: The idea here was to have each file as a separate
module with its own platform driver registration and one private
pinmux_info structure calling functions from the common module, but
never have common code call out to the individual drivers.
Arnd
next prev parent reply other threads:[~2011-11-29 16:04 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 [this message]
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=201111291604.55273.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.