OSDN Git Service

platform/x86: asus-nb-wmi: Map 0x35 to KEY_SCREENLOCK
authorJoão Paulo Rechi Vita <jprvita@gmail.com>
Thu, 1 Nov 2018 00:21:27 +0000 (17:21 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Feb 2019 16:33:28 +0000 (17:33 +0100)
[ Upstream commit b3f2f3799a972d3863d0fdc2ab6287aef6ca631f ]

When the OS registers to handle events from the display off hotkey the
EC will send a notification with 0x35 for every key press, independent
of the backlight state.

The behavior of this key on Windows, with the ATKACPI driver from Asus
installed, is turning off the backlight of all connected displays with a
fading effect, and any cursor input or key press turning the backlight
back on. The key press or cursor input that wakes up the display is also
passed through to the application under the cursor or under focus.

The key that matches this behavior the closest is KEY_SCREENLOCK.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/asus-nb-wmi.c

index c857d2d..d113103 100644 (file)
@@ -479,6 +479,7 @@ static const struct key_entry asus_nb_wmi_keymap[] = {
        { KE_KEY, 0x32, { KEY_MUTE } },
        { KE_KEY, 0x33, { KEY_DISPLAYTOGGLE } }, /* LCD on */
        { KE_KEY, 0x34, { KEY_DISPLAY_OFF } }, /* LCD off */
+       { KE_KEY, 0x35, { KEY_SCREENLOCK } },
        { KE_KEY, 0x40, { KEY_PREVIOUSSONG } },
        { KE_KEY, 0x41, { KEY_NEXTSONG } },
        { KE_KEY, 0x43, { KEY_STOPCD } }, /* Stop/Eject */