diff options
author | Dylan Van Assche <me@dylanvanassche.be> | 2020-12-29 21:15:12 +0300 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2021-02-03 17:34:37 +0300 |
commit | d86464527681b72941939258ef68904cae6f8136 (patch) | |
tree | ef0b35b97ba7540c6fc0689e7d165872cc6dc39a /drivers/leds/leds-gpio.c | |
parent | 6c3384d8f408548df74d27bfa0c95c47988f1480 (diff) |
leds: gpio: Set max brightness to 1
GPIO LEDs only know 2 states: ON or OFF and do not have PWM capabilities.
However, the max brightness is reported as 255.
This patch sets the max brightness value of a GPIO controlled LED to 1.
Tested on my PinePhone 1.2.
Signed-off-by: Dylan Van Assche <me@dylanvanassche.be>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds/leds-gpio.c')
-rw-r--r-- | drivers/leds/leds-gpio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index 93f5b1b60fde..b5d5e22d2d1e 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -96,7 +96,8 @@ static int create_gpio_led(const struct gpio_led *template, } else { state = (template->default_state == LEDS_GPIO_DEFSTATE_ON); } - led_dat->cdev.brightness = state ? LED_FULL : LED_OFF; + led_dat->cdev.brightness = state; + led_dat->cdev.max_brightness = 1; if (!template->retain_state_suspended) led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME; if (template->panic_indicator) |