diff options
author | Maximilian Weigand <mweigand@mweigand.net> | 2023-05-10 10:52:39 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-05-25 13:25:26 +0200 |
commit | ae9c48087f50f2373e62dc2e0fb63178e256f351 (patch) | |
tree | 2bc02e0e55d69299411572111f9b06afabf97a70 | |
parent | dt-bindings: leds: backlight: ktz8866: Add reg property and update example (diff) | |
download | linux-ae9c48087f50f2373e62dc2e0fb63178e256f351.tar.xz linux-ae9c48087f50f2373e62dc2e0fb63178e256f351.zip |
backlight: lm3630a: Turn off both led strings when display is blank
Use backlight_is_blank() to determine if the led strings should be turned
off in the update_status() functions of both strings.
Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://lore.kernel.org/r/20230510085239.1253896-1-mweigand2017@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
-rw-r--r-- | drivers/video/backlight/lm3630a_bl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index d8c42acecb5d..faf92c8d70c1 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -202,7 +202,9 @@ static int lm3630a_bank_a_update_status(struct backlight_device *bl) usleep_range(1000, 2000); /* minimum brightness is 0x04 */ ret = lm3630a_write(pchip, REG_BRT_A, bl->props.brightness); - if (bl->props.brightness < 0x4) + + if (backlight_is_blank(bl) || (backlight_get_brightness(bl) < 0x4)) + /* turn the string off */ ret |= lm3630a_update(pchip, REG_CTRL, LM3630A_LEDA_ENABLE, 0); else ret |= lm3630a_update(pchip, REG_CTRL, @@ -277,7 +279,9 @@ static int lm3630a_bank_b_update_status(struct backlight_device *bl) usleep_range(1000, 2000); /* minimum brightness is 0x04 */ ret = lm3630a_write(pchip, REG_BRT_B, bl->props.brightness); - if (bl->props.brightness < 0x4) + + if (backlight_is_blank(bl) || (backlight_get_brightness(bl) < 0x4)) + /* turn the string off */ ret |= lm3630a_update(pchip, REG_CTRL, LM3630A_LEDB_ENABLE, 0); else ret |= lm3630a_update(pchip, REG_CTRL, |