aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Zimmermann <[email protected]>2024-03-19 10:37:20 +0100
committerLee Jones <[email protected]>2024-03-28 10:12:48 +0000
commit899dbfb28b7941c381431a05c4a9ada42daf9507 (patch)
tree6be07dcdb698fb49ed76a44fcdaef9e96da96dc1
parent4cece764965020c22cff7665b18a012006359095 (diff)
auxdisplay: ht16k33: Replace use of fb_blank with backlight helper
Replace the use of struct backlight_properties.fb_blank with a call to backlight_get_brightness(). The helper implements similar logic as the driver's function. It also accounts for BL_CORE_SUSPENDED for drivers that set BL_CORE_SUSPENDRESUME. Ht16k33 doesn't use this, so there's no change in behaviour here. Signed-off-by: Thomas Zimmermann <[email protected]> Cc: Robin van der Gracht <[email protected]> Cc: Miguel Ojeda <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Miguel Ojeda <[email protected]> Reviewed-by: Robin van der Gracht <[email protected]> Reviewed-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
-rw-r--r--drivers/auxdisplay/ht16k33.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index 96acfb2b58cd..70a7b88709ff 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -284,14 +284,9 @@ static int ht16k33_initialize(struct ht16k33_priv *priv)
static int ht16k33_bl_update_status(struct backlight_device *bl)
{
- int brightness = bl->props.brightness;
+ const int brightness = backlight_get_brightness(bl);
struct ht16k33_priv *priv = bl_get_data(bl);
- if (bl->props.power != FB_BLANK_UNBLANK ||
- bl->props.fb_blank != FB_BLANK_UNBLANK ||
- bl->props.state & BL_CORE_FBBLANK)
- brightness = 0;
-
return ht16k33_brightness_set(priv, brightness);
}