Elida KD35T133 Panel Improvements
Subsystems (3)
v2 cover Elida KD35T133 Panel Improvements
From: Chris Morgan <[email protected]>
Fix a few bugs and clean up no longer needed code on the Elida KD35T133 DSI panel, as used in devices such as the Odroid Go Advance and the Anbernic RG351M.
Changes since V1:
- Split removal of shutdown logic into a new patch independent of dropping of prepared tracking.
- Added fixes to patch holding panel in reset after unprepare.
Chris Morgan (5):
drm/panel-elida-kd35t133: trival: update panel size from 5.5 to 3.5 drm/panel-elida-kd35t133: hold panel in reset for unprepare drm/panel-elida-kd35t133: drop
drm_connector_set_orientation_from_panel
drm/panel-elida-kd35t133: Drop shutdown logic drm/panel-elida-kd35t133: Drop prepare/unprepare logic
drivers/gpu/drm/panel/panel-elida-kd35t133.c | 37 ++------------------ 1 file changed, 3 insertions(+), 34 deletions(-)
Signature · 1 line
2.34.1
PATCH v2 1/5 drm/panel-elida-kd35t133: trival: update panel size from 5.5 to 3.5
From: Chris Morgan <[email protected]>
The comments at the top of the driver state the panel size incorrectly as 5.5" instead of 3.5".
--- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-elida-kd35t133.c +1 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* -* Elida kd35t133 5.5" MIPI-DSI panel driver +* Elida kd35t133 3.5" MIPI-DSI panel driver * Copyright (C) 2020 Theobroma Systems Design und Consulting GmbH * * based on
Signature · 1 line
2.34.1
PATCH v2 2/5 drm/panel-elida-kd35t133: hold panel in reset for unprepare
In reply to Chris MorganFrom: Chris Morgan <[email protected]>
For devices like the Anbernic RG351M and RG351P the panel is wired to an always on regulator. When the device suspends and wakes up, there are some slight artifacts on the screen that go away over time. If instead we hold the panel in reset status after it is unprepared, this does not happen.
--- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/panel/panel-elida-kd35t133.c +2 -0
@@ -104,6 +104,8 @@ static int kd35t133_unprepare(struct drm_panel *panel)return ret; } +gpiod_set_value_cansleep (ctx->reset_gpio,1 ); +regulator_disable (ctx->iovcc);regulator_disable (ctx->vdd);
Signature · 1 line
2.34.1
Re: [PATCH V2 2/5] drm/panel-elida-kd35t133: hold panel in reset for unprepare
Quoted 10 lines · Chris Morgan
From: Chris Morgan <[email protected]>
For devices like the Anbernic RG351M and RG351P the panel is wired to an always on regulator. When the device suspends and wakes up, there are some slight artifacts on the screen that go away over time. If instead we hold the panel in reset status after it is unprepared, this does not happen.
Fixes 5b6603360c12 ("drm/panel: add panel driver for Elida KD35T133 panels")Signed-off-by Chris Morgan <[email protected]>
Quoted 20 lines
--- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 2 ++ 1 file changed, 2 insertions(+)drivers/gpu/drm/panel/panel-elida-kd35t133.c +2
-0@@ -104,6 +104,8 @@ static int kd35t133_unprepare(struct drm_panel *panel)return ret; } +gpiod_set_value_cansleep (ctx->reset_gpio,1 ); +regulator_disable (ctx->iovcc);regulator_disable (ctx->vdd);Signature · 1 line
2.34.1
PATCH v2 3/5 drm/panel-elida-kd35t133: drop drm_connector_set_orientation_from_panel
In reply to Chris MorganFrom: Chris Morgan <[email protected]>
Stop calling drm_connector_set_orientation_from_panel() as its now called by the panel bridge directly when it is initialized.
--- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/gpu/drm/panel/panel-elida-kd35t133.c +0 -5
@@ -211,11 +211,6 @@ static int kd35t133_get_modes(struct drm_panel *panel, connector->display_info.width_mm = mode->width_mm; connector->display_info.height_mm = mode->height_mm;drm_mode_probed_add (connector, mode); -/* -* TODO: Remove once all drm drivers call -* drm_connector_set_orientation_from_panel() -*/ -drm_connector_set_panel_orientation (connector, ctx->orientation);return 1 ; }
Signature · 1 line
2.34.1
PATCH v2 4/5 drm/panel-elida-kd35t133: Drop shutdown logic
In reply to Chris MorganFrom: Chris Morgan <[email protected]>
The driver shutdown is duplicate as it calls drm_unprepare and drm_disable which are called anyway when associated drivers are shutdown/removed.
--- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/gpu/drm/panel/panel-elida-kd35t133.c +0 -17
@@ -296,27 +296,11 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)return 0 ; } -static void kd35t133_shutdown (struct mipi_dsi_device *dsi) -{ -struct kd35t133 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =drm_panel_unprepare (&ctx->panel); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to unprepare panel: %d\n" , ret); - - ret =drm_panel_disable (&ctx->panel); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to disable panel: %d\n" , ret); -} -static void kd35t133_remove (struct mipi_dsi_device *dsi) {struct kd35t133 *ctx =mipi_dsi_get_drvdata (dsi);int ret; -kd35t133_shutdown (dsi); - ret =mipi_dsi_detach (dsi);if (ret <0 )dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret);
@@ -337,7 +321,6 @@ static struct mipi_dsi_driver kd35t133_driver = { }, .probe = kd35t133_probe, .remove = kd35t133_remove, - .shutdown = kd35t133_shutdown, };module_mipi_dsi_driver (kd35t133_driver);
Signature · 1 line
2.34.1
Re: [PATCH V2 4/5] drm/panel-elida-kd35t133: Drop shutdown logic
Quoted 44 lines · Chris Morgan
From: Chris Morgan <[email protected]>
The driver shutdown is duplicate as it calls
drm_unprepareanddrm_disablewhich are called anyway when associated drivers are shutdown/removed.Signed-off-by Chris Morgan <[email protected]>--- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 17 ----------------- 1 file changed, 17 deletions(-)drivers/gpu/drm/panel/panel-elida-kd35t133.c +0
-16@@ -296,27 +296,11 @@ static int kd35t133_probe(struct mipi_dsi_device *dsi)return 0 ; } -static void kd35t133_shutdown (struct mipi_dsi_device *dsi) -{ -struct kd35t133 *ctx =mipi_dsi_get_drvdata (dsi); -int ret; - - ret =drm_panel_unprepare (&ctx->panel); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to unprepare panel: %d\n" , ret); - - ret =drm_panel_disable (&ctx->panel); -if (ret <0 ) -dev_err (&dsi->dev,"Failed to disable panel: %d\n" , ret); -} -static void kd35t133_remove (struct mipi_dsi_device *dsi) {struct kd35t133 *ctx =mipi_dsi_get_drvdata (dsi);int ret; -kd35t133_shutdown (dsi); - ret =mipi_dsi_detach (dsi);if (ret <0 )dev_err (&dsi->dev,"Failed to detach from DSI host: %d\n" , ret);
drivers/gpu/drm/panel/panel-elida-kd35t133.c static struct mipi_dsi_driver kd35t133_driver = { · line 326
Quoted 7 lines
drivers/gpu/drm/panel/panel-elida-kd35t133.c +0
-1@@ -337,7 +321,6 @@ static struct mipi_dsi_driver kd35t133_driver = { }, .probe = kd35t133_probe, .remove = kd35t133_remove, - .shutdown = kd35t133_shutdown, };module_mipi_dsi_driver (kd35t133_driver);
PATCH v2 5/5 drm/panel-elida-kd35t133: Drop prepare/unprepare logic
In reply to Chris MorganFrom: Chris Morgan <[email protected]>
Drop the prepare/unprepare logic, as this is now tracked elsewhere since this commit [1].
[1] commit d2aacaf07395 ("drm/panel: Check for already prepared/enabled in drm_panel")
--- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/gpu/drm/panel/panel-elida-kd35t133.c +0 -11
@@ -43,7 +43,6 @@ struct kd35t133 {struct regulator *vdd;struct regulator *iovcc;enum drm_panel_orientation orientation; -bool prepared; };static inline struct kd35t133 *panel_to_kd35t133 (struct drm_panel *panel)
@@ -91,9 +90,6 @@ static int kd35t133_unprepare(struct drm_panel *panel)struct mipi_dsi_device *dsi =to_mipi_dsi_device (ctx->dev);int ret; -if (!ctx->prepared) -return 0 ; - ret =mipi_dsi_dcs_set_display_off (dsi);if (ret <0 )dev_err (ctx->dev,"failed to set display off: %d\n" , ret);
@@ -109,8 +105,6 @@ static int kd35t133_unprepare(struct drm_panel *panel)regulator_disable (ctx->iovcc);regulator_disable (ctx->vdd); - ctx->prepared = false; -return 0 ; }
@@ -120,9 +114,6 @@ static int kd35t133_prepare(struct drm_panel *panel)struct mipi_dsi_device *dsi =to_mipi_dsi_device (ctx->dev);int ret; -if (ctx->prepared) -return 0 ; -dev_dbg (ctx->dev,"Resetting the panel\n" ); ret =regulator_enable (ctx->vdd);if (ret <0 ) {
@@ -166,8 +157,6 @@ static int kd35t133_prepare(struct drm_panel *panel)msleep (50 ); - ctx->prepared = true; -return 0 ; disable_iovcc:
Signature · 1 line
2.34.1
Re: [PATCH V2 5/5] drm/panel-elida-kd35t133: Drop prepare/unprepare logic
Quoted 54 lines · Chris Morgan
From: Chris Morgan <[email protected]>
Drop the prepare/unprepare logic, as this is now tracked elsewhere since this commit [1].
[1] commit
d2aacaf07395("drm/panel: Check for already prepared/enabled indrm_panel")Signed-off-by Chris Morgan <[email protected]>--- drivers/gpu/drm/panel/panel-elida-kd35t133.c | 11 ----------- 1 file changed, 11 deletions(-)drivers/gpu/drm/panel/panel-elida-kd35t133.c +0
-9@@ -43,7 +43,6 @@ struct kd35t133 {struct regulator *vdd;struct regulator *iovcc;enum drm_panel_orientation orientation; -bool prepared; };static inline struct kd35t133 *panel_to_kd35t133 (struct drm_panel *panel)@@ -91,9 +90,6 @@ static int kd35t133_unprepare(struct drm_panel *panel)struct mipi_dsi_device *dsi =to_mipi_dsi_device (ctx->dev);int ret; -if (!ctx->prepared) -return 0 ; - ret =mipi_dsi_dcs_set_display_off (dsi);if (ret <0 )dev_err (ctx->dev,"failed to set display off: %d\n" , ret);@@ -109,8 +105,6 @@ static int kd35t133_unprepare(struct drm_panel *panel)regulator_disable (ctx->iovcc);regulator_disable (ctx->vdd); - ctx->prepared = false; -return 0 ; }@@ -120,9 +114,6 @@ static int kd35t133_prepare(struct drm_panel *panel)struct mipi_dsi_device *dsi =to_mipi_dsi_device (ctx->dev);int ret; -if (ctx->prepared) -return 0 ; -dev_dbg (ctx->dev,"Resetting the panel\n" ); ret =regulator_enable (ctx->vdd);if (ret <0 ) {
drivers/gpu/drm/panel/panel-elida-kd35t133.c static int kd35t133_prepare(struct drm_panel *panel) · line 162
Quoted 8 lines
drivers/gpu/drm/panel/panel-elida-kd35t133.c +0
-2@@ -166,8 +157,6 @@ static int kd35t133_prepare(struct drm_panel *panel)msleep (50 ); - ctx->prepared = true; -return 0 ; disable_iovcc:
Hi,
Quoted 6 lines · Chris Morgan
From: Chris Morgan <[email protected]>
Fix a few bugs and clean up no longer needed code on the Elida KD35T133 DSI panel, as used in devices such as the Odroid Go Advance and the Anbernic RG351M.
Quoted 6 lines
Changes since V1:
- Split removal of shutdown logic into a new patch independent of dropping of prepared tracking.
- Added fixes to patch holding panel in reset after unprepare.[...]
Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)
[1/5] drm/panel-elida-kd35t133: trival: update panel size from 5.5 to 3.5
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c18b1b49764a1db824ed74286338b6283b619286 [2/5] drm/panel-elida-kd35t133: hold panel in reset for unprepare https://cgit.freedesktop.org/drm/drm-misc/commit/?id=03c5b2a5f6c39fe4e090346536cf1c14ee18b61e [3/5] drm/panel-elida-kd35t133: drop drm_connector_set_orientation_from_panel https://cgit.freedesktop.org/drm/drm-misc/commit/?id=3fc828b8ce2362982237f46a7cd46677f9094a8e [4/5] drm/panel-elida-kd35t133: Drop shutdown logic https://cgit.freedesktop.org/drm/drm-misc/commit/?id=5dea0c3fedee65413271a5700e653eff633e9a7f [5/5] drm/panel-elida-kd35t133: Drop prepare/unprepare logic https://cgit.freedesktop.org/drm/drm-misc/commit/?id=9f5ac1969df6dc0c2282454b147138c32d065b41
Signature · 1 line
Neil