drm/msm: dsi: Provide option to force continuous HS clock
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / msm / dsi / dsi_host.c
index a3ff0e2966047ab6c74d72444c098d79a6245b4a..ae061653ca06c037ef4f81a78f5093338417fb0b 100644 (file)
@@ -787,6 +787,11 @@ static void dsi_ctrl_config(struct msm_dsi_host *msm_host, bool enable,
                dsi_write(msm_host, REG_DSI_LANE_SWAP_CTRL,
                        DSI_LANE_SWAP_CTRL_DLN_SWAP_SEL(LANE_SWAP_0123));
        }
+
+       if (!(flags & MIPI_DSI_CLOCK_NON_CONTINUOUS))
+               dsi_write(msm_host, REG_DSI_LANE_CTRL,
+                       DSI_LANE_CTRL_CLKLN_HS_FORCE_REQUEST);
+
        data |= DSI_CTRL_ENABLE;
 
        dsi_write(msm_host, REG_DSI_CTRL, data);
@@ -1093,7 +1098,6 @@ static int dsi_cmd_dma_rx(struct msm_dsi_host *msm_host,
 {
        u32 *lp, *temp, data;
        int i, j = 0, cnt;
-       bool ack_error = false;
        u32 read_cnt;
        u8 reg[16];
        int repeated_bytes = 0;
@@ -1105,15 +1109,10 @@ static int dsi_cmd_dma_rx(struct msm_dsi_host *msm_host,
        if (cnt > 4)
                cnt = 4; /* 4 x 32 bits registers only */
 
-       /* Calculate real read data count */
-       read_cnt = dsi_read(msm_host, 0x1d4) >> 16;
-
-       ack_error = (rx_byte == 4) ?
-               (read_cnt == 8) : /* short pkt + 4-byte error pkt */
-               (read_cnt == (pkt_size + 6 + 4)); /* long pkt+4-byte error pkt*/
-
-       if (ack_error)
-               read_cnt -= 4; /* Remove 4 byte error pkt */
+       if (rx_byte == 4)
+               read_cnt = 4;
+       else
+               read_cnt = pkt_size + 6;
 
        /*
         * In case of multiple reads from the panel, after the first read, there
@@ -1215,7 +1214,7 @@ static void dsi_err_worker(struct work_struct *work)
                container_of(work, struct msm_dsi_host, err_work);
        u32 status = msm_host->err_work_state;
 
-       pr_err("%s: status=%x\n", __func__, status);
+       pr_err_ratelimited("%s: status=%x\n", __func__, status);
        if (status & DSI_ERR_STATE_MDP_FIFO_UNDERFLOW)
                dsi_sw_reset_restore(msm_host);