Skip to contentSkip to conversation

Input: SoC button array: add mapping for airplane mode button

PATCH Applied Werner Sembach 2 participants 4 messages Dec 15, 2023 – Dec 24, 2023

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

PATCH 1/1 Input: SoC button array: add mapping for airplane mode button

From: Christoffer Sandberg <[email protected]>

This add a mapping for the airplane mode button on the TUXEDO Pulse Gen3.

While it is physically a key it behaves more like a switch, sending a key down on first press and a key up on 2nd press. Therefor the switch event is used here. Besides this behaviour it uses the HID usage-id 0xc6 (Wireless Radio Button) and not 0xc8 (Wireless Radio Slider Switch), but since neither 0xc6 nor 0xc8 are currently implemented at all in soc_button_array this not to standard behaviour is not put behind a quirk for the moment.

---
 drivers/input/misc/soc_button_array.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/input/misc/soc_button_array.c +5 -0
index 08bcee3d6bcca..f6d060377d189 100644
@@ -299,6 +299,11 @@ static int soc_button_parse_btn_desc(struct device *dev,
 		info->name = "power";
 		info->event_code = KEY_POWER;
 		info->wakeup = true;
+	} else if (upage == 0x01 && usage == 0xc6) {
+		info->name = "airplane mode switch";
+		info->event_type = EV_SW;
+		info->event_code = SW_RFKILL_ALL;
+		info->active_low = false;
 	} else if (upage == 0x01 && usage == 0xca) {
 		info->name = "rotation lock switch";
 		info->event_type = EV_SW;
Signature · 1 line
2.34.1
#1 lore raw

Am 15.12.23 um 18:17 schrieb Werner Sembach:

Quoted 11 lines

From: Christoffer Sandberg <[email protected]>

This add a mapping for the airplane mode button on the TUXEDO Pulse Gen3.

While it is physically a key it behaves more like a switch, sending a key down on first press and a key up on 2nd press. Therefor the switch event is used here. Besides this behaviour it uses the HID usage-id 0xc6 (Wireless Radio Button) and not 0xc8 (Wireless Radio Slider Switch), but since neither 0xc6 nor 0xc8 are currently implemented at all in soc_button_array this not to standard behaviour is not put behind a quirk for the moment.

Quoted 2 lines
Quoted 20 lines
---
  drivers/input/misc/soc_button_array.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/input/misc/soc_button_array.c +5 -0
index 08bcee3d6bcca..f6d060377d189 100644
@@ -299,6 +299,11 @@ static int soc_button_parse_btn_desc(struct device *dev,
  		info->name = "power";
  		info->event_code = KEY_POWER;
  		info->wakeup = true;
+	} else if (upage == 0x01 && usage == 0xc6) {
+		info->name = "airplane mode switch";
+		info->event_type = EV_SW;
+		info->event_code = SW_RFKILL_ALL;
+		info->active_low = false;
  	} else if (upage == 0x01 && usage == 0xca) {
  		info->name = "rotation lock switch";
  		info->event_type = EV_SW;
#2 lore raw
In reply to Werner Sembach

Am 15.12.23 um 18:17 schrieb Werner Sembach:

Quoted 11 lines

From: Christoffer Sandberg <[email protected]>

This add a mapping for the airplane mode button on the TUXEDO Pulse Gen3.

While it is physically a key it behaves more like a switch, sending a key down on first press and a key up on 2nd press. Therefor the switch event is used here. Besides this behaviour it uses the HID usage-id 0xc6 (Wireless Radio Button) and not 0xc8 (Wireless Radio Slider Switch), but since neither 0xc6 nor 0xc8 are currently implemented at all in soc_button_array this not to standard behaviour is not put behind a quirk for the moment.

Quoted 2 lines

For reference: https://bugzilla.kernel.org/show_bug.cgi?id=214259

Quoted 20 lines
---
  drivers/input/misc/soc_button_array.c | 5 +++++
  1 file changed, 5 insertions(+)
drivers/input/misc/soc_button_array.c +5 -0
index 08bcee3d6bcca..f6d060377d189 100644
@@ -299,6 +299,11 @@ static int soc_button_parse_btn_desc(struct device *dev,
  		info->name = "power";
  		info->event_code = KEY_POWER;
  		info->wakeup = true;
+	} else if (upage == 0x01 && usage == 0xc6) {
+		info->name = "airplane mode switch";
+		info->event_type = EV_SW;
+		info->event_code = SW_RFKILL_ALL;
+		info->active_low = false;
  	} else if (upage == 0x01 && usage == 0xca) {
  		info->name = "rotation lock switch";
  		info->event_type = EV_SW;
maintainer Applied
#3 lore raw
In reply to Werner Sembach
Quoted 11 lines · Werner Sembach

From: Christoffer Sandberg <[email protected]>

This add a mapping for the airplane mode button on the TUXEDO Pulse Gen3.

While it is physically a key it behaves more like a switch, sending a key down on first press and a key up on 2nd press. Therefor the switch event is used here. Besides this behaviour it uses the HID usage-id 0xc6 (Wireless Radio Button) and not 0xc8 (Wireless Radio Slider Switch), but since neither 0xc6 nor 0xc8 are currently implemented at all in soc_button_array this not to standard behaviour is not put behind a quirk for the moment.

Quoted 2 lines

Applied, thank you.

Signature · 1 line
Dmitry