Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Maximilian Weigand and committed by
Lee Jones
ae9c4808 77036e09

+6 -2
+6 -2
drivers/video/backlight/lm3630a_bl.c
··· 202 202 usleep_range(1000, 2000); 203 203 /* minimum brightness is 0x04 */ 204 204 ret = lm3630a_write(pchip, REG_BRT_A, bl->props.brightness); 205 - if (bl->props.brightness < 0x4) 205 + 206 + if (backlight_is_blank(bl) || (backlight_get_brightness(bl) < 0x4)) 207 + /* turn the string off */ 206 208 ret |= lm3630a_update(pchip, REG_CTRL, LM3630A_LEDA_ENABLE, 0); 207 209 else 208 210 ret |= lm3630a_update(pchip, REG_CTRL, ··· 279 277 usleep_range(1000, 2000); 280 278 /* minimum brightness is 0x04 */ 281 279 ret = lm3630a_write(pchip, REG_BRT_B, bl->props.brightness); 282 - if (bl->props.brightness < 0x4) 280 + 281 + if (backlight_is_blank(bl) || (backlight_get_brightness(bl) < 0x4)) 282 + /* turn the string off */ 283 283 ret |= lm3630a_update(pchip, REG_CTRL, LM3630A_LEDB_ENABLE, 0); 284 284 else 285 285 ret |= lm3630a_update(pchip, REG_CTRL,