From: Dong Aisheng <aisheng.dong@freescale.com>
To: Shawn Guo <shawn.guo@linaro.org>
Cc: Dong Aisheng <dongas86@gmail.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
<linus.walleij@stericsson.com>,
<devicetree-discuss@lists.ozlabs.org>,
<linux-kernel@vger.kernel.org>, <rob.herring@calxeda.com>,
<kernel@pengutronix.de>, <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/3] pinctrl: pinctrl-imx: add imx pinctrl core driver
Date: Mon, 16 Apr 2012 11:47:14 +0800 [thread overview]
Message-ID: <20120416034713.GB17173@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <20120415141736.GG24997@S2101-09.ap.freescale.net>
On Sun, Apr 15, 2012 at 10:17:43PM +0800, Shawn Guo wrote:
> On Sun, Apr 15, 2012 at 11:49:04AM +0800, Dong Aisheng wrote:
> ...
> > >> +iomuxc@020e0000 {
> > >> + compatible = "fsl,imx6q-iomuxc";
> > >> + reg = <0x020e0000 0x4000>;
> > >> +
> > >> + /* shared pinctrl settings */
> > >> + usdhc4 {
> > >> + pinctrl_usdhc4_1: usdhc4grp-1 {
> > >> + fsl,pins = "MX6Q_PAD_SD4_CMD",
> > >> + "MX6Q_PAD_SD4_CLK",
> > >> + "MX6Q_PAD_SD4_DAT0",
> > >> + "MX6Q_PAD_SD4_DAT1",
> > >> + "MX6Q_PAD_SD4_DAT2",
> > >> + "MX6Q_PAD_SD4_DAT3",
> > >> + "MX6Q_PAD_SD4_DAT4",
> > >> + "MX6Q_PAD_SD4_DAT5",
> > >> + "MX6Q_PAD_SD4_DAT6",
> > >> + "MX6Q_PAD_SD4_DAT7";
> > >
> > > Do we really want to have all combinations of all pins in the devicetree
> > > as strings? This is going to be huge.
> > >
> > Correct.
> > My plan is:
> > 1) not all combinations, just define frequently used ones since
> > it's hard to define all combinations groups for per based IMX.
> > (maybe we can try to add a fix-up function which can do minor changes
> > based on available ones, then user does not need to write a new group
> > caused by only a small change.
> > what do you think?)
> >
> > 2) When dt supports macro, will try convert string to integer macro.
> > Then it maybe:
> > fsl,pins = <MX6Q_PAD_SD4_CMD 0
> > MX6Q_PAD_SD4_CLK 0
> > MX6Q_PAD_SD4_DAT0 1
> > .................>,
> > Why i did not start pin id with a raw integer is because it's less
> > meaning to user and
> > not easy to read in dts file.
> >
> We may want to use integer from the beginning to reduce the churn on
> driver later.
>
> I'm thinking about documenting the definition we used to have in
> iomux-mx*.h in the binding document and assign id to each of them
> in order.
>
> pinmux id
> ------ --
> MX6Q_PAD_SD2_DAT1__USDHC2_DAT1 0
> MX6Q_PAD_SD2_DAT1__ECSPI5_SS0 1
> MX6Q_PAD_SD2_DAT1__WEIM_WEIM_CS_2 2
> ...
>
> The ordering between the list and imx6q_pin_regs[] array need to match.
>
> By looking at the binding document, we can just put pinmux-id into
> property "fsl,pins" (maybe rename it to "fsl,pinmux-ids") to get the
> desired pinmux settings. With doing so, we can gain the following.
>
> 1) The pinmux-id can be used as index to locate the entry in array
> imx6q_pin_regs[], so that the slow string lookup can be avoid.
>
> 2) Property "fsl,mux" can be dropped, as it's been encoded in
> imx6q_pin_regs[] entry.
>
> 3) Converting the existing board files to device tree will be much
> easier. We only need to find the pinmux-id of those existing
> definitions and put them in "fsl, pinmux-ids".
>
> 4) When DTC support macro, we can simply move the pinmux-id list from
> binding document into dts file. No driver change is needed at all.
>
> Thoughts?
>
Good suggestion.
I can do it and it's easy to change.
But as i said above, before the dtc macro support is available, the pinctrl
setting in dts file will be hard to read since it's all raw data.
It becomes
fsl,pins = <1 2 3 4 5 6 ....>;
People have to search the binding doc to see what the data means.
The question is how long the dtc macro support will be available?
I'm very willing to do like as you said if it's just a short time.
But if it's long time, do we still want to lose the readability right now?
Regards
Dong Aisheng
next prev parent reply other threads:[~2012-04-16 3:36 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 16:18 Dong Aisheng
2012-04-13 16:18 ` [PATCH 2/3] pinctrl: pinctrl-imx: add imx6q pinctrl driver Dong Aisheng
2012-04-17 20:12 ` Stephen Warren
2012-04-18 3:40 ` Dong Aisheng
2012-04-13 16:18 ` [PATCH 3/3] ARM: imx6q: switch to use " Dong Aisheng
2012-04-14 13:53 ` Sascha Hauer
2012-04-15 4:03 ` Dong Aisheng
2012-04-15 7:37 ` Shawn Guo
2012-04-16 3:35 ` Dong Aisheng
2012-04-20 1:08 ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-24 8:23 ` Linus Walleij
2012-04-24 8:46 ` Dong Aisheng
2012-04-17 20:23 ` Stephen Warren
2012-04-13 18:17 ` [PATCH 1/3] pinctrl: pinctrl-imx: add imx pinctrl core driver Dong Aisheng
2012-04-14 13:48 ` Sascha Hauer
2012-04-15 3:49 ` Dong Aisheng
2012-04-15 14:17 ` Shawn Guo
2012-04-15 14:45 ` Sascha Hauer
2012-04-15 17:29 ` Sascha Hauer
2012-04-16 1:47 ` Shawn Guo
2012-04-16 18:01 ` Stephen Warren
2012-04-16 3:47 ` Dong Aisheng [this message]
2012-04-16 3:46 ` Shawn Guo
2012-04-17 9:57 ` Dong Aisheng
2012-04-17 12:30 ` Sascha Hauer
2012-04-18 3:38 ` Dong Aisheng
2012-04-17 20:58 ` Stephen Warren
2012-04-18 7:19 ` Dong Aisheng
2012-04-18 18:06 ` Stephen Warren
2012-04-19 15:28 ` Shawn Guo
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=20120416034713.GB17173@shlinux2.ap.freescale.net \
--to=aisheng.dong@freescale.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dongas86@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=s.hauer@pengutronix.de \
--cc=shawn.guo@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®