Skip to contentSkip to conversation

ARM: dts: samsung: exynos4412-midas: fix key-ok and use Linux event codes

PATCH Applied Raymond Hackley 2 participants 7 messages Oct 17, 2023 – Oct 24, 2023

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

v2 cover ARM: dts: samsung: exynos4412-midas: fix key-ok and use Linux event codes

Input event code 139 stands for KEY_MENU, instead of KEY_OK as node name key-ok inplies. Fix it with correct event code 0x160.

Use event codes with linux-event-codes.h included for input keys on midas in addition.

---
v2: Fix the event code before applying linux-event-codes.h

#1 lore raw

PATCH v2 1/2 ARM: dts: samsung: exynos4412-midas: fix key-ok event code

Input event code 139 stands for KEY_MENU, instead of KEY_OK as node name key-ok inplies. Fix it with correct event code 0x160.

---
 arch/arm/boot/dts/samsung/exynos4412-midas.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/samsung/exynos4412-midas.dtsi +1 -1
index 7daf25865551..3c1ae3c19828 100644
@@ -159,7 +159,7 @@ key-power {
 
 		key-ok {
 			gpios = <&gpx0 1 GPIO_ACTIVE_LOW>;
-			linux,code = <139>;
+			linux,code = <0x160>;
 			label = "ok";
 			debounce-interval = <10>;
 			wakeup-source;
Signature · 1 line
2.39.2
#2 lore raw

Re: [PATCH v2 1/2] ARM: dts: samsung: exynos4412-midas: fix key-ok event code

Quoted 13 lines · Raymond Hackley

Input event code 139 stands for KEY_MENU, instead of KEY_OK as node name key-ok inplies. Fix it with correct event code 0x160.

---
 arch/arm/boot/dts/samsung/exynos4412-midas.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/samsung/exynos4412-midas.dtsi +0 -0
index 7daf25865551..3c1ae3c19828 100644

arch/arm/boot/dts/samsung/exynos4412-midas.dtsi key-power { · line 162

Quoted 5 lines
arch/arm/boot/dts/samsung/exynos4412-midas.dtsi +1 -1
@@ -159,7 +159,7 @@ key-power {
 
 		key-ok {
 			gpios = <&gpx0 1 GPIO_ACTIVE_LOW>;
-			linux,code = <139>;
+			linux,code = <0x160>;

I applied this and was about to send in pull request, but it does not seem right, sorry. The button was always called "menu" button. Why changing it to OK? Just because of node name? The node name does not matter, this could be called "key-1" as well..

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH v2 1/2] ARM: dts: samsung: exynos4412-midas: fix key-ok event code

Hi Krzysztof,

This key-ok is the hardware middle button on midas, and there is also touchkey, which already provides <KEY_BACK KEY_MENU>, so I assume the other KEY_MENU in key-ok is duplicated. Fixing it with KEY_OK as the node name implies would make more sense.

Regards,
Raymond

#4 lore raw

Re: [PATCH v2 1/2] ARM: dts: samsung: exynos4412-midas: fix key-ok event code

Quoted 6 lines · Raymond Hackley

Hi Krzysztof,

This key-ok is the hardware middle button on midas, and there is also touchkey, which already provides <KEY_BACK KEY_MENU>, so I assume the other KEY_MENU in key-ok is duplicated. Fixing it with KEY_OK as the node name implies would make more sense.

Ah, ok, that makes sense.

Best regards,
Krzysztof

#5 lore raw

PATCH v2 2/2 ARM: dts: samsung: exynos4412-midas: use Linux event codes for input keys

In reply to Raymond Hackley

Use event codes with linux-event-codes.h included for input keys on midas.

---
 arch/arm/boot/dts/samsung/exynos4412-midas.dtsi | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
arch/arm/boot/dts/samsung/exynos4412-midas.dtsi +5 -4
index 3c1ae3c19828..d00b500254ab 100644
@@ -15,6 +15,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/clock/maxim,max77686.h>
 #include "exynos-pinctrl.h"
@@ -137,21 +138,21 @@ gpio-keys {
 
 		key-down {
 			gpios = <&gpx3 3 GPIO_ACTIVE_LOW>;
-			linux,code = <114>;
+			linux,code = <KEY_VOLUMEDOWN>;
 			label = "volume down";
 			debounce-interval = <10>;
 		};
 
 		key-up {
 			gpios = <&gpx2 2 GPIO_ACTIVE_LOW>;
-			linux,code = <115>;
+			linux,code = <KEY_VOLUMEUP>;
 			label = "volume up";
 			debounce-interval = <10>;
 		};
 
 		key-power {
 			gpios = <&gpx2 7 GPIO_ACTIVE_LOW>;
-			linux,code = <116>;
+			linux,code = <KEY_POWER>;
 			label = "power";
 			debounce-interval = <10>;
 			wakeup-source;
@@ -159,7 +160,7 @@ key-power {
 
 		key-ok {
 			gpios = <&gpx0 1 GPIO_ACTIVE_LOW>;
-			linux,code = <0x160>;
+			linux,code = <KEY_OK>;
 			label = "ok";
 			debounce-interval = <10>;
 			wakeup-source;
Signature · 1 line
2.39.2
#6 lore raw
In reply to Raymond Hackley
Quoted 6 lines · Raymond Hackley

Input event code 139 stands for KEY_MENU, instead of KEY_OK as node name key-ok inplies. Fix it with correct event code 0x160.

Use event codes with linux-event-codes.h included for input keys on midas in addition.

Applied, thanks!

It is however very late in the cycle, so there is a chance this will miss the merge window. If this happens, I will keep it for the next cycle (no need for resending).

[1/2] ARM: dts: samsung: exynos4412-midas: fix key-ok event code

      https://git.kernel.org/krzk/linux/c/25e20eedc1d63dcdf6f781588e8dbc37cd0aad16
[2/2] ARM: dts: samsung: exynos4412-midas: use Linux event codes for input keys
      https://git.kernel.org/krzk/linux/c/4a48fa417abc5b86da393c93ab63a9160076a248

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>