drm/panel: sharp-lq101r1sx01: Stop tracking prepared/enabled
As talked about in commit d2aacaf07395 ("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: Linus Walleij <linus.walleij@linaro.org> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20240604172305.v3.17.Ifd6b12b8a4bca7d492e892ea7455e83f5c0ab5a8@changeid Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240604172305.v3.17.Ifd6b12b8a4bca7d492e892ea7455e83f5c0ab5a8@changeid
This commit is contained in:
parent
728290006a
commit
316bb1473c
@ -24,9 +24,6 @@ struct sharp_panel {
|
||||
|
||||
struct regulator *supply;
|
||||
|
||||
bool prepared;
|
||||
bool enabled;
|
||||
|
||||
const struct drm_display_mode *mode;
|
||||
};
|
||||
|
||||
@ -85,26 +82,11 @@ static __maybe_unused int sharp_panel_read(struct sharp_panel *sharp,
|
||||
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)
|
||||
{
|
||||
struct sharp_panel *sharp = to_sharp_panel(panel);
|
||||
int err;
|
||||
|
||||
if (!sharp->prepared)
|
||||
return 0;
|
||||
|
||||
sharp_wait_frames(sharp, 4);
|
||||
|
||||
err = mipi_dsi_dcs_set_display_off(sharp->link1);
|
||||
@ -119,8 +101,6 @@ static int sharp_panel_unprepare(struct drm_panel *panel)
|
||||
|
||||
regulator_disable(sharp->supply);
|
||||
|
||||
sharp->prepared = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -164,9 +144,6 @@ static int sharp_panel_prepare(struct drm_panel *panel)
|
||||
u8 format = MIPI_DCS_PIXEL_FMT_24BIT;
|
||||
int err;
|
||||
|
||||
if (sharp->prepared)
|
||||
return 0;
|
||||
|
||||
err = regulator_enable(sharp->supply);
|
||||
if (err < 0)
|
||||
return err;
|
||||
@ -235,8 +212,6 @@ static int sharp_panel_prepare(struct drm_panel *panel)
|
||||
goto poweroff;
|
||||
}
|
||||
|
||||
sharp->prepared = true;
|
||||
|
||||
/* wait for 6 frames before continuing */
|
||||
sharp_wait_frames(sharp, 6);
|
||||
|
||||
@ -247,18 +222,6 @@ poweroff:
|
||||
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 = {
|
||||
.clock = 278000,
|
||||
.hdisplay = 2560,
|
||||
@ -295,10 +258,8 @@ static int sharp_panel_get_modes(struct drm_panel *panel,
|
||||
}
|
||||
|
||||
static const struct drm_panel_funcs sharp_panel_funcs = {
|
||||
.disable = sharp_panel_disable,
|
||||
.unprepare = sharp_panel_unprepare,
|
||||
.prepare = sharp_panel_prepare,
|
||||
.enable = sharp_panel_enable,
|
||||
.get_modes = sharp_panel_get_modes,
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user