Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49f5519c authored by Aravind Venkateswaran's avatar Aravind Venkateswaran Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: dsi: ensure phy config is done only during power up



DSI phy reset and initialization should only be done when as part of
the power up sequence. This can happen at two different places:
    (1) During bootup or resume sequence
    (2) When exiting idle power collapse in static screen

The checks in the current implementation to ensure the above make use
of the panel blank status. However, it is possible that the DSI clocks
can be toggled even after panel has been blanked. This may result in phy
init sequence getting called resulting in spurious transitions on the
DSI lanes. Fix this issue by modifying the existing sequence
appropriately.

Change-Id: I1f67b24058b3c98fb4472867c0421ae47fdcd9c7
Signed-off-by: default avatarAravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
parent bb29ea15
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -1270,12 +1270,21 @@ int mdss_dsi_on(struct mdss_panel_data *pdata)
	}
	}


	/*
	/*
	 * Enable DSI clocks.
	 * Enable DSI core clocks prior to resetting and initializing DSI
	 * This is also enable the DSI core power block and reset/setup
	 * Phy. Phy and ctrl setup need to be done before enabling the link
	 * DSI phy
	 * clocks.
	 */
	 */
	mdss_dsi_clk_ctrl(ctrl_pdata, ctrl_pdata->dsi_clk_handle,
	mdss_dsi_clk_ctrl(ctrl_pdata, ctrl_pdata->dsi_clk_handle,
			  MDSS_DSI_ALL_CLKS, MDSS_DSI_CLK_ON);
			  MDSS_DSI_CORE_CLK, MDSS_DSI_CLK_ON);
	if (!pdata->panel_info.ulps_suspend_enabled) {
		mdss_dsi_phy_sw_reset(ctrl_pdata);
		mdss_dsi_phy_init(ctrl_pdata);
		mdss_dsi_ctrl_setup(ctrl_pdata);
	}

	/* DSI link clocks need to be on prior to ctrl sw reset */
	mdss_dsi_clk_ctrl(ctrl_pdata, ctrl_pdata->dsi_clk_handle,
			  MDSS_DSI_LINK_CLK, MDSS_DSI_CLK_ON);
	mdss_dsi_sw_reset(ctrl_pdata, true);
	mdss_dsi_sw_reset(ctrl_pdata, true);
	mdss_dsi_read_hw_revision(ctrl_pdata);
	mdss_dsi_read_hw_revision(ctrl_pdata);


+2 −0
Original line number Original line Diff line number Diff line
@@ -582,6 +582,8 @@ void mdss_dsi_video_test_pattern(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_panel_pwm_cfg(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_panel_pwm_cfg(struct mdss_dsi_ctrl_pdata *ctrl);
bool mdss_dsi_panel_pwm_enable(struct mdss_dsi_ctrl_pdata *ctrl);
bool mdss_dsi_panel_pwm_enable(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_ctrl_phy_restore(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_ctrl_phy_restore(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_phy_sw_reset(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_phy_init(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_ctrl_init(struct device *ctrl_dev,
void mdss_dsi_ctrl_init(struct device *ctrl_dev,
			struct mdss_dsi_ctrl_pdata *ctrl);
			struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_cmd_mdp_busy(struct mdss_dsi_ctrl_pdata *ctrl);
void mdss_dsi_cmd_mdp_busy(struct mdss_dsi_ctrl_pdata *ctrl);
+4 −14
Original line number Original line Diff line number Diff line
@@ -63,7 +63,7 @@ static void mdss_dsi_ctrl_phy_reset(struct mdss_dsi_ctrl_pdata *ctrl)
	wmb();	/* maek sure reset cleared */
	wmb();	/* maek sure reset cleared */
}
}


static void mdss_dsi_phy_sw_reset(struct mdss_dsi_ctrl_pdata *ctrl)
void mdss_dsi_phy_sw_reset(struct mdss_dsi_ctrl_pdata *ctrl)
{
{
	struct mdss_dsi_ctrl_pdata *sctrl = NULL;
	struct mdss_dsi_ctrl_pdata *sctrl = NULL;
	struct dsi_shared_data *sdata;
	struct dsi_shared_data *sdata;
@@ -1487,20 +1487,10 @@ int mdss_dsi_post_clkon_cb(void *priv,
			mdss_dsi_read_hw_revision(ctrl);
			mdss_dsi_read_hw_revision(ctrl);


		/*
		/*
		 * Phy software reset should not be done for:
		 * Phy and controller setup is needed if coming out of idle
		 * 1.) Idle screen power collapse use-case. Issue a phy software
		 * power collapse with clamps enabled.
		 *     reset only when unblanking the panel in this case.
		 * 2.) When ULPS during suspend is enabled.
		 */
		 */
		if (pdata->panel_info.blank_state == MDSS_PANEL_BLANK_BLANK &&
		if (ctrl->mmss_clamp) {
			!pdata->panel_info.ulps_suspend_enabled)
			mdss_dsi_phy_sw_reset(ctrl);

		/*
		 * Phy and controller setup need not be done during bootup
		 * when continuous splash screen is enabled.
		 */
		if (!pdata->panel_info.cont_splash_enabled) {
			mdss_dsi_phy_init(ctrl);
			mdss_dsi_phy_init(ctrl);
			mdss_dsi_ctrl_setup(ctrl);
			mdss_dsi_ctrl_setup(ctrl);
		}
		}