Am 18.01.2020 um 03:40 schrieb aTc atc@k-n-p.org:
On 1/17/20 7:27 PM, H. Nikolaus Schaller wrote:
Input device name: "pyra-lid-wakeup" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 240 (KEY_UNKNOWN) Event type 5 (EV_SW) Event code 0 (SW_LID) state 1
Wouldn't KEY_WAKEUP make more sense here instead of KEY_UNKNOWN ? Or is that reserved for some specific feature.
Hm. Good question.
I do not remember why code 240 was chosen many years ago, but I could trace it back to pre-device-tree ages:
commit fa858e5cab7e65235af4526d031f1a6e7f5adf7a Author: NeilBrown neilb@suse.de Date: Mon Jul 23 11:04:51 2012 +1000
Configure 3G interrupt as a key-press
This ensures correct wakeup handling and make it easy to integrate with existing code.
Signed-off-by: NeilBrown neilb@suse.de
[...]
diff --git a/arch/arm/mach-omap2/board-omap3gta04.c b/arch/arm/mach-omap2/board-omap3gta04.c index 9f862341e189..320f7d3bb2d9 100644 --- a/arch/arm/mach-omap2/board-omap3gta04.c +++ b/arch/arm/mach-omap2/board-omap3gta04.c @@ -1094,19 +1094,38 @@ static struct gpio_keys_button gpio_buttons[] = { .wakeup = 1, }, }; +static struct gpio_keys_button gpio_3G_buttons[] = { + { + .code = KEY_UNKNOWN, + .gpio = -1/*WO3G_GPIO*/, + .desc = "Option", + .wakeup = 1, + }, +};
[...]
I also found a temporary switch to KEY_WAKEUP in 2013 but it was restored after 14 days. Maybe it triggered some user-space incompatibility. So there was some reason to use KEY_UNKNOWN. Using KEY_WWAN could also be a choice, but may also interfere with something else. I think it is reserved for a physical button to turn on/off WWAN through rfkill.
There is also an announcement by Neil Brown (back then he was Linux maintainer for the RAID subsystem):
http://lists.goldelico.com/pipermail/gta04-owner/2012-July/002660.html
IMHO the right solution is to check why it triggers without modem activity in the wrong moment. And make it ignored by the xmodmap or keymap or the application that gets into trouble.
Generally changing to a different event code than GTA04 would make the Pyra more incompatible with GTA04 and existing phone software and introduce problems with applications making assumptions about the different event code.