Commit 8744eeec authored by Hans de Goede's avatar Hans de Goede Committed by Jiri Kosina

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: default avatarMarek Behún <kabel@kernel.org>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 033c9786
...@@ -822,6 +822,7 @@ static int lenovo_register_leds(struct hid_device *hdev) ...@@ -822,6 +822,7 @@ static int lenovo_register_leds(struct hid_device *hdev)
data->led_mute.name = name_mute; data->led_mute.name = name_mute;
data->led_mute.brightness_set_blocking = lenovo_led_brightness_set; 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.flags = LED_HW_PLUGGABLE;
data->led_mute.dev = &hdev->dev; data->led_mute.dev = &hdev->dev;
ret = led_classdev_register(&hdev->dev, &data->led_mute); ret = led_classdev_register(&hdev->dev, &data->led_mute);
...@@ -830,6 +831,7 @@ static int lenovo_register_leds(struct hid_device *hdev) ...@@ -830,6 +831,7 @@ static int lenovo_register_leds(struct hid_device *hdev)
data->led_micmute.name = name_micm; data->led_micmute.name = name_micm;
data->led_micmute.brightness_set_blocking = lenovo_led_brightness_set; 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.flags = LED_HW_PLUGGABLE;
data->led_micmute.dev = &hdev->dev; data->led_micmute.dev = &hdev->dev;
ret = led_classdev_register(&hdev->dev, &data->led_micmute); ret = led_classdev_register(&hdev->dev, &data->led_micmute);
......
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