linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add pinctrl support to omap2-mcspi
@ 2012-09-17 17:22 Matt Porter
  2012-09-17 17:22 ` [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support Matt Porter
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Matt Porter @ 2012-09-17 17:22 UTC (permalink / raw)
  To: Linux OMAP List, Linux SPI Devel List, Grant Likely, Tony Lindgren
  Cc: Linux Kernel Mailing List, Linux ARM Kernel List, AnilKumar

Changes since v1:
	- warns that pins are not configured by the driver rather than
	  exiting 
	- dummy states are only enabled for OMAP platforms where DT is
	  not populated

This series enables pinctrl support for McSPI. Platforms that boot only
from DT and rely on pinctrl to set pinmuxes appropriately require this
for omap2-mcspi operation.

It has been tested on AM335x BeagleBone with an Adafruit SPI LCD attached
and regression tested on Beagleboard xM booting in the !DT case, using
board-omap3evm.c. 

The series applies on top of Tony's dt-devel branch.

Matt Porter (2):
  spi: omap2-mcspi: add pinctrl support
  ARM: OMAP2+: Enable pinctrl dummy states

 arch/arm/mach-omap2/devices.c |    5 +++++
 drivers/spi/spi-omap2-mcspi.c |    8 ++++++++
 2 files changed, 13 insertions(+)

-- 
1.7.9.5


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

* [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support
  2012-09-17 17:22 [PATCH v2 0/2] Add pinctrl support to omap2-mcspi Matt Porter
@ 2012-09-17 17:22 ` Matt Porter
  2012-09-17 17:26   ` Tony Lindgren
  2012-09-18  5:27   ` Shubhrajyoti
  2012-09-17 17:22 ` [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states Matt Porter
  2012-09-17 17:27 ` [PATCH v2 0/2] Add pinctrl support to omap2-mcspi Matt Porter
  2 siblings, 2 replies; 9+ messages in thread
From: Matt Porter @ 2012-09-17 17:22 UTC (permalink / raw)
  To: Linux OMAP List, Linux SPI Devel List, Grant Likely, Tony Lindgren
  Cc: Linux Kernel Mailing List, Linux ARM Kernel List, AnilKumar

Adds pinctrl support to support OMAP platforms that boot from DT
and rely on pinctrl support to set pinmuxes.

Signed-off-by: Matt Porter <mporter@ti.com>
---
 drivers/spi/spi-omap2-mcspi.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index b2fb141..9502566 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -38,6 +38,8 @@
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
+#include <linux/pinctrl/consumer.h>
+#include <linux/err.h>
 
 #include <linux/spi/spi.h>
 
@@ -1124,6 +1126,7 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
 	static int		bus_num = 1;
 	struct device_node	*node = pdev->dev.of_node;
 	const struct of_device_id *match;
+	struct pinctrl *pinctrl;
 
 	master = spi_alloc_master(&pdev->dev, sizeof *mcspi);
 	if (master == NULL) {
@@ -1219,6 +1222,11 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
 	if (status < 0)
 		goto dma_chnl_free;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl))
+		dev_warn(&pdev->dev,
+			"pins are not configured from the driver\n");
+
 	pm_runtime_use_autosuspend(&pdev->dev);
 	pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
 	pm_runtime_enable(&pdev->dev);
-- 
1.7.9.5


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

* [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states
  2012-09-17 17:22 [PATCH v2 0/2] Add pinctrl support to omap2-mcspi Matt Porter
  2012-09-17 17:22 ` [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support Matt Porter
@ 2012-09-17 17:22 ` Matt Porter
  2012-09-17 17:28   ` Tony Lindgren
  2012-09-18 12:11   ` Linus Walleij
  2012-09-17 17:27 ` [PATCH v2 0/2] Add pinctrl support to omap2-mcspi Matt Porter
  2 siblings, 2 replies; 9+ messages in thread
From: Matt Porter @ 2012-09-17 17:22 UTC (permalink / raw)
  To: Linux OMAP List, Linux SPI Devel List, Grant Likely, Tony Lindgren
  Cc: Linux Kernel Mailing List, Linux ARM Kernel List, AnilKumar

Enable pinctrl dummy states for all OMAP platforms that don't
populate DT. This allows drivers to be converted to pinctrl
and not generate new warnings on platforms that do not provide
pinctrl data. These platforms already have pinmuxes configured
before the drivers probe.

Signed-off-by: Matt Porter <mporter@ti.com>
---
 arch/arm/mach-omap2/devices.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 1efa984..6ef4010 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -17,6 +17,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/of.h>
+#include <linux/pinctrl/machine.h>
 #include <linux/platform_data/omap4-keypad.h>
 
 #include <asm/mach-types.h>
@@ -628,6 +629,10 @@ static inline void omap_init_vout(void) {}
 
 static int __init omap2_init_devices(void)
 {
+	/* Enable dummy states for those platforms without pinctrl support */
+	if (!of_have_populated_dt())
+		pinctrl_provide_dummies();
+
 	/*
 	 * please keep these calls, and their implementations above,
 	 * in alphabetical order so they're easier to sort through.
-- 
1.7.9.5


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

* Re: [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support
  2012-09-17 17:22 ` [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support Matt Porter
@ 2012-09-17 17:26   ` Tony Lindgren
  2012-09-18  5:27   ` Shubhrajyoti
  1 sibling, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2012-09-17 17:26 UTC (permalink / raw)
  To: Matt Porter
  Cc: Linux OMAP List, Linux SPI Devel List, Grant Likely,
	Linux Kernel Mailing List, Linux ARM Kernel List, AnilKumar

* Matt Porter <mporter@ti.com> [120917 10:21]:
> Adds pinctrl support to support OMAP platforms that boot from DT
> and rely on pinctrl support to set pinmuxes.
> 
> Signed-off-by: Matt Porter <mporter@ti.com>

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  drivers/spi/spi-omap2-mcspi.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
> index b2fb141..9502566 100644
> --- a/drivers/spi/spi-omap2-mcspi.c
> +++ b/drivers/spi/spi-omap2-mcspi.c
> @@ -38,6 +38,8 @@
>  #include <linux/pm_runtime.h>
>  #include <linux/of.h>
>  #include <linux/of_device.h>
> +#include <linux/pinctrl/consumer.h>
> +#include <linux/err.h>
>  
>  #include <linux/spi/spi.h>
>  
> @@ -1124,6 +1126,7 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
>  	static int		bus_num = 1;
>  	struct device_node	*node = pdev->dev.of_node;
>  	const struct of_device_id *match;
> +	struct pinctrl *pinctrl;
>  
>  	master = spi_alloc_master(&pdev->dev, sizeof *mcspi);
>  	if (master == NULL) {
> @@ -1219,6 +1222,11 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
>  	if (status < 0)
>  		goto dma_chnl_free;
>  
> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> +	if (IS_ERR(pinctrl))
> +		dev_warn(&pdev->dev,
> +			"pins are not configured from the driver\n");
> +
>  	pm_runtime_use_autosuspend(&pdev->dev);
>  	pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
>  	pm_runtime_enable(&pdev->dev);
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH v2 0/2] Add pinctrl support to omap2-mcspi
  2012-09-17 17:22 [PATCH v2 0/2] Add pinctrl support to omap2-mcspi Matt Porter
  2012-09-17 17:22 ` [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support Matt Porter
  2012-09-17 17:22 ` [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states Matt Porter
@ 2012-09-17 17:27 ` Matt Porter
  2 siblings, 0 replies; 9+ messages in thread
From: Matt Porter @ 2012-09-17 17:27 UTC (permalink / raw)
  To: Linux OMAP List, Linux SPI Devel List, Grant Likely, Tony Lindgren
  Cc: Linux Kernel Mailing List, Linux ARM Kernel List, AnilKumar

On Mon, Sep 17, 2012 at 01:22:16PM -0400, Matt Porter wrote:
> Changes since v1:
> 	- warns that pins are not configured by the driver rather than
> 	  exiting 
> 	- dummy states are only enabled for OMAP platforms where DT is
> 	  not populated
> 
> This series enables pinctrl support for McSPI. Platforms that boot only
> from DT and rely on pinctrl to set pinmuxes appropriately require this
> for omap2-mcspi operation.
> 
> It has been tested on AM335x BeagleBone with an Adafruit SPI LCD attached
> and regression tested on Beagleboard xM booting in the !DT case, using
> board-omap3evm.c. 
> 
> The series applies on top of Tony's dt-devel branch.

*sigh*, that's devel-dt of course.

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

* Re: [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states
  2012-09-17 17:22 ` [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states Matt Porter
@ 2012-09-17 17:28   ` Tony Lindgren
  2012-09-18 12:11   ` Linus Walleij
  1 sibling, 0 replies; 9+ messages in thread
From: Tony Lindgren @ 2012-09-17 17:28 UTC (permalink / raw)
  To: Matt Porter
  Cc: Linux OMAP List, Linux SPI Devel List, Grant Likely,
	Linux Kernel Mailing List, Linux ARM Kernel List, AnilKumar

* Matt Porter <mporter@ti.com> [120917 10:21]:
> Enable pinctrl dummy states for all OMAP platforms that don't
> populate DT. This allows drivers to be converted to pinctrl
> and not generate new warnings on platforms that do not provide
> pinctrl data. These platforms already have pinmuxes configured
> before the drivers probe.

Thanks this should do the trick until we've converted to use DT.
I'll queue this for the upcoming merge window.

Regards,

Tony
 
> Signed-off-by: Matt Porter <mporter@ti.com>
> ---
>  arch/arm/mach-omap2/devices.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
> index 1efa984..6ef4010 100644
> --- a/arch/arm/mach-omap2/devices.c
> +++ b/arch/arm/mach-omap2/devices.c
> @@ -17,6 +17,7 @@
>  #include <linux/err.h>
>  #include <linux/slab.h>
>  #include <linux/of.h>
> +#include <linux/pinctrl/machine.h>
>  #include <linux/platform_data/omap4-keypad.h>
>  
>  #include <asm/mach-types.h>
> @@ -628,6 +629,10 @@ static inline void omap_init_vout(void) {}
>  
>  static int __init omap2_init_devices(void)
>  {
> +	/* Enable dummy states for those platforms without pinctrl support */
> +	if (!of_have_populated_dt())
> +		pinctrl_provide_dummies();
> +
>  	/*
>  	 * please keep these calls, and their implementations above,
>  	 * in alphabetical order so they're easier to sort through.
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support
  2012-09-17 17:22 ` [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support Matt Porter
  2012-09-17 17:26   ` Tony Lindgren
@ 2012-09-18  5:27   ` Shubhrajyoti
  2012-09-18 12:03     ` Matt Porter
  1 sibling, 1 reply; 9+ messages in thread
From: Shubhrajyoti @ 2012-09-18  5:27 UTC (permalink / raw)
  To: Matt Porter
  Cc: Linux OMAP List, Linux SPI Devel List, Grant Likely,
	Tony Lindgren, Linux Kernel Mailing List, Linux ARM Kernel List,
	AnilKumar

On Monday 17 September 2012 10:52 PM, Matt Porter wrote:
> Adds pinctrl support to support OMAP platforms that boot from DT
> and rely on pinctrl support to set pinmuxes.
>
> Signed-off-by: Matt Porter <mporter@ti.com>
> ---
looks good to me.
you may want to repost with Mark in cc to review.
Acked-by: Shubhrajyoti D <shubhrajyoti@ti.com>

>  drivers/spi/spi-omap2-mcspi.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
> index b2fb141..9502566 100644
> --- a/drivers/spi/spi-omap2-mcspi.c
> +++ b/drivers/spi/spi-omap2-mcspi.c
> @@ -38,6 +38,8 @@
>  #include <linux/pm_runtime.h>
>  #include <linux/of.h>
>  #include <linux/of_device.h>
> +#include <linux/pinctrl/consumer.h>
> +#include <linux/err.h>
>  
>  #include <linux/spi/spi.h>
>  
> @@ -1124,6 +1126,7 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
>  	static int		bus_num = 1;
>  	struct device_node	*node = pdev->dev.of_node;
>  	const struct of_device_id *match;
> +	struct pinctrl *pinctrl;
>  
>  	master = spi_alloc_master(&pdev->dev, sizeof *mcspi);
>  	if (master == NULL) {
> @@ -1219,6 +1222,11 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
>  	if (status < 0)
>  		goto dma_chnl_free;
>  
> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> +	if (IS_ERR(pinctrl))
> +		dev_warn(&pdev->dev,
> +			"pins are not configured from the driver\n");
> +
>  	pm_runtime_use_autosuspend(&pdev->dev);
>  	pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
>  	pm_runtime_enable(&pdev->dev);


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

* Re: [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support
  2012-09-18  5:27   ` Shubhrajyoti
@ 2012-09-18 12:03     ` Matt Porter
  0 siblings, 0 replies; 9+ messages in thread
From: Matt Porter @ 2012-09-18 12:03 UTC (permalink / raw)
  To: Shubhrajyoti
  Cc: Linux OMAP List, Linux SPI Devel List, Grant Likely,
	Tony Lindgren, Linux Kernel Mailing List, Linux ARM Kernel List,
	AnilKumar, Mark Brown

On Tue, Sep 18, 2012 at 10:57:26AM +0530, Shubhrajyoti wrote:
> On Monday 17 September 2012 10:52 PM, Matt Porter wrote:
> > Adds pinctrl support to support OMAP platforms that boot from DT
> > and rely on pinctrl support to set pinmuxes.
> >
> > Signed-off-by: Matt Porter <mporter@ti.com>
> > ---
> looks good to me.
> you may want to repost with Mark in cc to review.
> Acked-by: Shubhrajyoti D <shubhrajyoti@ti.com>

Thanks...reposted this part with Mark cced.

-Matt
 
> >  drivers/spi/spi-omap2-mcspi.c |    8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
> > index b2fb141..9502566 100644
> > --- a/drivers/spi/spi-omap2-mcspi.c
> > +++ b/drivers/spi/spi-omap2-mcspi.c
> > @@ -38,6 +38,8 @@
> >  #include <linux/pm_runtime.h>
> >  #include <linux/of.h>
> >  #include <linux/of_device.h>
> > +#include <linux/pinctrl/consumer.h>
> > +#include <linux/err.h>
> >  
> >  #include <linux/spi/spi.h>
> >  
> > @@ -1124,6 +1126,7 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
> >  	static int		bus_num = 1;
> >  	struct device_node	*node = pdev->dev.of_node;
> >  	const struct of_device_id *match;
> > +	struct pinctrl *pinctrl;
> >  
> >  	master = spi_alloc_master(&pdev->dev, sizeof *mcspi);
> >  	if (master == NULL) {
> > @@ -1219,6 +1222,11 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
> >  	if (status < 0)
> >  		goto dma_chnl_free;
> >  
> > +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> > +	if (IS_ERR(pinctrl))
> > +		dev_warn(&pdev->dev,
> > +			"pins are not configured from the driver\n");
> > +
> >  	pm_runtime_use_autosuspend(&pdev->dev);
> >  	pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
> >  	pm_runtime_enable(&pdev->dev);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states
  2012-09-17 17:22 ` [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states Matt Porter
  2012-09-17 17:28   ` Tony Lindgren
@ 2012-09-18 12:11   ` Linus Walleij
  1 sibling, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2012-09-18 12:11 UTC (permalink / raw)
  To: Matt Porter
  Cc: Linux OMAP List, Linux SPI Devel List, Grant Likely,
	Tony Lindgren, AnilKumar, Linux Kernel Mailing List,
	Linux ARM Kernel List

On Mon, Sep 17, 2012 at 7:22 PM, Matt Porter <mporter@ti.com> wrote:

> Enable pinctrl dummy states for all OMAP platforms that don't
> populate DT. This allows drivers to be converted to pinctrl
> and not generate new warnings on platforms that do not provide
> pinctrl data. These platforms already have pinmuxes configured
> before the drivers probe.
>
> Signed-off-by: Matt Porter <mporter@ti.com>

Looks like a good idea, so FWIW:
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

end of thread, other threads:[~2012-09-18 12:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-17 17:22 [PATCH v2 0/2] Add pinctrl support to omap2-mcspi Matt Porter
2012-09-17 17:22 ` [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support Matt Porter
2012-09-17 17:26   ` Tony Lindgren
2012-09-18  5:27   ` Shubhrajyoti
2012-09-18 12:03     ` Matt Porter
2012-09-17 17:22 ` [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states Matt Porter
2012-09-17 17:28   ` Tony Lindgren
2012-09-18 12:11   ` Linus Walleij
2012-09-17 17:27 ` [PATCH v2 0/2] Add pinctrl support to omap2-mcspi Matt Porter

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).