Johnathon Harris | cd9ec30 | 2010-01-21 14:36:52 +0000 | [diff] [blame] | 1 | /* |
Herton Ronaldo Krzesinski | 270fdc0 | 2011-03-16 14:13:53 -0300 | [diff] [blame] | 2 | * HID driver for Ortek PKB-1700/WKB-2000 (wireless keyboard + mouse trackpad). |
Jiri Kosina | e96838d | 2011-03-17 00:39:33 +0100 | [diff] [blame] | 3 | * Fixes LogicalMaximum error in HID report description. |
Johnathon Harris | cd9ec30 | 2010-01-21 14:36:52 +0000 | [diff] [blame] | 4 | * |
| 5 | * Copyright (c) 2010 Johnathon Harris <jmharris@gmail.com> |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * This program is free software; you can redistribute it and/or modify it |
| 10 | * under the terms of the GNU General Public License as published by the Free |
| 11 | * Software Foundation; either version 2 of the License, or (at your option) |
| 12 | * any later version. |
| 13 | */ |
| 14 | |
| 15 | #include <linux/device.h> |
| 16 | #include <linux/hid.h> |
| 17 | #include <linux/module.h> |
| 18 | |
| 19 | #include "hid-ids.h" |
| 20 | |
Nikolai Kondrashov | 73e4008 | 2010-08-06 23:03:06 +0400 | [diff] [blame] | 21 | static __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
| 22 | unsigned int *rsize) |
Johnathon Harris | cd9ec30 | 2010-01-21 14:36:52 +0000 | [diff] [blame] | 23 | { |
Nikolai Kondrashov | 73e4008 | 2010-08-06 23:03:06 +0400 | [diff] [blame] | 24 | if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) { |
Joe Perches | 4291ee3 | 2010-12-09 19:29:03 -0800 | [diff] [blame] | 25 | hid_info(hdev, "Fixing up Ortek WKB-2000 report descriptor\n"); |
Johnathon Harris | cd9ec30 | 2010-01-21 14:36:52 +0000 | [diff] [blame] | 26 | rdesc[55] = 0x92; |
| 27 | } |
Nikolai Kondrashov | 73e4008 | 2010-08-06 23:03:06 +0400 | [diff] [blame] | 28 | return rdesc; |
Johnathon Harris | cd9ec30 | 2010-01-21 14:36:52 +0000 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | static const struct hid_device_id ortek_devices[] = { |
Herton Ronaldo Krzesinski | 270fdc0 | 2011-03-16 14:13:53 -0300 | [diff] [blame] | 32 | { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) }, |
Johnathon Harris | cd9ec30 | 2010-01-21 14:36:52 +0000 | [diff] [blame] | 33 | { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) }, |
| 34 | { } |
| 35 | }; |
| 36 | MODULE_DEVICE_TABLE(hid, ortek_devices); |
| 37 | |
| 38 | static struct hid_driver ortek_driver = { |
| 39 | .name = "ortek", |
| 40 | .id_table = ortek_devices, |
| 41 | .report_fixup = ortek_report_fixup |
| 42 | }; |
| 43 | |
| 44 | static int __init ortek_init(void) |
| 45 | { |
| 46 | return hid_register_driver(&ortek_driver); |
| 47 | } |
| 48 | |
| 49 | static void __exit ortek_exit(void) |
| 50 | { |
| 51 | hid_unregister_driver(&ortek_driver); |
| 52 | } |
| 53 | |
| 54 | module_init(ortek_init); |
| 55 | module_exit(ortek_exit); |
| 56 | MODULE_LICENSE("GPL"); |