* [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
[not found] ` <1347902538-21208-1-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
0 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
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
[not found] ` <1347902538-21208-2-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
[not found] ` <1347902538-21208-1-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
1 sibling, 1 reply; 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
[not found] ` <1347902538-21208-1-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
@ 2012-09-17 17:22 ` Matt Porter
2012-09-17 17:28 ` Tony Lindgren
[not found] ` <1347902538-21208-3-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2012-09-17 17:27 ` [PATCH v2 0/2] Add pinctrl support to omap2-mcspi Matt Porter
1 sibling, 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: AnilKumar, Linux Kernel Mailing List, Linux ARM Kernel List
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-l0cyMroinI0@public.gmane.org>
---
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
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support
[not found] ` <1347902538-21208-2-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
@ 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 Kernel Mailing List, AnilKumar, Linux SPI Devel List,
Linux OMAP List, Linux ARM Kernel List
* Matt Porter <mporter-l0cyMroinI0@public.gmane.org> [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-l0cyMroinI0@public.gmane.org>
Acked-by: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
> ---
> 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
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 0/2] Add pinctrl support to omap2-mcspi
[not found] ` <1347902538-21208-1-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2012-09-17 17:22 ` [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states Matt Porter
@ 2012-09-17 17:27 ` Matt Porter
1 sibling, 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: AnilKumar, Linux Kernel Mailing List, Linux ARM Kernel List
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.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ 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
[not found] ` <1347902538-21208-3-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
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
[not found] ` <1347902538-21208-2-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2012-09-17 17:26 ` Tony Lindgren
@ 2012-09-18 5:27 ` Shubhrajyoti
[not found] ` <5058063E.40509-l0cyMroinI0@public.gmane.org>
1 sibling, 1 reply; 9+ messages in thread
From: Shubhrajyoti @ 2012-09-18 5:27 UTC (permalink / raw)
To: Matt Porter
Cc: Tony Lindgren, Linux Kernel Mailing List, AnilKumar,
Linux SPI Devel List, Linux OMAP List, Linux ARM Kernel List
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-l0cyMroinI0@public.gmane.org>
> ---
looks good to me.
you may want to repost with Mark in cc to review.
Acked-by: Shubhrajyoti D <shubhrajyoti-l0cyMroinI0@public.gmane.org>
> 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);
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/2] spi: omap2-mcspi: add pinctrl support
[not found] ` <5058063E.40509-l0cyMroinI0@public.gmane.org>
@ 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: Tony Lindgren, Mark Brown, Linux Kernel Mailing List, AnilKumar,
Linux SPI Devel List, Linux OMAP List, Linux ARM Kernel List
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-l0cyMroinI0@public.gmane.org>
> > ---
> looks good to me.
> you may want to repost with Mark in cc to review.
> Acked-by: Shubhrajyoti D <shubhrajyoti-l0cyMroinI0@public.gmane.org>
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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states
[not found] ` <1347902538-21208-3-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
@ 2012-09-18 12:11 ` Linus Walleij
0 siblings, 0 replies; 9+ messages in thread
From: Linus Walleij @ 2012-09-18 12:11 UTC (permalink / raw)
To: Matt Porter
Cc: Tony Lindgren, Linux Kernel Mailing List, AnilKumar,
Linux SPI Devel List, Linux OMAP List, Linux ARM Kernel List
On Mon, Sep 17, 2012 at 7:22 PM, Matt Porter <mporter-l0cyMroinI0@public.gmane.org> 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-l0cyMroinI0@public.gmane.org>
Looks like a good idea, so FWIW:
Acked-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Yours,
Linus Walleij
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
^ 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
[not found] ` <1347902538-21208-2-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2012-09-17 17:26 ` Tony Lindgren
2012-09-18 5:27 ` Shubhrajyoti
[not found] ` <5058063E.40509-l0cyMroinI0@public.gmane.org>
2012-09-18 12:03 ` Matt Porter
[not found] ` <1347902538-21208-1-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
2012-09-17 17:22 ` [PATCH v2 2/2] ARM: OMAP2+: Enable pinctrl dummy states Matt Porter
2012-09-17 17:28 ` Tony Lindgren
[not found] ` <1347902538-21208-3-git-send-email-mporter-l0cyMroinI0@public.gmane.org>
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).