devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/3] gpio: add suspend/resume support for i.mx8x SoCs
@ 2022-11-11 15:50 Shenwei Wang
  2022-11-11 15:50 ` [PATCH v5 1/3] arm64: dts: imx8dxl-ss-lsio: add gpio-ranges property Shenwei Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Shenwei Wang @ 2022-11-11 15:50 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer
  Cc: Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Shenwei Wang, Peng Fan, Linus Walleij, devicetree,
	linux-arm-kernel, imx

On i.MX8QM/QXP/DXL SoCs, even a GPIO is selected as the wakeup source,
the GPIO block will be powered off when system enters into suspend
state. This can greatly reduce the power consumption of suspend state
because the whole partition can be shutdown. This is called PAD wakeup
feature on i.MX8x platform.

This series of patches enable this wakeup feature on i.MX8QM/QXP/DXL
platforms.

Changes in v5:
 - improve the commit log per Fabio's feedback.
 - remove the two patches accepted by Linus Walleij

Changes in v4:
 - fixed the format issues reported by Peng Fan.
 - change the return type of mxc_gpio_generic_config, and limit the
   suspend/resume behavior changes only on i.MX8QM/QXP/DXL platform.

Changes in v3:
 - According to the feedback from Linus Walleij, the wakeup feature is
   moved to pinctrl driver, and the array of gpio-pin mapping is moved
   to gpio device node and initialized via gpio-ranges property.

Shenwei Wang (3):
  arm64: dts: imx8dxl-ss-lsio: add gpio-ranges property
  arm64: dts: imx8qm-ss-lsio: add gpio-ranges property
  arm64: dts: imx8qxp-ss-lsio: add gpio-ranges property

 .../boot/dts/freescale/imx8dxl-ss-lsio.dtsi   | 41 +++++++++++++++++++
 .../boot/dts/freescale/imx8qm-ss-lsio.dtsi    | 38 +++++++++++++++++
 .../boot/dts/freescale/imx8qxp-ss-lsio.dtsi   | 25 +++++++++++
 3 files changed, 104 insertions(+)

--
2.34.1


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

* [PATCH v5 1/3] arm64: dts: imx8dxl-ss-lsio: add gpio-ranges property
  2022-11-11 15:50 [PATCH v5 0/3] gpio: add suspend/resume support for i.mx8x SoCs Shenwei Wang
@ 2022-11-11 15:50 ` Shenwei Wang
  2022-11-11 15:50 ` [PATCH v5 2/3] arm64: dts: imx8qm-ss-lsio: " Shenwei Wang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Shenwei Wang @ 2022-11-11 15:50 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer
  Cc: Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Shenwei Wang, Peng Fan, Linus Walleij, devicetree,
	linux-arm-kernel, imx

add gpio-ranges property for imx8dxl soc.

This gpio-range is used to record which GPIOs correspond to which pins on
which pin controllers. The GPIO to PIN mapping will be referenced by the
pad wakeup function in GPIO-MXC driver.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
---
 .../boot/dts/freescale/imx8dxl-ss-lsio.dtsi   | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8dxl-ss-lsio.dtsi b/arch/arm64/boot/dts/freescale/imx8dxl-ss-lsio.dtsi
index 815bd987b09b..5306d2b3fc3f 100644
--- a/arch/arm64/boot/dts/freescale/imx8dxl-ss-lsio.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8dxl-ss-lsio.dtsi
@@ -6,41 +6,82 @@
 &lsio_gpio0 {
 	compatible = "fsl,imx8dxl-gpio", "fsl,imx35-gpio";
 	interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
+	gpio-ranges = <&iomuxc 0 47 13>,
+		      <&iomuxc 13 61 4>,
+		      <&iomuxc 19 67 4>,
+		      <&iomuxc 24 72 1>;
 };
 
 &lsio_gpio1 {
 	compatible = "fsl,imx8dxl-gpio", "fsl,imx35-gpio";
 	interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
+	gpio-ranges = <&iomuxc 4 74 5>,
+		      <&iomuxc 9 80 16>;
 };
 
 &lsio_gpio2 {
 	compatible = "fsl,imx8dxl-gpio", "fsl,imx35-gpio";
 	interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>;
+	gpio-ranges = <&iomuxc 1 98 2>,
+		      <&iomuxc 3 101 1>,
+		      <&iomuxc 5 107 8>;
 };
 
 &lsio_gpio3 {
 	compatible = "fsl,imx8dxl-gpio", "fsl,imx35-gpio";
 	interrupts = <GIC_SPI 81 IRQ_TYPE_LEVEL_HIGH>;
+	gpio-ranges = <&iomuxc 0 115 4>,
+		      <&iomuxc 9 121 1>,
+		      <&iomuxc 10 120 1>,
+		      <&iomuxc 11 123 1>,
+		      <&iomuxc 12 122 1>,
+		      <&iomuxc 13 125 1>,
+		      <&iomuxc 14 124 1>,
+		      <&iomuxc 16 126 1>,
+		      <&iomuxc 17 128 1>,
+		      <&iomuxc 18 131 1>,
+		      <&iomuxc 19 130 1>,
+		      <&iomuxc 20 133 1>,
+		      <&iomuxc 21 132 1>,
+		      <&iomuxc 22 129 1>,
+		      <&iomuxc 23 134 1>;
 };
 
 &lsio_gpio4 {
 	compatible = "fsl,imx8dxl-gpio", "fsl,imx35-gpio";
 	interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
+	gpio-ranges = <&iomuxc 0 0 3>,
+		      <&iomuxc 3 4 4>,
+		      <&iomuxc 7 9 12>,
+		      <&iomuxc 19 22 2>,
+		      <&iomuxc 21 25 2>,
+		      <&iomuxc 29 29 3>;
 };
 
 &lsio_gpio5 {
 	compatible = "fsl,imx8dxl-gpio", "fsl,imx35-gpio";
 	interrupts = <GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>;
+	gpio-ranges = <&iomuxc 0 32 3>,
+		      <&iomuxc 3 36 6>,
+		      <&iomuxc 9 43 3>;
 };
 
 &lsio_gpio6 {
 	compatible = "fsl,imx8dxl-gpio", "fsl,imx35-gpio";
 	interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
+	gpio-ranges = <&iomuxc 0 53 7>,
+		      <&iomuxc 8 86 10>,
+		      <&iomuxc 19 107 8>;
 };
 
 &lsio_gpio7 {
 	compatible = "fsl,imx8dxl-gpio", "fsl,imx35-gpio";
 	interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
+	gpio-ranges = <&iomuxc 0 0 3>,
+		      <&iomuxc 3 4 4>,
+		      <&iomuxc 8 22 2>,
+		      <&iomuxc 10 25 2>,
+		      <&iomuxc 16 44 2>;
 };
 
 &lsio_mu0 {
-- 
2.34.1


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

* [PATCH v5 2/3] arm64: dts: imx8qm-ss-lsio: add gpio-ranges property
  2022-11-11 15:50 [PATCH v5 0/3] gpio: add suspend/resume support for i.mx8x SoCs Shenwei Wang
  2022-11-11 15:50 ` [PATCH v5 1/3] arm64: dts: imx8dxl-ss-lsio: add gpio-ranges property Shenwei Wang
@ 2022-11-11 15:50 ` Shenwei Wang
  2022-11-11 15:50 ` [PATCH v5 3/3] arm64: dts: imx8qxp-ss-lsio: " Shenwei Wang
  2022-11-14  8:52 ` [PATCH v5 0/3] gpio: add suspend/resume support for i.mx8x SoCs Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Shenwei Wang @ 2022-11-11 15:50 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer
  Cc: Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Shenwei Wang, Peng Fan, Linus Walleij, devicetree,
	linux-arm-kernel, imx

add gpio-ranges property for imx8qm soc.

This gpio-range is used to record which GPIOs correspond to which pins on
which pin controllers. The GPIO to PIN mapping will be referenced by the
pad wakeup function in GPIO-MXC driver.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
---
 .../boot/dts/freescale/imx8qm-ss-lsio.dtsi    | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8qm-ss-lsio.dtsi b/arch/arm64/boot/dts/freescale/imx8qm-ss-lsio.dtsi
index 669aa14ce9f7..b483134f84d1 100644
--- a/arch/arm64/boot/dts/freescale/imx8qm-ss-lsio.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qm-ss-lsio.dtsi
@@ -6,30 +6,68 @@
 
 &lsio_gpio0 {
 	compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 0 6>,
+		      <&iomuxc 6 7 22>,
+		      <&iomuxc 28 36 4>;
 };
 
 &lsio_gpio1 {
 	compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 40 4>,
+		      <&iomuxc 4 50 12>,
+		      <&iomuxc 16 63 8>,
+		      <&iomuxc 24 72 8>;
 };
 
 &lsio_gpio2 {
 	compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 80 4>,
+		      <&iomuxc 4 85 18>,
+		      <&iomuxc 22 104 10>;
 };
 
 &lsio_gpio3 {
 	compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 114 2>,
+		      <&iomuxc 2 117 16>,
+		      <&iomuxc 18 141 1>,
+		      <&iomuxc 19 140 1>,
+		      <&iomuxc 20 139 1>,
+		      <&iomuxc 21 138 1>,
+		      <&iomuxc 22 137 1>,
+		      <&iomuxc 23 136 1>,
+		      <&iomuxc 24 135 1>,
+		      <&iomuxc 25 134 1>,
+		      <&iomuxc 26 142 3>,
+		      <&iomuxc 29 146 3>;
 };
 
 &lsio_gpio4 {
 	compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 149 3>,
+		      <&iomuxc 3 153 4>,
+		      <&iomuxc 7 158 6>,
+		      <&iomuxc 13 165 6>,
+		      <&iomuxc 19 172 8>,
+		      <&iomuxc 27 198 5>;
 };
 
 &lsio_gpio5 {
 	compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 203 1>,
+		      <&iomuxc 1 205 2>,
+		      <&iomuxc 3 210 11>,
+		      <&iomuxc 14 223 3>,
+		      <&iomuxc 17 227 2>,
+		      <&iomuxc 19 230 5>,
+		      <&iomuxc 24 236 6>,
+		      <&iomuxc 30 243 2>;
 };
 
 &lsio_gpio6 {
 	compatible = "fsl,imx8qm-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 245 10>,
+		      <&iomuxc 10 256 12>;
 };
 
 &lsio_gpio7 {
-- 
2.34.1


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

* [PATCH v5 3/3] arm64: dts: imx8qxp-ss-lsio: add gpio-ranges property
  2022-11-11 15:50 [PATCH v5 0/3] gpio: add suspend/resume support for i.mx8x SoCs Shenwei Wang
  2022-11-11 15:50 ` [PATCH v5 1/3] arm64: dts: imx8dxl-ss-lsio: add gpio-ranges property Shenwei Wang
  2022-11-11 15:50 ` [PATCH v5 2/3] arm64: dts: imx8qm-ss-lsio: " Shenwei Wang
@ 2022-11-11 15:50 ` Shenwei Wang
  2022-11-14  8:52 ` [PATCH v5 0/3] gpio: add suspend/resume support for i.mx8x SoCs Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Shenwei Wang @ 2022-11-11 15:50 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Shawn Guo, Sascha Hauer
  Cc: Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Shenwei Wang, Peng Fan, Linus Walleij, devicetree,
	linux-arm-kernel, imx

add gpio-ranges property for imx8qxp soc.

This gpio-range is used to record which GPIOs correspond to which pins on
which pin controllers. The GPIO to PIN mapping will be referenced by the
pad wakeup function in GPIO-MXC driver.

Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
---
 .../boot/dts/freescale/imx8qxp-ss-lsio.dtsi   | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8qxp-ss-lsio.dtsi b/arch/arm64/boot/dts/freescale/imx8qxp-ss-lsio.dtsi
index 8e2152c6eb88..8f722b1dd078 100644
--- a/arch/arm64/boot/dts/freescale/imx8qxp-ss-lsio.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8qxp-ss-lsio.dtsi
@@ -6,26 +6,51 @@
 
 &lsio_gpio0 {
 	compatible = "fsl,imx8qxp-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 1 56 12>,
+		      <&iomuxc 13 69 4>,
+		      <&iomuxc 19 75 4>,
+		      <&iomuxc 24 80 1>,
+		      <&iomuxc 25 82 7>;
 };
 
 &lsio_gpio1 {
 	compatible = "fsl,imx8qxp-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 89 9>,
+		      <&iomuxc 9 99 16>,
+		      <&iomuxc 25 116 7>;
 };
 
 &lsio_gpio2 {
 	compatible = "fsl,imx8qxp-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 123 1>,
+		      <&iomuxc 1 126 2>,
+		      <&iomuxc 3 129 1>;
 };
 
 &lsio_gpio3 {
 	compatible = "fsl,imx8qxp-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 146 4>,
+		      <&iomuxc 4 151 13>,
+		      <&iomuxc 17 165 8>;
 };
 
 &lsio_gpio4 {
 	compatible = "fsl,imx8qxp-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 0 3>,
+		      <&iomuxc 3 4 4>,
+		      <&iomuxc 7 9 6>,
+		      <&iomuxc 13 16 6>,
+		      <&iomuxc 19 23 2>,
+		      <&iomuxc 21 26 2>,
+		      <&iomuxc 23 30 6>,
+		      <&iomuxc 29 37 3>;
 };
 
 &lsio_gpio5 {
 	compatible = "fsl,imx8qxp-gpio", "fsl,imx35-gpio";
+	gpio-ranges = <&iomuxc 0 40 3>,
+		      <&iomuxc 3 44 6>,
+		      <&iomuxc 9 51 3>;
 };
 
 &lsio_gpio6 {
-- 
2.34.1


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

* Re: [PATCH v5 0/3] gpio: add suspend/resume support for i.mx8x SoCs
  2022-11-11 15:50 [PATCH v5 0/3] gpio: add suspend/resume support for i.mx8x SoCs Shenwei Wang
                   ` (2 preceding siblings ...)
  2022-11-11 15:50 ` [PATCH v5 3/3] arm64: dts: imx8qxp-ss-lsio: " Shenwei Wang
@ 2022-11-14  8:52 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2022-11-14  8:52 UTC (permalink / raw)
  To: Shenwei Wang
  Cc: Rob Herring, Krzysztof Kozlowski, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team, Peng Fan,
	Linus Walleij, devicetree, linux-arm-kernel, imx

On Fri, Nov 11, 2022 at 09:50:13AM -0600, Shenwei Wang wrote:
> On i.MX8QM/QXP/DXL SoCs, even a GPIO is selected as the wakeup source,
> the GPIO block will be powered off when system enters into suspend
> state. This can greatly reduce the power consumption of suspend state
> because the whole partition can be shutdown. This is called PAD wakeup
> feature on i.MX8x platform.
> 
> This series of patches enable this wakeup feature on i.MX8QM/QXP/DXL
> platforms.
> 
> Changes in v5:
>  - improve the commit log per Fabio's feedback.
>  - remove the two patches accepted by Linus Walleij
> 
> Changes in v4:
>  - fixed the format issues reported by Peng Fan.
>  - change the return type of mxc_gpio_generic_config, and limit the
>    suspend/resume behavior changes only on i.MX8QM/QXP/DXL platform.
> 
> Changes in v3:
>  - According to the feedback from Linus Walleij, the wakeup feature is
>    moved to pinctrl driver, and the array of gpio-pin mapping is moved
>    to gpio device node and initialized via gpio-ranges property.
> 
> Shenwei Wang (3):
>   arm64: dts: imx8dxl-ss-lsio: add gpio-ranges property
>   arm64: dts: imx8qm-ss-lsio: add gpio-ranges property
>   arm64: dts: imx8qxp-ss-lsio: add gpio-ranges property

Applied all, thanks!

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

end of thread, other threads:[~2022-11-14  8:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-11 15:50 [PATCH v5 0/3] gpio: add suspend/resume support for i.mx8x SoCs Shenwei Wang
2022-11-11 15:50 ` [PATCH v5 1/3] arm64: dts: imx8dxl-ss-lsio: add gpio-ranges property Shenwei Wang
2022-11-11 15:50 ` [PATCH v5 2/3] arm64: dts: imx8qm-ss-lsio: " Shenwei Wang
2022-11-11 15:50 ` [PATCH v5 3/3] arm64: dts: imx8qxp-ss-lsio: " Shenwei Wang
2022-11-14  8:52 ` [PATCH v5 0/3] gpio: add suspend/resume support for i.mx8x SoCs Shawn Guo

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