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-core.c | |
parent | ed9d5c96147b3bed6178252e8e04b27b7d32edd0 (diff) |
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-core.c')
-rw-r--r-- | drivers/hid/hid-core.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 4f4143cc789b..05a0c9a35bf2 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1232,7 +1232,6 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) hdev->claimed |= HID_CLAIMED_INPUT; if (hdev->quirks & HID_QUIRK_MULTITOUCH) { /* this device should be handled by hid-multitouch, skip it */ - hdev->quirks &= ~HID_QUIRK_MULTITOUCH; return -ENODEV; } @@ -1667,6 +1666,10 @@ static int hid_bus_match(struct device *dev, struct device_driver *drv) struct hid_driver *hdrv = container_of(drv, struct hid_driver, driver); struct hid_device *hdev = container_of(dev, struct hid_device, dev); + if ((hdev->quirks & HID_QUIRK_MULTITOUCH) && + !strncmp(hdrv->name, "hid-multitouch", 14)) + return 1; + if (!hid_match_device(hdev, hdrv)) return 0; @@ -1691,8 +1694,11 @@ static int hid_device_probe(struct device *dev) if (!hdev->driver) { id = hid_match_device(hdev, hdrv); if (id == NULL) { - ret = -ENODEV; - goto unlock; + if (!((hdev->quirks & HID_QUIRK_MULTITOUCH) && + !strncmp(hdrv->name, "hid-multitouch", 14))) { + ret = -ENODEV; + goto unlock; + } } hdev->driver = hdrv; |