[v2,3/3] drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence

Message ID 1673330093-6771-4-git-send-email-xinlei.lee@mediatek.com
State New
Headers
Series Reduce lcm_reset to DSI LP11 send cmd time |

Commit Message

Xinlei Lee (李昕磊) Jan. 10, 2023, 5:54 a.m. UTC
  From: Xinlei Lee <xinlei.lee@mediatek.com>

For "boe,tv105wum-nw0" this special panel, it is stipulated in the 
panel spec that MIPI needs to keep the LP11 state before the 
lcm_reset pin is pulled high.

Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
---
 drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

AngeloGioacchino Del Regno Jan. 10, 2023, 9:22 a.m. UTC | #1
Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> From: Xinlei Lee <xinlei.lee@mediatek.com>
> 
> For "boe,tv105wum-nw0" this special panel, it is stipulated in the
> panel spec that MIPI needs to keep the LP11 state before the
> lcm_reset pin is pulled high.
> 
> Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> ---
>   drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> index f0093035f1ff..67df61de64ae 100644
> --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> @@ -36,6 +36,7 @@ struct panel_desc {
>   	const struct panel_init_cmd *init_cmds;
>   	unsigned int lanes;
>   	bool discharge_on_disable;
> +	bool lp11_before_reset;
>   };
>   
>   struct boe_panel {
> @@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct drm_panel *panel)
>   
>   	usleep_range(10000, 11000);
>   
> +	if (boe->desc->lp11_before_reset) {
> +		mipi_dsi_dcs_nop(boe->dsi);

NOP will never reach the driveric if it is in reset, which should apparently be
the state of it at that point in code.

I guess that you wanted to do that after LCM reset and before sending init cmds.

Regards,
Angelo
  
Xinlei Lee (李昕磊) Jan. 12, 2023, 10 a.m. UTC | #2
On Tue, 2023-01-10 at 10:22 +0100, AngeloGioacchino Del Regno wrote:
> Il 10/01/23 06:54, xinlei.lee@mediatek.com ha scritto:
> > From: Xinlei Lee <xinlei.lee@mediatek.com>
> > 
> > For "boe,tv105wum-nw0" this special panel, it is stipulated in the
> > panel spec that MIPI needs to keep the LP11 state before the
> > lcm_reset pin is pulled high.
> > 
> > Signed-off-by: Xinlei Lee <xinlei.lee@mediatek.com>
> > ---
> >   drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++
> >   1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > index f0093035f1ff..67df61de64ae 100644
> > --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
> > @@ -36,6 +36,7 @@ struct panel_desc {
> >   	const struct panel_init_cmd *init_cmds;
> >   	unsigned int lanes;
> >   	bool discharge_on_disable;
> > +	bool lp11_before_reset;
> >   };
> >   
> >   struct boe_panel {
> > @@ -1261,6 +1262,10 @@ static int boe_panel_prepare(struct
> > drm_panel *panel)
> >   
> >   	usleep_range(10000, 11000);
> >   
> > +	if (boe->desc->lp11_before_reset) {
> > +		mipi_dsi_dcs_nop(boe->dsi);
> 
> NOP will never reach the driveric if it is in reset, which should
> apparently be
> the state of it at that point in code.
> 
> I guess that you wanted to do that after LCM reset and before sending
> init cmds.
> 
> Regards,
> Angelo
> 

Hi Angelo:

To explain to you that in my patch, sending a NOP before lcm_reset is 
what this particular panel driver needs.

Indeed, the NOP will not reach the panel driveric before lcm_reset,
but the driveric specification stipulates that the MIPI signal needs
to be pulled high before lcm_reset is pulled high(NOP 
-> mtk_dsi_host_transfer -> mtk_dsi_lane_ready) . In order to avoid 
special driver initialization exceptions, this control was added.

Best Regards!
xinlei
  

Patch

diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
index f0093035f1ff..67df61de64ae 100644
--- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
+++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c
@@ -36,6 +36,7 @@  struct panel_desc {
 	const struct panel_init_cmd *init_cmds;
 	unsigned int lanes;
 	bool discharge_on_disable;
+	bool lp11_before_reset;
 };
 
 struct boe_panel {
@@ -1261,6 +1262,10 @@  static int boe_panel_prepare(struct drm_panel *panel)
 
 	usleep_range(10000, 11000);
 
+	if (boe->desc->lp11_before_reset) {
+		mipi_dsi_dcs_nop(boe->dsi);
+		usleep_range(1000, 2000);
+	}
 	gpiod_set_value(boe->enable_gpio, 1);
 	usleep_range(1000, 2000);
 	gpiod_set_value(boe->enable_gpio, 0);
@@ -1487,6 +1492,7 @@  static const struct panel_desc boe_tv105wum_nw0_desc = {
 	.mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE |
 		      MIPI_DSI_MODE_LPM,
 	.init_cmds = boe_init_cmd,
+	.lp11_before_reset = true,
 };
 
 static int boe_panel_get_modes(struct drm_panel *panel,