Skip to content

Commit

Permalink
HID: add support for Skycable 0x3f07 wireless presenter
Browse files Browse the repository at this point in the history
This device contains the very same bug in report descriptor as the
Ortek ones do (i.e. LogicalMinimum == 1, which is wrong for the key
array).

As we have more reports for the Ortek devices, we are keeping the driver
name for now. Apparently there is a chip producer which sells chip with
this buggy descriptor to multiple vendors. Thus if such reports start
to come at highger frequency, we'll either have to rename the driver
accordingly, or come up with more generic workaround.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jiri Kosina authored and John E. Connolly committed Aug 11, 2011
1 parent 7d9011f commit 31e86c5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
11 changes: 9 additions & 2 deletions drivers/hid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,17 @@ config HID_NTRIG
Support for N-Trig touch screen.

config HID_ORTEK
tristate "Ortek"
tristate "Ortek PKB-1700/WKB-2000/Skycable wireless keyboard and mouse trackpad"
depends on USB_HID
---help---
Support for Ortek WKB-2000 wireless keyboard + mouse trackpad.
There are certain devices which have LogicalMaximum wrong in the keyboard
usage page of their report descriptor. The most prevailing ones so far
are manufactured by Ortek, thus the name of the driver. Currently
supported devices by this driver are

- Ortek PKB-1700
- Ortek WKB-2000
- Skycable wireless presenter

config HID_PANTHERLORD
tristate "Pantherlord support"
Expand Down
1 change: 1 addition & 0 deletions drivers/hid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,7 @@ static const struct hid_device_id hid_blacklist[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
Expand Down
3 changes: 3 additions & 0 deletions drivers/hid/hid-ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@
#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600

#define USB_VENDOR_ID_SKYCABLE 0x1223
#define USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER 0x3F07

#define USB_VENDOR_ID_SONY 0x054c
#define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE 0x024b
#define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268
Expand Down
18 changes: 13 additions & 5 deletions drivers/hid/hid-ortek.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/*
* HID driver for Ortek WKB-2000 (wireless keyboard + mouse trackpad).
* Fixes LogicalMaximum error in USB report description, see
* http://bugzilla.kernel.org/show_bug.cgi?id=14787
* HID driver for various devices which are apparently based on the same chipset
* from certain vendor which produces chips that contain wrong LogicalMaximum
* value in their HID report descriptor. Currently supported devices are:
*
* Ortek PKB-1700
* Ortek WKB-2000
* Skycable wireless presenter
*
* Copyright (c) 2010 Johnathon Harris <jmharris@gmail.com>
* Copyright (c) 2011 Jiri Kosina
*/

/*
Expand All @@ -23,14 +28,17 @@ static void ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int rsize)
{
if (rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) {
dev_info(&hdev->dev, "Fixing up Ortek WKB-2000 "
"report descriptor.\n");
hid_info(hdev, "Fixing up logical minimum in report descriptor (Ortek)\n");
rdesc[55] = 0x92;
} else if (*rsize >= 54 && rdesc[52] == 0x25 && rdesc[53] == 0x01) {
hid_info(hdev, "Fixing up logical minimum in report descriptor (Skycable)\n");
rdesc[53] = 0x65;
}
}

static const struct hid_device_id ortek_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
{ HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },
{ }
};
MODULE_DEVICE_TABLE(hid, ortek_devices);
Expand Down

0 comments on commit 31e86c5

Please sign in to comment.