diff options
author | Jiri Kosina <jkosina@suse.cz> | 2021-04-29 22:39:33 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2021-04-29 22:39:33 +0300 |
commit | 743b357607ee9dabe049a89ac68f878c6e661687 (patch) | |
tree | 5b1976fd0a4adae8093458161062cdf15f97279f /drivers/hid | |
parent | 590ade88bafd8a88a2d3f69fa197cda491221b38 (diff) | |
parent | ba3f92938f2c01623546d4570ecc19a8b7786fa7 (diff) | |
download | linux-743b357607ee9dabe049a89ac68f878c6e661687.tar.xz |
Merge branch 'for-5.13/elan' into for-linus
- Mute LED support fixes for Elantech driver from Hans de Goede
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-elan.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/hid/hid-elan.c b/drivers/hid/hid-elan.c index dae193749d44..021049805bb7 100644 --- a/drivers/hid/hid-elan.c +++ b/drivers/hid/hid-elan.c @@ -410,15 +410,6 @@ static int elan_start_multitouch(struct hid_device *hdev) return 0; } -static enum led_brightness elan_mute_led_get_brigtness(struct led_classdev *led_cdev) -{ - struct device *dev = led_cdev->dev->parent; - struct hid_device *hdev = to_hid_device(dev); - struct elan_drvdata *drvdata = hid_get_drvdata(hdev); - - return drvdata->mute_led_state; -} - static int elan_mute_led_set_brigtness(struct led_classdev *led_cdev, enum led_brightness value) { @@ -445,8 +436,9 @@ static int elan_mute_led_set_brigtness(struct led_classdev *led_cdev, kfree(dmabuf); if (ret != ELAN_LED_REPORT_SIZE) { - hid_err(hdev, "Failed to set mute led brightness: %d\n", ret); - return ret; + if (ret != -ENODEV) + hid_err(hdev, "Failed to set mute led brightness: %d\n", ret); + return ret < 0 ? ret : -EIO; } drvdata->mute_led_state = led_state; @@ -459,9 +451,10 @@ static int elan_init_mute_led(struct hid_device *hdev) struct led_classdev *mute_led = &drvdata->mute_led; mute_led->name = "elan:red:mute"; - mute_led->brightness_get = elan_mute_led_get_brigtness; + mute_led->default_trigger = "audio-mute"; mute_led->brightness_set_blocking = elan_mute_led_set_brigtness; mute_led->max_brightness = LED_ON; + mute_led->flags = LED_HW_PLUGGABLE; mute_led->dev = &hdev->dev; return devm_led_classdev_register(&hdev->dev, mute_led); |