linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] arm64: dts: meson-sm1-sei610: gpio-keys: switch to IRQs
@ 2019-11-21 18:37 Kevin Hilman
  2019-11-21 19:37 ` Martin Blumenstingl
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Hilman @ 2019-11-21 18:37 UTC (permalink / raw)
  To: linux-amlogic; +Cc: linux-arm-kernel, Jérôme Brunet

From: Kevin Hilman <khilman@baylibre.com>

Switch the GPIO buttons/switches to use interrupts instead of polling.
While at it, add the mic mute switch and the power button.

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
 .../boot/dts/amlogic/meson-sm1-sei610.dts     | 26 +++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
index 5bd07469766b..2c90f4713d0e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts
@@ -46,25 +46,47 @@
 	};
 
 	gpio-keys {
-		compatible = "gpio-keys-polled";
-		poll-interval = <100>;
+		compatible = "gpio-keys";
 
 		key1 {
 			label = "A";
 			linux,code = <BTN_0>;
 			gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>;
+			interrupt-parent = <&gpio_intc>;
+			interrupts = <34 IRQ_TYPE_EDGE_BOTH>;
 		};
 
 		key2 {
 			label = "B";
 			linux,code = <BTN_1>;
 			gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
+			interrupt-parent = <&gpio_intc>;
+			interrupts = <35 IRQ_TYPE_EDGE_BOTH>;
 		};
 
 		key3 {
 			label = "C";
 			linux,code = <BTN_2>;
 			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
+			interrupt-parent = <&gpio_intc>;
+			interrupts = <2 IRQ_TYPE_EDGE_BOTH>;
+		};
+
+		mic_mute {
+			label = "MicMute";
+			linux,code = <SW_MUTE_DEVICE>;
+			linux,input-type = <EV_SW>;
+			gpios = <&gpio_ao GPIOE_2 GPIO_ACTIVE_LOW>;
+			interrupt-parent = <&gpio_intc>;
+			interrupts = <99 IRQ_TYPE_EDGE_BOTH>;
+		};
+
+		power_key {
+			label = "PowerKey";
+			linux,code = <KEY_POWER>;
+			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
+			interrupt-parent = <&gpio_intc>;
+			interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
 		};
 	};
 
-- 
2.22.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 1/1] arm64: dts: meson-sm1-sei610: gpio-keys: switch to IRQs
  2019-11-21 18:37 [PATCH 1/1] arm64: dts: meson-sm1-sei610: gpio-keys: switch to IRQs Kevin Hilman
@ 2019-11-21 19:37 ` Martin Blumenstingl
  2019-11-21 23:28   ` Kevin Hilman
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Blumenstingl @ 2019-11-21 19:37 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-amlogic, linux-arm-kernel, Jérôme Brunet

On Thu, Nov 21, 2019 at 7:37 PM Kevin Hilman <khilman@kernel.org> wrote:
>
> From: Kevin Hilman <khilman@baylibre.com>
>
> Switch the GPIO buttons/switches to use interrupts instead of polling.
> While at it, add the mic mute switch and the power button.
>
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
(I don't have the schematics of the board so I have to assume that the
GPIOs are the right ones - based on that)
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* Re: [PATCH 1/1] arm64: dts: meson-sm1-sei610: gpio-keys: switch to IRQs
  2019-11-21 19:37 ` Martin Blumenstingl
@ 2019-11-21 23:28   ` Kevin Hilman
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Hilman @ 2019-11-21 23:28 UTC (permalink / raw)
  To: Martin Blumenstingl, Kevin Hilman
  Cc: linux-amlogic, linux-arm-kernel, Jérôme Brunet

Hi Martin,

Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:

> On Thu, Nov 21, 2019 at 7:37 PM Kevin Hilman <khilman@kernel.org> wrote:
>>
>> From: Kevin Hilman <khilman@baylibre.com>
>>
>> Switch the GPIO buttons/switches to use interrupts instead of polling.
>> While at it, add the mic mute switch and the power button.
>>
>> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
>
> (I don't have the schematics of the board so I have to assume that the
> GPIOs are the right ones - based on that)

I have the schematics, and I also forgot to mention that I tested this
on the SEI610 board, and can watch the interrupt counts in
/proc/interrupts increase for each of the buttons/switches.

> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

Thanks for the review,

Kevin

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2019-11-21 23:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-21 18:37 [PATCH 1/1] arm64: dts: meson-sm1-sei610: gpio-keys: switch to IRQs Kevin Hilman
2019-11-21 19:37 ` Martin Blumenstingl
2019-11-21 23:28   ` Kevin Hilman

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