[RAMEN9610-12260][COMMON] fbdev: dpu: PHY status check code is added
authorhwangjae lee <hj-yo.lee@samsung.com>
Mon, 18 Feb 2019 04:15:47 +0000 (13:15 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:17 +0000 (20:23 +0300)
Change-Id: Iab233973f1822972e5632a4c3e39acaf3b4b491f
Signed-off-by: hwangjae lee <hj-yo.lee@samsung.com>
drivers/video/fbdev/exynos/dpu20/cal_9610/regs-dsim.h
drivers/video/fbdev/exynos/dpu20/dsim_drv.c

index 2f7021be567e12e44c146d5c137db9eb1d8c3eab..399589d918a5d101b90cbc2d946334d085edde0d 100644 (file)
 
 #define DSIM_VERSION                                   (0x0)
 
+#define M4S4_TOP_ISO_BYPASS                            (0x1 << 0)
+#define M4S4_MODULE_ISO_BYPASS                         (0x1 << 0)
+#define MIPI_PHY_M4S4_CON                              0x1186070C
+
 #define DSIM_SWRST                                     (0x4)
 #define DSIM_DPHY_RST                                  (1 << 16)
 #define DSIM_SWRST_FUNCRST                             (1 << 8)
index 26c64e15883630b9c4a35213538d0e7b8235e8ae..05099901c59a18dda8e490b30ce247352279e600 100644 (file)
@@ -758,6 +758,24 @@ int dsim_set_panel_power(struct dsim_device *dsim, bool on)
        return 0;
 }
 
+static void dsim_phy_status(struct phy *phy)
+{
+       void __iomem *phy_iso_regs;
+       u32 phy_iso = 0;
+       /* 1: Isolation bypassed, 0: Isolation enabled */
+
+       dsim_dbg("%s, PHY count : %d\n", __func__, phy->power_count);
+       phy_iso_regs = ioremap(MIPI_PHY_M4S4_CON, 0x10);
+       phy_iso = readl(phy_iso_regs);
+       if ((phy_iso & M4S4_TOP_ISO_BYPASS) != M4S4_TOP_ISO_BYPASS) {
+               dsim_err("Isolation bypass should be set\n");
+               phy_iso = M4S4_TOP_ISO_BYPASS;
+               writel(phy_iso, phy_iso_regs);
+               dsim_err("Isolation bypass was set\n");
+       }
+       iounmap(phy_iso_regs);
+}
+
 static int _dsim_enable(struct dsim_device *dsim, enum dsim_state state)
 {
        bool panel_ctrl;
@@ -786,6 +804,9 @@ static int _dsim_enable(struct dsim_device *dsim, enum dsim_state state)
        if (dsim->phy_ex)
                phy_power_on(dsim->phy_ex);
 
+       /* DPHY status */
+       dsim_phy_status(dsim->phy);
+
        panel_ctrl = (state == DSIM_STATE_ON) ? true : false;
        dsim_reg_init(dsim->id, &dsim->lcd_info, &dsim->clks, panel_ctrl);
        dsim_reg_start(dsim->id);
@@ -1019,6 +1040,9 @@ static int dsim_exit_ulps(struct dsim_device *dsim)
        if (dsim->phy_ex)
                phy_power_on(dsim->phy_ex);
 
+       /* DPHY status */
+       dsim_phy_status(dsim->phy);
+
        dsim_reg_init(dsim->id, &dsim->lcd_info, &dsim->clks, false);
        ret = dsim_reg_exit_ulps_and_start(dsim->id, dsim->lcd_info.ddi_type,
                        dsim->data_lane);