]> Git Repo - linux.git/commitdiff
HID: input: support Microsoft wireless radio control hotkey
authorChris Chiu <[email protected]>
Mon, 3 Dec 2018 06:46:21 +0000 (14:46 +0800)
committerBenjamin Tissoires <[email protected]>
Wed, 5 Dec 2018 14:46:27 +0000 (15:46 +0100)
The ASUS laptops start to support the airplane mode radio management
to replace the original mechanism of airplane mode toggle hotkey.
On the ASUS P5440FF, it presents as a HID device connecting via
I2C, named i2c-AMPD0001. When pressing it, the Embedded Controller
send hid report via I2C and switch the airplane mode indicator LED
based on the status.

However, it's not working because it fails to be identified as a
hidinput device. It fails in hidinput_connect() due to the macro
IS_INPUT_APPLICATION doesn't have HID_GD_WIRELESS_RADIO_CTLS as
a legit application code.

It's easy to add the HID I2C vendor and product id to the quirk
list and apply HID_QUIRK_HIDINPUT_FORCE to make it work. But it
makes more sense to support it as a generic input application.

Signed-off-by: Chris Chiu <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>
include/linux/hid.h

index ce5f996c8d3d13a53c7c9ceaee5e9eb5ee17d879..42079116fb6156d109c141d8b0c80a933ab900e8 100644 (file)
@@ -840,7 +840,8 @@ static inline bool hid_is_using_ll_driver(struct hid_device *hdev,
 #define IS_INPUT_APPLICATION(a) \
                (((a >= HID_UP_GENDESK) && (a <= HID_GD_MULTIAXIS)) \
                || ((a >= HID_DG_PEN) && (a <= HID_DG_WHITEBOARD)) \
-               || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL))
+               || (a == HID_GD_SYSTEM_CONTROL) || (a == HID_CP_CONSUMER_CONTROL) \
+               || (a == HID_GD_WIRELESS_RADIO_CTLS))
 
 /* HID core API */
 
This page took 0.063639 seconds and 4 git commands to generate.