diff options
author | Hans de Goede <hdegoede@redhat.com> | 2018-07-11 12:38:35 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2018-07-17 15:25:40 +0200 |
commit | 7ed3f281d8f36c19ca15fe7fcc52200668a73d72 (patch) | |
tree | c7154b5a157a6d16f9723a18eb91944ee8b87d2a /drivers/hid/hid-elan.c | |
parent | 19588bee0ea569bd6cc6bea5b284c34f1f526a59 (diff) | |
download | linux-7ed3f281d8f36c19ca15fe7fcc52200668a73d72.tar.bz2 |
HID: elan: Add a flag for selecting if the touchpad has a LED
Note all Elan touchpads have a LED make this configurable using
a flag in hi_id.driver_data.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-elan.c')
-rw-r--r-- | drivers/hid/hid-elan.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/hid/hid-elan.c b/drivers/hid/hid-elan.c index 6969fb5344a5..ae1e24061c0a 100644 --- a/drivers/hid/hid-elan.c +++ b/drivers/hid/hid-elan.c @@ -36,6 +36,8 @@ #define ELAN_MUTE_LED_REPORT 0xBC #define ELAN_LED_REPORT_SIZE 8 +#define ELAN_HAS_LED BIT(0) + struct elan_drvdata { struct input_dev *input; u8 prev_report[ELAN_INPUT_REPORT_SIZE]; @@ -450,9 +452,11 @@ static int elan_probe(struct hid_device *hdev, const struct hid_device_id *id) if (ret) goto err; - ret = elan_init_mute_led(hdev); - if (ret) - goto err; + if (id->driver_data & ELAN_HAS_LED) { + ret = elan_init_mute_led(hdev); + if (ret) + goto err; + } return 0; err: @@ -466,7 +470,8 @@ static void elan_remove(struct hid_device *hdev) } static const struct hid_device_id elan_devices[] = { - { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_HP_X2_10_COVER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_HP_X2_10_COVER), + .driver_data = ELAN_HAS_LED }, { } }; MODULE_DEVICE_TABLE(hid, elan_devices); |