* [PATCH] spi: rockchip: support "sleep" pin configuration
@ 2016-12-17 0:59 Brian Norris
[not found] ` <1481936356-76161-1-git-send-email-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Brian Norris @ 2016-12-17 0:59 UTC (permalink / raw)
To: Mark Brown
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Caesar Wang, Brian Norris,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
In the pattern of many other devices, support a system-sleep pin
configuration.
Signed-off-by: Brian Norris <briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
Documentation/devicetree/bindings/spi/spi-rockchip.txt | 7 +++++++
drivers/spi/spi-rockchip.c | 5 +++++
2 files changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/spi/spi-rockchip.txt b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
index d2ca153614f9..83da4931d832 100644
--- a/Documentation/devicetree/bindings/spi/spi-rockchip.txt
+++ b/Documentation/devicetree/bindings/spi/spi-rockchip.txt
@@ -31,6 +31,10 @@ Optional Properties:
- rx-sample-delay-ns: nanoseconds to delay after the SCLK edge before sampling
Rx data (may need to be fine tuned for high capacitance lines).
No delay (0) by default.
+- pinctrl-names: Names for the pin configuration(s); may be "default" or
+ "sleep", where the "sleep" configuration may describe the state
+ the pins should be in during system suspend. See also
+ pinctrl/pinctrl-bindings.txt.
Example:
@@ -46,4 +50,7 @@ Example:
interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&cru SCLK_SPI0>, <&cru PCLK_SPI0>;
clock-names = "spiclk", "apb_pclk";
+ pinctrl-0 = <&spi1_pins>;
+ pinctrl-1 = <&spi1_sleep>;
+ pinctrl-names = "default", "sleep";
};
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 0f89c2169c24..acf31f36b898 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -17,6 +17,7 @@
#include <linux/dmaengine.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/pm_runtime.h>
@@ -843,6 +844,8 @@ static int rockchip_spi_suspend(struct device *dev)
clk_disable_unprepare(rs->apb_pclk);
}
+ pinctrl_pm_select_sleep_state(dev);
+
return ret;
}
@@ -852,6 +855,8 @@ static int rockchip_spi_resume(struct device *dev)
struct spi_master *master = dev_get_drvdata(dev);
struct rockchip_spi *rs = spi_master_get_devdata(master);
+ pinctrl_pm_select_default_state(dev);
+
if (!pm_runtime_suspended(dev)) {
ret = clk_prepare_enable(rs->apb_pclk);
if (ret < 0)
--
2.8.0.rc3.226.g39d4020
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 4+ messages in thread[parent not found: <1481936356-76161-1-git-send-email-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>]
* Re: [PATCH] spi: rockchip: support "sleep" pin configuration [not found] ` <1481936356-76161-1-git-send-email-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> @ 2016-12-17 6:03 ` Doug Anderson 2016-12-18 7:41 ` Caesar Wang 2016-12-21 4:04 ` Rob Herring 2 siblings, 0 replies; 4+ messages in thread From: Doug Anderson @ 2016-12-17 6:03 UTC (permalink / raw) To: Brian Norris Cc: Mark Brown, linux-spi, Caesar Wang, open list:ARM/Rockchip SoC..., linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Hi, On Fri, Dec 16, 2016 at 4:59 PM, Brian Norris <briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> wrote: > In the pattern of many other devices, support a system-sleep pin > configuration. > > Signed-off-by: Brian Norris <briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> > --- > Documentation/devicetree/bindings/spi/spi-rockchip.txt | 7 +++++++ > drivers/spi/spi-rockchip.c | 5 +++++ > 2 files changed, 12 insertions(+) FWIW Reviewed-by: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: rockchip: support "sleep" pin configuration [not found] ` <1481936356-76161-1-git-send-email-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> 2016-12-17 6:03 ` Doug Anderson @ 2016-12-18 7:41 ` Caesar Wang 2016-12-21 4:04 ` Rob Herring 2 siblings, 0 replies; 4+ messages in thread From: Caesar Wang @ 2016-12-18 7:41 UTC (permalink / raw) To: Brian Norris, Mark Brown Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-spi-u79uwXL29TY76Z2rM5mHXA, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Caesar Wang 在 2016年12月17日 08:59, Brian Norris 写道: > In the pattern of many other devices, support a system-sleep pin > configuration. > > Signed-off-by: Brian Norris <briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> Tested-by: Caesar Wang <wxt-TNX95d0MmH7DzftRWevZcw@public.gmane.org> > --- > Documentation/devicetree/bindings/spi/spi-rockchip.txt | 7 +++++++ > drivers/spi/spi-rockchip.c | 5 +++++ > 2 files changed, 12 insertions(+) > > diff --git a/Documentation/devicetree/bindings/spi/spi-rockchip.txt b/Documentation/devicetree/bindings/spi/spi-rockchip.txt > index d2ca153614f9..83da4931d832 100644 > --- a/Documentation/devicetree/bindings/spi/spi-rockchip.txt > +++ b/Documentation/devicetree/bindings/spi/spi-rockchip.txt > @@ -31,6 +31,10 @@ Optional Properties: > - rx-sample-delay-ns: nanoseconds to delay after the SCLK edge before sampling > Rx data (may need to be fine tuned for high capacitance lines). > No delay (0) by default. > +- pinctrl-names: Names for the pin configuration(s); may be "default" or > + "sleep", where the "sleep" configuration may describe the state > + the pins should be in during system suspend. See also > + pinctrl/pinctrl-bindings.txt. > > > Example: > @@ -46,4 +50,7 @@ Example: > interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>; > clocks = <&cru SCLK_SPI0>, <&cru PCLK_SPI0>; > clock-names = "spiclk", "apb_pclk"; > + pinctrl-0 = <&spi1_pins>; > + pinctrl-1 = <&spi1_sleep>; > + pinctrl-names = "default", "sleep"; > }; > diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c > index 0f89c2169c24..acf31f36b898 100644 > --- a/drivers/spi/spi-rockchip.c > +++ b/drivers/spi/spi-rockchip.c > @@ -17,6 +17,7 @@ > #include <linux/dmaengine.h> > #include <linux/module.h> > #include <linux/of.h> > +#include <linux/pinctrl/consumer.h> > #include <linux/platform_device.h> > #include <linux/spi/spi.h> > #include <linux/pm_runtime.h> > @@ -843,6 +844,8 @@ static int rockchip_spi_suspend(struct device *dev) > clk_disable_unprepare(rs->apb_pclk); > } > > + pinctrl_pm_select_sleep_state(dev); > + > return ret; > } > > @@ -852,6 +855,8 @@ static int rockchip_spi_resume(struct device *dev) > struct spi_master *master = dev_get_drvdata(dev); > struct rockchip_spi *rs = spi_master_get_devdata(master); > > + pinctrl_pm_select_default_state(dev); > + > if (!pm_runtime_suspended(dev)) { > ret = clk_prepare_enable(rs->apb_pclk); > if (ret < 0) -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] spi: rockchip: support "sleep" pin configuration [not found] ` <1481936356-76161-1-git-send-email-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> 2016-12-17 6:03 ` Doug Anderson 2016-12-18 7:41 ` Caesar Wang @ 2016-12-21 4:04 ` Rob Herring 2 siblings, 0 replies; 4+ messages in thread From: Rob Herring @ 2016-12-21 4:04 UTC (permalink / raw) To: Brian Norris Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA, Caesar Wang, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-kernel-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA On Fri, Dec 16, 2016 at 04:59:16PM -0800, Brian Norris wrote: > In the pattern of many other devices, support a system-sleep pin > configuration. > > Signed-off-by: Brian Norris <briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org> > --- > Documentation/devicetree/bindings/spi/spi-rockchip.txt | 7 +++++++ > drivers/spi/spi-rockchip.c | 5 +++++ > 2 files changed, 12 insertions(+) Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-12-21 4:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-17 0:59 [PATCH] spi: rockchip: support "sleep" pin configuration Brian Norris
[not found] ` <1481936356-76161-1-git-send-email-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-12-17 6:03 ` Doug Anderson
2016-12-18 7:41 ` Caesar Wang
2016-12-21 4:04 ` Rob Herring
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).