HID: multitouch: do not blindly set EV_KEY or EV_ABS bits
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 11 Jul 2017 17:02:18 +0000 (10:02 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 13 Jul 2017 14:48:29 +0000 (16:48 +0200)
Now that input core insists on having dev->absinfo when device claims to
generate EV_ABS in its dev->evbit, we should not be blindly setting that
bit.

The code in question might have been needed before input_set_abs_params()
started setting EV_ABS in device's evbit, but not anymore, and is now
breaking devices such as SMART SPNL-6075 Touchscreen.

Fixes: 6ecfe51b4082 ("Input: refuse to register absolute devices ...")
Reported-by: Matthias Fend <Matthias.Fend@wolfvision.net>
Tested-by: Matthias Fend <Matthias.Fend@wolfvision.net>
Cc: stable@vger.kernel.org
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-multitouch.c

index f3e35e7a189d30aba1b6619ddba328cbec75a836..aff20f4b6d97ead09453b303eaf4ac3ac94e1628 100644 (file)
@@ -620,16 +620,6 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
        return 0;
 }
 
-static int mt_touch_input_mapped(struct hid_device *hdev, struct hid_input *hi,
-               struct hid_field *field, struct hid_usage *usage,
-               unsigned long **bit, int *max)
-{
-       if (usage->type == EV_KEY || usage->type == EV_ABS)
-               set_bit(usage->type, hi->input->evbit);
-
-       return -1;
-}
-
 static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
 {
        __s32 quirks = td->mtclass.quirks;
@@ -969,8 +959,10 @@ static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi,
                return 0;
 
        if (field->application == HID_DG_TOUCHSCREEN ||
-           field->application == HID_DG_TOUCHPAD)
-               return mt_touch_input_mapped(hdev, hi, field, usage, bit, max);
+           field->application == HID_DG_TOUCHPAD) {
+               /* We own these mappings, tell hid-input to ignore them */
+               return -1;
+       }
 
        /* let hid-core decide for the others */
        return 0;