diff options
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 1 | ||||
-rw-r--r-- | drivers/hid/hid-kye.c | 45 |
3 files changed, 30 insertions, 17 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8de5cb8319b9..b0f2f459f59b 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1594,6 +1594,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1594 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, | 1594 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, |
1595 | { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, | 1595 | { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, |
1596 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, | 1596 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, |
1597 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GX_IMPERATOR) }, | ||
1597 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, | 1598 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, |
1598 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) }, | 1599 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) }, |
1599 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) }, | 1600 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index c5aea29f164f..02885319c10a 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -479,6 +479,7 @@ | |||
479 | #define USB_VENDOR_ID_KYE 0x0458 | 479 | #define USB_VENDOR_ID_KYE 0x0458 |
480 | #define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 | 480 | #define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 |
481 | #define USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE 0x0138 | 481 | #define USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE 0x0138 |
482 | #define USB_DEVICE_ID_GENIUS_GX_IMPERATOR 0x4018 | ||
482 | #define USB_DEVICE_ID_KYE_GPEN_560 0x5003 | 483 | #define USB_DEVICE_ID_KYE_GPEN_560 0x5003 |
483 | #define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010 | 484 | #define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010 |
484 | #define USB_DEVICE_ID_KYE_MOUSEPEN_I608X 0x5011 | 485 | #define USB_DEVICE_ID_KYE_MOUSEPEN_I608X 0x5011 |
diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c index 1e2ee2aa84a0..73845120295e 100644 --- a/drivers/hid/hid-kye.c +++ b/drivers/hid/hid-kye.c | |||
@@ -268,6 +268,26 @@ static __u8 easypen_m610x_rdesc_fixed[] = { | |||
268 | 0xC0 /* End Collection */ | 268 | 0xC0 /* End Collection */ |
269 | }; | 269 | }; |
270 | 270 | ||
271 | static __u8 *kye_consumer_control_fixup(struct hid_device *hdev, __u8 *rdesc, | ||
272 | unsigned int *rsize, int offset, const char *device_name) { | ||
273 | /* | ||
274 | * the fixup that need to be done: | ||
275 | * - change Usage Maximum in the Comsumer Control | ||
276 | * (report ID 3) to a reasonable value | ||
277 | */ | ||
278 | if (*rsize >= offset + 31 && | ||
279 | /* Usage Page (Consumer Devices) */ | ||
280 | rdesc[offset] == 0x05 && rdesc[offset + 1] == 0x0c && | ||
281 | /* Usage (Consumer Control) */ | ||
282 | rdesc[offset + 2] == 0x09 && rdesc[offset + 3] == 0x01 && | ||
283 | /* Usage Maximum > 12287 */ | ||
284 | rdesc[offset + 10] == 0x2a && rdesc[offset + 12] > 0x2f) { | ||
285 | hid_info(hdev, "fixing up %s report descriptor\n", device_name); | ||
286 | rdesc[offset + 12] = 0x2f; | ||
287 | } | ||
288 | return rdesc; | ||
289 | } | ||
290 | |||
271 | static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, | 291 | static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
272 | unsigned int *rsize) | 292 | unsigned int *rsize) |
273 | { | 293 | { |
@@ -315,23 +335,12 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
315 | } | 335 | } |
316 | break; | 336 | break; |
317 | case USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE: | 337 | case USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE: |
318 | /* | 338 | rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 104, |
319 | * the fixup that need to be done: | 339 | "Genius Gila Gaming Mouse"); |
320 | * - change Usage Maximum in the Comsumer Control | 340 | break; |
321 | * (report ID 3) to a reasonable value | 341 | case USB_DEVICE_ID_GENIUS_GX_IMPERATOR: |
322 | */ | 342 | rdesc = kye_consumer_control_fixup(hdev, rdesc, rsize, 83, |
323 | if (*rsize >= 135 && | 343 | "Genius Gx Imperator Keyboard"); |
324 | /* Usage Page (Consumer Devices) */ | ||
325 | rdesc[104] == 0x05 && rdesc[105] == 0x0c && | ||
326 | /* Usage (Consumer Control) */ | ||
327 | rdesc[106] == 0x09 && rdesc[107] == 0x01 && | ||
328 | /* Usage Maximum > 12287 */ | ||
329 | rdesc[114] == 0x2a && rdesc[116] > 0x2f) { | ||
330 | hid_info(hdev, | ||
331 | "fixing up Genius Gila Gaming Mouse " | ||
332 | "report descriptor\n"); | ||
333 | rdesc[116] = 0x2f; | ||
334 | } | ||
335 | break; | 344 | break; |
336 | } | 345 | } |
337 | return rdesc; | 346 | return rdesc; |
@@ -428,6 +437,8 @@ static const struct hid_device_id kye_devices[] = { | |||
428 | USB_DEVICE_ID_KYE_EASYPEN_M610X) }, | 437 | USB_DEVICE_ID_KYE_EASYPEN_M610X) }, |
429 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, | 438 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, |
430 | USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, | 439 | USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) }, |
440 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, | ||
441 | USB_DEVICE_ID_GENIUS_GX_IMPERATOR) }, | ||
431 | { } | 442 | { } |
432 | }; | 443 | }; |
433 | MODULE_DEVICE_TABLE(hid, kye_devices); | 444 | MODULE_DEVICE_TABLE(hid, kye_devices); |