Skip to contentSkip to conversation

powerpc: wii.dts: GPIO interrupt and button support

PATCH Applied Jonathan Neuschäfer 2 participants 5 messages Jan 12, 2019 – Jan 24, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover powerpc: wii.dts: GPIO interrupt and button support

This patchset adds the necessary bits to wii.dts to enable interrupt support in the GPIO controller, and defines two GPIO-based buttons, the POWER button and the EJECT button.

I will send another patchset which will implement interrupt support in the GPIO driver (gpio-hlwd.c).

Jonathan Neuschäfer (2):
powerpc: wii.dts: Add interrupt-related properties to GPIO node
powerpc: wii.dts: Add GPIO keys

 arch/powerpc/boot/dts/wii.dts | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 powerpc: wii.dts: Add interrupt-related properties to GPIO node

The Hollywood GPIO controller is connected to the Hollywood PIC (&PIC1) at IRQs 10 and 11; IRQ 10 for GPIO lines that are configured for access by the PPC, 11 for GPIO lines that are configured for access by the ARM926.

---
 arch/powerpc/boot/dts/wii.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/powerpc/boot/dts/wii.dts +5 -0
index 40fe791ec9e6..864e5a17aa1d 100644
@@ -187,6 +187,11 @@
 				"DEBUG0", "DEBUG1", "DEBUG2", "DEBUG3",
 				"DEBUG4", "DEBUG5", "DEBUG6", "DEBUG7";
 
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			interrupts = <10>;
+			interrupt-parent = <&PIC1>;
+
 			/*
 			 * This is commented out while a standard binding
 			 * for i2c over gpio is defined.
Signature · 1 line
2.20.1
#2 lore raw

Re: [1/2] powerpc: wii.dts: Add interrupt-related properties to GPIO node

Quoted 6 lines · On Sat, 2019-01-12 at 16:21:23 UTC, =?utf-8?q?Jonathan_Neusch=C3=A4fer?= wrote:

The Hollywood GPIO controller is connected to the Hollywood PIC (&PIC1) at IRQs 10 and 11; IRQ 10 for GPIO lines that are configured for access by the PPC, 11 for GPIO lines that are configured for access by the ARM926.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/8de7547e03059281fda075355c114694

cheers

#3 lore raw

Re: [1/2] powerpc: wii.dts: Add interrupt-related properties to GPIO node

In reply to Jonathan Neuschäfer
Quoted 6 lines · On Sat, 2019-01-12 at 16:21:23 UTC, =?utf-8?q?Jonathan_Neusch=C3=A4fer?= wrote:

The Hollywood GPIO controller is connected to the Hollywood PIC (&PIC1) at IRQs 10 and 11; IRQ 10 for GPIO lines that are configured for access by the PPC, 11 for GPIO lines that are configured for access by the ARM926.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f4ddc19a711736eb54fb8259499faf5a

cheers

#4 lore raw

PATCH 2/2 powerpc: wii.dts: Add GPIO keys

In reply to Jonathan Neuschäfer

The Wii has POWER and EJECT buttons, which are connected through normalization logic to the GPIO controller (the length of an assertion of these signals is always the same, regardless of how long the user pressed the buttons).

---
 arch/powerpc/boot/dts/wii.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/powerpc/boot/dts/wii.dts +17 -0
index 864e5a17aa1d..64f886a6327f 100644
@@ -14,6 +14,7 @@
 
 /dts-v1/;
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 
 /*
  * This is commented-out for now.
@@ -249,5 +250,21 @@
 			gpios = <&GPIO 8 GPIO_ACTIVE_HIGH>;
 		};
 	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		power {
+			label = "Power Button";
+			gpios = <&GPIO 0 GPIO_ACTIVE_HIGH>;
+			linux,code = <KEY_POWER>;
+		};
+
+		eject {
+			label = "Eject Button";
+			gpios = <&GPIO 6 GPIO_ACTIVE_HIGH>;
+			linux,code = <KEY_EJECTCD>;
+		};
+	};
 };
 
Signature · 1 line
2.20.1