Commit 30bb75d7 authored by Michal Malý's avatar Michal Malý Committed by Jiri Kosina

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: default avatarMichal Malý <madcatxster@gmail.com>
Signed-off-by: default avatarSimon Wood <simon@mungewell.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 96440c8a
...@@ -406,6 +406,15 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -406,6 +406,15 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
return ret; return ret;
} }
static void lg_remove(struct hid_device *hdev)
{
unsigned long quirks = (unsigned long)hid_get_drvdata(hdev);
if(quirks & LG_FF4)
lg4ff_deinit(hdev);
hid_hw_stop(hdev);
}
static const struct hid_device_id lg_devices[] = { static const struct hid_device_id lg_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER), { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER),
.driver_data = LG_RDESC | LG_WIRELESS }, .driver_data = LG_RDESC | LG_WIRELESS },
...@@ -481,6 +490,7 @@ static struct hid_driver lg_driver = { ...@@ -481,6 +490,7 @@ static struct hid_driver lg_driver = {
.input_mapped = lg_input_mapped, .input_mapped = lg_input_mapped,
.event = lg_event, .event = lg_event,
.probe = lg_probe, .probe = lg_probe,
.remove = lg_remove,
}; };
static int __init lg_init(void) static int __init lg_init(void)
......
...@@ -21,8 +21,10 @@ static inline int lg3ff_init(struct hid_device *hdev) { return -1; } ...@@ -21,8 +21,10 @@ static inline int lg3ff_init(struct hid_device *hdev) { return -1; }
#ifdef CONFIG_LOGIWII_FF #ifdef CONFIG_LOGIWII_FF
int lg4ff_init(struct hid_device *hdev); int lg4ff_init(struct hid_device *hdev);
int lg4ff_deinit(struct hid_device *hdev);
#else #else
static inline int lg4ff_init(struct hid_device *hdev) { return -1; } static inline int lg4ff_init(struct hid_device *hdev) { return -1; }
static inline int lg4ff_deinit(struct hid_device *hdev) { return -1; }
#endif #endif
#endif #endif
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment