linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: dts: Add GPIO and GPIO keys device nodes
@ 2018-04-16  2:40 Baolin Wang
  2018-04-16  2:40 ` [PATCH 2/2] arm64: dts: Add the rtc enable clock for watchdog Baolin Wang
  2018-05-25 22:29 ` [PATCH 1/2] arm64: dts: Add GPIO and GPIO keys device nodes Olof Johansson
  0 siblings, 2 replies; 4+ messages in thread
From: Baolin Wang @ 2018-04-16  2:40 UTC (permalink / raw)
  To: robh+dt, mark.rutland, catalin.marinas, will.deacon, arnd,
	orsonzhai, zhang.lyra
  Cc: devicetree, arm, linux-arm-kernel, linux-kernel, broonie, baolin.wang

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>
---
 arch/arm64/boot/dts/sprd/sc2731.dtsi |   11 ++++++++
 arch/arm64/boot/dts/sprd/sc9860.dtsi |   30 ++++++++++++++++++++
 arch/arm64/boot/dts/sprd/whale2.dtsi |   50 ++++++++++++++++++++++++++++++++++
 3 files changed, 91 insertions(+)

diff --git a/arch/arm64/boot/dts/sprd/sc2731.dtsi b/arch/arm64/boot/dts/sprd/sc2731.dtsi
index 4331006..98d3b4f 100644
--- a/arch/arm64/boot/dts/sprd/sc2731.dtsi
+++ b/arch/arm64/boot/dts/sprd/sc2731.dtsi
@@ -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";
 
diff --git a/arch/arm64/boot/dts/sprd/sc9860.dtsi b/arch/arm64/boot/dts/sprd/sc9860.dtsi
index 5dbfb79..3066a55 100644
--- a/arch/arm64/boot/dts/sprd/sc9860.dtsi
+++ b/arch/arm64/boot/dts/sprd/sc9860.dtsi
@@ -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;
+			};
+		};
 	};
 };
diff --git a/arch/arm64/boot/dts/sprd/whale2.dtsi b/arch/arm64/boot/dts/sprd/whale2.dtsi
index 66a881e..bf7e70c 100644
--- a/arch/arm64/boot/dts/sprd/whale2.dtsi
+++ b/arch/arm64/boot/dts/sprd/whale2.dtsi
@@ -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>;
-- 
1.7.9.5

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

* [PATCH 2/2] arm64: dts: Add the rtc enable clock for watchdog
  2018-04-16  2:40 [PATCH 1/2] arm64: dts: Add GPIO and GPIO keys device nodes Baolin Wang
@ 2018-04-16  2:40 ` Baolin Wang
  2018-05-25 22:29   ` Olof Johansson
  2018-05-25 22:29 ` [PATCH 1/2] arm64: dts: Add GPIO and GPIO keys device nodes Olof Johansson
  1 sibling, 1 reply; 4+ messages in thread
From: Baolin Wang @ 2018-04-16  2:40 UTC (permalink / raw)
  To: robh+dt, mark.rutland, catalin.marinas, will.deacon, arnd,
	orsonzhai, zhang.lyra
  Cc: devicetree, arm, linux-arm-kernel, linux-kernel, broonie, baolin.wang

Add the rtc enable clock for watchdog controller to make it work well.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 arch/arm64/boot/dts/sprd/whale2.dtsi |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/sprd/whale2.dtsi b/arch/arm64/boot/dts/sprd/whale2.dtsi
index bf7e70c..e9db910 100644
--- a/arch/arm64/boot/dts/sprd/whale2.dtsi
+++ b/arch/arm64/boot/dts/sprd/whale2.dtsi
@@ -214,8 +214,9 @@
 				reg = <0 0x40310000 0 0x1000>;
 				interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
 				timeout-sec = <12>;
-				clock-names = "enable";
-				clocks = <&aon_gate CLK_APCPU_WDG_EB>;
+				clock-names = "enable", "rtc_enable";
+				clocks = <&aon_gate CLK_APCPU_WDG_EB>,
+				       <&aon_gate CLK_AP_WDG_RTC_EB>;
 			};
 		};
 
-- 
1.7.9.5

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

* Re: [PATCH 1/2] arm64: dts: Add GPIO and GPIO keys device nodes
  2018-04-16  2:40 [PATCH 1/2] arm64: dts: Add GPIO and GPIO keys device nodes Baolin Wang
  2018-04-16  2:40 ` [PATCH 2/2] arm64: dts: Add the rtc enable clock for watchdog Baolin Wang
@ 2018-05-25 22:29 ` Olof Johansson
  1 sibling, 0 replies; 4+ messages in thread
From: Olof Johansson @ 2018-05-25 22:29 UTC (permalink / raw)
  To: Baolin Wang
  Cc: robh+dt, mark.rutland, catalin.marinas, will.deacon, arnd,
	orsonzhai, zhang.lyra, devicetree, arm, linux-arm-kernel,
	linux-kernel, broonie

On Mon, Apr 16, 2018 at 10:40:03AM +0800, Baolin Wang wrote:
> 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>

Applied with "sprd:" added to the subject.


-Olof

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

* Re: [PATCH 2/2] arm64: dts: Add the rtc enable clock for watchdog
  2018-04-16  2:40 ` [PATCH 2/2] arm64: dts: Add the rtc enable clock for watchdog Baolin Wang
@ 2018-05-25 22:29   ` Olof Johansson
  0 siblings, 0 replies; 4+ messages in thread
From: Olof Johansson @ 2018-05-25 22:29 UTC (permalink / raw)
  To: Baolin Wang
  Cc: robh+dt, mark.rutland, catalin.marinas, will.deacon, arnd,
	orsonzhai, zhang.lyra, devicetree, arm, linux-arm-kernel,
	linux-kernel, broonie

On Mon, Apr 16, 2018 at 10:40:04AM +0800, Baolin Wang wrote:
> Add the rtc enable clock for watchdog controller to make it work well.
> 
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>

APplied with "sprd: whale2:" added to the patch subject.


-Olof

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

end of thread, other threads:[~2018-05-25 22:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16  2:40 [PATCH 1/2] arm64: dts: Add GPIO and GPIO keys device nodes Baolin Wang
2018-04-16  2:40 ` [PATCH 2/2] arm64: dts: Add the rtc enable clock for watchdog Baolin Wang
2018-05-25 22:29   ` Olof Johansson
2018-05-25 22:29 ` [PATCH 1/2] arm64: dts: Add GPIO and GPIO keys device nodes Olof Johansson

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