diff mbox

[3/4] imx27-dt: configure i2c1 gpio on armadeus apf27

Message ID 1353874625-14754-4-git-send-email-tremyfr@yahoo.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Philippe Reynes Nov. 25, 2012, 8:17 p.m. UTC
Signed-off-by: Philippe Reynes <tremyfr@yahoo.fr>
---
 arch/arm/mach-imx/imx27-dt.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Comments

Thomas Petazzoni Nov. 26, 2012, 9:28 a.m. UTC | #1
Dear Philippe Reynes,

On Sun, 25 Nov 2012 21:17:04 +0100, Philippe Reynes wrote:

>  static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
> @@ -48,6 +49,10 @@ int apf27_lan8700_wakeup(struct phy_device *phydev)
>  static void __init apf27_init(void)
>  {
>  	phy_register_fixup_for_id("imx27-fec.0-1:1f", apf27_lan8700_wakeup);
> +
> +	/* configure i2c1 gpio */
> +	mxc_gpio_mode((GPIO_PORTD | GPIO_OUT | GPIO_PF | 17));
> +	mxc_gpio_mode((GPIO_PORTD | GPIO_OUT | GPIO_PF | 18));
>  }

I haven't followed i.MX 27 support lately, but this surely should be
done using a pinctrl driver. I see that there is a general pinctrl
driver for i.MX, but a drivers/pinctrl/pinctrl-imx27.c might be
missing. It would probably be a better idea to implement the missing
pinctrl driver, if not already available?

Best regards,

Thomas
Sascha Hauer Nov. 26, 2012, 9:59 a.m. UTC | #2
On Mon, Nov 26, 2012 at 10:28:58AM +0100, Thomas Petazzoni wrote:
> Dear Philippe Reynes,
> 
> On Sun, 25 Nov 2012 21:17:04 +0100, Philippe Reynes wrote:
> 
> >  static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
> > @@ -48,6 +49,10 @@ int apf27_lan8700_wakeup(struct phy_device *phydev)
> >  static void __init apf27_init(void)
> >  {
> >  	phy_register_fixup_for_id("imx27-fec.0-1:1f", apf27_lan8700_wakeup);
> > +
> > +	/* configure i2c1 gpio */
> > +	mxc_gpio_mode((GPIO_PORTD | GPIO_OUT | GPIO_PF | 17));
> > +	mxc_gpio_mode((GPIO_PORTD | GPIO_OUT | GPIO_PF | 18));
> >  }
> 
> I haven't followed i.MX 27 support lately, but this surely should be
> done using a pinctrl driver. I see that there is a general pinctrl
> driver for i.MX, but a drivers/pinctrl/pinctrl-imx27.c might be
> missing. It would probably be a better idea to implement the missing
> pinctrl driver, if not already available?

It's not available, and yes, it should be implemented. Adding the iomux
setup to a i.MX27 SoC specific file is not a good idea.

Sascha
diff mbox

Patch

diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index f212f81..2eb7014 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -17,6 +17,7 @@ 
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <mach/common.h>
+#include <mach/iomux-mx27.h>
 #include <mach/mx27.h>
 
 static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
@@ -48,6 +49,10 @@  int apf27_lan8700_wakeup(struct phy_device *phydev)
 static void __init apf27_init(void)
 {
 	phy_register_fixup_for_id("imx27-fec.0-1:1f", apf27_lan8700_wakeup);
+
+	/* configure i2c1 gpio */
+	mxc_gpio_mode((GPIO_PORTD | GPIO_OUT | GPIO_PF | 17));
+	mxc_gpio_mode((GPIO_PORTD | GPIO_OUT | GPIO_PF | 18));
 }
 
 static void __init imx27_dt_init(void)