diff options
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 32 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 3 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.h | 2 |
3 files changed, 35 insertions, 2 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 9edf9806cff9..8b89e15bcf32 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -613,6 +613,30 @@ struct wacom_usbdev_data { | |||
613 | static LIST_HEAD(wacom_udev_list); | 613 | static LIST_HEAD(wacom_udev_list); |
614 | static DEFINE_MUTEX(wacom_udev_list_lock); | 614 | static DEFINE_MUTEX(wacom_udev_list_lock); |
615 | 615 | ||
616 | static struct usb_device *wacom_get_sibling(struct usb_device *dev, int vendor, int product) | ||
617 | { | ||
618 | int port1; | ||
619 | struct usb_device *sibling; | ||
620 | |||
621 | if (vendor == 0 && product == 0) | ||
622 | return dev; | ||
623 | |||
624 | if (dev->parent == NULL) | ||
625 | return NULL; | ||
626 | |||
627 | usb_hub_for_each_child(dev->parent, port1, sibling) { | ||
628 | struct usb_device_descriptor *d; | ||
629 | if (sibling == NULL) | ||
630 | continue; | ||
631 | |||
632 | d = &sibling->descriptor; | ||
633 | if (d->idVendor == vendor && d->idProduct == product) | ||
634 | return sibling; | ||
635 | } | ||
636 | |||
637 | return NULL; | ||
638 | } | ||
639 | |||
616 | static struct wacom_usbdev_data *wacom_get_usbdev_data(struct usb_device *dev) | 640 | static struct wacom_usbdev_data *wacom_get_usbdev_data(struct usb_device *dev) |
617 | { | 641 | { |
618 | struct wacom_usbdev_data *data; | 642 | struct wacom_usbdev_data *data; |
@@ -1257,13 +1281,19 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
1257 | strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); | 1281 | strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); |
1258 | 1282 | ||
1259 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) { | 1283 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) { |
1284 | struct usb_device *other_dev; | ||
1285 | |||
1260 | /* Append the device type to the name */ | 1286 | /* Append the device type to the name */ |
1261 | strlcat(wacom_wac->name, | 1287 | strlcat(wacom_wac->name, |
1262 | features->device_type == BTN_TOOL_PEN ? | 1288 | features->device_type == BTN_TOOL_PEN ? |
1263 | " Pen" : " Finger", | 1289 | " Pen" : " Finger", |
1264 | sizeof(wacom_wac->name)); | 1290 | sizeof(wacom_wac->name)); |
1265 | 1291 | ||
1266 | error = wacom_add_shared_data(wacom_wac, dev); | 1292 | |
1293 | other_dev = wacom_get_sibling(dev, features->oVid, features->oPid); | ||
1294 | if (other_dev == NULL || wacom_get_usbdev_data(other_dev) == NULL) | ||
1295 | other_dev = dev; | ||
1296 | error = wacom_add_shared_data(wacom_wac, other_dev); | ||
1267 | if (error) | 1297 | if (error) |
1268 | goto fail3; | 1298 | goto fail3; |
1269 | } | 1299 | } |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index c3468c8dbd89..21d1f4eaff53 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -1340,7 +1340,8 @@ void wacom_setup_device_quirks(struct wacom_features *features) | |||
1340 | 1340 | ||
1341 | /* these device have multiple inputs */ | 1341 | /* these device have multiple inputs */ |
1342 | if (features->type >= WIRELESS || | 1342 | if (features->type >= WIRELESS || |
1343 | (features->type >= INTUOS5S && features->type <= INTUOS5L)) | 1343 | (features->type >= INTUOS5S && features->type <= INTUOS5L) || |
1344 | (features->oVid && features->oPid)) | ||
1344 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; | 1345 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; |
1345 | 1346 | ||
1346 | /* quirk for bamboo touch with 2 low res touches */ | 1347 | /* quirk for bamboo touch with 2 low res touches */ |
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 96c185cc301e..3f926ec19ef9 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h | |||
@@ -109,6 +109,8 @@ struct wacom_features { | |||
109 | int distance_fuzz; | 109 | int distance_fuzz; |
110 | unsigned quirks; | 110 | unsigned quirks; |
111 | unsigned touch_max; | 111 | unsigned touch_max; |
112 | int oVid; | ||
113 | int oPid; | ||
112 | }; | 114 | }; |
113 | 115 | ||
114 | struct wacom_shared { | 116 | struct wacom_shared { |