Skip to content

Commit 4cf56a8

Browse files
dtorJiri Kosina
authored andcommitted
HID: multitouch: do not blindly set EV_KEY or EV_ABS bits
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: 6ecfe51 ("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>
1 parent a91ab91 commit 4cf56a8

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

drivers/hid/hid-multitouch.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -620,16 +620,6 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
620620
return 0;
621621
}
622622

623-
static int mt_touch_input_mapped(struct hid_device *hdev, struct hid_input *hi,
624-
struct hid_field *field, struct hid_usage *usage,
625-
unsigned long **bit, int *max)
626-
{
627-
if (usage->type == EV_KEY || usage->type == EV_ABS)
628-
set_bit(usage->type, hi->input->evbit);
629-
630-
return -1;
631-
}
632-
633623
static int mt_compute_slot(struct mt_device *td, struct input_dev *input)
634624
{
635625
__s32 quirks = td->mtclass.quirks;
@@ -969,8 +959,10 @@ static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi,
969959
return 0;
970960

971961
if (field->application == HID_DG_TOUCHSCREEN ||
972-
field->application == HID_DG_TOUCHPAD)
973-
return mt_touch_input_mapped(hdev, hi, field, usage, bit, max);
962+
field->application == HID_DG_TOUCHPAD) {
963+
/* We own these mappings, tell hid-input to ignore them */
964+
return -1;
965+
}
974966

975967
/* let hid-core decide for the others */
976968
return 0;

0 commit comments

Comments
 (0)