All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers
@ 2012-05-06 12:58 Shawn Guo
  2012-05-06 12:58 ` [PATCH 1/5] tty: serial: imx: adopt pinctrl API Shawn Guo
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Shawn Guo @ 2012-05-06 12:58 UTC (permalink / raw)
  To: linux-arm-kernel

With patch 5b3aa5f (pinctrl: add pinctrl_provide_dummies interface for
platforms to use) applied on pinctrl tree, and patch "ARM: imx: enable
pinctrl dummy states" [1] being there, we are ready to adopt pinctrl
API for imx drivers.  So let's start from a few outstanding ones.

I would expect to ask Arnd and Olof to pull pinctrl tree into arm-soc
as a dependency and then have series [1] and this patch set go through
arm-soc tree to ease the merge process.

Regards,
Shawn

[1] http://thread.gmane.org/gmane.linux.kernel.mmc/14180

Shawn Guo (5):
  tty: serial: imx: adopt pinctrl API
  net: fec: adopt pinctrl API
  can: flexcan: adopt pinctrl API
  i2c: imx: adopt pinctrl API
  spi/imx: adopt pinctrl API

 drivers/i2c/busses/i2c-imx.c         |    8 ++++++++
 drivers/net/can/flexcan.c            |    6 ++++++
 drivers/net/ethernet/freescale/fec.c |    9 +++++++++
 drivers/spi/spi-imx.c                |    8 ++++++++
 drivers/tty/serial/imx.c             |    8 ++++++++
 5 files changed, 39 insertions(+), 0 deletions(-)

-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] tty: serial: imx: adopt pinctrl API
  2012-05-06 12:58 [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers Shawn Guo
@ 2012-05-06 12:58 ` Shawn Guo
  2012-05-06 13:47   ` Shawn Guo
  2012-05-06 12:58 ` [PATCH 2/5] net: fec: " Shawn Guo
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Shawn Guo @ 2012-05-06 12:58 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/tty/serial/imx.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index e7fecee..ec20673 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -47,6 +47,7 @@
 #include <linux/slab.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/pinctrl/consumer.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -1464,6 +1465,7 @@ static int serial_imx_probe(struct platform_device *pdev)
 	void __iomem *base;
 	int ret = 0;
 	struct resource *res;
+	struct pinctrl *pinctrl;
 
 	sport = kzalloc(sizeof(*sport), GFP_KERNEL);
 	if (!sport)
@@ -1503,6 +1505,12 @@ static int serial_imx_probe(struct platform_device *pdev)
 	sport->timer.function = imx_timeout;
 	sport->timer.data     = (unsigned long)sport;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl)) {
+		ret = PTR_ERR(pinctrl);
+		goto unmap;
+	}
+
 	sport->clk = clk_get(&pdev->dev, "uart");
 	if (IS_ERR(sport->clk)) {
 		ret = PTR_ERR(sport->clk);
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/5] net: fec: adopt pinctrl API
  2012-05-06 12:58 [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers Shawn Guo
  2012-05-06 12:58 ` [PATCH 1/5] tty: serial: imx: adopt pinctrl API Shawn Guo
@ 2012-05-06 12:58 ` Shawn Guo
  2012-05-06 16:46   ` David Miller
  2012-05-06 17:26   ` Steven King
  2012-05-06 12:58 ` [PATCH 3/5] can: flexcan: " Shawn Guo
                   ` (3 subsequent siblings)
  5 siblings, 2 replies; 12+ messages in thread
From: Shawn Guo @ 2012-05-06 12:58 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/net/ethernet/freescale/fec.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index a12b3f5..500c106 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -48,6 +48,7 @@
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
 #include <linux/of_net.h>
+#include <linux/pinctrl/consumer.h>
 
 #include <asm/cacheflush.h>
 
@@ -1542,6 +1543,7 @@ fec_probe(struct platform_device *pdev)
 	struct resource *r;
 	const struct of_device_id *of_id;
 	static int dev_id;
+	struct pinctrl *pinctrl;
 
 	of_id = of_match_device(fec_dt_ids, &pdev->dev);
 	if (of_id)
@@ -1609,6 +1611,12 @@ fec_probe(struct platform_device *pdev)
 		}
 	}
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl)) {
+		ret = PTR_ERR(pinctrl);
+		goto failed_pin;
+	}
+
 	fep->clk = clk_get(&pdev->dev, NULL);
 	if (IS_ERR(fep->clk)) {
 		ret = PTR_ERR(fep->clk);
@@ -1639,6 +1647,7 @@ failed_mii_init:
 failed_init:
 	clk_disable_unprepare(fep->clk);
 	clk_put(fep->clk);
+failed_pin:
 failed_clk:
 	for (i = 0; i < FEC_IRQ_NUM; i++) {
 		irq = platform_get_irq(pdev, i);
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/5] can: flexcan: adopt pinctrl API
  2012-05-06 12:58 [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers Shawn Guo
  2012-05-06 12:58 ` [PATCH 1/5] tty: serial: imx: adopt pinctrl API Shawn Guo
  2012-05-06 12:58 ` [PATCH 2/5] net: fec: " Shawn Guo
@ 2012-05-06 12:58 ` Shawn Guo
  2012-05-06 12:58 ` [PATCH 4/5] i2c: imx: " Shawn Guo
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2012-05-06 12:58 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/net/can/flexcan.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index 1efb083..38c0690 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -35,6 +35,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/pinctrl/consumer.h>
 
 #define DRV_NAME			"flexcan"
 
@@ -927,11 +928,16 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
 	struct flexcan_priv *priv;
 	struct resource *mem;
 	struct clk *clk = NULL;
+	struct pinctrl *pinctrl;
 	void __iomem *base;
 	resource_size_t mem_size;
 	int err, irq;
 	u32 clock_freq = 0;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl))
+		return PTR_ERR(pinctrl);
+
 	if (pdev->dev.of_node) {
 		const u32 *clock_freq_p;
 
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/5] i2c: imx: adopt pinctrl API
  2012-05-06 12:58 [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers Shawn Guo
                   ` (2 preceding siblings ...)
  2012-05-06 12:58 ` [PATCH 3/5] can: flexcan: " Shawn Guo
@ 2012-05-06 12:58 ` Shawn Guo
  2012-05-06 12:58 ` [PATCH 5/5] spi/imx: " Shawn Guo
  2012-05-06 13:45 ` [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers Shawn Guo
  5 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2012-05-06 12:58 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/i2c/busses/i2c-imx.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index dfb84b7..56bce9a 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -51,6 +51,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_i2c.h>
+#include <linux/pinctrl/consumer.h>
 
 #include <mach/irqs.h>
 #include <mach/hardware.h>
@@ -470,6 +471,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
 	struct imx_i2c_struct *i2c_imx;
 	struct resource *res;
 	struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
+	struct pinctrl *pinctrl;
 	void __iomem *base;
 	resource_size_t res_size;
 	int irq, bitrate;
@@ -520,6 +522,12 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
 	i2c_imx->base			= base;
 	i2c_imx->res			= res;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl)) {
+		ret = PTR_ERR(pinctrl);
+		goto fail3;
+	}
+
 	/* Get I2C clock */
 	i2c_imx->clk = clk_get(&pdev->dev, "i2c_clk");
 	if (IS_ERR(i2c_imx->clk)) {
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/5] spi/imx: adopt pinctrl API
  2012-05-06 12:58 [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers Shawn Guo
                   ` (3 preceding siblings ...)
  2012-05-06 12:58 ` [PATCH 4/5] i2c: imx: " Shawn Guo
@ 2012-05-06 12:58 ` Shawn Guo
  2012-05-06 13:45 ` [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers Shawn Guo
  5 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2012-05-06 12:58 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/spi/spi-imx.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 570f220..69c9a66 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -37,6 +37,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
+#include <linux/pinctrl/consumer.h>
 
 #include <mach/spi.h>
 
@@ -758,6 +759,7 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
 	struct spi_master *master;
 	struct spi_imx_data *spi_imx;
 	struct resource *res;
+	struct pinctrl *pinctrl;
 	int i, ret, num_cs;
 
 	if (!np && !mxc_platform_info) {
@@ -845,6 +847,12 @@ static int __devinit spi_imx_probe(struct platform_device *pdev)
 		goto out_iounmap;
 	}
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl)) {
+		ret = PTR_ERR(pinctrl);
+		goto out_free_irq;
+	}
+
 	spi_imx->clk = clk_get(&pdev->dev, NULL);
 	if (IS_ERR(spi_imx->clk)) {
 		dev_err(&pdev->dev, "unable to get clock\n");
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers
  2012-05-06 12:58 [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers Shawn Guo
                   ` (4 preceding siblings ...)
  2012-05-06 12:58 ` [PATCH 5/5] spi/imx: " Shawn Guo
@ 2012-05-06 13:45 ` Shawn Guo
  5 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2012-05-06 13:45 UTC (permalink / raw)
  To: linux-arm-kernel

Sorry for forgetting updating Greg's email address.

Regards,
Shawn

On Sun, May 06, 2012 at 08:58:09PM +0800, Shawn Guo wrote:
> With patch 5b3aa5f (pinctrl: add pinctrl_provide_dummies interface for
> platforms to use) applied on pinctrl tree, and patch "ARM: imx: enable
> pinctrl dummy states" [1] being there, we are ready to adopt pinctrl
> API for imx drivers.  So let's start from a few outstanding ones.
> 
> I would expect to ask Arnd and Olof to pull pinctrl tree into arm-soc
> as a dependency and then have series [1] and this patch set go through
> arm-soc tree to ease the merge process.
> 
> Regards,
> Shawn
> 
> [1] http://thread.gmane.org/gmane.linux.kernel.mmc/14180
> 
> Shawn Guo (5):
>   tty: serial: imx: adopt pinctrl API
>   net: fec: adopt pinctrl API
>   can: flexcan: adopt pinctrl API
>   i2c: imx: adopt pinctrl API
>   spi/imx: adopt pinctrl API
> 
>  drivers/i2c/busses/i2c-imx.c         |    8 ++++++++
>  drivers/net/can/flexcan.c            |    6 ++++++
>  drivers/net/ethernet/freescale/fec.c |    9 +++++++++
>  drivers/spi/spi-imx.c                |    8 ++++++++
>  drivers/tty/serial/imx.c             |    8 ++++++++
>  5 files changed, 39 insertions(+), 0 deletions(-)
> 
> -- 
> 1.7.5.4
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/5] tty: serial: imx: adopt pinctrl API
  2012-05-06 12:58 ` [PATCH 1/5] tty: serial: imx: adopt pinctrl API Shawn Guo
@ 2012-05-06 13:47   ` Shawn Guo
  0 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2012-05-06 13:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, May 06, 2012 at 08:58:10PM +0800, Shawn Guo wrote:
> Cc: Greg Kroah-Hartman <gregkh@suse.de>

Corrected to "Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>".

Regards,
Shawn

> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  drivers/tty/serial/imx.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index e7fecee..ec20673 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -47,6 +47,7 @@
>  #include <linux/slab.h>
>  #include <linux/of.h>
>  #include <linux/of_device.h>
> +#include <linux/pinctrl/consumer.h>
>  
>  #include <asm/io.h>
>  #include <asm/irq.h>
> @@ -1464,6 +1465,7 @@ static int serial_imx_probe(struct platform_device *pdev)
>  	void __iomem *base;
>  	int ret = 0;
>  	struct resource *res;
> +	struct pinctrl *pinctrl;
>  
>  	sport = kzalloc(sizeof(*sport), GFP_KERNEL);
>  	if (!sport)
> @@ -1503,6 +1505,12 @@ static int serial_imx_probe(struct platform_device *pdev)
>  	sport->timer.function = imx_timeout;
>  	sport->timer.data     = (unsigned long)sport;
>  
> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> +	if (IS_ERR(pinctrl)) {
> +		ret = PTR_ERR(pinctrl);
> +		goto unmap;
> +	}
> +
>  	sport->clk = clk_get(&pdev->dev, "uart");
>  	if (IS_ERR(sport->clk)) {
>  		ret = PTR_ERR(sport->clk);
> -- 
> 1.7.5.4
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/5] net: fec: adopt pinctrl API
  2012-05-06 12:58 ` [PATCH 2/5] net: fec: " Shawn Guo
@ 2012-05-06 16:46   ` David Miller
  2012-05-07  0:41     ` Shawn Guo
  2012-05-06 17:26   ` Steven King
  1 sibling, 1 reply; 12+ messages in thread
From: David Miller @ 2012-05-06 16:46 UTC (permalink / raw)
  To: linux-arm-kernel


CC:'ing me privately on networking patches accomplishes nothing,
I mostly ignore all private email.

CC:'ing netdev at vger.kernel.org instead is the thing to do.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/5] net: fec: adopt pinctrl API
  2012-05-06 12:58 ` [PATCH 2/5] net: fec: " Shawn Guo
  2012-05-06 16:46   ` David Miller
@ 2012-05-06 17:26   ` Steven King
  2012-05-07  0:46     ` Shawn Guo
  1 sibling, 1 reply; 12+ messages in thread
From: Steven King @ 2012-05-06 17:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Sunday 06 May 2012 5:58:11 am Shawn Guo wrote:
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> ---
>  drivers/net/ethernet/freescale/fec.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)

As the fec driver is also used by m68k/coldfire, perhaps a CC to the 
uclinux-dev at uclinux.org would be apropos.
>
> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> +	if (IS_ERR(pinctrl)) {
> +		ret = PTR_ERR(pinctrl);
> +		goto failed_pin;
> +	}

What happens here if pinmux support isnt implemented yet as is the case for 
m68k/coldfire?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/5] net: fec: adopt pinctrl API
  2012-05-06 16:46   ` David Miller
@ 2012-05-07  0:41     ` Shawn Guo
  0 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2012-05-07  0:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, May 06, 2012 at 12:46:23PM -0400, David Miller wrote:
> 
> CC:'ing me privately on networking patches accomplishes nothing,
> I mostly ignore all private email.
> 
> CC:'ing netdev at vger.kernel.org instead is the thing to do.

Ok, will resend to have the list Cc-ed.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/5] net: fec: adopt pinctrl API
  2012-05-06 17:26   ` Steven King
@ 2012-05-07  0:46     ` Shawn Guo
  0 siblings, 0 replies; 12+ messages in thread
From: Shawn Guo @ 2012-05-07  0:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, May 06, 2012 at 10:26:28AM -0700, Steven King wrote:
> > +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> > +	if (IS_ERR(pinctrl)) {
> > +		ret = PTR_ERR(pinctrl);
> > +		goto failed_pin;
> > +	}
> 
> What happens here if pinmux support isnt implemented yet as is the case for 
> m68k/coldfire?

There are a set of stub functions defined for !CONFIG_PINCTRL
in include/linux/pinctrl/consumer.h to ensure the pinctrl calls
succeed for those cases.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-05-07  0:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-06 12:58 [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers Shawn Guo
2012-05-06 12:58 ` [PATCH 1/5] tty: serial: imx: adopt pinctrl API Shawn Guo
2012-05-06 13:47   ` Shawn Guo
2012-05-06 12:58 ` [PATCH 2/5] net: fec: " Shawn Guo
2012-05-06 16:46   ` David Miller
2012-05-07  0:41     ` Shawn Guo
2012-05-06 17:26   ` Steven King
2012-05-07  0:46     ` Shawn Guo
2012-05-06 12:58 ` [PATCH 3/5] can: flexcan: " Shawn Guo
2012-05-06 12:58 ` [PATCH 4/5] i2c: imx: " Shawn Guo
2012-05-06 12:58 ` [PATCH 5/5] spi/imx: " Shawn Guo
2012-05-06 13:45 ` [PATCH 0/5] Adopt pinctrl API for a few outstanding imx drivers Shawn Guo

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.