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

Commit 094cc2ea 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: esd recovery support in command mode for 8x10 targets"

parents 37d6dc37 68b5e191
Loading
Loading
Loading
Loading
+49 −0
Original line number Diff line number Diff line
@@ -226,6 +226,9 @@ irqreturn_t msm_dsi_isr_handler(int irq, void *ptr)
	if (isr & DSI_INTR_BTA_DONE)
		complete(&ctrl->bta_comp);

	if (isr & DSI_INTR_CMD_MDP_DONE)
		complete(&ctrl->mdp_comp);

	return IRQ_HANDLED;
}

@@ -267,6 +270,49 @@ static void msm_dsi_release_cmd_engine(struct mdss_dsi_ctrl_pdata *ctrl)
	}
}

static int msm_dsi_wait4mdp_done(struct mdss_dsi_ctrl_pdata *ctrl)
{
	int rc;
	unsigned long flag;

	spin_lock_irqsave(&ctrl->mdp_lock, flag);
	INIT_COMPLETION(ctrl->mdp_comp);
	msm_dsi_set_irq(ctrl, DSI_INTR_CMD_MDP_DONE_MASK);
	spin_unlock_irqrestore(&ctrl->mdp_lock, flag);

	rc = wait_for_completion_timeout(&ctrl->mdp_comp,
			msecs_to_jiffies(VSYNC_PERIOD * 4));

	if (rc == 0) {
		pr_err("DSI wait 4 mdp done time out\n");
		rc = -ETIME;
	} else if (!IS_ERR_VALUE(rc)) {
		rc = 0;
	}

	msm_dsi_clear_irq(ctrl, DSI_INTR_CMD_MDP_DONE_MASK);

	return rc;
}

void msm_dsi_cmd_mdp_busy(struct mdss_dsi_ctrl_pdata *ctrl)
{
	int rc;
	u32 dsi_status;
	unsigned char *ctrl_base = dsi_host_private->dsi_base;

	if (ctrl->panel_mode == DSI_VIDEO_MODE)
		return;

	dsi_status = MIPI_INP(ctrl_base + DSI_STATUS);
	if (dsi_status & 0x04) {
		pr_debug("dsi command engine is busy\n");
		rc = msm_dsi_wait4mdp_done(ctrl);
		if (rc)
			pr_err("Timed out waiting for mdp done");
	}
}

static int msm_dsi_wait4video_done(struct mdss_dsi_ctrl_pdata *ctrl)
{
	int rc;
@@ -1184,6 +1230,8 @@ static int msm_dsi_bta_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
	}

	mutex_lock(&ctrl_pdata->cmd_mutex);
	msm_dsi_clk_ctrl(&ctrl_pdata->panel_data, 1);
	msm_dsi_cmd_mdp_busy(ctrl_pdata);
	msm_dsi_set_irq(ctrl_pdata, DSI_INTR_BTA_DONE_MASK);
	INIT_COMPLETION(ctrl_pdata->bta_comp);

@@ -1194,6 +1242,7 @@ static int msm_dsi_bta_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
	ret = wait_for_completion_killable_timeout(&ctrl_pdata->bta_comp,
									HZ/10);
	msm_dsi_clear_irq(ctrl_pdata, DSI_INTR_BTA_DONE_MASK);
	msm_dsi_clk_ctrl(&ctrl_pdata->panel_data, 0);
	mutex_unlock(&ctrl_pdata->cmd_mutex);

	if (ret <= 0)