diff options
author | Benjamin Tissoires <benjamin.tissoires@enac.fr> | 2012-03-06 17:57:04 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-03-12 11:27:07 +0100 |
commit | 8d179a9ef25a64b451e2bbd46f6a6c16c6a72eb1 (patch) | |
tree | 0085e1c271a4795447120dbc488b524aa93d229e /drivers/hid/hid-multitouch.c | |
parent | ed9d5c96147b3bed6178252e8e04b27b7d32edd0 (diff) | |
download | lwn-8d179a9ef25a64b451e2bbd46f6a6c16c6a72eb1.tar.gz lwn-8d179a9ef25a64b451e2bbd46f6a6c16c6a72eb1.zip |
HID: handle all multitouch devices through hid-multitouch
When the quirk HID_QUIRK_MULTITOUCH is present and when hid-multitouch
is loaded, let's pass the device to hid-multitouch even if it has
not been registered in hid-multitouch.
If any other driver wants to take precedence over hid-multitouch,
the usual way of adding it to hid_have_special_driver will work as
the quirk HID_QUIRK_MULTITOUCH won't be set by the generic hid layer.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-multitouch.c')
-rw-r--r-- | drivers/hid/hid-multitouch.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 2088ab4e5db5..a61ba42e1bff 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -637,10 +637,12 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) struct mt_device *td; struct mt_class *mtclass = mt_classes; /* MT_CLS_DEFAULT */ - for (i = 0; mt_classes[i].name ; i++) { - if (id->driver_data == mt_classes[i].name) { - mtclass = &(mt_classes[i]); - break; + if (id) { + for (i = 0; mt_classes[i].name ; i++) { + if (id->driver_data == mt_classes[i].name) { + mtclass = &(mt_classes[i]); + break; + } } } @@ -648,6 +650,7 @@ static int mt_probe(struct hid_device *hdev, const struct hid_device_id *id) * that emit events over several HID messages. */ hdev->quirks |= HID_QUIRK_NO_INPUT_SYNC; + hdev->quirks &= ~HID_QUIRK_MULTITOUCH; td = kzalloc(sizeof(struct mt_device), GFP_KERNEL); if (!td) { |