Commit 157c1381 authored by Douglas Anderson's avatar Douglas Anderson

drm/panel: kingdisplay-kd097d04: 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: Brian Norris <briannorris@chromium.org>
Cc: Chris Zhong <zyw@rock-chips.com>
Cc: Nickey Yang <nickey.yang@rock-chips.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
Reviewed-by: default avatarHeiko Stuebner <heiko@sntech.de>
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240503143327.RFT.v2.12.I711d07c4f4738df199697fd534c452cdfa46a21f@changeid
parent eeb133ff
...@@ -23,9 +23,6 @@ struct kingdisplay_panel { ...@@ -23,9 +23,6 @@ struct kingdisplay_panel {
struct regulator *supply; struct regulator *supply;
struct gpio_desc *enable_gpio; struct gpio_desc *enable_gpio;
bool prepared;
bool enabled;
}; };
struct kingdisplay_panel_cmd { struct kingdisplay_panel_cmd {
...@@ -185,15 +182,10 @@ static int kingdisplay_panel_disable(struct drm_panel *panel) ...@@ -185,15 +182,10 @@ static int kingdisplay_panel_disable(struct drm_panel *panel)
struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel); struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel);
int err; int err;
if (!kingdisplay->enabled)
return 0;
err = mipi_dsi_dcs_set_display_off(kingdisplay->link); err = mipi_dsi_dcs_set_display_off(kingdisplay->link);
if (err < 0) if (err < 0)
dev_err(panel->dev, "failed to set display off: %d\n", err); dev_err(panel->dev, "failed to set display off: %d\n", err);
kingdisplay->enabled = false;
return 0; return 0;
} }
...@@ -202,9 +194,6 @@ static int kingdisplay_panel_unprepare(struct drm_panel *panel) ...@@ -202,9 +194,6 @@ static int kingdisplay_panel_unprepare(struct drm_panel *panel)
struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel); struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel);
int err; int err;
if (!kingdisplay->prepared)
return 0;
err = mipi_dsi_dcs_enter_sleep_mode(kingdisplay->link); err = mipi_dsi_dcs_enter_sleep_mode(kingdisplay->link);
if (err < 0) { if (err < 0) {
dev_err(panel->dev, "failed to enter sleep mode: %d\n", err); dev_err(panel->dev, "failed to enter sleep mode: %d\n", err);
...@@ -220,8 +209,6 @@ static int kingdisplay_panel_unprepare(struct drm_panel *panel) ...@@ -220,8 +209,6 @@ static int kingdisplay_panel_unprepare(struct drm_panel *panel)
if (err < 0) if (err < 0)
return err; return err;
kingdisplay->prepared = false;
return 0; return 0;
} }
...@@ -231,9 +218,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel) ...@@ -231,9 +218,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel)
int err, regulator_err; int err, regulator_err;
unsigned int i; unsigned int i;
if (kingdisplay->prepared)
return 0;
gpiod_set_value_cansleep(kingdisplay->enable_gpio, 0); gpiod_set_value_cansleep(kingdisplay->enable_gpio, 0);
err = regulator_enable(kingdisplay->supply); err = regulator_enable(kingdisplay->supply);
...@@ -275,8 +259,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel) ...@@ -275,8 +259,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel)
/* T7: 10ms */ /* T7: 10ms */
usleep_range(10000, 11000); usleep_range(10000, 11000);
kingdisplay->prepared = true;
return 0; return 0;
poweroff: poweroff:
...@@ -289,18 +271,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel) ...@@ -289,18 +271,6 @@ static int kingdisplay_panel_prepare(struct drm_panel *panel)
return err; return err;
} }
static int kingdisplay_panel_enable(struct drm_panel *panel)
{
struct kingdisplay_panel *kingdisplay = to_kingdisplay_panel(panel);
if (kingdisplay->enabled)
return 0;
kingdisplay->enabled = true;
return 0;
}
static const struct drm_display_mode default_mode = { static const struct drm_display_mode default_mode = {
.clock = 229000, .clock = 229000,
.hdisplay = 1536, .hdisplay = 1536,
...@@ -341,7 +311,6 @@ static const struct drm_panel_funcs kingdisplay_panel_funcs = { ...@@ -341,7 +311,6 @@ static const struct drm_panel_funcs kingdisplay_panel_funcs = {
.disable = kingdisplay_panel_disable, .disable = kingdisplay_panel_disable,
.unprepare = kingdisplay_panel_unprepare, .unprepare = kingdisplay_panel_unprepare,
.prepare = kingdisplay_panel_prepare, .prepare = kingdisplay_panel_prepare,
.enable = kingdisplay_panel_enable,
.get_modes = kingdisplay_panel_get_modes, .get_modes = kingdisplay_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