diff options
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 36 | ||||
-rw-r--r-- | include/linux/hid.h | 1 |
2 files changed, 37 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 | */ | ||
964 | static 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 */ |
951 | static void usbhid_fixup_petalynx_descriptor(unsigned char *rdesc, int rsize) | 983 | static 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 | /** |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 6a70b788ee9c..3902690647b0 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -295,6 +295,7 @@ struct hid_item { | |||
295 | #define HID_QUIRK_RDESC_PETALYNX 0x00000008 | 295 | #define HID_QUIRK_RDESC_PETALYNX 0x00000008 |
296 | #define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010 | 296 | #define HID_QUIRK_RDESC_MACBOOK_JIS 0x00000010 |
297 | #define HID_QUIRK_RDESC_BUTTON_CONSUMER 0x00000020 | 297 | #define HID_QUIRK_RDESC_BUTTON_CONSUMER 0x00000020 |
298 | #define HID_QUIRK_RDESC_SAMSUNG_REMOTE 0x00000040 | ||
298 | 299 | ||
299 | /* | 300 | /* |
300 | * This is the global environment of the parser. This information is | 301 | * This is the global environment of the parser. This information is |