diff options
author | Jiri Kosina <jkosina@suse.cz> | 2009-11-13 04:45:53 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2009-11-13 04:45:53 -0500 |
commit | 24985cf68612a5617d396b0b188cec807641cde1 (patch) | |
tree | ac0fcd5288312e8ecdad289258c07ae8ea8dca1c /drivers/hid/hid-lg.c | |
parent | 5b915d9e6dc3d22fedde91dfef1cb1a8fa9a1870 (diff) |
HID: support Logitech/3DConnexion SpaceTraveler and SpaceNavigator
These devices wrongly report their axes as relative instead of absolute.
Fix this in up report descriptor of the device before it enters the parser.
Reported-by: simon.windows@gmail.com
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-lg.c')
-rw-r--r-- | drivers/hid/hid-lg.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index 0f870a3243ed..8e28f1dc40a6 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #define LG_NOGET 0x100 | 33 | #define LG_NOGET 0x100 |
34 | #define LG_FF 0x200 | 34 | #define LG_FF 0x200 |
35 | #define LG_FF2 0x400 | 35 | #define LG_FF2 0x400 |
36 | #define LG_RDESC_REL_ABS 0x800 | ||
36 | 37 | ||
37 | /* | 38 | /* |
38 | * Certain Logitech keyboards send in report #3 keys which are far | 39 | * Certain Logitech keyboards send in report #3 keys which are far |
@@ -51,6 +52,13 @@ static void lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
51 | rdesc[84] = rdesc[89] = 0x4d; | 52 | rdesc[84] = rdesc[89] = 0x4d; |
52 | rdesc[85] = rdesc[90] = 0x10; | 53 | rdesc[85] = rdesc[90] = 0x10; |
53 | } | 54 | } |
55 | if ((quirks & LG_RDESC_REL_ABS) && rsize >= 50 && | ||
56 | rdesc[32] == 0x81 && rdesc[33] == 0x06 && | ||
57 | rdesc[49] == 0x81 && rdesc[50] == 0x06) { | ||
58 | dev_info(&hdev->dev, "fixing up rel/abs in Logitech " | ||
59 | "report descriptor\n"); | ||
60 | rdesc[33] = rdesc[50] = 0x02; | ||
61 | } | ||
54 | } | 62 | } |
55 | 63 | ||
56 | #define lg_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ | 64 | #define lg_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ |
@@ -303,8 +311,13 @@ static const struct hid_device_id lg_devices[] = { | |||
303 | .driver_data = LG_FF }, | 311 | .driver_data = LG_FF }, |
304 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2), | 312 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2), |
305 | .driver_data = LG_FF2 }, | 313 | .driver_data = LG_FF2 }, |
314 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR), | ||
315 | .driver_data = LG_RDESC_REL_ABS }, | ||
316 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER), | ||
317 | .driver_data = LG_RDESC_REL_ABS }, | ||
306 | { } | 318 | { } |
307 | }; | 319 | }; |
320 | |||
308 | MODULE_DEVICE_TABLE(hid, lg_devices); | 321 | MODULE_DEVICE_TABLE(hid, lg_devices); |
309 | 322 | ||
310 | static struct hid_driver lg_driver = { | 323 | static struct hid_driver lg_driver = { |