Commit 316bb147 authored by Douglas Anderson's avatar Douglas Anderson Committed by Neil Armstrong

drm/panel: sharp-lq101r1sx01: Stop tracking prepared/enabled

As talked about in commit d2aacaf0 ("drm/panel: Check for already
prepared/enabled in drm_panel"), we want to remove needless code from
panel drivers that was storing and double-checking the
prepared/enabled state. Even if someone was relying on the
double-check before, that double-check is now in the core and not
needed in individual drivers.

Cc: Thierry Reding <treding@nvidia.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240604172305.v3.17.Ifd6b12b8a4bca7d492e892ea7455e83f5c0ab5a8@changeidSigned-off-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240604172305.v3.17.Ifd6b12b8a4bca7d492e892ea7455e83f5c0ab5a8@changeid
parent 72829000
...@@ -24,9 +24,6 @@ struct sharp_panel { ...@@ -24,9 +24,6 @@ struct sharp_panel {
struct regulator *supply; struct regulator *supply;
bool prepared;
bool enabled;
const struct drm_display_mode *mode; const struct drm_display_mode *mode;
}; };
...@@ -85,26 +82,11 @@ static __maybe_unused int sharp_panel_read(struct sharp_panel *sharp, ...@@ -85,26 +82,11 @@ static __maybe_unused int sharp_panel_read(struct sharp_panel *sharp,
return err; return err;
} }
static int sharp_panel_disable(struct drm_panel *panel)
{
struct sharp_panel *sharp = to_sharp_panel(panel);
if (!sharp->enabled)
return 0;
sharp->enabled = false;
return 0;
}
static int sharp_panel_unprepare(struct drm_panel *panel) static int sharp_panel_unprepare(struct drm_panel *panel)
{ {
struct sharp_panel *sharp = to_sharp_panel(panel); struct sharp_panel *sharp = to_sharp_panel(panel);
int err; int err;
if (!sharp->prepared)
return 0;
sharp_wait_frames(sharp, 4); sharp_wait_frames(sharp, 4);
err = mipi_dsi_dcs_set_display_off(sharp->link1); err = mipi_dsi_dcs_set_display_off(sharp->link1);
...@@ -119,8 +101,6 @@ static int sharp_panel_unprepare(struct drm_panel *panel) ...@@ -119,8 +101,6 @@ static int sharp_panel_unprepare(struct drm_panel *panel)
regulator_disable(sharp->supply); regulator_disable(sharp->supply);
sharp->prepared = false;
return 0; return 0;
} }
...@@ -164,9 +144,6 @@ static int sharp_panel_prepare(struct drm_panel *panel) ...@@ -164,9 +144,6 @@ static int sharp_panel_prepare(struct drm_panel *panel)
u8 format = MIPI_DCS_PIXEL_FMT_24BIT; u8 format = MIPI_DCS_PIXEL_FMT_24BIT;
int err; int err;
if (sharp->prepared)
return 0;
err = regulator_enable(sharp->supply); err = regulator_enable(sharp->supply);
if (err < 0) if (err < 0)
return err; return err;
...@@ -235,8 +212,6 @@ static int sharp_panel_prepare(struct drm_panel *panel) ...@@ -235,8 +212,6 @@ static int sharp_panel_prepare(struct drm_panel *panel)
goto poweroff; goto poweroff;
} }
sharp->prepared = true;
/* wait for 6 frames before continuing */ /* wait for 6 frames before continuing */
sharp_wait_frames(sharp, 6); sharp_wait_frames(sharp, 6);
...@@ -247,18 +222,6 @@ static int sharp_panel_prepare(struct drm_panel *panel) ...@@ -247,18 +222,6 @@ static int sharp_panel_prepare(struct drm_panel *panel)
return err; return err;
} }
static int sharp_panel_enable(struct drm_panel *panel)
{
struct sharp_panel *sharp = to_sharp_panel(panel);
if (sharp->enabled)
return 0;
sharp->enabled = true;
return 0;
}
static const struct drm_display_mode default_mode = { static const struct drm_display_mode default_mode = {
.clock = 278000, .clock = 278000,
.hdisplay = 2560, .hdisplay = 2560,
...@@ -295,10 +258,8 @@ static int sharp_panel_get_modes(struct drm_panel *panel, ...@@ -295,10 +258,8 @@ static int sharp_panel_get_modes(struct drm_panel *panel,
} }
static const struct drm_panel_funcs sharp_panel_funcs = { static const struct drm_panel_funcs sharp_panel_funcs = {
.disable = sharp_panel_disable,
.unprepare = sharp_panel_unprepare, .unprepare = sharp_panel_unprepare,
.prepare = sharp_panel_prepare, .prepare = sharp_panel_prepare,
.enable = sharp_panel_enable,
.get_modes = sharp_panel_get_modes, .get_modes = sharp_panel_get_modes,
}; };
......
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