Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1cea2c22 authored by Baolin Wang's avatar Baolin Wang Committed by Olof Johansson
Browse files

arm64: dts: sprd: Add GPIO and GPIO keys device nodes



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: default avatarBaolin Wang <baolin.wang@linaro.org>
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parent 4b9743e8
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -24,6 +24,17 @@
			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";

+30 −0
Original line number Diff line number Diff line
@@ -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"

/ {
@@ -679,5 +681,33 @@
				};
			};
		};

		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;
			};
		};
	};
};
+50 −0
Original line number Diff line number Diff line
@@ -154,6 +154,56 @@
				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>;