summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2021-04-04 10:04:28 +0200
committerJiri Kosina <jkosina@suse.cz>2021-04-07 12:48:19 +0200
commit8744eeec539aa760c41a64b3efbb77868b1d700a (patch)
tree6d3a5b3d142911bd6646041c9255a89de6342314 /drivers/hid
parent033c978680255a81c6284cb6ea4de20bd2bdbe5c (diff)
downloadlinux-8744eeec539aa760c41a64b3efbb77868b1d700a.tar.bz2
HID: lenovo: Set LEDs max_brightness value
The LEDs can only by turned on/off, so max_brightness should be set to 1. Without this the max_brightness sysfs-attribute will report 255 which is wrong. Reviewed-by: Marek BehĂșn <kabel@kernel.org> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-lenovo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index 1b8dd85ceb05..668762663f69 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -822,6 +822,7 @@ static int lenovo_register_leds(struct hid_device *hdev)
data->led_mute.name = name_mute;
data->led_mute.brightness_set_blocking = lenovo_led_brightness_set;
+ data->led_mute.max_brightness = 1;
data->led_mute.flags = LED_HW_PLUGGABLE;
data->led_mute.dev = &hdev->dev;
ret = led_classdev_register(&hdev->dev, &data->led_mute);
@@ -830,6 +831,7 @@ static int lenovo_register_leds(struct hid_device *hdev)
data->led_micmute.name = name_micm;
data->led_micmute.brightness_set_blocking = lenovo_led_brightness_set;
+ data->led_micmute.max_brightness = 1;
data->led_micmute.flags = LED_HW_PLUGGABLE;
data->led_micmute.dev = &hdev->dev;
ret = led_classdev_register(&hdev->dev, &data->led_micmute);