arm64: dts: sprd: Add GPIO and GPIO keys device nodes
authorBaolin Wang <baolin.wang@linaro.org>
Mon, 16 Apr 2018 02:40:03 +0000 (10:40 +0800)
committerOlof Johansson <olof@lixom.net>
Fri, 25 May 2018 22:28:29 +0000 (15:28 -0700)
This patch adds device nodes to enable one GPIO controller located on
digital chip, 2 EIC (external interrupt controller) controllers loacted
on PMIC and digital chip for Spreadtrum SC9860 platform.

Moreover this patch adds 3 GPIO keys relied on EIC controller to support
power key and volume up/down keys.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm64/boot/dts/sprd/sc2731.dtsi
arch/arm64/boot/dts/sprd/sc9860.dtsi
arch/arm64/boot/dts/sprd/whale2.dtsi

index 4331006185bfc60be5a32f20bd263ad24b3762d3..98d3b4fdb9adc9d71f5b747c4dd16c6c5d4639fa 100644 (file)
                        interrupts = <2 IRQ_TYPE_LEVEL_HIGH>;
                };
 
+               pmic_eic: gpio@300 {
+                       compatible = "sprd,sc27xx-eic";
+                       reg = <0x300>;
+                       interrupt-parent = <&sc2731_pmic>;
+                       interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+                       gpio-controller;
+                       #gpio-cells = <2>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+               };
+
                regulators {
                        compatible = "sprd,sc27xx-regulator";
 
index dcd03ffcda0307dc2759f3b4313867071bfc09b6..3f5160d2f1307b0db5076d3dc2844fffc544489f 100644 (file)
@@ -7,6 +7,8 @@
  */
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
 #include "whale2.dtsi"
 
 / {
                                };
                        };
                };
+
+               gpio-keys {
+                       compatible = "gpio-keys";
+
+                       key-volumedown {
+                               label = "Volume Down Key";
+                               linux,code = <KEY_VOLUMEDOWN>;
+                               gpios = <&eic_debounce 2 GPIO_ACTIVE_LOW>;
+                               debounce-interval = <2>;
+                               wakeup-source;
+                       };
+
+                       key-volumeup {
+                               label = "Volume Up Key";
+                               linux,code = <KEY_VOLUMEUP>;
+                               gpios = <&pmic_eic 10 GPIO_ACTIVE_HIGH>;
+                               debounce-interval = <2>;
+                               wakeup-source;
+                       };
+
+                       key-power {
+                               label = "Power Key";
+                               linux,code = <KEY_POWER>;
+                               gpios = <&pmic_eic 1 GPIO_ACTIVE_HIGH>;
+                               debounce-interval = <2>;
+                               wakeup-source;
+                       };
+               };
        };
 };
index 66a881e6da920d9ee317d188533a8d5c54e571bd..bf7e70c52c6131b73c7928878ab700ac799efc0b 100644 (file)
                                clocks = <&aon_gate CLK_SPLK_EB>;
                        };
 
+                       eic_debounce: gpio@40210000 {
+                               compatible = "sprd,sc9860-eic-debounce";
+                               reg = <0 0x40210000 0 0x80>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
+                       eic_latch: gpio@40210080 {
+                               compatible = "sprd,sc9860-eic-latch";
+                               reg = <0 0x40210080 0 0x20>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
+                       eic_async: gpio@402100a0 {
+                               compatible = "sprd,sc9860-eic-async";
+                               reg = <0 0x402100a0 0 0x20>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
+                       eic_sync: gpio@402100c0 {
+                               compatible = "sprd,sc9860-eic-sync";
+                               reg = <0 0x402100c0 0 0x20>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
+                       ap_gpio: gpio@40280000 {
+                               compatible = "sprd,sc9860-gpio";
+                               reg = <0 0x40280000 0 0x1000>;
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
                        pin_controller: pinctrl@402a0000 {
                                compatible = "sprd,sc9860-pinctrl";
                                reg = <0 0x402a0000 0 0x10000>;