From: hwangjae lee Date: Mon, 18 Feb 2019 04:15:47 +0000 (+0900) Subject: [RAMEN9610-12260][COMMON] fbdev: dpu: PHY status check code is added X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4dfd31f8d1207f105855c550ac20fb949456cbb7;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [RAMEN9610-12260][COMMON] fbdev: dpu: PHY status check code is added Change-Id: Iab233973f1822972e5632a4c3e39acaf3b4b491f Signed-off-by: hwangjae lee --- diff --git a/drivers/video/fbdev/exynos/dpu20/cal_9610/regs-dsim.h b/drivers/video/fbdev/exynos/dpu20/cal_9610/regs-dsim.h index 2f7021be567e..399589d918a5 100644 --- a/drivers/video/fbdev/exynos/dpu20/cal_9610/regs-dsim.h +++ b/drivers/video/fbdev/exynos/dpu20/cal_9610/regs-dsim.h @@ -17,6 +17,10 @@ #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) diff --git a/drivers/video/fbdev/exynos/dpu20/dsim_drv.c b/drivers/video/fbdev/exynos/dpu20/dsim_drv.c index 26c64e158836..05099901c59a 100644 --- a/drivers/video/fbdev/exynos/dpu20/dsim_drv.c +++ b/drivers/video/fbdev/exynos/dpu20/dsim_drv.c @@ -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);