drm/msm/dsi-staging: add support to wait post dsi command rx

Some display panel have the requirement of waiting for certain
duration before dsi host can read back the response from panel,
to a DCS read command. This change adds the support to store
the delay required in dsi message structure it self.

Change-Id: I82f53d811f82195eb900e4594b01c6e0f23fed53
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
Signed-off-by: Shashank Babu Chinta Venkata <sbchin@codeaurora.org>
tirimbino
Sandeep Panda 7 years ago committed by Shashank Babu Chinta Venkata
parent 8a660b69f1
commit c4429baaa0
  1. 9
      drivers/gpu/drm/msm/dsi-staging/dsi_ctrl.c
  2. 2
      drivers/gpu/drm/msm/dsi-staging/dsi_display.c
  3. 4
      drivers/gpu/drm/msm/dsi-staging/dsi_panel.c
  4. 2
      include/drm/drm_mipi_dsi.h

@ -1338,9 +1338,6 @@ 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;
@ -1378,9 +1375,9 @@ static int dsi_message_rx(struct dsi_ctrl *dsi_ctrl,
* 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));
if (msg->wait_ms)
usleep_range(msg->wait_ms * 1000,
((msg->wait_ms * 1000) + 10));
dlen = dsi_ctrl->hw.ops.get_cmd_read_data(&dsi_ctrl->hw,
buff, total_bytes_read,

@ -749,7 +749,7 @@ static int dsi_display_cmd_prepare(const char *cmd_buf, u32 cmd_buf_len,
cmd->msg.channel = cmd_buf[2];
cmd->msg.flags = cmd_buf[3];
cmd->msg.ctrl = 0;
cmd->post_wait_ms = cmd_buf[4];
cmd->post_wait_ms = cmd->msg.wait_ms = cmd_buf[4];
cmd->msg.tx_len = ((cmd_buf[5] << 8) | (cmd_buf[6]));
if (cmd->msg.tx_len > payload_len) {

@ -1490,7 +1490,7 @@ static int dsi_panel_create_cmd_packets(const char *data,
cmd[i].msg.channel = data[2];
cmd[i].msg.flags |= (data[3] == 1 ? MIPI_DSI_MSG_REQ_ACK : 0);
cmd[i].msg.ctrl = 0;
cmd[i].post_wait_ms = data[4];
cmd[i].post_wait_ms = cmd[i].msg.wait_ms = data[4];
cmd[i].msg.tx_len = ((data[5] << 8) | (data[6]));
size = cmd[i].msg.tx_len * sizeof(u8);
@ -3471,6 +3471,7 @@ static int dsi_panel_roi_prepare_dcs_cmds(struct dsi_panel_cmd_set *set,
set->cmds[0].msg.tx_buf = caset;
set->cmds[0].msg.rx_len = 0;
set->cmds[0].msg.rx_buf = 0;
set->cmds[0].msg.wait_ms = 0;
set->cmds[0].last_command = 0;
set->cmds[0].post_wait_ms = 0;
@ -3482,6 +3483,7 @@ static int dsi_panel_roi_prepare_dcs_cmds(struct dsi_panel_cmd_set *set,
set->cmds[1].msg.tx_buf = paset;
set->cmds[1].msg.rx_len = 0;
set->cmds[1].msg.rx_buf = 0;
set->cmds[1].msg.wait_ms = 0;
set->cmds[1].last_command = 1;
set->cmds[1].post_wait_ms = 0;

@ -32,6 +32,7 @@ struct mipi_dsi_device;
* @type: payload data type
* @flags: flags controlling this message transmission
* @ctrl: ctrl index to transmit on
* @wait_ms: duration in ms to wait after message transmission
* @tx_len: length of @tx_buf
* @tx_buf: data to be written
* @rx_len: length of @rx_buf
@ -42,6 +43,7 @@ struct mipi_dsi_msg {
u8 type;
u16 flags;
u32 ctrl;
u32 wait_ms;
size_t tx_len;
const void *tx_buf;

Loading…
Cancel
Save