summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/lv5207lp.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2020-07-19 11:07:41 +0300
committerLee Jones <lee.jones@linaro.org>2020-07-20 12:27:06 +0300
commit51d53e5b06b8e75d02a17bfe678e7be7554a2322 (patch)
tree890ce583f0e0b89cecec269aae786e1b4b7e841b /drivers/video/backlight/lv5207lp.c
parenta00a5feb1e96ff55c24131472db53dc56cc7570b (diff)
downloadlinux-51d53e5b06b8e75d02a17bfe678e7be7554a2322.tar.xz
backlight: Use backlight_get_brightness() throughout
Introduce the backlight_get_brightness() helper in all video/backlight/* drivers. This simplifies the code and align the implementation of the update_status() operation across the different backlight drivers. Some of the drivers gains a little extra functionality by the change as they now respect the fb_blank() ioctl. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/video/backlight/lv5207lp.c')
-rw-r--r--drivers/video/backlight/lv5207lp.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c
index c6ad73a784e2..1842ae9a55f8 100644
--- a/drivers/video/backlight/lv5207lp.c
+++ b/drivers/video/backlight/lv5207lp.c
@@ -46,12 +46,7 @@ static int lv5207lp_write(struct lv5207lp *lv, u8 reg, u8 data)
static int lv5207lp_backlight_update_status(struct backlight_device *backlight)
{
struct lv5207lp *lv = bl_get_data(backlight);
- int brightness = backlight->props.brightness;
-
- if (backlight->props.power != FB_BLANK_UNBLANK ||
- backlight->props.fb_blank != FB_BLANK_UNBLANK ||
- backlight->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
- brightness = 0;
+ int brightness = backlight_get_brightness(backlight);
if (brightness) {
lv5207lp_write(lv, LV5207LP_CTRL1,