diff options
author | Michal Malý <madcatxster@gmail.com> | 2011-08-04 10:20:40 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-08-04 10:45:55 -0400 |
commit | 30bb75d71b3732c0adb6297815288ce0fb9cc04c (patch) | |
tree | 7666cc033dbf3a4239803b43702f2d4a57447a8e /drivers/hid/hid-lg.c | |
parent | 96440c8a00e22e541135dee2eba9f3e7d8195f65 (diff) |
HID: lg4ff - Add range setting support and sysfs interface
Wheel range of certain Logitech wheels - namely Driving Force GT, Driving Force
Pro, G25 and G27 can be adjusted. Minimu is 40 degrees, maximum 900. DFGT, G25
and G27 all use a common command, DFP uses another one. Range can be set from
userspace by writing to
"/sys/module/hid_logitech/drivers/hid:logitech/<dev>range". The driver use list
to store range of each connected wheel; it's not possible to use driver_data in
hid_device struct as it's already b hig-lg driver.
Signed-off-by: Michal Malý <madcatxster@gmail.com>
Signed-off-by: Simon Wood <simon@mungewell.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-lg.c')
-rw-r--r-- | drivers/hid/hid-lg.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index e0ae4a09425d..e7a7bd1eb34a 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c | |||
@@ -406,6 +406,15 @@ err_free: | |||
406 | return ret; | 406 | return ret; |
407 | } | 407 | } |
408 | 408 | ||
409 | static void lg_remove(struct hid_device *hdev) | ||
410 | { | ||
411 | unsigned long quirks = (unsigned long)hid_get_drvdata(hdev); | ||
412 | if(quirks & LG_FF4) | ||
413 | lg4ff_deinit(hdev); | ||
414 | |||
415 | hid_hw_stop(hdev); | ||
416 | } | ||
417 | |||
409 | static const struct hid_device_id lg_devices[] = { | 418 | static const struct hid_device_id lg_devices[] = { |
410 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER), | 419 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER), |
411 | .driver_data = LG_RDESC | LG_WIRELESS }, | 420 | .driver_data = LG_RDESC | LG_WIRELESS }, |
@@ -481,6 +490,7 @@ static struct hid_driver lg_driver = { | |||
481 | .input_mapped = lg_input_mapped, | 490 | .input_mapped = lg_input_mapped, |
482 | .event = lg_event, | 491 | .event = lg_event, |
483 | .probe = lg_probe, | 492 | .probe = lg_probe, |
493 | .remove = lg_remove, | ||
484 | }; | 494 | }; |
485 | 495 | ||
486 | static int __init lg_init(void) | 496 | static int __init lg_init(void) |