Skip to content

Commit 6967893

Browse files
Matej Gromadvhart
authored andcommitted
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>
1 parent 56a37a7 commit 6967893

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/platform/x86/fujitsu-laptop.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ static void eco_led_set(struct led_classdev *cdev,
212212

213213
static struct led_classdev eco_led = {
214214
.name = "fujitsu::eco_led",
215-
.max_brightness = 1,
216215
.brightness_get = eco_led_get,
217216
.brightness_set = eco_led_set
218217
};
@@ -306,7 +305,7 @@ static void eco_led_set(struct led_classdev *cdev,
306305
int curr;
307306

308307
curr = call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0);
309-
if (brightness)
308+
if (brightness >= LED_FULL)
310309
call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr | ECO_LED_ON);
311310
else
312311
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)
352351
enum led_brightness brightness = LED_OFF;
353352

354353
if (call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0) & ECO_LED_ON)
355-
brightness = cdev->max_brightness;
354+
brightness = LED_FULL;
356355

357356
return brightness;
358357
}

0 commit comments

Comments
 (0)