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

Commit db8ae1be authored by Sandeep Panda's avatar Sandeep Panda Committed by Aravind Venkateswaran
Browse files

drm/msm/dsi-staging: fix DSI controller init sequence



Ensure that all the DSI clocks are on and sourced correctly from the
DSI PLL prior to issuing the DSI controller software reset as part of
the initialization sequence. If the clocks are not correctly configured
then the soft reset may not take effect and can lead to DSI commands
transfer failures.

CRs-Fixed: 2085016
Change-Id: I582fcbc0dc1d57955e900c9ffa7e797454b4ba9c
Signed-off-by: default avatarAravind Venkateswaran <aravindh@codeaurora.org>
Signed-off-by: default avatarSandeep Panda <spanda@codeaurora.org>
parent d98d9ee8
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2002,8 +2002,6 @@ int dsi_ctrl_host_init(struct dsi_ctrl *dsi_ctrl)
	dsi_ctrl->hw.ops.enable_status_interrupts(&dsi_ctrl->hw, 0x0);
	dsi_ctrl->hw.ops.enable_error_interrupts(&dsi_ctrl->hw, 0x0);

	/* Perform a soft reset before enabling dsi controller */
	dsi_ctrl->hw.ops.soft_reset(&dsi_ctrl->hw);
	pr_debug("[DSI_%d]Host initialization complete\n",
		dsi_ctrl->cell_index);
	dsi_ctrl_update_state(dsi_ctrl, DSI_CTRL_OP_HOST_INIT, 0x1);
+16 −10
Original line number Diff line number Diff line
@@ -3536,6 +3536,13 @@ int dsi_display_prepare(struct dsi_display *display)
		goto error_ctrl_clk_off;
	}

	rc = dsi_display_set_clk_src(display);
	if (rc) {
		pr_err("[%s] failed to set DSI link clock source, rc=%d\n",
			display->name, rc);
		goto error_phy_disable;
	}

	rc = dsi_display_ctrl_init(display);
	if (rc) {
		pr_err("[%s] failed to setup DSI controller, rc=%d\n",
@@ -3543,9 +3550,9 @@ int dsi_display_prepare(struct dsi_display *display)
		goto error_phy_disable;
	}

	rc = dsi_display_set_clk_src(display);
	rc = dsi_display_ctrl_host_enable(display);
	if (rc) {
		pr_err("[%s] failed to set DSI link clock source, rc=%d\n",
		pr_err("[%s] failed to enable DSI host, rc=%d\n",
		       display->name, rc);
		goto error_ctrl_deinit;
	}
@@ -3555,29 +3562,28 @@ int dsi_display_prepare(struct dsi_display *display)
	if (rc) {
		pr_err("[%s] failed to enable DSI link clocks, rc=%d\n",
		       display->name, rc);
		goto error_ctrl_deinit;
		goto error_host_engine_off;
	}

	rc = dsi_display_ctrl_host_enable(display);
	rc = dsi_display_soft_reset(display);
	if (rc) {
		pr_err("[%s] failed to enable DSI host, rc=%d\n",
		       display->name, rc);
		pr_err("[%s] failed soft reset, rc=%d\n", display->name, rc);
		goto error_ctrl_link_off;
	}

	rc = dsi_panel_prepare(display->panel);
	if (rc) {
		pr_err("[%s] panel prepare failed, rc=%d\n", display->name, rc);
		goto error_host_engine_off;
		goto error_ctrl_link_off;
	}

	goto error;

error_host_engine_off:
	(void)dsi_display_ctrl_host_disable(display);
error_ctrl_link_off:
	(void)dsi_display_clk_ctrl(display->dsi_clk_handle,
			DSI_LINK_CLK, DSI_CLK_OFF);
error_host_engine_off:
	(void)dsi_display_ctrl_host_disable(display);
error_ctrl_deinit:
	(void)dsi_display_ctrl_deinit(display);
error_phy_disable: