Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291641
b: refs/heads/master
c: 8d179a9
h: refs/heads/master
i:
  291639: 566e648
v: v3
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Mar 12, 2012
1 parent dc8c3b2 commit 25b85ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ed9d5c96147b3bed6178252e8e04b27b7d32edd0
refs/heads/master: 8d179a9ef25a64b451e2bbd46f6a6c16c6a72eb1
12 changes: 9 additions & 3 deletions trunk/drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand Down
11 changes: 7 additions & 4 deletions trunk/drivers/hid/hid-multitouch.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,17 +637,20 @@ 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;
}
}
}

/* This allows the driver to correctly support devices
* 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) {
Expand Down

0 comments on commit 25b85ba

Please sign in to comment.