[edk2,edk2-platforms,v4,33/34] Platform/DeveloperBox: add description of power button to DT

Message ID 20171110142127.12018-34-ard.biesheuvel@linaro.org
State New
Headers show
Series
  • add support for Socionext SynQuacer
Related show

Commit Message

Ard Biesheuvel Nov. 10, 2017, 2:21 p.m.
Add the power button as a gpio-keys KEY_POWER button, and mark it as
a wakeup source so it can be used under the OS both as a 'sleep' and
as a 'wake' button.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

-- 
2.11.0

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Leif Lindholm Nov. 17, 2017, 5:06 p.m. | #1
On Fri, Nov 10, 2017 at 02:21:26PM +0000, Ard Biesheuvel wrote:
> Add the power button as a gpio-keys KEY_POWER button, and mark it as

> a wakeup source so it can be used under the OS both as a 'sleep' and

> as a 'wake' button.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>


Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>


> ---

>  Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts | 14 ++++++++++++++

>  1 file changed, 14 insertions(+)

> 

> diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts b/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts

> index 6ae7d5f300b6..d2cd7ef90e6f 100644

> --- a/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts

> +++ b/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts

> @@ -15,9 +15,23 @@

>  

>  #include "SynQuacer.dtsi"

>  

> +#define KEY_POWER     116

> +

>  / {

>      model = "Socionext Developer Box";

>      compatible = "socionext,developer-box", "socionext,synquacer";

> +

> +    gpio-keys {

> +        compatible = "gpio-keys";

> +        interrupt-parent = <&exiu>;

> +

> +        power {

> +            label = "Power Button";

> +            linux,code = <KEY_POWER>;

> +            interrupts = <GIC_SPI 120 IRQ_TYPE_EDGE_FALLING>;

> +            wakeup-source;

> +        };

> +    };

>  };

>  

>  &gpio {

> -- 

> 2.11.0

> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Patch

diff --git a/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts b/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts
index 6ae7d5f300b6..d2cd7ef90e6f 100644
--- a/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts
+++ b/Silicon/Socionext/SynQuacer/DeviceTree/DeveloperBox.dts
@@ -15,9 +15,23 @@ 
 
 #include "SynQuacer.dtsi"
 
+#define KEY_POWER     116
+
 / {
     model = "Socionext Developer Box";
     compatible = "socionext,developer-box", "socionext,synquacer";
+
+    gpio-keys {
+        compatible = "gpio-keys";
+        interrupt-parent = <&exiu>;
+
+        power {
+            label = "Power Button";
+            linux,code = <KEY_POWER>;
+            interrupts = <GIC_SPI 120 IRQ_TYPE_EDGE_FALLING>;
+            wakeup-source;
+        };
+    };
 };
 
 &gpio {