Commit 6edfa8dc authored by Jiri Slaby's avatar Jiri Slaby Committed by Jiri Kosina

HID: move reset leds quirk

Move the handling of the leds resetting from the core to
the dell and logitech drivers.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 93c10132
...@@ -26,8 +26,6 @@ static int dell_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -26,8 +26,6 @@ static int dell_probe(struct hid_device *hdev, const struct hid_device_id *id)
{ {
int ret; int ret;
hdev->quirks |= HID_QUIRK_RESET_LEDS;
ret = hid_parse(hdev); ret = hid_parse(hdev);
if (ret) { if (ret) {
dev_err(&hdev->dev, "parse failed\n"); dev_err(&hdev->dev, "parse failed\n");
...@@ -40,6 +38,8 @@ static int dell_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -40,6 +38,8 @@ static int dell_probe(struct hid_device *hdev, const struct hid_device_id *id)
goto err_free; goto err_free;
} }
usbhid_set_leds(hdev);
return 0; return 0;
err_free: err_free:
return ret; return ret;
......
...@@ -226,8 +226,6 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -226,8 +226,6 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
hid_set_drvdata(hdev, (void *)quirks); hid_set_drvdata(hdev, (void *)quirks);
if (quirks & LG_RESET_LEDS)
hdev->quirks |= HID_QUIRK_RESET_LEDS;
if (quirks & LG_NOGET) if (quirks & LG_NOGET)
hdev->quirks |= HID_QUIRK_NOGET; hdev->quirks |= HID_QUIRK_NOGET;
...@@ -243,6 +241,9 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -243,6 +241,9 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id)
goto err_free; goto err_free;
} }
if (quirks & LG_RESET_LEDS)
usbhid_set_leds(hdev);
return 0; return 0;
err_free: err_free:
return ret; return ret;
......
...@@ -591,7 +591,7 @@ static int hid_find_field_early(struct hid_device *hid, unsigned int page, ...@@ -591,7 +591,7 @@ static int hid_find_field_early(struct hid_device *hid, unsigned int page,
return -1; return -1;
} }
static void usbhid_set_leds(struct hid_device *hid) void usbhid_set_leds(struct hid_device *hid)
{ {
struct hid_field *field; struct hid_field *field;
int offset; int offset;
...@@ -601,6 +601,7 @@ static void usbhid_set_leds(struct hid_device *hid) ...@@ -601,6 +601,7 @@ static void usbhid_set_leds(struct hid_device *hid)
usbhid_submit_report(hid, field->report, USB_DIR_OUT); usbhid_submit_report(hid, field->report, USB_DIR_OUT);
} }
} }
EXPORT_SYMBOL_GPL(usbhid_set_leds);
/* /*
* Traverse the supplied list of reports and find the longest * Traverse the supplied list of reports and find the longest
...@@ -860,9 +861,6 @@ static int usbhid_start(struct hid_device *hid) ...@@ -860,9 +861,6 @@ static int usbhid_start(struct hid_device *hid)
usbhid_init_reports(hid); usbhid_init_reports(hid);
hid_dump_device(hid); hid_dump_device(hid);
if (hid->quirks & HID_QUIRK_RESET_LEDS)
usbhid_set_leds(hid);
return 0; return 0;
fail: fail:
......
...@@ -274,7 +274,6 @@ struct hid_item { ...@@ -274,7 +274,6 @@ struct hid_item {
#define HID_QUIRK_BADPAD 0x00000020 #define HID_QUIRK_BADPAD 0x00000020
#define HID_QUIRK_MULTI_INPUT 0x00000040 #define HID_QUIRK_MULTI_INPUT 0x00000040
#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
#define HID_QUIRK_RESET_LEDS 0x00100000
#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
/* /*
...@@ -756,6 +755,7 @@ extern void hid_generic_exit(void); ...@@ -756,6 +755,7 @@ extern void hid_generic_exit(void);
u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
int usbhid_quirks_init(char **quirks_param); int usbhid_quirks_init(char **quirks_param);
void usbhid_quirks_exit(void); void usbhid_quirks_exit(void);
void usbhid_set_leds(struct hid_device *hid);
#ifdef CONFIG_HID_FF #ifdef CONFIG_HID_FF
int hid_ff_init(struct hid_device *hid); int hid_ff_init(struct hid_device *hid);
......
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