diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index bcfaf32..c54cb28 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -502,7 +502,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel field->hidinput = hidinput; - if (field->flags & HID_MAIN_ITEM_CONSTANT) + if ((field->flags & HID_MAIN_ITEM_CONSTANT) && + (usage->hid & HID_USAGE_PAGE) != HID_UP_ASUSVENDOR) goto ignore; /* Ignore if report count is out of bounds. */ @@ -980,6 +981,17 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel } break; + case HID_UP_ASUSVENDOR: + switch (usage->hid & HID_USAGE) { + case 0x06C: map_key_clear(KEY_SLEEP); break; /* Fn+F1: Sleep */ + case 0x088: map_key_clear(KEY_WLAN); break; /* Fn+F2: Wifi & BT */ + case 0x010: map_key_clear(KEY_BRIGHTNESSDOWN); break; /* Fn+F5: Brightness down */ + case 0x020: map_key_clear(KEY_BRIGHTNESSUP); break; /* Fn+F6: Brightness up */ + case 0x06B: map_key_clear(KEY_F24); break; /* Fn+F9: Touchpad */ + default: goto ignore; + } + break; + default: unknown: if (field->report_size == 1) { diff --git a/include/linux/hid.h b/include/linux/hid.h index 75b66ec..16a64fd 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -172,6 +172,7 @@ struct hid_item { #define HID_UP_LOGIVENDOR3 0xff430000 #define HID_UP_LNVENDOR 0xffa00000 #define HID_UP_SENSOR 0x00200000 +#define HID_UP_ASUSVENDOR 0xff310000 #define HID_USAGE 0x0000ffff