summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorMatej Groma <matejgroma@gmail.com>2016-07-04 13:04:12 +0300
committerDarren Hart <dvhart@linux.intel.com>2016-07-06 21:31:12 +0300
commit696789343b56f3efa26da29eb5b442b673bd83c8 (patch)
tree213a2f7ab4d7971be9c7333d1000d5e4e42819f8 /drivers/platform
parent56a37a72002b1eb01a1de391cf66383652784e78 (diff)
downloadlinux-696789343b56f3efa26da29eb5b442b673bd83c8.tar.xz
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')
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c5
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,
static struct led_classdev eco_led = {
.name = "fujitsu::eco_led",
- .max_brightness = 1,
.brightness_get = eco_led_get,
.brightness_set = eco_led_set
};
@@ -306,7 +305,7 @@ static void eco_led_set(struct led_classdev *cdev,
int curr;
curr = call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0);
- if (brightness)
+ if (brightness >= LED_FULL)
call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr | ECO_LED_ON);
else
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)
enum led_brightness brightness = LED_OFF;
if (call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0) & ECO_LED_ON)
- brightness = cdev->max_brightness;
+ brightness = LED_FULL;
return brightness;
}