From: aisheng.dong@freescale.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] pinctrl: pinctrl-imx: add imx pinctrl core driver
Date: Wed, 18 Apr 2012 11:38:02 +0800 [thread overview]
Message-ID: <20120418033801.GA18021@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <20120417123006.GC3852@pengutronix.de>
On Tue, Apr 17, 2012 at 08:30:06PM +0800, Sascha Hauer wrote:
> On Tue, Apr 17, 2012 at 05:57:23PM +0800, Dong Aisheng wrote:
> > Sascha & Shawn,
> >
> > Just let you know:
> > After changes the pinctrl table may look like:
> > (i also removed fsl,* config properties since it was introduced for better
> > readability before, but after dtc macro support is available, it could also
> > be removed. So i removed now. Then the using is much similar as iomux-v3).
> >
> > iomuxc at 020e0000 {
> > compatible = "fsl,imx6q-iomuxc";
> > reg = <0x020e0000 0x4000>;
> >
> > /* shared pinctrl settings */
> > uart4 {
> > pinctrl_uart4_1: uart4grp-1 {
> > fsl,pins = <58 61>;
> > fsl,configs = <0x12407>
>
> Why do we have a hex value for the config now? This should be
> independent on how we describe the mux settings.
>
Yes, that's independent on mux.
Originally for config, it is like:
fsl,pull = <2>;
fsl,pue = <1>;
fsl,pke = <1>;
fsl,speed = <2>;
fsl,drive-strength = <6>;
fsl,slew-rate = <1>;
fsl,hysteresis = <1>;
But i think, as mux, after dtc supports macro, we do not need them any more.
A macro seems enough to tell people what the config data means.
Like:
/define/ MX6Q_UART_PAD_CTRL 0x12407
Since i have already changed mux to raw data, i also want to change config to
raw data at the same time and this is also easy to use.
> Also I think a single fsl,configs entry for a pin group is not
> enough, what for example with I2C where the data line needs a pullup
> whereas the clock line does not?
>
For this case, the hex value for fsl,configs has not difference as the original one.
The original purpose is put the same config pins in one group and the config value
functions on all the pins in that group.
But if we have a pin needs different config, we need separate it in another group.
For example,
i2c1 {
pinctrl_i2c_scl: i2c1clk-1 {
fsl,pins = <...>;
fsl,configs = <PULLUP..>;
};
pinctrl_i2c_sda: i2c1sda-1 {
fsl,pins = <...>;
fsl,configs = <NO_PULLUP...>;
};
};
I have ever also considered another approach for imx which can avoid this issue
by dropping the fsl,configs property which is like:
i2c1 {
pinctrl_i2c1: i2c1 {
fsl,pins = <MX6Q_PAD_EIM_D21__I2C1_SCL PULLUP..
MX6Q_PAD_EIM_D28__I2C1_SDA PULLDOWN..>
};
};
Each pin can have its specific pad config setting.
Without macro support, it is like:
i2c1 {
pinctrl_i2c1: i2c1 {
/* the value is write randomly, just for showing example */
fsl,pins = <1001 0x13502 /* with pull up */
1056 0x3502>; /* no pull up */
};
};
The benefit is that it can get better flexibility and the drawback is that
for pins have no config, we still need write a dummy value
to tell the core this pin have no config.
For iomux v3, it's
#define NO_PAD_CTRL (1 << 16)
It works for mx5, but for mx6, it needs to be :
#define NO_PAD_CTRL (1 << 17) /* bigger than 16 */
(It seems it's not good enough since in the future it may need change again)
Then dts file will look like:
pinctrl_i2c1: i2c1 {
fsl,pins = <1001 0x20000 /* no config */
1056 0x20000>; /* no config */
};
pinctrl_xxx: xxx1 {
fsl,pins = <1001 0x20000 /* no config */
1056 0x20000 /* no config */
1066 0x20000 /* no config */
1076 0x20000 /* no config */
1086 0x20000 /* no config */
1096 0x20000 /* no config */
1006 0x20000 /* no config */
1016 0x20000 /* no config */
1026 0x20000 /* no config */
};
First the 0x20000 cause confusing, second the 0x20000 data is a little redundancy
and many pins may have the same config.
One way may add a property to tell core whether pins have config, but that seems
does not work since it's possible some pins have config while others not.
This is unlike the current way, we can do not define fsl,configs property to tell
driver no config need for these pins.
And based on the assumption that most pins have the same pin config setting.
I chosed the original approach.
The is also the same way as Tegra does.
What do you think of those two approaches? What's your suggestion?
Regards
Dong Aisheng
next prev parent reply other threads:[~2012-04-18 3:38 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 16:18 [PATCH 1/3] pinctrl: pinctrl-imx: add imx pinctrl core driver Dong Aisheng
2012-04-13 16:18 ` [PATCH 3/3] ARM: imx6q: switch to use pinctrl driver 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
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 [this message]
[not found] ` <1334333915-1174-2-git-send-email-b29396@freescale.com>
2012-04-17 20:12 ` [PATCH 2/3] pinctrl: pinctrl-imx: add imx6q pinctrl driver Stephen Warren
2012-04-18 3:40 ` Dong Aisheng
2012-04-17 20:58 ` [PATCH 1/3] pinctrl: pinctrl-imx: add imx pinctrl core driver 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=20120418033801.GA18021@shlinux2.ap.freescale.net \
--to=aisheng.dong@freescale.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).