[PATCH v2 19/24] drm/tilcdc: Backlight update

Sam Ravnborg sam at ravnborg.org
Sun Aug 23 10:45:27 UTC 2020


Introduce backlight_{enable,disable} to enable/disable backlight.
Dropped NULL check as backlight_{enable,disable} handles this.

Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
Cc: Rob Clark <robdclark at gmail.com>
Cc: Ezequiel Garcia <ezequiel at vanguardiasur.com.ar>
Cc: Jyri Sarha <jsarha at ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen at ti.com>
---
 drivers/gpu/drm/tilcdc/tilcdc_panel.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_panel.c b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
index 12823d60c4e8..b6dd0a21fd0f 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_panel.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_panel.c
@@ -47,11 +47,10 @@ static void panel_encoder_dpms(struct drm_encoder *encoder, int mode)
 	struct backlight_device *backlight = panel_encoder->mod->backlight;
 	struct gpio_desc *gpio = panel_encoder->mod->enable_gpio;
 
-	if (backlight) {
-		backlight->props.power = mode == DRM_MODE_DPMS_ON ?
-					 FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
-		backlight_update_status(backlight);
-	}
+	if (mode == DRM_MODE_DPMS_ON)
+		backlight_enable(backlight);
+	else
+		backlight_disable(backlight);
 
 	if (gpio)
 		gpiod_set_value_cansleep(gpio,
-- 
2.25.1



More information about the dri-devel mailing list