MLK-18605-4 drm/bridge: sec-dsim: refine data lanes stop state check
authorFancy Fang <chen.fang@nxp.com>
Wed, 13 Jun 2018 11:45:58 +0000 (19:45 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
When the attached dsi device does not use all the data lanes
to transfer data, data lanes stop state check should only
check the lanes used precisely, since unused lanes state is
not guaranteed to be in some stable state.

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

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

index e62b43c..006e164 100644 (file)
@@ -426,7 +426,7 @@ static int sec_mipi_dsim_bridge_attach(struct drm_bridge *bridge)
 static int sec_mipi_dsim_config_pll(struct sec_mipi_dsim *dsim)
 {
        int ret;
-       uint32_t pllctrl = 0, status, data_lanes_en;
+       uint32_t pllctrl = 0, status, data_lanes_en, stop;
 
        dsim_write(dsim, 0x8000, DSIM_PLLTMR);
 
@@ -451,7 +451,8 @@ static int sec_mipi_dsim_config_pll(struct sec_mipi_dsim *dsim)
                return -EBUSY;
        }
 
-       if (STATUS_GET_STOPSTATEDAT(status) != data_lanes_en) {
+       stop = STATUS_GET_STOPSTATEDAT(status);
+       if ((stop & data_lanes_en) != data_lanes_en) {
                dev_err(dsim->dev,
                        "one or more data lanes is not in stop state\n");
                return -EBUSY;