MLK-20687 drm/bridge: sec-dsim: correct LPM config for Long Packet
authorFancy Fang <chen.fang@nxp.com>
Mon, 7 Jan 2019 02:29:42 +0000 (10:29 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
According to the test, the Low Power Mode config should be
done before the Long Packet payload is written to SFR FIFO.
Otherwise, the packet send out by DSIM is not correct. This
should be the DSIM implementation behaviour.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit c7833c3920264c32934870bc49006348be9ad397)

drivers/gpu/drm/bridge/sec-dsim.c

index 2e8d4c1..b614578 100644 (file)
@@ -592,9 +592,6 @@ static void sec_mipi_dsim_write_ph_to_sfr_fifo(struct sec_mipi_dsim *dsim,
 {
        uint32_t pkthdr;
 
-       /* config LPM for CMD TX */
-       sec_mipi_dsim_config_cmd_lpm(dsim, use_lpm);
-
        pkthdr = PKTHDR_SET_DATA1(((u8 *)header)[2])    | /* WC MSB  */
                 PKTHDR_SET_DATA0(((u8 *)header)[1])    | /* WC LSB  */
                 PKTHDR_SET_DI(((u8 *)header)[0]);        /* Data ID */
@@ -698,7 +695,9 @@ static ssize_t sec_mipi_dsim_host_transfer(struct mipi_dsi_host *host,
        if (unlikely(msg->rx_buf))
                reinit_completion(&dsim->rx_done);
 
+       /* config LPM for CMD TX */
        use_lpm = msg->flags & MIPI_DSI_MSG_USE_LPM ? true : false;
+       sec_mipi_dsim_config_cmd_lpm(dsim, use_lpm);
 
        if (packet.payload_length) {            /* Long Packet case */
                reinit_completion(&dsim->pl_tx_done);