Skip to content

Commit

Permalink
HID: huion: Don't ignore other interfaces
Browse files Browse the repository at this point in the history
Don't ignore non pen-reporting interfaces as they may be used by some
models reusing the same product ID.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Nikolai Kondrashov authored and Jiri Kosina committed Jul 29, 2014
1 parent e917e98 commit fb85329
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions drivers/hid/hid-huion.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,6 @@ static int huion_tablet_enable(struct hid_device *hdev)
static int huion_probe(struct hid_device *hdev, const struct hid_device_id *id)
{
int ret;
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);

/* Ignore interfaces 1 (mouse) and 2 (keyboard) for tablet,
* as they are not used
*/
switch (id->product) {
case USB_DEVICE_ID_HUION_TABLET:
if (intf->cur_altsetting->desc.bInterfaceNumber != 0x00)
return -ENODEV;
break;
}

ret = hid_parse(hdev);
if (ret) {
Expand Down Expand Up @@ -151,8 +140,13 @@ static int huion_probe(struct hid_device *hdev, const struct hid_device_id *id)
static int huion_raw_event(struct hid_device *hdev, struct hid_report *report,
u8 *data, int size)
{
/* If this is a pen input report then invert the in-range bit */
if (report->type == HID_INPUT_REPORT && report->id == 0x07 && size >= 2)
struct usb_interface *intf = to_usb_interface(hdev->dev.parent);

/* If this is a pen input report */
if (intf->cur_altsetting->desc.bInterfaceNumber == 0 &&
report->type == HID_INPUT_REPORT &&
report->id == 0x07 && size >= 2)
/* Invert the in-range bit */
data[1] ^= 0x40;

return 0;
Expand Down

0 comments on commit fb85329

Please sign in to comment.