Commit d2895af5 authored by Sam Ravnborg's avatar Sam Ravnborg

drm/panel: ronbo-rb070d30: use drm_panel backlight support

Use the backlight support in drm_panel to simplify the driver
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20191207140353.23967-19-sam@ravnborg.org
parent 83d4ed86
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* This file based on panel-ilitek-ili9881c.c * This file based on panel-ilitek-ili9881c.c
*/ */
#include <linux/backlight.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/err.h> #include <linux/err.h>
...@@ -29,7 +28,6 @@ ...@@ -29,7 +28,6 @@
struct rb070d30_panel { struct rb070d30_panel {
struct drm_panel panel; struct drm_panel panel;
struct mipi_dsi_device *dsi; struct mipi_dsi_device *dsi;
struct backlight_device *backlight;
struct regulator *supply; struct regulator *supply;
struct { struct {
...@@ -84,22 +82,13 @@ static int rb070d30_panel_enable(struct drm_panel *panel) ...@@ -84,22 +82,13 @@ static int rb070d30_panel_enable(struct drm_panel *panel)
if (ret) if (ret)
return ret; return ret;
ret = backlight_enable(ctx->backlight);
if (ret)
goto out;
return 0; return 0;
out:
mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
return ret;
} }
static int rb070d30_panel_disable(struct drm_panel *panel) static int rb070d30_panel_disable(struct drm_panel *panel)
{ {
struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel); struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
backlight_disable(ctx->backlight);
return mipi_dsi_dcs_enter_sleep_mode(ctx->dsi); return mipi_dsi_dcs_enter_sleep_mode(ctx->dsi);
} }
...@@ -208,11 +197,9 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi) ...@@ -208,11 +197,9 @@ static int rb070d30_panel_dsi_probe(struct mipi_dsi_device *dsi)
return PTR_ERR(ctx->gpios.shlr); return PTR_ERR(ctx->gpios.shlr);
} }
ctx->backlight = devm_of_find_backlight(&dsi->dev); ret = drm_panel_of_backlight(&ctx->panel);
if (IS_ERR(ctx->backlight)) { if (ret)
DRM_DEV_ERROR(&dsi->dev, "Couldn't get our backlight\n"); return ret;
return PTR_ERR(ctx->backlight);
}
ret = drm_panel_add(&ctx->panel); ret = drm_panel_add(&ctx->panel);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment