diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2020-07-19 10:07:41 +0200 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2020-07-20 11:27:06 +0200 |
commit | 51d53e5b06b8e75d02a17bfe678e7be7554a2322 (patch) | |
tree | 890ce583f0e0b89cecec269aae786e1b4b7e841b /drivers/video/backlight/qcom-wled.c | |
parent | backlight: jornada720_bl: Introduce backlight_is_blank() (diff) | |
download | linux-51d53e5b06b8e75d02a17bfe678e7be7554a2322.tar.xz linux-51d53e5b06b8e75d02a17bfe678e7be7554a2322.zip |
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/qcom-wled.c')
-rw-r--r-- | drivers/video/backlight/qcom-wled.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c index c25c31199952..3bc7800eb0a9 100644 --- a/drivers/video/backlight/qcom-wled.c +++ b/drivers/video/backlight/qcom-wled.c @@ -433,14 +433,9 @@ static int wled5_ovp_delay(struct wled *wled) static int wled_update_status(struct backlight_device *bl) { struct wled *wled = bl_get_data(bl); - u16 brightness = bl->props.brightness; + u16 brightness = backlight_get_brightness(bl); int rc = 0; - if (bl->props.power != FB_BLANK_UNBLANK || - bl->props.fb_blank != FB_BLANK_UNBLANK || - bl->props.state & BL_CORE_FBBLANK) - brightness = 0; - mutex_lock(&wled->lock); if (brightness) { rc = wled->wled_set_brightness(wled, brightness); |