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

Commit 6a00cb93 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: handle DSI ctrl/PHY regulator control properly"

parents 2226ed44 e5a5b9e6
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -1087,6 +1087,8 @@ static int mdss_dsi_off(struct mdss_panel_data *pdata, int power_state)
		/* disable DSI phy */
		mdss_dsi_phy_disable(ctrl_pdata);
	}
	ctrl_pdata->ctrl_state &= ~CTRL_STATE_DSI_ACTIVE;

	mdss_dsi_clk_ctrl(ctrl_pdata, ctrl_pdata->dsi_clk_handle,
			  MDSS_DSI_CORE_CLK, MDSS_DSI_CLK_OFF);

@@ -1291,6 +1293,7 @@ int mdss_dsi_on(struct mdss_panel_data *pdata)
		mdss_dsi_phy_init(ctrl_pdata);
		mdss_dsi_ctrl_setup(ctrl_pdata);
	}
	ctrl_pdata->ctrl_state |= CTRL_STATE_DSI_ACTIVE;

	/* DSI link clocks need to be on prior to ctrl sw reset */
	mdss_dsi_clk_ctrl(ctrl_pdata, ctrl_pdata->dsi_clk_handle,
@@ -1406,9 +1409,9 @@ static int mdss_dsi_unblank(struct mdss_panel_data *pdata)
				panel_data);
	mipi  = &pdata->panel_info.mipi;

	pr_debug("%s+: ctrl=%p ndx=%d cur_blank_state=%d ctrl_state=%x\n",
	pr_debug("%s+: ctrl=%p ndx=%d cur_power_state=%d ctrl_state=%x\n",
			__func__, ctrl_pdata, ctrl_pdata->ndx,
			pdata->panel_info.blank_state, ctrl_pdata->ctrl_state);
		pdata->panel_info.panel_power_state, ctrl_pdata->ctrl_state);

	if (mdss_dsi_is_ctrl_clk_master(ctrl_pdata))
		sctrl = mdss_dsi_get_ctrl_clk_slave();
@@ -1419,7 +1422,7 @@ static int mdss_dsi_unblank(struct mdss_panel_data *pdata)
		mdss_dsi_clk_ctrl(sctrl, sctrl->dsi_clk_handle,
				  MDSS_DSI_ALL_CLKS, MDSS_DSI_CLK_ON);

	if (pdata->panel_info.blank_state == MDSS_PANEL_BLANK_LOW_POWER) {
	if (mdss_dsi_is_panel_on_lp(pdata)) {
		pr_debug("%s: dsi_unblank with panel always on\n", __func__);
		if (ctrl_pdata->low_power_config)
			ret = ctrl_pdata->low_power_config(pdata, false);
@@ -2689,7 +2692,8 @@ static int mdss_dsi_cont_splash_config(struct mdss_panel_info *pinfo,
		}
		if (ctrl_pdata->bklt_ctrl == BL_PWM)
			mdss_dsi_panel_pwm_enable(ctrl_pdata);
		pinfo->blank_state = MDSS_PANEL_BLANK_UNBLANK;
		ctrl_pdata->ctrl_state |= (CTRL_STATE_PANEL_INIT |
			CTRL_STATE_MDP_ACTIVE | CTRL_STATE_DSI_ACTIVE);
		if (ctrl_pdata->panel_data.panel_info.type == MIPI_CMD_PANEL)
			clk_handle = ctrl_pdata->mdp_clk_handle;
		else
@@ -2705,8 +2709,6 @@ static int mdss_dsi_cont_splash_config(struct mdss_panel_info *pinfo,
			if (data & BIT(16))
				ctrl_pdata->burst_mode_enabled = true;
		}
		ctrl_pdata->ctrl_state |=
			(CTRL_STATE_PANEL_INIT | CTRL_STATE_MDP_ACTIVE);
	} else {
		pinfo->panel_power_state = MDSS_PANEL_POWER_OFF;
	}
+10 −0
Original line number Diff line number Diff line
@@ -138,9 +138,19 @@ enum dsi_pm_type {
	DSI_MAX_PM
};

/*
 * DSI controller states.
 *	CTRL_STATE_UNKNOWN - Unknown state of DSI controller.
 *	CTRL_STATE_PANEL_INIT - State specifies that the panel is initialized.
 *	CTRL_STATE_MDP_ACTIVE - State specifies that MDP is ready to send
 *				data to DSI.
 *	CTRL_STATE_DSI_ACTIVE - State specifies that DSI controller/PHY is
 *				initialized.
 */
#define CTRL_STATE_UNKNOWN		0x00
#define CTRL_STATE_PANEL_INIT		BIT(0)
#define CTRL_STATE_MDP_ACTIVE		BIT(1)
#define CTRL_STATE_DSI_ACTIVE		BIT(2)

#define DSI_NON_BURST_SYNCH_PULSE	0
#define DSI_NON_BURST_SYNCH_EVENT	1
+0 −6
Original line number Diff line number Diff line
@@ -707,7 +707,6 @@ static int mdss_dsi_panel_on(struct mdss_panel_data *pdata)
	}

end:
	pinfo->blank_state = MDSS_PANEL_BLANK_UNBLANK;
	pr_debug("%s:-\n", __func__);
	return ret;
}
@@ -768,7 +767,6 @@ static int mdss_dsi_panel_off(struct mdss_panel_data *pdata)
		mdss_dsi_panel_cmds_send(ctrl, &ctrl->off_cmds, CMD_REQ_COMMIT);

end:
	pinfo->blank_state = MDSS_PANEL_BLANK_BLANK;
	pr_debug("%s:-\n", __func__);
	return 0;
}
@@ -792,10 +790,6 @@ static int mdss_dsi_panel_low_power_config(struct mdss_panel_data *pdata,
		enable);

	/* Any panel specific low power commands/config */
	if (enable)
		pinfo->blank_state = MDSS_PANEL_BLANK_LOW_POWER;
	else
		pinfo->blank_state = MDSS_PANEL_BLANK_UNBLANK;

	pr_debug("%s:-\n", __func__);
	return 0;
+0 −1
Original line number Diff line number Diff line
@@ -597,7 +597,6 @@ struct mdss_panel_info {
	u32 partial_update_roi_merge;
	struct ion_handle *splash_ihdl;
	int panel_power_state;
	int blank_state;
	int compression_mode;

	uint32_t panel_dead;
+4 −7
Original line number Diff line number Diff line
@@ -1837,8 +1837,7 @@ int mdss_dsi_pre_clkoff_cb(void *priv,
		 * However, when blanking the panel, we should enter ULPS
		 * only if ULPS during suspend feature is enabled.
		 */
		if (pdata->panel_info.blank_state ==
			MDSS_PANEL_BLANK_BLANK) {
		if (!(ctrl->ctrl_state & CTRL_STATE_DSI_ACTIVE)) {
			if (pdata->panel_info.ulps_suspend_enabled)
				mdss_dsi_ulps_config(ctrl, 1);
		} else if (mdss_dsi_ulps_feature_enabled(pdata)) {
@@ -1856,7 +1855,7 @@ int mdss_dsi_pre_clkoff_cb(void *priv,
		 * Enable DSI clamps only if entering idle power collapse or
		 * when ULPS during suspend is enabled.
		 */
		if ((pdata->panel_info.blank_state != MDSS_PANEL_BLANK_BLANK) ||
		if ((ctrl->ctrl_state & CTRL_STATE_DSI_ACTIVE) ||
			pdata->panel_info.ulps_suspend_enabled) {
			rc = mdss_dsi_clamp_ctrl(ctrl, 1);
			if (rc)
@@ -1958,8 +1957,7 @@ int mdss_dsi_post_clkoff_cb(void *priv,

		for (i = DSI_MAX_PM - 1; i >= DSI_CORE_PM; i--) {
			if ((i != DSI_CORE_PM) &&
			    (pdata->panel_info.blank_state !=
			     MDSS_PANEL_BLANK_BLANK))
			    (ctrl->ctrl_state & CTRL_STATE_DSI_ACTIVE))
				continue;
			rc = msm_dss_enable_vreg(
				sdata->power_data[i].vreg_config,
@@ -2008,8 +2006,7 @@ int mdss_dsi_pre_clkon_cb(void *priv,
		pr_debug("%s: Enable DSI core power\n", __func__);
		for (i = DSI_CORE_PM; i < DSI_MAX_PM; i++) {
			if ((i != DSI_CORE_PM) &&
			    (pdata->panel_info.blank_state !=
				MDSS_PANEL_BLANK_BLANK) &&
			    (ctrl->ctrl_state & CTRL_STATE_DSI_ACTIVE) &&
				!pdata->panel_info.cont_splash_enabled)
				continue;
			rc = msm_dss_enable_vreg(