backlight: backlight: Introduce backlight_get_brightness()
authorSam Ravnborg <sam@ravnborg.org>
Sun, 19 Jul 2020 08:07:36 +0000 (10:07 +0200)
committerLee Jones <lee.jones@linaro.org>
Mon, 20 Jul 2020 09:27:02 +0000 (10:27 +0100)
commit2144d00ed0db28c764513080f95e4c49ea9133b0
tree5168f25f5c6013e7bf5941b612a9a815a1bcb92a
parent5ab4246cfc6f62cd0eb4c95a029e6fa7f29b3984
backlight: backlight: Introduce backlight_get_brightness()

Based on an idea from Emil Velikov, add a helper that checks
backlight_is_blank() and return 0 as brightness if display is blank or
the property value if not.

This allows us to simplify the update_status() implementation
in most of the backlight drivers.

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>
include/linux/backlight.h