]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/bridge: analogix_dp: Set PD_INC_BG first when powering up edp phy
authorzain wang <wzz@rock-chips.com>
Mon, 23 Apr 2018 10:49:42 +0000 (12:49 +0200)
committerAndrzej Hajda <a.hajda@samsung.com>
Tue, 24 Apr 2018 06:34:34 +0000 (08:34 +0200)
Following the correct power up sequence:
dp_pd=ff => dp_pd=7f => wait 10us => dp_pd=00

Cc: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: zain wang <wzz@rock-chips.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180423105003.9004-7-enric.balletbo@collabora.com
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h

index b47c5af43560f2b7db79ce0fefa78f0cfe897795..bb72f8b0e6039ea50870765805144aff7f1d7d90 100644 (file)
@@ -321,10 +321,16 @@ void analogix_dp_set_analog_power_down(struct analogix_dp_device *dp,
                break;
        case POWER_ALL:
                if (enable) {
-                       reg = DP_PHY_PD | AUX_PD | CH3_PD | CH2_PD |
-                               CH1_PD | CH0_PD;
+                       reg = DP_ALL_PD;
                        writel(reg, dp->reg_base + phy_pd_addr);
                } else {
+                       reg = DP_ALL_PD;
+                       writel(reg, dp->reg_base + phy_pd_addr);
+                       usleep_range(10, 15);
+                       reg &= ~DP_INC_BG;
+                       writel(reg, dp->reg_base + phy_pd_addr);
+                       usleep_range(10, 15);
+
                        writel(0x00, dp->reg_base + phy_pd_addr);
                }
                break;
index 40200c652533b1fd4909c23010ce5c6828d2998e..9602668669f41c99e93148e21a73611d6f126805 100644 (file)
 #define DP_PLL_REF_BIT_1_2500V                 (0x7 << 0)
 
 /* ANALOGIX_DP_PHY_PD */
+#define DP_INC_BG                              (0x1 << 7)
+#define DP_EXP_BG                              (0x1 << 6)
 #define DP_PHY_PD                              (0x1 << 5)
 #define AUX_PD                                 (0x1 << 4)
 #define CH3_PD                                 (0x1 << 3)
 #define CH2_PD                                 (0x1 << 2)
 #define CH1_PD                                 (0x1 << 1)
 #define CH0_PD                                 (0x1 << 0)
+#define DP_ALL_PD                              (0xff)
 
 /* ANALOGIX_DP_PHY_TEST */
 #define MACRO_RST                              (0x1 << 5)