Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d586dca0 authored by Jiri Kosina's avatar Jiri Kosina
Browse files

HID: add support for Skycable 0x3f07 wireless presenter



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: default avatarJiri Kosina <jkosina@suse.cz>
parent 99759619
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -340,10 +340,17 @@ config HID_NTRIG
	Support for N-Trig touch screen.
	Support for N-Trig touch screen.


config HID_ORTEK
config HID_ORTEK
	tristate "Ortek PKB-1700/WKB-2000 wireless keyboard and mouse trackpad"
	tristate "Ortek PKB-1700/WKB-2000/Skycable wireless keyboard and mouse trackpad"
	depends on USB_HID
	depends on USB_HID
	---help---
	---help---
	Support for Ortek PKB-1700/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
config HID_PANTHERLORD
	tristate "Pantherlord/GreenAsia game controller"
	tristate "Pantherlord/GreenAsia game controller"
+1 −0
Original line number Original line Diff line number Diff line
@@ -1448,6 +1448,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
	{ 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_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_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_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) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
+3 −0
Original line number Original line Diff line number Diff line
@@ -521,6 +521,9 @@
#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE	0x0001
#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE	0x0001
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE	0x0600
#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_VENDOR_ID_SONY			0x054c
#define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE	0x024b
#define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE	0x024b
#define USB_DEVICE_ID_SONY_PS3_CONTROLLER	0x0268
#define USB_DEVICE_ID_SONY_PS3_CONTROLLER	0x0268
+13 −3
Original line number Original line Diff line number Diff line
/*
/*
 *  HID driver for Ortek PKB-1700/WKB-2000 (wireless keyboard + mouse trackpad).
 *  HID driver for various devices which are apparently based on the same chipset
 *  Fixes LogicalMaximum error in HID report description.
 *  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) 2010 Johnathon Harris <jmharris@gmail.com>
 *  Copyright (c) 2011 Jiri Kosina
 */
 */


/*
/*
@@ -22,8 +28,11 @@ static __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc,
		unsigned int *rsize)
		unsigned int *rsize)
{
{
	if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) {
	if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) {
		hid_info(hdev, "Fixing up Ortek WKB-2000 report descriptor\n");
		hid_info(hdev, "Fixing up logical minimum in report descriptor (Ortek)\n");
		rdesc[55] = 0x92;
		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;
	}
	}
	return rdesc;
	return rdesc;
}
}
@@ -31,6 +40,7 @@ static __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc,
static const struct hid_device_id ortek_devices[] = {
static const struct hid_device_id ortek_devices[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
	{ 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);
MODULE_DEVICE_TABLE(hid, ortek_devices);