Skip to content

Commit db5e2a4

Browse files
committed
platform/x86: thinkpad_acpi: Fix max_brightness of thinklight
Thinklight has only two values, on/off so it's reasonable for max_brightness to be 0 and 1 as if you write anything between 0 and 255 it will be 255 anyway so there's no point for it to be 255. This may look like it is a userspace API change, but writes with a value larget then the new max_brightness will still be accepted, these will be silently clamped to the new max_brightness by led_set_brightness_nosleep(). So no userspace API problems are expected. Reported-by: Michał Szczepaniak <[email protected]> Link: https://lore.kernel.org/platform-driver-x86/[email protected]/ Signed-off-by: Hans de Goede <[email protected]>
1 parent e57d58e commit db5e2a4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5572,6 +5572,7 @@ static enum led_brightness light_sysfs_get(struct led_classdev *led_cdev)
55725572
static struct tpacpi_led_classdev tpacpi_led_thinklight = {
55735573
.led_classdev = {
55745574
.name = "tpacpi::thinklight",
5575+
.max_brightness = 1,
55755576
.brightness_set_blocking = &light_sysfs_set,
55765577
.brightness_get = &light_sysfs_get,
55775578
}

0 commit comments

Comments
 (0)