Patchwork [v3,4/4] mmc: sdhci-imx-esdhc: convert to use pinctrl subsystem

login
register
mail settings
Submitter Dong Aisheng
Date April 26, 2012, 2:40 p.m.
Message ID <1335451227-27709-4-git-send-email-b29396@freescale.com>
Download mbox | patch
Permalink /patch/155283/
State New
Headers show

Comments

Dong Aisheng - April 26, 2012, 2:40 p.m.
From: Dong Aisheng <dong.aisheng@linaro.org>

This driver is shared between many platforms. Currently only imx6q has
pinctrl support, to avoid breaking other platforms that do not have pinctrl
support to run this driver, enable pinctrl dummy state for them before
they also convert to pinctrl subsystem.

Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
This patch depends on:
pinctrl: add pinctrl_provide_dummies interface for platforms to use
http://www.spinics.net/lists/arm-kernel/msg171538.html

ChangeLog v2->v3:
 * patch name updated.
   v1 name is ARM: imx6q: switch to use pinctrl driver
 * using pinctrl dummy state to avoid breaking other platforms to use this
   driver.

ChangeLog v1->v2:
 * using updated binding
---
 arch/arm/boot/dts/imx6q-arm2.dts               |    4 +++
 arch/arm/boot/dts/imx6q.dtsi                   |   32 ++++++++++++++++++++++++
 arch/arm/mach-imx/Kconfig                      |    2 +
 arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c |    2 +
 arch/arm/mach-imx/mach-cpuimx51.c              |    2 +
 arch/arm/mach-imx/mach-cpuimx51sd.c            |    2 +
 arch/arm/mach-imx/mach-eukrea_cpuimx25.c       |    2 +
 arch/arm/mach-imx/mach-mx25_3ds.c              |    2 +
 arch/arm/mach-imx/mach-mx35_3ds.c              |    2 +
 arch/arm/mach-imx/mach-mx51_3ds.c              |    2 +
 arch/arm/mach-imx/mach-mx51_babbage.c          |    2 +
 arch/arm/mach-imx/mach-mx51_efikamx.c          |    2 +
 arch/arm/mach-imx/mach-mx51_efikasb.c          |    2 +
 arch/arm/mach-imx/mach-mx53_ard.c              |    2 +
 arch/arm/mach-imx/mach-mx53_evk.c              |    2 +
 arch/arm/mach-imx/mach-mx53_loco.c             |    2 +
 arch/arm/mach-imx/mach-mx53_smd.c              |    2 +
 arch/arm/mach-imx/mach-pcm043.c                |    2 +
 arch/arm/mach-imx/mach-vpr200.c                |    2 +
 drivers/mmc/host/sdhci-esdhc-imx.c             |    9 ++++++
 20 files changed, 79 insertions(+), 0 deletions(-)
Stephen Warren - April 26, 2012, 4:32 p.m.
On 04/26/2012 08:40 AM, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
> 
> This driver is shared between many platforms. Currently only imx6q has
> pinctrl support, to avoid breaking other platforms that do not have pinctrl
> support to run this driver, enable pinctrl dummy state for them before
> they also convert to pinctrl subsystem.

The series,

Acked-by: Stephen Warren <swarren@wwwdotorg.org>

(My ack isn't meant to override or influence any discussions between
Freescale maintainers re: the binding, but more that the binding seems
to be /a/ reasonable solution, and is specified well enough that I
understand what's going on there)
Sascha Hauer - April 27, 2012, 7:35 a.m.
On Thu, Apr 26, 2012 at 10:40:27PM +0800, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
> 
> This driver is shared between many platforms. Currently only imx6q has
> pinctrl support, to avoid breaking other platforms that do not have pinctrl
> support to run this driver, enable pinctrl dummy state for them before
> they also convert to pinctrl subsystem.
> 
> Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
> ---
> This patch depends on:
> pinctrl: add pinctrl_provide_dummies interface for platforms to use
> http://www.spinics.net/lists/arm-kernel/msg171538.html
> 
> ChangeLog v2->v3:
>  * patch name updated.
>    v1 name is ARM: imx6q: switch to use pinctrl driver
>  * using pinctrl dummy state to avoid breaking other platforms to use this
>    driver.
> 
> ChangeLog v1->v2:
>  * using updated binding
> ---
>  arch/arm/boot/dts/imx6q-arm2.dts               |    4 +++
>  arch/arm/boot/dts/imx6q.dtsi                   |   32 ++++++++++++++++++++++++
>  arch/arm/mach-imx/Kconfig                      |    2 +
>  arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c |    2 +
>  arch/arm/mach-imx/mach-cpuimx51.c              |    2 +
>  arch/arm/mach-imx/mach-cpuimx51sd.c            |    2 +
>  arch/arm/mach-imx/mach-eukrea_cpuimx25.c       |    2 +
>  arch/arm/mach-imx/mach-mx25_3ds.c              |    2 +
>  arch/arm/mach-imx/mach-mx35_3ds.c              |    2 +
>  arch/arm/mach-imx/mach-mx51_3ds.c              |    2 +
>  arch/arm/mach-imx/mach-mx51_babbage.c          |    2 +
>  arch/arm/mach-imx/mach-mx51_efikamx.c          |    2 +
>  arch/arm/mach-imx/mach-mx51_efikasb.c          |    2 +
>  arch/arm/mach-imx/mach-mx53_ard.c              |    2 +
>  arch/arm/mach-imx/mach-mx53_evk.c              |    2 +
>  arch/arm/mach-imx/mach-mx53_loco.c             |    2 +
>  arch/arm/mach-imx/mach-mx53_smd.c              |    2 +
>  arch/arm/mach-imx/mach-pcm043.c                |    2 +
>  arch/arm/mach-imx/mach-vpr200.c                |    2 +

Here you are patching only the boards which happen to use the esdhc
controller, so we need to patch other boards when another driver gains
pinctrl. Let's add the provide_dummies call to the SoCs instead which
do not have pinctrl yet.

Sascha
Shawn Guo - April 27, 2012, 8:26 a.m.
On Fri, Apr 27, 2012 at 04:29:31PM +0800, Dong Aisheng wrote:
> You meant add provide_dummies call in imx*_soc_init call?
> We could do it but there might be a case that some boards are converted
> to use pinctrl while others still not but they're based on the same soc.
> For examples, 4 mx53 boards and we may not be able to convert them all at
> the same time.
> 
Only non-DT boot will call imx*_soc_init, while DT boot will not.  And
imx pinctrl only supports DT.
Dong Aisheng - April 27, 2012, 8:29 a.m.
On Fri, Apr 27, 2012 at 03:35:04PM +0800, Sascha Hauer wrote:
> On Thu, Apr 26, 2012 at 10:40:27PM +0800, Dong Aisheng wrote:
> > From: Dong Aisheng <dong.aisheng@linaro.org>
> > 
> > This driver is shared between many platforms. Currently only imx6q has
> > pinctrl support, to avoid breaking other platforms that do not have pinctrl
> > support to run this driver, enable pinctrl dummy state for them before
> > they also convert to pinctrl subsystem.
> > 
> > Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
> > ---
> > This patch depends on:
> > pinctrl: add pinctrl_provide_dummies interface for platforms to use
> > http://www.spinics.net/lists/arm-kernel/msg171538.html
> > 
> > ChangeLog v2->v3:
> >  * patch name updated.
> >    v1 name is ARM: imx6q: switch to use pinctrl driver
> >  * using pinctrl dummy state to avoid breaking other platforms to use this
> >    driver.
> > 
> > ChangeLog v1->v2:
> >  * using updated binding
> > ---
> >  arch/arm/boot/dts/imx6q-arm2.dts               |    4 +++
> >  arch/arm/boot/dts/imx6q.dtsi                   |   32 ++++++++++++++++++++++++
> >  arch/arm/mach-imx/Kconfig                      |    2 +
> >  arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c |    2 +
> >  arch/arm/mach-imx/mach-cpuimx51.c              |    2 +
> >  arch/arm/mach-imx/mach-cpuimx51sd.c            |    2 +
> >  arch/arm/mach-imx/mach-eukrea_cpuimx25.c       |    2 +
> >  arch/arm/mach-imx/mach-mx25_3ds.c              |    2 +
> >  arch/arm/mach-imx/mach-mx35_3ds.c              |    2 +
> >  arch/arm/mach-imx/mach-mx51_3ds.c              |    2 +
> >  arch/arm/mach-imx/mach-mx51_babbage.c          |    2 +
> >  arch/arm/mach-imx/mach-mx51_efikamx.c          |    2 +
> >  arch/arm/mach-imx/mach-mx51_efikasb.c          |    2 +
> >  arch/arm/mach-imx/mach-mx53_ard.c              |    2 +
> >  arch/arm/mach-imx/mach-mx53_evk.c              |    2 +
> >  arch/arm/mach-imx/mach-mx53_loco.c             |    2 +
> >  arch/arm/mach-imx/mach-mx53_smd.c              |    2 +
> >  arch/arm/mach-imx/mach-pcm043.c                |    2 +
> >  arch/arm/mach-imx/mach-vpr200.c                |    2 +
> 
> Here you are patching only the boards which happen to use the esdhc
> controller, so we need to patch other boards when another driver gains

Yes, theoretically, if a board does not have drivers running with pinctrl,
it may not need change.

There're so many boards under arch/arm/mach-imx/*:
b29396@shlinux2:~/upstream/linux-pinctrl$ ls arch/arm/mach-imx/mach-
mach-apf9328.c             mach-imx27_visstrim_m10.c  mach-mx31lilly.c           mach-mx51_efikamx.o        mach-pcm037_eet.c
mach-armadillo5x0.c        mach-imx6q.c               mach-mx31lilly.o           mach-mx51_efikasb.c        mach-pcm037_eet.o
mach-armadillo5x0.o        mach-imx6q.o               mach-mx31lite.c            mach-mx51_efikasb.o        mach-pcm037.o
mach-bug.c                 mach-kzm_arm11_01.c        mach-mx31lite.o            mach-mx53_ard.c            mach-pcm038.c
mach-bug.o                 mach-kzm_arm11_01.o        mach-mx31moboard.c         mach-mx53_ard.o            mach-pcm043.c
mach-cpuimx27.c            mach-mx1ads.c              mach-mx31moboard.o         mach-mx53_evk.c            mach-pcm043.o
mach-cpuimx35.c            mach-mx21ads.c             mach-mx35_3ds.c            mach-mx53_evk.o            mach-qong.c
mach-cpuimx51.c            mach-mx25_3ds.c            mach-mx35_3ds.o            mach-mx53_loco.c           mach-qong.o
mach-cpuimx51.o            mach-mx27_3ds.c            mach-mx50_rdp.c            mach-mx53_loco.o           mach-scb9328.c
mach-cpuimx51sd.c          mach-mx27ads.c             mach-mx51_3ds.c            mach-mx53_smd.c            mach-vpr200.c
mach-cpuimx51sd.o          mach-mx31_3ds.c            mach-mx51_3ds.o            mach-mx53_smd.o            mach-vpr200.o
mach-eukrea_cpuimx25.c     mach-mx31_3ds.o            mach-mx51_babbage.c        mach-mxt_td60.c
mach-imx27ipcam.c          mach-mx31ads.c             mach-mx51_babbage.o        mach-pca100.c
mach-imx27lite.c           mach-mx31ads.o             mach-mx51_efikamx.c        mach-pcm037.c

Some of them i'm not familiar and i don't know whether they may use pinctrl
so i just patched the affected ones.

One lazy method may be just patch all board files without pinctrl support
and it will not cause any error.

What's your suggestion?

> pinctrl. Let's add the provide_dummies call to the SoCs instead which
> do not have pinctrl yet.
> 
You meant add provide_dummies call in imx*_soc_init call?
We could do it but there might be a case that some boards are converted
to use pinctrl while others still not but they're based on the same soc.
For examples, 4 mx53 boards and we may not be able to convert them all at
the same time.

Regards
Dong Aisheng
Sascha Hauer - April 27, 2012, 8:31 a.m.
On Fri, Apr 27, 2012 at 04:29:31PM +0800, Dong Aisheng wrote:
> mach-imx27ipcam.c          mach-mx31ads.c             mach-mx51_babbage.o        mach-pca100.c
> mach-imx27lite.c           mach-mx31ads.o             mach-mx51_efikamx.c        mach-pcm037.c
> 
> Some of them i'm not familiar and i don't know whether they may use pinctrl
> so i just patched the affected ones.
> 
> One lazy method may be just patch all board files without pinctrl support
> and it will not cause any error.
> 
> What's your suggestion?
> 
> > pinctrl. Let's add the provide_dummies call to the SoCs instead which
> > do not have pinctrl yet.
> > 
> You meant add provide_dummies call in imx*_soc_init call?
> We could do it but there might be a case that some boards are converted
> to use pinctrl while others still not but they're based on the same soc.
> For examples, 4 mx53 boards and we may not be able to convert them all at
> the same time.

My point is that none of the mx5 boards have pinctrl since there is no
SoC driver for it.
For DT based boards pinctrl should be mandatory once the SoC has pinctrl
support. All non DT boards probably won't get pinctrl anyway.

Sascha
Sascha Hauer - April 27, 2012, 8:47 a.m.
On Fri, Apr 27, 2012 at 04:54:46PM +0800, Dong Aisheng wrote:
> On Fri, Apr 27, 2012 at 04:31:42PM +0800, Sascha Hauer wrote:
> > On Fri, Apr 27, 2012 at 04:29:31PM +0800, Dong Aisheng wrote:
> > > mach-imx27ipcam.c          mach-mx31ads.c             mach-mx51_babbage.o        mach-pca100.c
> > > mach-imx27lite.c           mach-mx31ads.o             mach-mx51_efikamx.c        mach-pcm037.c
> > > 
> > > Some of them i'm not familiar and i don't know whether they may use pinctrl
> > > so i just patched the affected ones.
> > > 
> > > One lazy method may be just patch all board files without pinctrl support
> > > and it will not cause any error.
> > > 
> > > What's your suggestion?
> > > 
> > > > pinctrl. Let's add the provide_dummies call to the SoCs instead which
> > > > do not have pinctrl yet.
> > > > 
> > > You meant add provide_dummies call in imx*_soc_init call?
> > > We could do it but there might be a case that some boards are converted
> > > to use pinctrl while others still not but they're based on the same soc.
> > > For examples, 4 mx53 boards and we may not be able to convert them all at
> > > the same time.
> > 
> > My point is that none of the mx5 boards have pinctrl since there is no
> > SoC driver for it.
> > For DT based boards pinctrl should be mandatory once the SoC has pinctrl
> > support. All non DT boards probably won't get pinctrl anyway.
> > 
> Ok, so i would be fine for me to change it in imx*_soc_init.
> BTW, there're:
> imx1_soc_init()
> imx25_soc_init()
> imx27_soc_init()
> imx31_soc_init()
> imx35_soc_init()
> imx50_soc_init()
> imx51_soc_init()
> imx53_soc_init()
> 
> I'm not sure about mx1, mx27, mx31
> Do you think if i could add them all?

Of course. Or do you see a pinctrl driver for any i.MX except i.MX6?

Sascha
Dong Aisheng - April 27, 2012, 8:54 a.m.
On Fri, Apr 27, 2012 at 04:31:42PM +0800, Sascha Hauer wrote:
> On Fri, Apr 27, 2012 at 04:29:31PM +0800, Dong Aisheng wrote:
> > mach-imx27ipcam.c          mach-mx31ads.c             mach-mx51_babbage.o        mach-pca100.c
> > mach-imx27lite.c           mach-mx31ads.o             mach-mx51_efikamx.c        mach-pcm037.c
> > 
> > Some of them i'm not familiar and i don't know whether they may use pinctrl
> > so i just patched the affected ones.
> > 
> > One lazy method may be just patch all board files without pinctrl support
> > and it will not cause any error.
> > 
> > What's your suggestion?
> > 
> > > pinctrl. Let's add the provide_dummies call to the SoCs instead which
> > > do not have pinctrl yet.
> > > 
> > You meant add provide_dummies call in imx*_soc_init call?
> > We could do it but there might be a case that some boards are converted
> > to use pinctrl while others still not but they're based on the same soc.
> > For examples, 4 mx53 boards and we may not be able to convert them all at
> > the same time.
> 
> My point is that none of the mx5 boards have pinctrl since there is no
> SoC driver for it.
> For DT based boards pinctrl should be mandatory once the SoC has pinctrl
> support. All non DT boards probably won't get pinctrl anyway.
> 
Ok, so i would be fine for me to change it in imx*_soc_init.
BTW, there're:
imx1_soc_init()
imx25_soc_init()
imx27_soc_init()
imx31_soc_init()
imx35_soc_init()
imx50_soc_init()
imx51_soc_init()
imx53_soc_init()

I'm not sure about mx1, mx27, mx31
Do you think if i could add them all?

Regards
Dong Aisheng
Dong Aisheng - April 27, 2012, 9:13 a.m.
On Fri, Apr 27, 2012 at 04:47:44PM +0800, Sascha Hauer wrote:
> On Fri, Apr 27, 2012 at 04:54:46PM +0800, Dong Aisheng wrote:
> > On Fri, Apr 27, 2012 at 04:31:42PM +0800, Sascha Hauer wrote:
> > > On Fri, Apr 27, 2012 at 04:29:31PM +0800, Dong Aisheng wrote:
> > > > mach-imx27ipcam.c          mach-mx31ads.c             mach-mx51_babbage.o        mach-pca100.c
> > > > mach-imx27lite.c           mach-mx31ads.o             mach-mx51_efikamx.c        mach-pcm037.c
> > > > 
> > > > Some of them i'm not familiar and i don't know whether they may use pinctrl
> > > > so i just patched the affected ones.
> > > > 
> > > > One lazy method may be just patch all board files without pinctrl support
> > > > and it will not cause any error.
> > > > 
> > > > What's your suggestion?
> > > > 
> > > > > pinctrl. Let's add the provide_dummies call to the SoCs instead which
> > > > > do not have pinctrl yet.
> > > > > 
> > > > You meant add provide_dummies call in imx*_soc_init call?
> > > > We could do it but there might be a case that some boards are converted
> > > > to use pinctrl while others still not but they're based on the same soc.
> > > > For examples, 4 mx53 boards and we may not be able to convert them all at
> > > > the same time.
> > > 
> > > My point is that none of the mx5 boards have pinctrl since there is no
> > > SoC driver for it.
> > > For DT based boards pinctrl should be mandatory once the SoC has pinctrl
> > > support. All non DT boards probably won't get pinctrl anyway.
> > > 
> > Ok, so i would be fine for me to change it in imx*_soc_init.
> > BTW, there're:
> > imx1_soc_init()
> > imx25_soc_init()
> > imx27_soc_init()
> > imx31_soc_init()
> > imx35_soc_init()
> > imx50_soc_init()
> > imx51_soc_init()
> > imx53_soc_init()
> > 
> > I'm not sure about mx1, mx27, mx31
> > Do you think if i could add them all?
> 
> Of course. Or do you see a pinctrl driver for any i.MX except i.MX6?
> 
My understanding is that besides if have pinctrl driver, calling provide_dummies
also depends on whether it really has drivers using pinctrl.
Anyway, will update it soon.
Thanks for the confirm.

Regards
Dong Aisheng

Patch

diff --git a/arch/arm/boot/dts/imx6q-arm2.dts b/arch/arm/boot/dts/imx6q-arm2.dts
index ce1c823..34dd9cd 100644
--- a/arch/arm/boot/dts/imx6q-arm2.dts
+++ b/arch/arm/boot/dts/imx6q-arm2.dts
@@ -37,12 +37,16 @@ 
 				cd-gpios = <&gpio6 11 0>;
 				wp-gpios = <&gpio6 14 0>;
 				vmmc-supply = <&reg_3p3v>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_usdhc3_1>;
 				status = "okay";
 			};
 
 			usdhc@0219c000 { /* uSDHC4 */
 				fsl,card-wired;
 				vmmc-supply = <&reg_3p3v>;
+				pinctrl-names = "default";
+				pinctrl-0 = <&pinctrl_usdhc4_1>;
 				status = "okay";
 			};
 
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index 4905f51..a89f294 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -386,7 +386,39 @@ 
 			};
 
 			iomuxc@020e0000 {
+				compatible = "fsl,imx6q-iomuxc";
 				reg = <0x020e0000 0x4000>;
+
+				/* shared pinctrl settings */
+				usdhc3 {
+					pinctrl_usdhc3_1: usdhc3grp-1 {
+						fsl,pins = <1273 0x17059	/* MX6Q_PAD_SD3_CMD__USDHC3_CMD */
+							    1281 0x10059	/* MX6Q_PAD_SD3_CLK__USDHC3_CLK	*/
+							    1289 0x17059	/* MX6Q_PAD_SD3_DAT0__USDHC3_DAT0 */
+							    1297 0x17059	/* MX6Q_PAD_SD3_DAT1__USDHC3_DAT1 */
+							    1305 0x17059	/* MX6Q_PAD_SD3_DAT2__USDHC3_DAT2 */
+							    1312 0x17059	/* MX6Q_PAD_SD3_DAT3__USDHC3_DAT3 */
+							    1265 0x17059	/* MX6Q_PAD_SD3_DAT4__USDHC3_DAT4 */
+							    1257 0x17059	/* MX6Q_PAD_SD3_DAT5__USDHC3_DAT5 */
+							    1249 0x17059	/* MX6Q_PAD_SD3_DAT6__USDHC3_DAT6 */
+							    1241 0x17059>;	/* MX6Q_PAD_SD3_DAT7__USDHC3_DAT7 */
+					};
+				};
+
+				usdhc4 {
+					pinctrl_usdhc4_1: usdhc4grp-1 {
+						fsl,pins = <1386 0x17059	/* MX6Q_PAD_SD4_CMD__USDHC4_CMD */
+							    1392 0x10059	/* MX6Q_PAD_SD4_CLK__USDHC4_CLK	*/
+							    1462 0x17059	/* MX6Q_PAD_SD4_DAT0__USDHC4_DAT0 */
+							    1470 0x17059	/* MX6Q_PAD_SD4_DAT1__USDHC4_DAT1 */
+							    1478 0x17059	/* MX6Q_PAD_SD4_DAT2__USDHC4_DAT2 */
+							    1486 0x17059	/* MX6Q_PAD_SD4_DAT3__USDHC4_DAT3 */
+							    1493 0x17059	/* MX6Q_PAD_SD4_DAT4__USDHC4_DAT4 */
+							    1501 0x17059	/* MX6Q_PAD_SD4_DAT5__USDHC4_DAT5 */
+							    1509 0x17059	/* MX6Q_PAD_SD4_DAT6__USDHC4_DAT6 */
+							    1517 0x17059>;	/* MX6Q_PAD_SD4_DAT7__USDHC4_DAT7 */
+					};
+				};
 			};
 
 			dcic@020e4000 { /* DCIC1 */
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 7561eca..e0fc67c 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -842,6 +842,8 @@  config SOC_IMX6Q
 	select HAVE_IMX_MMDC
 	select HAVE_IMX_SRC
 	select HAVE_SMP
+	select PINCTRL
+	select PINCTRL_IMX6Q
 	select USE_OF
 
 	help
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
index fd8bf8a..12bbb62 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
@@ -25,6 +25,7 @@ 
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/leds.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/platform_device.h>
 #include <linux/input.h>
 #include <video/platform_lcd.h>
@@ -251,6 +252,7 @@  void __init eukrea_mbimxsd35_baseboard_init(void)
 			ARRAY_SIZE(eukrea_mbimxsd_pads)))
 		printk(KERN_ERR "error setting mbimxsd pads !\n");
 
+	pinctrl_provide_dummies();
 	imx35_add_imx_uart1(&uart_pdata);
 	imx35_add_ipu_core(&mx3_ipu_data);
 	imx35_add_mx3_sdc_fb(&mx3fb_pdata);
diff --git a/arch/arm/mach-imx/mach-cpuimx51.c b/arch/arm/mach-imx/mach-cpuimx51.c
index 944025d..2c67d7f 100644
--- a/arch/arm/mach-imx/mach-cpuimx51.c
+++ b/arch/arm/mach-imx/mach-cpuimx51.c
@@ -22,6 +22,7 @@ 
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/interrupt.h>
+#include <linux/pinctrl/machine.h>
 
 #include <mach/eukrea-baseboards.h>
 #include <mach/common.h>
@@ -243,6 +244,7 @@  static void __init eukrea_cpuimx51_init(void)
 	mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads,
 					ARRAY_SIZE(eukrea_cpuimx51_pads));
 
+	pinctrl_provide_dummies();
 	imx51_add_imx_uart(0, &uart_pdata);
 	imx51_add_mxc_nand(&eukrea_cpuimx51_nand_board_info);
 
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
index 9fbe923..5d5a872 100644
--- a/arch/arm/mach-imx/mach-cpuimx51sd.c
+++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
@@ -25,6 +25,7 @@ 
 #include <linux/i2c-gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/can/platform/mcp251x.h>
+#include <linux/pinctrl/machine.h>
 
 #include <mach/eukrea-baseboards.h>
 #include <mach/common.h>
@@ -265,6 +266,7 @@  static void __init eukrea_cpuimx51sd_init(void)
 
 	mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51sd_pads,
 					ARRAY_SIZE(eukrea_cpuimx51sd_pads));
+	pinctrl_provide_dummies();
 
 #if defined(CONFIG_CPU_FREQ_IMX)
 	get_cpu_op = mx51_get_cpu_op;
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index 76a97a5..b90b795 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -23,6 +23,7 @@ 
 #include <linux/clk.h>
 #include <linux/irq.h>
 #include <linux/gpio.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/platform_device.h>
 #include <linux/usb/otg.h>
 #include <linux/usb/ulpi.h>
@@ -131,6 +132,7 @@  static void __init eukrea_cpuimx25_init(void)
 			ARRAY_SIZE(eukrea_cpuimx25_pads)))
 		printk(KERN_ERR "error setting cpuimx25 pads !\n");
 
+	pinctrl_provide_dummies();
 	imx25_add_imx_uart0(&uart_pdata);
 	imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info);
 	imx25_add_imxdi_rtc(NULL);
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c
index f267342..347467c 100644
--- a/arch/arm/mach-imx/mach-mx25_3ds.c
+++ b/arch/arm/mach-imx/mach-mx25_3ds.c
@@ -29,6 +29,7 @@ 
 #include <linux/irq.h>
 #include <linux/gpio.h>
 #include <linux/platform_device.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/usb/otg.h>
 
 #include <mach/hardware.h>
@@ -233,6 +234,7 @@  static void __init mx25pdk_init(void)
 	mxc_iomux_v3_setup_multiple_pads(mx25pdk_pads,
 			ARRAY_SIZE(mx25pdk_pads));
 
+	pinctrl_provide_dummies();
 	imx25_add_imx_uart0(&uart_pdata);
 	imx25_add_fsl_usb2_udc(&otg_device_pdata);
 	imx25_add_mxc_ehci_hs(&usbh2_pdata);
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index 6ae51c6..b8cfc6a 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -31,6 +31,7 @@ 
 #include <linux/platform_device.h>
 #include <linux/memory.h>
 #include <linux/gpio.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/usb/otg.h>
 
 #include <linux/mtd/physmap.h>
@@ -380,6 +381,7 @@  static void __init mx35_3ds_init(void)
 
 	mxc_iomux_v3_setup_multiple_pads(mx35pdk_pads, ARRAY_SIZE(mx35pdk_pads));
 
+	pinctrl_provide_dummies();
 	imx35_add_fec(NULL);
 	imx35_add_imx2_wdt(NULL);
 	platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c
index 83eab41..9a8a6f2 100644
--- a/arch/arm/mach-imx/mach-mx51_3ds.c
+++ b/arch/arm/mach-imx/mach-mx51_3ds.c
@@ -14,6 +14,7 @@ 
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
 #include <linux/gpio.h>
+#include <linux/pinctrl/machine.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -139,6 +140,7 @@  static void __init mx51_3ds_init(void)
 
 	mxc_iomux_v3_setup_multiple_pads(mx51_3ds_pads,
 					ARRAY_SIZE(mx51_3ds_pads));
+	pinctrl_provide_dummies();
 
 	imx51_add_imx_uart(0, &uart_pdata);
 	imx51_add_imx_uart(1, &uart_pdata);
diff --git a/arch/arm/mach-imx/mach-mx51_babbage.c b/arch/arm/mach-imx/mach-mx51_babbage.c
index e4b822e..9adc94b 100644
--- a/arch/arm/mach-imx/mach-mx51_babbage.c
+++ b/arch/arm/mach-imx/mach-mx51_babbage.c
@@ -17,6 +17,7 @@ 
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/input.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/spi/flash.h>
 #include <linux/spi/spi.h>
 
@@ -353,6 +354,7 @@  void __init imx51_babbage_common_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
 					 ARRAY_SIZE(mx51babbage_pads));
+	pinctrl_provide_dummies();
 }
 
 /*
diff --git a/arch/arm/mach-imx/mach-mx51_efikamx.c b/arch/arm/mach-imx/mach-mx51_efikamx.c
index 586e9f8..8486569 100644
--- a/arch/arm/mach-imx/mach-mx51_efikamx.c
+++ b/arch/arm/mach-imx/mach-mx51_efikamx.c
@@ -22,6 +22,7 @@ 
 #include <linux/input.h>
 #include <linux/delay.h>
 #include <linux/io.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/spi/flash.h>
 #include <linux/spi/spi.h>
 #include <linux/mfd/mc13892.h>
@@ -237,6 +238,7 @@  static void __init mx51_efikamx_init(void)
 
 	mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
 					ARRAY_SIZE(mx51efikamx_pads));
+	pinctrl_provide_dummies();
 	efika_board_common_init();
 
 	mx51_efikamx_board_id();
diff --git a/arch/arm/mach-imx/mach-mx51_efikasb.c b/arch/arm/mach-imx/mach-mx51_efikasb.c
index 24aded9..dfd9952 100644
--- a/arch/arm/mach-imx/mach-mx51_efikasb.c
+++ b/arch/arm/mach-imx/mach-mx51_efikasb.c
@@ -22,6 +22,7 @@ 
 #include <linux/input.h>
 #include <linux/delay.h>
 #include <linux/io.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/spi/flash.h>
 #include <linux/spi/spi.h>
 #include <linux/mfd/mc13892.h>
@@ -260,6 +261,7 @@  static void __init efikasb_board_init(void)
 
 	mxc_iomux_v3_setup_multiple_pads(mx51efikasb_pads,
 					ARRAY_SIZE(mx51efikasb_pads));
+	pinctrl_provide_dummies();
 	efika_board_common_init();
 
 	mx51_efikasb_board_id();
diff --git a/arch/arm/mach-imx/mach-mx53_ard.c b/arch/arm/mach-imx/mach-mx53_ard.c
index 0564198..d251da4 100644
--- a/arch/arm/mach-imx/mach-mx53_ard.c
+++ b/arch/arm/mach-imx/mach-mx53_ard.c
@@ -22,6 +22,7 @@ 
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/smsc911x.h>
 #include <linux/regulator/machine.h>
 #include <linux/regulator/fixed.h>
@@ -226,6 +227,7 @@  void __init imx53_ard_common_init(void)
 	mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads,
 					 ARRAY_SIZE(mx53_ard_pads));
 	weim_cs_config();
+	pinctrl_provide_dummies();
 }
 
 static struct platform_device *devices[] __initdata = {
diff --git a/arch/arm/mach-imx/mach-mx53_evk.c b/arch/arm/mach-imx/mach-mx53_evk.c
index 5a72188..9ca7010 100644
--- a/arch/arm/mach-imx/mach-mx53_evk.c
+++ b/arch/arm/mach-imx/mach-mx53_evk.c
@@ -23,6 +23,7 @@ 
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/spi/flash.h>
 #include <linux/spi/spi.h>
 #include <mach/common.h>
@@ -134,6 +135,7 @@  void __init imx53_evk_common_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads,
 					 ARRAY_SIZE(mx53_evk_pads));
+	pinctrl_provide_dummies();
 }
 
 static void __init mx53_evk_board_init(void)
diff --git a/arch/arm/mach-imx/mach-mx53_loco.c b/arch/arm/mach-imx/mach-mx53_loco.c
index 37f67ca..4c11cc1 100644
--- a/arch/arm/mach-imx/mach-mx53_loco.c
+++ b/arch/arm/mach-imx/mach-mx53_loco.c
@@ -23,6 +23,7 @@ 
 #include <linux/delay.h>
 #include <linux/gpio.h>
 #include <linux/i2c.h>
+#include <linux/pinctrl/machine.h>
 
 #include <mach/common.h>
 #include <mach/hardware.h>
@@ -266,6 +267,7 @@  void __init imx53_qsb_common_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
 					 ARRAY_SIZE(mx53_loco_pads));
+	pinctrl_provide_dummies();
 }
 
 static struct i2c_board_info mx53loco_i2c_devices[] = {
diff --git a/arch/arm/mach-imx/mach-mx53_smd.c b/arch/arm/mach-imx/mach-mx53_smd.c
index 8e972c5..d621022 100644
--- a/arch/arm/mach-imx/mach-mx53_smd.c
+++ b/arch/arm/mach-imx/mach-mx53_smd.c
@@ -22,6 +22,7 @@ 
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/pinctrl/machine.h>
 
 #include <mach/common.h>
 #include <mach/hardware.h>
@@ -128,6 +129,7 @@  void __init imx53_smd_common_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads,
 					 ARRAY_SIZE(mx53_smd_pads));
+	pinctrl_provide_dummies();
 }
 
 static void __init mx53_smd_board_init(void)
diff --git a/arch/arm/mach-imx/mach-pcm043.c b/arch/arm/mach-imx/mach-pcm043.c
index 237474f..c0ec1b8 100644
--- a/arch/arm/mach-imx/mach-pcm043.c
+++ b/arch/arm/mach-imx/mach-pcm043.c
@@ -25,6 +25,7 @@ 
 #include <linux/delay.h>
 #include <linux/i2c.h>
 #include <linux/i2c/at24.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/usb/otg.h>
 #include <linux/usb/ulpi.h>
 
@@ -361,6 +362,7 @@  static void __init pcm043_init(void)
 
 	mxc_iomux_v3_setup_multiple_pads(pcm043_pads, ARRAY_SIZE(pcm043_pads));
 
+	pinctrl_provide_dummies();
 	imx35_add_fec(NULL);
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 	imx35_add_imx2_wdt(NULL);
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c
index 033257e..cf9afcb 100644
--- a/arch/arm/mach-imx/mach-vpr200.c
+++ b/arch/arm/mach-imx/mach-vpr200.c
@@ -23,6 +23,7 @@ 
 #include <linux/mtd/physmap.h>
 #include <linux/memory.h>
 #include <linux/gpio.h>
+#include <linux/pinctrl/machine.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -271,6 +272,7 @@  static void __init vpr200_board_init(void)
 
 	mxc_iomux_v3_setup_multiple_pads(vpr200_pads, ARRAY_SIZE(vpr200_pads));
 
+	pinctrl_provide_dummies();
 	imx35_add_fec(NULL);
 	imx35_add_imx2_wdt(NULL);
 	imx_add_gpio_keys(&vpr200_gpio_keys_data);
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 6193a0d..039bc19 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -24,6 +24,7 @@ 
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
+#include <linux/pinctrl/consumer.h>
 #include <mach/esdhc.h>
 #include "sdhci-pltfm.h"
 #include "sdhci-esdhc.h"
@@ -68,6 +69,7 @@  struct pltfm_imx_data {
 	int flags;
 	u32 scratchpad;
 	enum imx_esdhc_type devtype;
+	struct pinctrl *pinctrl;
 	struct esdhc_platform_data boarddata;
 };
 
@@ -467,6 +469,12 @@  static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev)
 	clk_prepare_enable(clk);
 	pltfm_host->clk = clk;
 
+	imx_data->pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(imx_data->pinctrl)) {
+		err = PTR_ERR(imx_data->pinctrl);
+		goto pin_err;
+	}
+
 	if (!is_imx25_esdhc(imx_data))
 		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
@@ -559,6 +567,7 @@  no_card_detect_irq:
 		gpio_free(boarddata->wp_gpio);
 no_card_detect_pin:
 no_board_data:
+pin_err:
 	clk_disable_unprepare(pltfm_host->clk);
 	clk_put(pltfm_host->clk);
 err_clk_get: