diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2020-07-19 11:07:41 +0300 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2020-07-20 12:27:06 +0300 |
commit | 51d53e5b06b8e75d02a17bfe678e7be7554a2322 (patch) | |
tree | 890ce583f0e0b89cecec269aae786e1b4b7e841b /drivers/video/backlight/adp5520_bl.c | |
parent | a00a5feb1e96ff55c24131472db53dc56cc7570b (diff) | |
download | linux-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/adp5520_bl.c')
-rw-r--r-- | drivers/video/backlight/adp5520_bl.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index 0f63f76723a5..686988c3df3a 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c @@ -65,15 +65,7 @@ static int adp5520_bl_set(struct backlight_device *bl, int brightness) static int adp5520_bl_update_status(struct backlight_device *bl) { - int brightness = bl->props.brightness; - - if (bl->props.power != FB_BLANK_UNBLANK) - brightness = 0; - - if (bl->props.fb_blank != FB_BLANK_UNBLANK) - brightness = 0; - - return adp5520_bl_set(bl, brightness); + return adp5520_bl_set(bl, backlight_get_brightness(bl)); } static int adp5520_bl_get_brightness(struct backlight_device *bl) |