]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/hid/hid-multitouch.c
Merge branches 'for-4.10/asus', 'for-4.10/cp2112', 'for-4.10/i2c-hid-nopower', 'for...
[mirror_ubuntu-bionic-kernel.git] / drivers / hid / hid-multitouch.c
index 89e9032ab1e7446c37b5d4d19c6dfc3ec6498bfd..6dca668068440213d837f69c7763bddbe91e561b 100644 (file)
@@ -565,6 +565,14 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 
        case HID_UP_BUTTON:
                code = BTN_MOUSE + ((usage->hid - 1) & HID_USAGE);
+               /*
+                * MS PTP spec says that external buttons left and right have
+                * usages 2 and 3.
+                */
+               if (cls->name == MT_CLS_WIN_8 &&
+                   field->application == HID_DG_TOUCHPAD &&
+                   (usage->hid & HID_USAGE) > 1)
+                       code--;
                hid_map_usage(hi, usage, bit, max, EV_KEY, code);
                input_set_capability(hi->input, EV_KEY, code);
                return 1;