diff options
author | Douglas Anderson <dianders@chromium.org> | 2023-08-04 14:06:04 -0700 |
---|---|---|
committer | Douglas Anderson <dianders@chromium.org> | 2023-09-13 08:36:18 -0700 |
commit | f8c37b88092e12157b2b707f1a83684b0b97b68e (patch) | |
tree | 6d9a3470701604ea0097b42ac445e8966498c44c /drivers/gpu/drm/panel/panel-truly-nt35597.c | |
parent | 8569c31545385195bdb0c021124e68336e91c693 (diff) |
drm/panel: Don't store+check prepared/enabled for simple cases
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.
This pile of panel drivers appears to be simple to handle. Based on
code inspection they seemed to be using the prepared/enabled state
simply for double-checking that nothing else in the kernel called them
inconsistently. Now that the core drm_panel is doing the double
checking (and warning) it should be very clear that these devices
don't need their own double-check.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230804140605.RFC.1.Ia54954fd2f7645c1b86597494902973f57feeb71@changeid
Diffstat (limited to 'drivers/gpu/drm/panel/panel-truly-nt35597.c')
-rw-r--r-- | drivers/gpu/drm/panel/panel-truly-nt35597.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/drivers/gpu/drm/panel/panel-truly-nt35597.c b/drivers/gpu/drm/panel/panel-truly-nt35597.c index 4f4009f9fe25..b73448cf349d 100644 --- a/drivers/gpu/drm/panel/panel-truly-nt35597.c +++ b/drivers/gpu/drm/panel/panel-truly-nt35597.c @@ -64,8 +64,6 @@ struct truly_nt35597 { struct mipi_dsi_device *dsi[2]; const struct nt35597_config *config; - bool prepared; - bool enabled; }; static inline struct truly_nt35597 *panel_to_ctx(struct drm_panel *panel) @@ -313,16 +311,12 @@ static int truly_nt35597_disable(struct drm_panel *panel) struct truly_nt35597 *ctx = panel_to_ctx(panel); int ret; - if (!ctx->enabled) - return 0; - if (ctx->backlight) { ret = backlight_disable(ctx->backlight); if (ret < 0) dev_err(ctx->dev, "backlight disable failed %d\n", ret); } - ctx->enabled = false; return 0; } @@ -331,9 +325,6 @@ static int truly_nt35597_unprepare(struct drm_panel *panel) struct truly_nt35597 *ctx = panel_to_ctx(panel); int ret = 0; - if (!ctx->prepared) - return 0; - ctx->dsi[0]->mode_flags = 0; ctx->dsi[1]->mode_flags = 0; @@ -354,7 +345,6 @@ static int truly_nt35597_unprepare(struct drm_panel *panel) if (ret < 0) dev_err(ctx->dev, "power_off failed ret = %d\n", ret); - ctx->prepared = false; return ret; } @@ -367,9 +357,6 @@ static int truly_nt35597_prepare(struct drm_panel *panel) const struct nt35597_config *config; u32 num_cmds; - if (ctx->prepared) - return 0; - ret = truly_35597_power_on(ctx); if (ret < 0) return ret; @@ -409,8 +396,6 @@ static int truly_nt35597_prepare(struct drm_panel *panel) /* Per DSI spec wait 120ms after sending set_display_on DCS command */ msleep(120); - ctx->prepared = true; - return 0; power_off: @@ -424,17 +409,12 @@ static int truly_nt35597_enable(struct drm_panel *panel) struct truly_nt35597 *ctx = panel_to_ctx(panel); int ret; - if (ctx->enabled) - return 0; - if (ctx->backlight) { ret = backlight_enable(ctx->backlight); if (ret < 0) dev_err(ctx->dev, "backlight enable failed %d\n", ret); } - ctx->enabled = true; - return 0; } |