Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334847
b: refs/heads/master
c: aea2bf6
h: refs/heads/master
i:
  334845: 3602185
  334843: 35b27db
  334839: 11f52bf
  334831: 7c3fdbb
  334815: d9e8f5d
  334783: 95c713b
  334719: f093f31
  334591: 83ecf23
  334335: 5a91003
  333823: 57a241b
v: v3
  • Loading branch information
Jason Gerecke authored and Linus Torvalds committed Oct 25, 2012
1 parent e6833a6 commit 8158690
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 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: 2008713c7174e5c0f207bac684c6df0939047009
refs/heads/master: aea2bf6a57a9e4596bfad164f986ba10ddc6adf3
32 changes: 31 additions & 1 deletion trunk/drivers/input/tablet/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,30 @@ struct wacom_usbdev_data {
static LIST_HEAD(wacom_udev_list);
static DEFINE_MUTEX(wacom_udev_list_lock);

static struct usb_device *wacom_get_sibling(struct usb_device *dev, int vendor, int product)
{
int port1;
struct usb_device *sibling;

if (vendor == 0 && product == 0)
return dev;

if (dev->parent == NULL)
return NULL;

usb_hub_for_each_child(dev->parent, port1, sibling) {
struct usb_device_descriptor *d;
if (sibling == NULL)
continue;

d = &sibling->descriptor;
if (d->idVendor == vendor && d->idProduct == product)
return sibling;
}

return NULL;
}

static struct wacom_usbdev_data *wacom_get_usbdev_data(struct usb_device *dev)
{
struct wacom_usbdev_data *data;
Expand Down Expand Up @@ -1257,13 +1281,19 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));

if (features->quirks & WACOM_QUIRK_MULTI_INPUT) {
struct usb_device *other_dev;

/* Append the device type to the name */
strlcat(wacom_wac->name,
features->device_type == BTN_TOOL_PEN ?
" Pen" : " Finger",
sizeof(wacom_wac->name));

error = wacom_add_shared_data(wacom_wac, dev);

other_dev = wacom_get_sibling(dev, features->oVid, features->oPid);
if (other_dev == NULL || wacom_get_usbdev_data(other_dev) == NULL)
other_dev = dev;
error = wacom_add_shared_data(wacom_wac, other_dev);
if (error)
goto fail3;
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/input/tablet/wacom_wac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,8 @@ void wacom_setup_device_quirks(struct wacom_features *features)

/* these device have multiple inputs */
if (features->type >= WIRELESS ||
(features->type >= INTUOS5S && features->type <= INTUOS5L))
(features->type >= INTUOS5S && features->type <= INTUOS5L) ||
(features->oVid && features->oPid))
features->quirks |= WACOM_QUIRK_MULTI_INPUT;

/* quirk for bamboo touch with 2 low res touches */
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/input/tablet/wacom_wac.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ struct wacom_features {
int distance_fuzz;
unsigned quirks;
unsigned touch_max;
int oVid;
int oPid;
};

struct wacom_shared {
Expand Down

0 comments on commit 8158690

Please sign in to comment.