Commit 3004d2e9 authored by Douglas Anderson's avatar Douglas Anderson

drm/panel: sitronix-st7703: Stop tracking prepared

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.

One thing to note for st7703 is that it has a special "allpixelson"
debugfs file. When this file is written the driver hacks a
disable/unprepare and then a prepare/enable to try to reset the
panel. Potentially that might have been relying on the old booleans we
removed. It'll still "work" because of the checks in the core but it
deserves a comment. This debugfs file didn't appear to be particularly
safe to use even before this patch since it would cause a
disabled/unprepared panel to become prepared/enabled.

Cc: Guido Günther <agx@sigxcpu.org>
Cc: Ondřej Jirman <megi@xff.cz>
Cc: Chris Morgan <macromorgan@hotmail.com>
Cc: Frank Oltmanns <frank@oltmanns.dev>
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>
Link: https://patchwork.freedesktop.org/patch/msgid/20240503143327.RFT.v2.42.Ifc436b262d72f1a33ddef10adfd7578d4acb60d8@changeid
parent ac9e1786
...@@ -58,7 +58,6 @@ struct st7703 { ...@@ -58,7 +58,6 @@ struct st7703 {
struct gpio_desc *reset_gpio; struct gpio_desc *reset_gpio;
struct regulator *vcc; struct regulator *vcc;
struct regulator *iovcc; struct regulator *iovcc;
bool prepared;
struct dentry *debugfs; struct dentry *debugfs;
const struct st7703_panel_desc *desc; const struct st7703_panel_desc *desc;
...@@ -752,13 +751,9 @@ static int st7703_unprepare(struct drm_panel *panel) ...@@ -752,13 +751,9 @@ static int st7703_unprepare(struct drm_panel *panel)
{ {
struct st7703 *ctx = panel_to_st7703(panel); struct st7703 *ctx = panel_to_st7703(panel);
if (!ctx->prepared)
return 0;
gpiod_set_value_cansleep(ctx->reset_gpio, 1); gpiod_set_value_cansleep(ctx->reset_gpio, 1);
regulator_disable(ctx->iovcc); regulator_disable(ctx->iovcc);
regulator_disable(ctx->vcc); regulator_disable(ctx->vcc);
ctx->prepared = false;
return 0; return 0;
} }
...@@ -768,9 +763,6 @@ static int st7703_prepare(struct drm_panel *panel) ...@@ -768,9 +763,6 @@ static int st7703_prepare(struct drm_panel *panel)
struct st7703 *ctx = panel_to_st7703(panel); struct st7703 *ctx = panel_to_st7703(panel);
int ret; int ret;
if (ctx->prepared)
return 0;
dev_dbg(ctx->dev, "Resetting the panel\n"); dev_dbg(ctx->dev, "Resetting the panel\n");
gpiod_set_value_cansleep(ctx->reset_gpio, 1); gpiod_set_value_cansleep(ctx->reset_gpio, 1);
...@@ -793,8 +785,6 @@ static int st7703_prepare(struct drm_panel *panel) ...@@ -793,8 +785,6 @@ static int st7703_prepare(struct drm_panel *panel)
gpiod_set_value_cansleep(ctx->reset_gpio, 0); gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(15000, 20000); usleep_range(15000, 20000);
ctx->prepared = true;
return 0; return 0;
} }
...@@ -854,7 +844,13 @@ static int allpixelson_set(void *data, u64 val) ...@@ -854,7 +844,13 @@ static int allpixelson_set(void *data, u64 val)
dev_dbg(ctx->dev, "Setting all pixels on\n"); dev_dbg(ctx->dev, "Setting all pixels on\n");
mipi_dsi_generic_write_seq(dsi, ST7703_CMD_ALL_PIXEL_ON); mipi_dsi_generic_write_seq(dsi, ST7703_CMD_ALL_PIXEL_ON);
msleep(val * 1000); msleep(val * 1000);
/* Reset the panel to get video back */
/*
* Reset the panel to get video back. NOTE: This isn't a
* particularly safe thing to do in general because it assumes
* that the screen was on to begin with, but this is just a
* debugfs file so it's not a huge deal.
*/
drm_panel_disable(&ctx->panel); drm_panel_disable(&ctx->panel);
drm_panel_unprepare(&ctx->panel); drm_panel_unprepare(&ctx->panel);
drm_panel_prepare(&ctx->panel); drm_panel_prepare(&ctx->panel);
......
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