aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid
diff options
context:
space:
mode:
authorRobert Schedel <r.schedel@yahoo.de>2007-12-25 18:57:40 -0500
committerJiri Kosina <jkosina@suse.cz>2008-01-28 08:51:22 -0500
commitfe56caa97e626cc6d6e18adbd5ccd1a9aa9a4fcf (patch)
treeceeb0dc577e292633dac2a17b28c4e46e7984eb8 /drivers/hid/usbhid
parentb0e668240949f69e84d69f998aa9af759e8be635 (diff)
HID: Support Samsung IR remote
Samsung USB remotes (0419:0001) are rejected by kernel 2.6.23, because the report descriptor from the remote contains a 48 bit HID report field. HID 1.11 states: Fields may span at most 4 bytes. This patch, based on 2.6.23, fixes this by modifying the internal report descriptor in hid-quirks.c. Additional user space support (e.g. LIRC) is required to fetch the information from the hiddev interface. The burden to reconstruct the data is moved into userspace (lirc through hiddev). There is no need to set HID_QUIRK_HIDDEV quirk, as the device has also output applications, which trigger the creation of hiddev device automatically. Signed-off-by: Robert Schedel <r.schedel@yahoo.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r--drivers/hid/usbhid/hid-quirks.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 68b38fdb1203..30f63e9f93a3 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -341,6 +341,9 @@
341#define USB_VENDOR_ID_SAITEK 0x06a3 341#define USB_VENDOR_ID_SAITEK 0x06a3
342#define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17 342#define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17
343 343
344#define USB_VENDOR_ID_SAMSUNG 0x0419
345#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
346
344#define USB_VENDOR_ID_SONY 0x054c 347#define USB_VENDOR_ID_SONY 0x054c
345#define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268 348#define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268
346 349
@@ -673,6 +676,8 @@ static const struct hid_rdesc_blacklist {
673 676
674 { USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE, HID_QUIRK_RDESC_PETALYNX }, 677 { USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE, HID_QUIRK_RDESC_PETALYNX },
675 678
679 { USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE, HID_QUIRK_RDESC_SAMSUNG_REMOTE },
680
676 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX }, 681 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
677 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2, HID_QUIRK_RDESC_SWAPPED_MIN_MAX }, 682 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2, HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
678 683
@@ -947,6 +952,33 @@ static void usbhid_fixup_logitech_descriptor(unsigned char *rdesc, int rsize)
947 } 952 }
948} 953}
949 954
955/*
956 * Samsung IrDA remote controller (reports as Cypress USB Mouse).
957 *
958 * Vendor specific report #4 has a size of 48 bit,
959 * and therefore is not accepted when inspecting the descriptors.
960 * As a workaround we reinterpret the report as:
961 * Variable type, count 6, size 8 bit, log. maximum 255
962 * The burden to reconstruct the data is moved into user space.
963 */
964static void usbhid_fixup_samsung_irda_descriptor(unsigned char *rdesc,
965 int rsize)
966{
967 if (rsize >= 182 && rdesc[175] == 0x25
968 && rdesc[176] == 0x40
969 && rdesc[177] == 0x75
970 && rdesc[178] == 0x30
971 && rdesc[179] == 0x95
972 && rdesc[180] == 0x01
973 && rdesc[182] == 0x40) {
974 printk(KERN_INFO "Fixing up Samsung IrDA report descriptor\n");
975 rdesc[176] = 0xff;
976 rdesc[178] = 0x08;
977 rdesc[180] = 0x06;
978 rdesc[182] = 0x42;
979 }
980}
981
950/* Petalynx Maxter Remote has maximum for consumer page set too low */ 982/* Petalynx Maxter Remote has maximum for consumer page set too low */
951static void usbhid_fixup_petalynx_descriptor(unsigned char *rdesc, int rsize) 983static void usbhid_fixup_petalynx_descriptor(unsigned char *rdesc, int rsize)
952{ 984{
@@ -1026,6 +1058,10 @@ static void __usbhid_fixup_report_descriptor(__u32 quirks, char *rdesc, unsigned
1026 1058
1027 if (quirks & HID_QUIRK_RDESC_BUTTON_CONSUMER) 1059 if (quirks & HID_QUIRK_RDESC_BUTTON_CONSUMER)
1028 usbhid_fixup_button_consumer_descriptor(rdesc, rsize); 1060 usbhid_fixup_button_consumer_descriptor(rdesc, rsize);
1061
1062 if (quirks & HID_QUIRK_RDESC_SAMSUNG_REMOTE)
1063 usbhid_fixup_samsung_irda_descriptor(rdesc, rsize);
1064
1029} 1065}
1030 1066
1031/** 1067/**