ARM: dts: imx6qdl-sabresd: Add power key support
Subsystems (2)
PATCH v2 1/1 ARM: dts: imx6qdl-sabresd: Add power key support
This patch adds support for imx6qdl-sabresd board's power key, the key is named "SW1" on board, press it can wake up system from suspend.
Add a new pinctrl entry for gpio keys and move all gpio keys pin to this entry.
--- arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-)
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +22 -4
@@ -10,6 +10,7 @@ * http://www.gnu.org/copyleft/gpl.html */ +#include <dt-bindings/input/input.h> / { memory { reg = <0x10000000 0x40000000>;
@@ -46,19 +47,28 @@ gpio-keys { compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_keys>; + + power { + label = "Power Button"; + gpios = <&gpio3 29 0>; + gpio-key,wakeup; + linux,code = <KEY_POWER>; + }; volume-up { label = "Volume Up"; gpios = <&gpio1 4 0>; gpio-key,wakeup; - linux,code = <115>; /* KEY_VOLUMEUP */ + linux,code = <KEY_VOLUMEUP>; }; volume-down { label = "Volume Down"; gpios = <&gpio1 5 0>; gpio-key,wakeup; - linux,code = <114>; /* KEY_VOLUMEDOWN */ + linux,code = <KEY_VOLUMEDOWN>; }; };
@@ -171,8 +181,6 @@ hog { pinctrl_hog: hoggrp { fsl,pins = < - MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000 - MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x80000000 MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x80000000 MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x80000000 MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x80000000
@@ -185,6 +193,16 @@ >; }; }; + + gpio-keys { + pinctrl_gpio_keys: gpio_keysgrp { + fsl,pins = < + MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x80000000 + MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000 + MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x80000000 + >; + }; + }; }; &ldb {
Signature · 1 line
1.7.9.5
PATCH v2 1/1 ARM: dts: imx6qdl-sabresd: Add power key support
Quoted 8 lines · Anson Huang
This patch adds support for imx6qdl-sabresd board's power key, the key is named "SW1" on board, press it can wake up system from suspend.
Add a new pinctrl entry for gpio keys and move all gpio keys pin to this entry.
Signed-off-by Anson Huang <[email protected]>
There are a couple of minor things below. Nothing major, so I just fixed them up and applied the patch.
arch/arm/boot/dts/imx6qdl-sabresd.dtsi line 13
Quoted 13 lines
--- arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-)arch/arm/boot/dts/imx6qdl-sabresd.dtsi +1
-0@@ -10,6 +10,7 @@ * http://www.gnu.org/copyleft/gpl.html */ +#include <dt-bindings/input/input.h>
Have a blank line here.
Quoted 44 lines
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +11
-4/ { memory { reg = <0x10000000 0x40000000>;@@ -46,19 +47,28 @@ gpio-keys { compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_keys>; + + power { + label = "Power Button"; + gpios = <&gpio3 29 0>; + gpio-key,wakeup; + linux,code = <KEY_POWER>; + }; volume-up { label = "Volume Up"; gpios = <&gpio1 4 0>; gpio-key,wakeup; - linux,code = <115>; /* KEY_VOLUMEUP */ + linux,code = <KEY_VOLUMEUP>; }; volume-down { label = "Volume Down"; gpios = <&gpio1 5 0>; gpio-key,wakeup; - linux,code = <114>; /* KEY_VOLUMEDOWN */ + linux,code = <KEY_VOLUMEDOWN>; }; };@@ -171,8 +181,6 @@ hog { pinctrl_hog: hoggrp { fsl,pins = < - MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000 - MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x80000000 MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x80000000 MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x80000000 MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x80000000
arch/arm/boot/dts/imx6qdl-sabresd.dtsi line 197
Quoted 5 lines
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +2
-0@@ -185,6 +193,16 @@ >; }; }; + + gpio-keys {
We now use one pinctrl container 'imx6qdl-sabresd' for all pinctrl groups, so we can move pinctrl_gpio_keys into above and save this gpio-keys container.
Shawn
Quoted 15 lines
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +8
-0+ pinctrl_gpio_keys: gpio_keysgrp { + fsl,pins = < + MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x80000000 + MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000 + MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x80000000 + >; + }; + }; }; &ldb {Signature · 1 line
1.7.9.5
PATCH v2 1/1 ARM: dts: imx6qdl-sabresd: Add power key support
Best Regards.
Anson huang ???
?
Freescale Semiconductor Shanghai
?????????192?A?2?
201203
Tel:021-28937058
Quoted 81 lines
-----Original Message-----
From: Shawn Guo [mailto:shawn.guo at linaro.org]
Sent: Friday, December 20, 2013 10:28 AM
To: Huang Yongcai-B20788
Cc: kernel at pengutronix.de; linux-arm-kernel at lists.infradead.org; devicetree at vger.kernel.org
Subject: Re: [PATCH V2] ARM: dts: imx6qdl-sabresd: Add power key supportQuoted 7 lines · Anson Huang
This patch adds support for imx6qdl-sabresd board's power key, the key is named "SW1" on board, press it can wake up system from suspend.
Add a new pinctrl entry for gpio keys and move all gpio keys pin to this entry.
Signed-off-by Anson Huang <[email protected]>There are a couple of minor things below. Nothing major, so I just fixed them up and applied the patch.
Quoted 10 lines
--- arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-)arch/arm/boot/dts/imx6qdl-sabresd.dtsi +0
-0arch/arm/boot/dts/imx6qdl-sabresd.dtsi line 13
Quoted 4 lines
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +1
-0@@ -10,6 +10,7 @@ * http://www.gnu.org/copyleft/gpl.html */ +#include <dt-bindings/input/input.h>Have a blank line here.
Quoted 35 lines
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +11
-2/ { memory { reg = <0x10000000 0x40000000>;@@ -46,19 +47,28 @@ gpio-keys { compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_gpio_keys>; + + power { + label = "Power Button"; + gpios = <&gpio3 29 0>; + gpio-key,wakeup; + linux,code = <KEY_POWER>; + }; volume-up { label = "Volume Up"; gpios = <&gpio1 4 0>; gpio-key,wakeup; - linux,code = <115>; /* KEY_VOLUMEUP */ + linux,code = <KEY_VOLUMEUP>; }; volume-down { label = "Volume Down"; gpios = <&gpio1 5 0>; gpio-key,wakeup; - linux,code = <114>; /* KEY_VOLUMEDOWN */ + linux,code = <KEY_VOLUMEDOWN>; }; };arch/arm/boot/dts/imx6qdl-sabresd.dtsi line 186
Quoted 8 lines
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +0
-2@@ -171,8 +181,6 @@ hog { pinctrl_hog: hoggrp { fsl,pins = < - MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000 - MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x80000000 MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x80000000 MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x80000000 MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x80000000 @@ -185,6+193,16 @@
Quoted 9 lines
arch/arm/boot/dts/imx6qdl-sabresd.dtsi line 197
Quoted 5 lines
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +2
-0>; }; }; + + gpio-keys {We now use one pinctrl container 'imx6qdl-sabresd' for all pinctrl groups, so we can move
pinctrl_gpio_keysinto above and save this gpio-keys container.
Understood, thanks, just put this group in the hog node, no need to add a new gpio-keys. [Anson]
Quoted 17 lines
Shawn
Quoted 15 lines
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +8
-1+ pinctrl_gpio_keys: gpio_keysgrp { + fsl,pins = < + MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x80000000 + MX6QDL_PAD_GPIO_4__GPIO1_IO04 0x80000000 + MX6QDL_PAD_GPIO_5__GPIO1_IO05 0x80000000 + >; + }; + }; }; &ldb { --1.7.9.5
PATCH v2 1/1 ARM: dts: imx6qdl-sabresd: Add power key support
Quoted 11 lines · Anson.Huang at freescale.com
Quoted 10 lines
+193,16 @@
arch/arm/boot/dts/imx6qdl-sabresd.dtsi line 197
Quoted 5 lines
arch/arm/boot/dts/imx6qdl-sabresd.dtsi +2
-0>; }; }; + + gpio-keys {We now use one pinctrl container 'imx6qdl-sabresd' for all pinctrl groups, so we can move
pinctrl_gpio_keysinto above and save this gpio-keys container.
Quoted 1 line
Understood, thanks, just put this group in the hog node, no need to add a new gpio-keys.
What I meant is something below.
Shawn