diff options
author | Matej Groma <matejgroma@gmail.com> | 2016-07-04 06:04:12 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2016-07-06 14:31:12 -0400 |
commit | 696789343b56f3efa26da29eb5b442b673bd83c8 (patch) | |
tree | 213a2f7ab4d7971be9c7333d1000d5e4e42819f8 /drivers/platform/x86 | |
parent | 56a37a72002b1eb01a1de391cf66383652784e78 (diff) |
fujitsu-laptop: Rework brightness of eco led
For the sake of internal consistency, unset maximum brightness of eco
led and make it activatable only on values >= LED_FULL.
Signed-off-by: Matej Groma <matejgroma@gmail.com>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/fujitsu-laptop.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 6ce8e7860013..61f39abf5dc8 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c | |||
@@ -212,7 +212,6 @@ static void eco_led_set(struct led_classdev *cdev, | |||
212 | 212 | ||
213 | static struct led_classdev eco_led = { | 213 | static struct led_classdev eco_led = { |
214 | .name = "fujitsu::eco_led", | 214 | .name = "fujitsu::eco_led", |
215 | .max_brightness = 1, | ||
216 | .brightness_get = eco_led_get, | 215 | .brightness_get = eco_led_get, |
217 | .brightness_set = eco_led_set | 216 | .brightness_set = eco_led_set |
218 | }; | 217 | }; |
@@ -306,7 +305,7 @@ static void eco_led_set(struct led_classdev *cdev, | |||
306 | int curr; | 305 | int curr; |
307 | 306 | ||
308 | curr = call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0); | 307 | curr = call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0); |
309 | if (brightness) | 308 | if (brightness >= LED_FULL) |
310 | call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr | ECO_LED_ON); | 309 | call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr | ECO_LED_ON); |
311 | else | 310 | else |
312 | call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr & ~ECO_LED_ON); | 311 | call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr & ~ECO_LED_ON); |
@@ -352,7 +351,7 @@ static enum led_brightness eco_led_get(struct led_classdev *cdev) | |||
352 | enum led_brightness brightness = LED_OFF; | 351 | enum led_brightness brightness = LED_OFF; |
353 | 352 | ||
354 | if (call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0) & ECO_LED_ON) | 353 | if (call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0) & ECO_LED_ON) |
355 | brightness = cdev->max_brightness; | 354 | brightness = LED_FULL; |
356 | 355 | ||
357 | return brightness; | 356 | return brightness; |
358 | } | 357 | } |