OSDN Git Service

platform/x86: asus-wmi: Ignore WMI events with code 0x79
authorHans de Goede <hdegoede@redhat.com>
Sun, 10 May 2020 12:24:32 +0000 (14:24 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 12 May 2020 14:27:12 +0000 (17:27 +0300)
commit10d7ff74b6f2d5e5b38d752a683225c944dd3da9
tree490e9c1b44ab18def9171bbc97bdeb935e4f4eb0
parentb0dbd97de1f1fd6b3c9a7bb8f7c795bba7e169d8
platform/x86: asus-wmi: Ignore WMI events with code 0x79

On some Asus devices, e.g. the T100TA, when the charger is connected
we not only get a WMI event with code 0x58, but immediately after that
event we also get an even with code 0x79.

This is likely related to these devices having an Asus WMI device with a
device-id of 0x00120066, which seems to provide some sort of charger-type
info. The T100TA charger over a micro-USB connector, the embedded-
controller register read when calling asus_wmi_get_devstate(0x00120066)
returns different values when connected to a USB port (max 500mA charging)
vs when connected to a 2A capable wall-charger. But the AML code reading
this mangles the return value so that we can no longer tell the difference.
So for now the meaning of the value return when getting the status of
device-id 0x00120066 is unclear.

This commit adds a key-mapping of code 0x79 to KE_IGNORE, silencing the
kernel logging the following message every time the charger is plugged-in:

[   79.639548] asus_wmi: Unknown key 79 pressed

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/asus-nb-wmi.c