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

Commit 5e23ea87 authored by Sandeep Panda's avatar Sandeep Panda Committed by Shashank Babu Chinta Venkata
Browse files

drm/msm/dsi-staging: fix multiple reg read in ESD



In the current implementation when ESD check needs
to send multiple read commands then the last command
flag is only set for first read command. So the
transfer of rest of the read commands will fail. This
changes fixes all the issues related to multiple
reg read feature.

Change-Id: If783c9e7bc15630358d2cb1f6cd5a6b3320fbf6d
Signed-off-by: default avatarSandeep Panda <spanda@codeaurora.org>
Signed-off-by: default avatarShashank Babu Chinta Venkata <sbchin@codeaurora.org>
parent 6e0f03f6
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1338,6 +1338,9 @@ static int dsi_message_rx(struct dsi_ctrl *dsi_ctrl,
	u32 dlen, diff, rlen = msg->rx_len;
	unsigned char *buff;
	char cmd;
	struct dsi_cmd_desc *of_cmd;

	of_cmd = container_of(msg, struct dsi_cmd_desc, msg);

	if (msg->rx_len <= 2) {
		short_resp = true;
@@ -1371,6 +1374,13 @@ static int dsi_message_rx(struct dsi_ctrl *dsi_ctrl,
			pr_err("Message transmission failed, rc=%d\n", rc);
			goto error;
		}
		/*
		 * wait before reading rdbk_data register, if any delay is
		 * required after sending the read command.
		 */
		if (of_cmd && of_cmd->post_wait_ms)
			usleep_range(of_cmd->post_wait_ms * 1000,
				     ((of_cmd->post_wait_ms * 1000) + 10));

		dlen = dsi_ctrl->hw.ops.get_cmd_read_data(&dsi_ctrl->hw,
					buff, total_bytes_read,
+5 −5
Original line number Diff line number Diff line
@@ -564,14 +564,14 @@ static int dsi_display_read_status(struct dsi_display_ctrl *ctrl,
	lenp = config->status_valid_params ?: config->status_cmds_rlen;
	count = config->status_cmd.count;
	cmds = config->status_cmd.cmds;
	if (cmds->last_command) {
		cmds->msg.flags |= MIPI_DSI_MSG_LASTCOMMAND;
		flags |= DSI_CTRL_CMD_LAST_COMMAND;
	}
	flags |= (DSI_CTRL_CMD_FETCH_MEMORY | DSI_CTRL_CMD_READ);

	for (i = 0; i < count; ++i) {
		memset(config->status_buf, 0x0, SZ_4K);
		if (cmds[i].last_command) {
			cmds[i].msg.flags |= MIPI_DSI_MSG_LASTCOMMAND;
			flags |= DSI_CTRL_CMD_LAST_COMMAND;
		}
		cmds[i].msg.rx_buf = config->status_buf;
		cmds[i].msg.rx_len = config->status_cmds_rlen[i];
		rc = dsi_ctrl_cmd_transfer(ctrl->ctrl, &cmds[i].msg, flags);
@@ -655,7 +655,7 @@ static int dsi_display_status_reg_read(struct dsi_display *display)

		rc = dsi_display_validate_status(ctrl, display->panel);
		if (rc <= 0) {
			pr_err("[%s] read status failed on master,rc=%d\n",
			pr_err("[%s] read status failed on slave,rc=%d\n",
			       display->name, rc);
			goto exit;
		}