[Robusta2] fbdev: dpu: command is written in LPDT mode
authorhwangjae lee <hj-yo.lee@samsung.com>
Fri, 2 Nov 2018 08:23:10 +0000 (17:23 +0900)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:29:57 +0000 (17:29 +0800)
Change-Id: I045783d47f7fa15ab3228c9b1d1af1d6b0ce7cc9
Signed-off-by: hwangjae lee <hj-yo.lee@samsung.com>
arch/arm64/boot/dts/exynos/exynos9610-display-lcd.dtsi
drivers/video/fbdev/exynos/dpu20/Kconfig
drivers/video/fbdev/exynos/dpu20/cal_9610/dsim_cal.h
drivers/video/fbdev/exynos/dpu20/cal_9610/dsim_reg.c
drivers/video/fbdev/exynos/dpu20/decon_core.c
drivers/video/fbdev/exynos/dpu20/dsim.h
drivers/video/fbdev/exynos/dpu20/dsim_drv.c

index 87d8a81ac890cf7b828b739057f2fbe2c2f02b5a..8a8452a72138244b836979e265748555264d1a34 100755 (executable)
                                timing,dsi-hs-clk = <1300>;
                                /* TODO : pms value to be set */
                                timing,pmsk = <1 100 1 0>;
-                               timing,dsi-escape-clk = <20>;
+                               timing,dsi-escape-clk = <10>;
                                mic_en = <0>;           /* 0: Disable, 1: Enable */
                                mic_ratio = <0>;        /* 0: 1/2 mic, 1: 1/3 mic */
                                mic_ver = <0>;          /* 0: mic v1.1, 1: v1.2, 2: v2.0 */
index 49a5f8deac52c073adaeda9e0e19c904be3a434d..712dc9a005338d761c1d594092b8fecdb91d6a5c 100644 (file)
@@ -124,6 +124,12 @@ config EXYNOS_DECON_DQE
        depends on EXYNOS_DPU20
        default n
 
+config EXYNOS_PANEL_INIT_LPDT
+       bool "Support PANEL INIT LPDT command"
+       depends on EXYNOS_DPU20
+       default n
+       help
+         If this menu is enabled, COMMAND will write in LPDT mode.
 endif
 
 source "drivers/video/fbdev/exynos/dpu20/panels/Kconfig"
index abd244f235e73c96870a11c5a722fa265e3f91a9..d14a42a3afafdcebfeb20885c11675df732d63b2 100644 (file)
@@ -73,6 +73,9 @@ void dsim_reg_set_bist(u32 id, u32 en);
 
 void dsim_reg_set_cmd_transfer_mode(u32 id, u32 lp);
 
+void dsim_reg_set_int(u32 id, u32 en);
+
+int dsim_reg_set_hs_clock(u32 id, u32 en);
 /* DSIM SFR dump */
 void __dsim_dump(u32 id, struct dsim_regs *regs);
 
index 9d0bee02dfb3163ff2ff06505d1899c26779f4c4..b4c68ac8fbc0e0e898a92a02a471c83901a581fc 100644 (file)
@@ -1552,7 +1552,7 @@ static u32 dsim_reg_is_noncont_clk_enabled(u32 id)
        return ret;
 }
 
-static int dsim_reg_set_hs_clock(u32 id, u32 en)
+int dsim_reg_set_hs_clock(u32 id, u32 en)
 {
        int reg = 0;
        int is_noncont = dsim_reg_is_noncont_clk_enabled(id);
@@ -1568,7 +1568,7 @@ static int dsim_reg_set_hs_clock(u32 id, u32 en)
        return reg;
 }
 
-static void dsim_reg_set_int(u32 id, u32 en)
+void dsim_reg_set_int(u32 id, u32 en)
 {
        u32 val = en ? 0 : ~0;
        u32 mask;
@@ -1762,6 +1762,10 @@ void dsim_reg_init(u32 id, struct decon_lcd *lcd_info, struct dsim_clks *clks,
 
        dsim_reg_set_config(id, lcd_info, clks);
 
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+       dsim_reg_set_cmd_transfer_mode(dsim->id, 1);
+#endif
+
        if (panel_ctrl)
                dsim_reset_panel(dsim);
 }
@@ -1770,7 +1774,6 @@ void dsim_reg_init(u32 id, struct decon_lcd *lcd_info, struct dsim_clks *clks,
 void dsim_reg_start(u32 id)
 {
        dsim_reg_set_hs_clock(id, 1);
-       dsim_reg_set_int(id, 1);
 }
 
 /* Unset clocks and lanes and stop_state */
@@ -1813,7 +1816,10 @@ int dsim_reg_exit_ulps_and_start(u32 id, u32 ddi_type, u32 lanes)
 
        /* try to exit ULPS mode. The sequence is depends on DDI type */
        ret = dsim_reg_set_ulps_by_ddi(id, ddi_type, lanes, 0);
+#if !defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
        dsim_reg_start(id);
+#endif
+       dsim_reg_set_int(id, 1);
        return ret;
 }
 
index da62add4d278f3fbf66ef14e73da392cfa63d1d2..2463fc33d9d2005267ebd0ac019065acddd51dd5 100755 (executable)
@@ -4006,7 +4006,21 @@ static int decon_initial_display(struct decon_device *decon, bool is_colormap)
        dsim = container_of(decon->out_sd[0], struct dsim_device, sd);
        decon_reg_start(decon->id, &psr);
        decon_reg_set_int(decon->id, &psr, 1);
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+       if (decon->dt.out_type == DECON_OUT_DSI)
+               v4l2_subdev_call(decon->out_sd[0], core, ioctl,
+                               DSIM_IOC_LPDT_CMD, (unsigned long *)1);
+#endif
        call_panel_ops(dsim, displayon, dsim);
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+       if (decon->dt.out_type == DECON_OUT_DSI) {
+               v4l2_subdev_call(decon->out_sd[0], core, ioctl,
+                               DSIM_IOC_HS_CLK_ENABLE, NULL);
+               v4l2_subdev_call(decon->out_sd[0], core, ioctl,
+                               DSIM_IOC_LPDT_CMD, (unsigned long *)0);
+
+       }
+#endif
        decon_wait_for_vsync(decon, VSYNC_TIMEOUT_MSEC);
        if (decon_reg_wait_update_done_and_mask(decon->id, &psr,
                                SHADOW_UPDATE_TIMEOUT) < 0)
index 349d6d1d036e337f455ecdc3f1f480dcf54f6bb1..f1208ea5f199e80509e0f17c1fca681fca2ffc89 100755 (executable)
@@ -409,6 +409,8 @@ static inline bool IS_DSIM_OFF_STATE(struct dsim_device *dsim)
 #define DSIM_IOC_FREE_FB_RES           _IOW('D', 11, u32)
 #define DSIM_IOC_DOZE                  _IOW('D', 20, u32)
 #define DSIM_IOC_DOZE_SUSPEND          _IOW('D', 21, u32)
+#define DSIM_IOC_HS_CLK_ENABLE         _IOW('D', 30, int)
+#define DSIM_IOC_LPDT_CMD              _IOW('D', 31, int)
 
 #if defined(CONFIG_EXYNOS_READ_ESD_SOLUTION)
 #define DSIM_ESD_OK                    0
index fa64f574a69796546732cd094eff015d086fa3f6..3d70566bb7b2729ffef5961a6ae456116558792a 100755 (executable)
@@ -814,7 +814,10 @@ static int _dsim_enable(struct dsim_device *dsim, enum dsim_state state)
 
        panel_ctrl = (state == DSIM_STATE_ON) ? true : false;
        dsim_reg_init(dsim->id, &dsim->lcd_info, &dsim->clks, panel_ctrl);
+#if !defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
        dsim_reg_start(dsim->id);
+#endif
+       dsim_reg_set_int(dsim->id, 1);
 
        dsim->state = state;
        enable_irq(dsim->res.irq);
@@ -842,8 +845,16 @@ static int dsim_enable(struct dsim_device *dsim)
                goto out;
        }
 
-       if (prev_state != DSIM_STATE_INIT)
+       if (prev_state != DSIM_STATE_INIT) {
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+               dsim_reg_set_cmd_transfer_mode(dsim->id, 1);
+#endif
                call_panel_ops(dsim, displayon, dsim);
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+               dsim_reg_start(dsim->id);
+               dsim_reg_set_cmd_transfer_mode(dsim->id, 0);
+#endif
+       }
 
        dsim_info("dsim-%d %s - (state:%s -> %s)\n", dsim->id, __func__,
                        dsim_state_names[prev_state],
@@ -872,8 +883,15 @@ static int dsim_doze(struct dsim_device *dsim)
                                dsim->id, dsim_state_names[next_state], ret);
                goto out;
        }
-       if (prev_state != DSIM_STATE_INIT)
+       if (prev_state != DSIM_STATE_INIT) {
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+               dsim_reg_set_cmd_transfer_mode(dsim->id, 1);
+#endif
                call_panel_ops(dsim, doze, dsim);
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+               dsim_reg_set_cmd_transfer_mode(dsim->id, 0);
+#endif
+       }
        dsim_info("dsim-%d %s - (state:%s -> %s)\n", dsim->id, __func__,
                        dsim_state_names[prev_state],
                        dsim_state_names[dsim->state]);
@@ -939,8 +957,15 @@ static int dsim_disable(struct dsim_device *dsim)
                return 0;
        }
 
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+       dsim_reg_set_hs_clock(dsim->id, 0);
+       dsim_reg_set_cmd_transfer_mode(dsim->id, 1);
+#endif
        dsim_info("dsim-%d %s +\n", dsim->id, __func__);
        call_panel_ops(dsim, suspend, dsim);
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+       dsim_reg_set_cmd_transfer_mode(dsim->id, 0);
+#endif
        ret = _dsim_disable(dsim, next_state);
        if (ret < 0) {
                dsim_err("dsim-%d failed to set %s (ret %d)\n",
@@ -967,8 +992,14 @@ static int dsim_doze_suspend(struct dsim_device *dsim)
                return 0;
        }
 
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+       dsim_reg_set_cmd_transfer_mode(dsim->id, 1);
+#endif
        dsim_info("dsim-%d %s +\n", dsim->id, __func__);
        call_panel_ops(dsim, doze_suspend, dsim);
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+       dsim_reg_set_cmd_transfer_mode(dsim->id, 0);
+#endif
        ret = _dsim_disable(dsim, next_state);
        if (ret < 0) {
                dsim_err("dsim-%d failed to set %s (ret %d)\n",
@@ -1155,6 +1186,18 @@ static long dsim_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
                ret = dsim_doze_suspend(dsim);
                break;
 
+       case DSIM_IOC_HS_CLK_ENABLE:
+               ret = dsim_reg_set_hs_clock(dsim->id, 1);
+               break;
+
+       case DSIM_IOC_LPDT_CMD:
+               if ((unsigned long)arg)
+                       dsim_reg_set_cmd_transfer_mode(dsim->id, 1);
+               else
+                       dsim_reg_set_cmd_transfer_mode(dsim->id, 0);
+
+               break;
+
        default:
                dsim_err("unsupported ioctl");
                ret = -EINVAL;
@@ -1312,7 +1355,13 @@ static ssize_t dsim_cmd_sysfs_store(struct device *dev,
        switch (cmd) {
        case 1:
                ret = dsim_cmd_sysfs_read(dsim);
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+       dsim_reg_set_cmd_transfer_mode(dsim->id, 1);
+#endif
                call_panel_ops(dsim, dump, dsim);
+#if defined(CONFIG_EXYNOS_PANEL_INIT_LPDT)
+       dsim_reg_set_cmd_transfer_mode(dsim->id, 0);
+#endif
                if (ret)
                        return ret;
                break;