]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/hid/hid-input.c
Merge branches 'for-4.8/upstream-fixes', 'for-4.9/alps', 'for-4.9/hid-input', 'for...
[mirror_ubuntu-bionic-kernel.git] / drivers / hid / hid-input.c
index bcfaf32d9e5ebd4284d0608db962aa2c6d789cbd..fb9ace1cef8b50cbcb52955eb41f4490cb7aff7f 100644 (file)
@@ -604,6 +604,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
                        break;
                }
 
+               /*
+                * Some lazy vendors declare 255 usages for System Control,
+                * leading to the creation of ABS_X|Y axis and too many others.
+                * It wouldn't be a problem if joydev doesn't consider the
+                * device as a joystick then.
+                */
+               if (field->application == HID_GD_SYSTEM_CONTROL)
+                       goto ignore;
+
                if ((usage->hid & 0xf0) == 0x90) {      /* D-pad */
                        switch (usage->hid) {
                        case HID_GD_UP:    usage->hat_dir = 1; break;
@@ -953,6 +962,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
        case HID_UP_HPVENDOR2:
                set_bit(EV_REP, input->evbit);
                switch (usage->hid & HID_USAGE) {
+               case 0x001: map_key_clear(KEY_MICMUTE);         break;
                case 0x003: map_key_clear(KEY_BRIGHTNESSDOWN);  break;
                case 0x004: map_key_clear(KEY_BRIGHTNESSUP);    break;
                default:    goto ignore;