Skip to contentSkip to conversation

Correctly inform userspace about max brightness.

PATCH In review Jens Taprogge 1 participant 2 messages Mar 24, 2012 – Apr 18, 2012 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Correctly inform userspace about max brightness.

Since thinkpad_acpi (currently?) only supports switching the leds on or off, we should inform userspace about that. Currently 256 brightness levels are reported by userspace.

Please apply.

---
 drivers/platform/x86/thinkpad_acpi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +2 -0
index a0bc79f..cb549d0 100644
@@ -4827,6 +4827,7 @@ static enum led_brightness light_sysfs_get(struct led_classdev *led_cdev)
 static struct tpacpi_led_classdev tpacpi_led_thinklight = {
 	.led_classdev = {
 		.name		= "tpacpi::thinklight",
+		.max_brightness = 1,
 		.brightness_set	= &light_sysfs_set,
 		.brightness_get	= &light_sysfs_get,
 	}
@@ -5232,6 +5233,7 @@ static int __init tpacpi_init_led(unsigned int led)
 	if (!tpacpi_led_names[led])
 		return 0;
 
+	tpacpi_leds[led].led_classdev.max_brightness = 1;
 	tpacpi_leds[led].led_classdev.brightness_set = &led_sysfs_set;
 	tpacpi_leds[led].led_classdev.blink_set = &led_sysfs_blink_set;
 	if (led_supported == TPACPI_LED_570)
Signature · 1 line
1.7.5.4
#1 lore raw

Hello Henrique,

any comment on this patch?

Best Regards
Jens

Quoted 32 lines · Jens Taprogge

Since thinkpad_acpi (currently?) only supports switching the leds on or off, we should inform userspace about that. Currently 256 brightness levels are reported by userspace.

Please apply.

---
 drivers/platform/x86/thinkpad_acpi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +2 -0
index a0bc79f..cb549d0 100644
@@ -4827,6 +4827,7 @@ static enum led_brightness light_sysfs_get(struct led_classdev *led_cdev)
 static struct tpacpi_led_classdev tpacpi_led_thinklight = {
 	.led_classdev = {
 		.name		= "tpacpi::thinklight",
+		.max_brightness = 1,
 		.brightness_set	= &light_sysfs_set,
 		.brightness_get	= &light_sysfs_get,
 	}
@@ -5232,6 +5233,7 @@ static int __init tpacpi_init_led(unsigned int led)
 	if (!tpacpi_led_names[led])
 		return 0;
 
+	tpacpi_leds[led].led_classdev.max_brightness = 1;
 	tpacpi_leds[led].led_classdev.brightness_set = &led_sysfs_set;
 	tpacpi_leds[led].led_classdev.blink_set = &led_sysfs_blink_set;
 	if (led_supported == TPACPI_LED_570)
Signature · 1 line
1.7.5.4