backlight: lm3630a: turn off both led strings when display is blank
Subsystems (3)
PATCH v2 1/1 backlight: lm3630a: turn off both led strings when display is blank
From: Maximilian Weigand <[email protected]>
Use backlight_is_blank() to determine if the led strings should be turned off in the update_status() functions of both strings.
---
Changes in v2:
- fix description, replace display_is_black() with backlight_is_black()
- use backlight_get_brightness() instead of accessing the property directly
drivers/video/backlight/lm3630a_bl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/video/backlight/lm3630a_bl.c +6 -2
@@ -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,
base-commit: ac9a78681b921877518763ba0e89202254349d1b --
2.39.2
Quoted 7 lines · Maximilian Weigand
From: Maximilian Weigand <[email protected]>
Use
backlight_is_blank()to determine if the led strings should be turned off in theupdate_status()functions of both strings.Reviewed-by Daniel Thompson <[email protected]>Signed-off-by Maximilian Weigand <[email protected]>
Looks good.
Quoted 6 lines · Maximilian Weigand
From: Maximilian Weigand <[email protected]>
Use
backlight_is_blank()to determine if the led strings should be turned off in theupdate_status()functions of both strings.Reviewed-by Daniel Thompson <[email protected]>
I moved this tag to the correct place and ...
Quoted 9 lines
Signed-off-by Maximilian Weigand <[email protected]>---
Changes in v2:
- fix description, replacedisplay_is_black()withbacklight_is_black()
- usebacklight_get_brightness()instead of accessing the property directlydrivers/video/backlight/lm3630a_bl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
Applied, thanks
Signature · 1 line
Lee Jones [李琼斯]