diff options
author | Inki Dae <inki.dae@samsung.com> | 2014-08-13 04:03:12 -0400 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2014-09-19 11:56:08 -0400 |
commit | 78d3a8c6134fbe1fe048b13bddb8e7602affabaa (patch) | |
tree | 6f5b8c23086bddffb3c41bc31d31c88ac106e47d /drivers/gpu/drm/exynos | |
parent | d87f09abb31d2d52dda261b5128c39d3944afbab (diff) |
drm/exynos: mipi-dsi: consider non-continuous clock mode
This patch adds non-continuous clock mode support
Clock mode on Clock Lane is continuous clock by default.
So if we want to transmit data in non-continuous clock mode
to reduce power consumption, then host driver should set
DSIM_CLKLANE_STOP bit. In this case, host controller turns off
HS clock between high speed transmissions.
For this, this patch adds a new bit, DSIM_CLKLANE_STOP, and makes
the host driver sets this bit only in case that dsi->mode_flags has
MIPI_DSI_CLOCK_NON_CONTINUOUS flag.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_dsi.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index d3393098f424..670c2f9be31c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c | |||
@@ -114,6 +114,8 @@ | |||
114 | #define DSIM_SYNC_INFORM (1 << 27) | 114 | #define DSIM_SYNC_INFORM (1 << 27) |
115 | #define DSIM_EOT_DISABLE (1 << 28) | 115 | #define DSIM_EOT_DISABLE (1 << 28) |
116 | #define DSIM_MFLUSH_VS (1 << 29) | 116 | #define DSIM_MFLUSH_VS (1 << 29) |
117 | /* This flag is valid only for exynos3250/3472/4415/5260/5430 */ | ||
118 | #define DSIM_CLKLANE_STOP (1 << 30) | ||
117 | 119 | ||
118 | /* DSIM_ESCMODE */ | 120 | /* DSIM_ESCMODE */ |
119 | #define DSIM_TX_TRIGGER_RST (1 << 4) | 121 | #define DSIM_TX_TRIGGER_RST (1 << 4) |
@@ -262,6 +264,7 @@ struct exynos_dsi_driver_data { | |||
262 | unsigned int plltmr_reg; | 264 | unsigned int plltmr_reg; |
263 | 265 | ||
264 | unsigned int has_freqband:1; | 266 | unsigned int has_freqband:1; |
267 | unsigned int has_clklane_stop:1; | ||
265 | }; | 268 | }; |
266 | 269 | ||
267 | struct exynos_dsi { | 270 | struct exynos_dsi { |
@@ -304,6 +307,7 @@ struct exynos_dsi { | |||
304 | static struct exynos_dsi_driver_data exynos4_dsi_driver_data = { | 307 | static struct exynos_dsi_driver_data exynos4_dsi_driver_data = { |
305 | .plltmr_reg = 0x50, | 308 | .plltmr_reg = 0x50, |
306 | .has_freqband = 1, | 309 | .has_freqband = 1, |
310 | .has_clklane_stop = 1, | ||
307 | }; | 311 | }; |
308 | 312 | ||
309 | static struct exynos_dsi_driver_data exynos5_dsi_driver_data = { | 313 | static struct exynos_dsi_driver_data exynos5_dsi_driver_data = { |
@@ -569,6 +573,7 @@ static void exynos_dsi_disable_clock(struct exynos_dsi *dsi) | |||
569 | 573 | ||
570 | static int exynos_dsi_init_link(struct exynos_dsi *dsi) | 574 | static int exynos_dsi_init_link(struct exynos_dsi *dsi) |
571 | { | 575 | { |
576 | struct exynos_dsi_driver_data *driver_data = dsi->driver_data; | ||
572 | int timeout; | 577 | int timeout; |
573 | u32 reg; | 578 | u32 reg; |
574 | u32 lanes_mask; | 579 | u32 lanes_mask; |
@@ -650,6 +655,20 @@ static int exynos_dsi_init_link(struct exynos_dsi *dsi) | |||
650 | reg |= DSIM_LANE_EN(lanes_mask); | 655 | reg |= DSIM_LANE_EN(lanes_mask); |
651 | writel(reg, dsi->reg_base + DSIM_CONFIG_REG); | 656 | writel(reg, dsi->reg_base + DSIM_CONFIG_REG); |
652 | 657 | ||
658 | /* | ||
659 | * Use non-continuous clock mode if the periparal wants and | ||
660 | * host controller supports | ||
661 | * | ||
662 | * In non-continous clock mode, host controller will turn off | ||
663 | * the HS clock between high-speed transmissions to reduce | ||
664 | * power consumption. | ||
665 | */ | ||
666 | if (driver_data->has_clklane_stop && | ||
667 | dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) { | ||
668 | reg |= DSIM_CLKLANE_STOP; | ||
669 | writel(reg, dsi->reg_base + DSIM_CONFIG_REG); | ||
670 | } | ||
671 | |||
653 | /* Check clock and data lane state are stop state */ | 672 | /* Check clock and data lane state are stop state */ |
654 | timeout = 100; | 673 | timeout = 100; |
655 | do { | 674 | do { |