Skip to contentSkip to conversation

platform/x86: thinkpad_acpi: Fix thinklight LED brightness returning 255

PATCH In review Hans de Goede 1 participant 2 messages Jan 27, 2023 – Jan 30, 2023 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: thinkpad_acpi: Fix thinklight LED brightness returning 255

Reading the thinklight LED brightnes while the LED is on returns 255 (LED_FULL) but we advertise a max_brightness of 1, so this should be 1 (LED_ON).

Fixes db5e2a4ca0a7 ("platform/x86: thinkpad_acpi: Fix max_brightness of thinklight")
---
 drivers/platform/x86/thinkpad_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/thinkpad_acpi.c +1 -1
index 02860c32625e..32c10457399e 100644
@@ -5563,7 +5563,7 @@ static int light_sysfs_set(struct led_classdev *led_cdev,
 
 static enum led_brightness light_sysfs_get(struct led_classdev *led_cdev)
 {
-	return (light_get_status() == 1) ? LED_FULL : LED_OFF;
+	return (light_get_status() == 1) ? LED_ON : LED_OFF;
 }
 
 static struct tpacpi_led_classdev tpacpi_led_thinklight = {
Signature · 1 line
2.39.0
#1 lore raw

Hi,

Quoted 6 lines · Hans de Goede

Reading the thinklight LED brightnes while the LED is on returns 255 (LED_FULL) but we advertise a max_brightness of 1, so this should be 1 (LED_ON).

Fixes db5e2a4ca0a7 ("platform/x86: thinkpad_acpi: Fix max_brightness of thinklight")

I've applied this to the pdx86 fixes branch now:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes

and this will be included in my next fixes pull-req to Linus.

Regards,

Hans

Quoted 17 lines
---
 drivers/platform/x86/thinkpad_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/thinkpad_acpi.c +1 -1
index 02860c32625e..32c10457399e 100644
@@ -5563,7 +5563,7 @@ static int light_sysfs_set(struct led_classdev *led_cdev,
 
 static enum led_brightness light_sysfs_get(struct led_classdev *led_cdev)
 {
-	return (light_get_status() == 1) ? LED_FULL : LED_OFF;
+	return (light_get_status() == 1) ? LED_ON : LED_OFF;
 }
 
 static struct tpacpi_led_classdev tpacpi_led_thinklight = {