fbdev: omapfb: panel-dsi-cm: Use backlight helper
authorStephen Kitt <steve@sk2.org>
Tue, 7 Jun 2022 19:23:34 +0000 (21:23 +0200)
committerHelge Deller <deller@gmx.de>
Mon, 9 Jan 2023 08:57:51 +0000 (09:57 +0100)
Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-omap@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c

index 4fc4b26..ba94a0a 100644 (file)
@@ -331,13 +331,7 @@ static int dsicm_bl_update_status(struct backlight_device *dev)
        struct panel_drv_data *ddata = dev_get_drvdata(&dev->dev);
        struct omap_dss_device *in = ddata->in;
        int r;
-       int level;
-
-       if (dev->props.fb_blank == FB_BLANK_UNBLANK &&
-                       dev->props.power == FB_BLANK_UNBLANK)
-               level = dev->props.brightness;
-       else
-               level = 0;
+       int level = backlight_get_brightness(dev);
 
        dev_dbg(&ddata->pdev->dev, "update brightness to %d\n", level);