Commit 2a1c99d7 authored by Douglas Anderson's avatar Douglas Anderson

drm/panel: simple: 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.
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
Acked-by: default avatarSui Jingfeng <sui.jingfeng@linux.dev>
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240503143327.RFT.v2.26.I865be97dd393d6ae3c3a3cd1358c95fdbca0fe83@changeid
parent 49869668
...@@ -138,9 +138,6 @@ struct panel_desc { ...@@ -138,9 +138,6 @@ struct panel_desc {
struct panel_simple { struct panel_simple {
struct drm_panel base; struct drm_panel base;
bool enabled;
bool prepared;
ktime_t unprepared_time; ktime_t unprepared_time;
...@@ -290,14 +287,9 @@ static int panel_simple_disable(struct drm_panel *panel) ...@@ -290,14 +287,9 @@ static int panel_simple_disable(struct drm_panel *panel)
{ {
struct panel_simple *p = to_panel_simple(panel); struct panel_simple *p = to_panel_simple(panel);
if (!p->enabled)
return 0;
if (p->desc->delay.disable) if (p->desc->delay.disable)
msleep(p->desc->delay.disable); msleep(p->desc->delay.disable);
p->enabled = false;
return 0; return 0;
} }
...@@ -317,18 +309,12 @@ static int panel_simple_suspend(struct device *dev) ...@@ -317,18 +309,12 @@ static int panel_simple_suspend(struct device *dev)
static int panel_simple_unprepare(struct drm_panel *panel) static int panel_simple_unprepare(struct drm_panel *panel)
{ {
struct panel_simple *p = to_panel_simple(panel);
int ret; int ret;
/* Unpreparing when already unprepared is a no-op */
if (!p->prepared)
return 0;
pm_runtime_mark_last_busy(panel->dev); pm_runtime_mark_last_busy(panel->dev);
ret = pm_runtime_put_autosuspend(panel->dev); ret = pm_runtime_put_autosuspend(panel->dev);
if (ret < 0) if (ret < 0)
return ret; return ret;
p->prepared = false;
return 0; return 0;
} }
...@@ -356,21 +342,14 @@ static int panel_simple_resume(struct device *dev) ...@@ -356,21 +342,14 @@ static int panel_simple_resume(struct device *dev)
static int panel_simple_prepare(struct drm_panel *panel) static int panel_simple_prepare(struct drm_panel *panel)
{ {
struct panel_simple *p = to_panel_simple(panel);
int ret; int ret;
/* Preparing when already prepared is a no-op */
if (p->prepared)
return 0;
ret = pm_runtime_get_sync(panel->dev); ret = pm_runtime_get_sync(panel->dev);
if (ret < 0) { if (ret < 0) {
pm_runtime_put_autosuspend(panel->dev); pm_runtime_put_autosuspend(panel->dev);
return ret; return ret;
} }
p->prepared = true;
return 0; return 0;
} }
...@@ -378,14 +357,9 @@ static int panel_simple_enable(struct drm_panel *panel) ...@@ -378,14 +357,9 @@ static int panel_simple_enable(struct drm_panel *panel)
{ {
struct panel_simple *p = to_panel_simple(panel); struct panel_simple *p = to_panel_simple(panel);
if (p->enabled)
return 0;
if (p->desc->delay.enable) if (p->desc->delay.enable)
msleep(p->desc->delay.enable); msleep(p->desc->delay.enable);
p->enabled = true;
return 0; return 0;
} }
...@@ -609,7 +583,6 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) ...@@ -609,7 +583,6 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
if (!panel) if (!panel)
return -ENOMEM; return -ENOMEM;
panel->enabled = false;
panel->desc = desc; panel->desc = desc;
panel->supply = devm_regulator_get(dev, "power"); panel->supply = devm_regulator_get(dev, "power");
......
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