fbdev: atmel_lcdfb: Rework backlight status updates
authorStephen Kitt <steve@sk2.org>
Mon, 9 Jan 2023 20:02:38 +0000 (21:02 +0100)
committerHelge Deller <deller@gmx.de>
Mon, 9 Jan 2023 20:33:14 +0000 (21:33 +0100)
commitee4202db16e59e792f570092ad1f440f2d31ea03
treea1ddaf20353db03ef90d3791de0d1b83ed67b53a
parent8791906e667e44eddd62b341196f93911da8a578
fbdev: atmel_lcdfb: Rework backlight status updates

Instead of checking the state of various backlight_properties fields
against the memorised state in atmel_lcdfb_info.bl_power,
atmel_bl_update_status() should retrieve the desired state using
backlight_get_brightness (which takes into account the power state,
blanking etc.). This means the explicit checks using props.fb_blank
and props.power can be dropped.

The backlight framework ensures that backlight is never negative, so
the test before reading the brightness from the hardware always ends
up false and the whole block can be removed. The framework retrieves
the brightness from the hardware through atmel_bl_get_brightness()
when necessary.

As a result, bl_power in struct atmel_lcdfb_info is no longer
necessary, so remove that while we're at it. Since we only ever care
about reading the current state in backlight_properties, drop the
updates at the end of the function.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/atmel_lcdfb.c