aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2014-07-23 12:31:55 -0400
committerJiri Kosina <jkosina@suse.cz>2014-07-29 05:21:25 -0400
commitfb853296d8ce3056c3668f2e51dee8533c32a9d5 (patch)
treeb944b9e7634cedfcaf9da6e7cdd2e5d499df6489 /drivers/hid
parente917e98f4829a5842ea8283548bf5dedfd88b2d0 (diff)
HID: huion: Don't ignore other interfaces
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>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-huion.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/hid/hid-huion.c b/drivers/hid/hid-huion.c
index 25d01cdd3bbc..46c425bf4f0d 100644
--- a/drivers/hid/hid-huion.c
+++ b/drivers/hid/hid-huion.c
@@ -107,17 +107,6 @@ static int huion_tablet_enable(struct hid_device *hdev)
107static int huion_probe(struct hid_device *hdev, const struct hid_device_id *id) 107static int huion_probe(struct hid_device *hdev, const struct hid_device_id *id)
108{ 108{
109 int ret; 109 int ret;
110 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
111
112 /* Ignore interfaces 1 (mouse) and 2 (keyboard) for tablet,
113 * as they are not used
114 */
115 switch (id->product) {
116 case USB_DEVICE_ID_HUION_TABLET:
117 if (intf->cur_altsetting->desc.bInterfaceNumber != 0x00)
118 return -ENODEV;
119 break;
120 }
121 110
122 ret = hid_parse(hdev); 111 ret = hid_parse(hdev);
123 if (ret) { 112 if (ret) {
@@ -151,8 +140,13 @@ err:
151static int huion_raw_event(struct hid_device *hdev, struct hid_report *report, 140static int huion_raw_event(struct hid_device *hdev, struct hid_report *report,
152 u8 *data, int size) 141 u8 *data, int size)
153{ 142{
154 /* If this is a pen input report then invert the in-range bit */ 143 struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
155 if (report->type == HID_INPUT_REPORT && report->id == 0x07 && size >= 2) 144
145 /* If this is a pen input report */
146 if (intf->cur_altsetting->desc.bInterfaceNumber == 0 &&
147 report->type == HID_INPUT_REPORT &&
148 report->id == 0x07 && size >= 2)
149 /* Invert the in-range bit */
156 data[1] ^= 0x40; 150 data[1] ^= 0x40;
157 151
158 return 0; 152 return 0;