2013-03-07 03:36:41

by Wenyou Yang

[permalink] [raw]
Subject: [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi

Signed-off-by: Wenyou Yang <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/spi/spi-atmel.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 1e212d1..6b166f4 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -23,6 +23,7 @@
#include <linux/platform_data/atmel.h>
#include <linux/platform_data/dma-atmel.h>
#include <linux/of.h>
+#include <linux/pinctrl/consumer.h>

#include <linux/io.h>
#include <linux/gpio.h>
@@ -1493,11 +1494,18 @@ static int atmel_spi_probe(struct platform_device *pdev)
int ret;
struct spi_master *master;
struct atmel_spi *as;
+ struct pinctrl *pinctrl;

regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!regs)
return -ENXIO;

+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pinctrl)) {
+ dev_err(&pdev->dev, "Failed to request pinctrl\n");
+ return PTR_ERR(pinctrl);
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
--
1.7.9.5


Subject: Re: [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi

On 11:34 Thu 07 Mar , Wenyou Yang wrote:
> Signed-off-by: Wenyou Yang <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> ---
> drivers/spi/spi-atmel.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 1e212d1..6b166f4 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -23,6 +23,7 @@
> #include <linux/platform_data/atmel.h>
> #include <linux/platform_data/dma-atmel.h>
> #include <linux/of.h>
> +#include <linux/pinctrl/consumer.h>
>
> #include <linux/io.h>
> #include <linux/gpio.h>
> @@ -1493,11 +1494,18 @@ static int atmel_spi_probe(struct platform_device *pdev)
> int ret;
> struct spi_master *master;
> struct atmel_spi *as;
> + struct pinctrl *pinctrl;
>
> regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!regs)
> return -ENXIO;
>
> + pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> + if (IS_ERR(pinctrl)) {
> + dev_err(&pdev->dev, "Failed to request pinctrl\n");
> + return PTR_ERR(pinctrl);
> + }

drop this, this is handled at bus level

Best Regards,
J.
> +
> irq = platform_get_irq(pdev, 0);
> if (irq < 0)
> return irq;
> --
> 1.7.9.5
>

2013-03-12 01:12:21

by Wenyou Yang

[permalink] [raw]
Subject: RE: [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi

Hi JC,

> -----Original Message-----
> From: Jean-Christophe PLAGNIOL-VILLARD [mailto:[email protected]]
> Sent: 2013??3??11?? 21:11
> To: Yang, Wenyou
> Cc: [email protected]; [email protected]; Ferre,
> Nicolas; [email protected]; Lin, JM;
> [email protected]; [email protected]
> Subject: Re: [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi
>
> On 11:34 Thu 07 Mar , Wenyou Yang wrote:
> > Signed-off-by: Wenyou Yang <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > ---
> > drivers/spi/spi-atmel.c | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> > index 1e212d1..6b166f4 100644
> > --- a/drivers/spi/spi-atmel.c
> > +++ b/drivers/spi/spi-atmel.c
> > @@ -23,6 +23,7 @@
> > #include <linux/platform_data/atmel.h>
> > #include <linux/platform_data/dma-atmel.h>
> > #include <linux/of.h>
> > +#include <linux/pinctrl/consumer.h>
> >
> > #include <linux/io.h>
> > #include <linux/gpio.h>
> > @@ -1493,11 +1494,18 @@ static int atmel_spi_probe(struct
> platform_device *pdev)
> > int ret;
> > struct spi_master *master;
> > struct atmel_spi *as;
> > + struct pinctrl *pinctrl;
> >
> > regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > if (!regs)
> > return -ENXIO;
> >
> > + pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> > + if (IS_ERR(pinctrl)) {
> > + dev_err(&pdev->dev, "Failed to request pinctrl\n");
> > + return PTR_ERR(pinctrl);
> > + }
>
> drop this, this is handled at bus level
>
Thanks a lot for your advance.

> Best Regards,
> J.

Best Regards
Wenyou Yang
> > +
> > irq = platform_get_irq(pdev, 0);
> > if (irq < 0)
> > return irq;
> > --
> > 1.7.9.5
> >
????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?