]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Input: soc_button_array - fix mapping of the 5th GPIO in a PNP0C40 device
authorHans de Goede <hdegoede@redhat.com>
Fri, 4 Jan 2019 02:10:45 +0000 (18:10 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 4 Jan 2019 19:16:24 +0000 (11:16 -0800)
commite9eb788f9442d1b5d93efdb30c3be071ce8a22b1
tree12c814f4cb1c6be442c18e5c8b1cd327c68de7af
parent39be9b6d0455ed6dc6e9ac7252f56a498db5314e
Input: soc_button_array - fix mapping of the 5th GPIO in a PNP0C40 device

The Microsoft documenation for the PNP0C40 device aka the
"Windows-compatible button array" describes the 5th GpioInt listed in
the resources as: '5. Interrupt corresponding to the "Rotation Lock"
button, if supported'.

Notice this describes the 5th entry as a button while we sofar have been
mapping it to EV_SW, SW_ROTATE_LOCK. On my Point of View TAB P1006W-232
which actually comes with a rotation-lock button, the button indeed is a
button and not a slider/switch. An image search for other Windows tablets
has found 2 more models with a rotation-lock button and on both of those
it too is a push-button and not a slider/switch.

Further evidence can be found in the HUT extension HUTRR52 from Microsoft
which adds rotation lock support to the HUT, which describes 2 different
usages: "0xC9 System Display Rotation Lock Button" and
"0xCA System Display Rotation Lock Slider Switch" note that switch is seen
as a separate thing here and the non switch wording is an exact match for
the "Windows-compatible button array" spec wording.

TL;DR: our current mapping of the 5th GPIO to SW_ROTATE_LOCK is wrong
because the 5th GPIO is for a push-button not a switch.

This commit fixes this by maping the 5th GPIO to KEY_ROTATE_LOCK_TOGGLE.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/soc_button_array.c