From: Inki Dae <inki.dae@samsung.com>
To: dri-devel@lists.freedesktop.org
Cc: a.hajda@samsung.com
Subject: [PATCH 2/2] drm/exynos: mipi-dsi: consider non-continuous clock mode
Date: Tue, 12 Aug 2014 15:33:06 +0900 [thread overview]
Message-ID: <1407825186-5792-3-git-send-email-inki.dae@samsung.com> (raw)
In-Reply-To: <1407825186-5792-1-git-send-email-inki.dae@samsung.com>
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 clear
DSIM_TX_REQUEST_HSCLK.
For this, this patch makes the host driver set DSIM_TX_REQUEST_HSCLK
only in case that dsi->mode_flags has no MIPI_DSI_CLOCK_NON_CONTINUOUS
flag.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
---
drivers/gpu/drm/exynos/exynos_drm_dsi.c | 32 +++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 86aebd8..8c43c96 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -493,8 +493,17 @@ static int exynos_dsi_enable_clock(struct exynos_dsi *dsi)
| DSIM_ESC_PRESCALER(esc_div)
| DSIM_LANE_ESC_CLK_EN_CLK
| DSIM_LANE_ESC_CLK_EN_DATA(BIT(dsi->lanes) - 1)
- | DSIM_BYTE_CLK_SRC(0)
- | DSIM_TX_REQUEST_HSCLK;
+ | DSIM_BYTE_CLK_SRC(0);
+
+ /*
+ * Set DSIM_TX_REQUEST_HSCLK only in case of not requesting
+ * non-continous clock mode. So if MIPI_DSI_CLOCK_NON_CONTINUOUS,
+ * then host controller will turn off the HS clock between high-speed
+ * transmissions.
+ */
+ if (!(dsi->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS))
+ reg |= DSIM_TX_REQUEST_HSCLK;
+
writel(reg, dsi->reg_base + DSIM_CLKCTRL_REG);
return 0;
@@ -701,10 +710,29 @@ static void exynos_dsi_set_display_mode(struct exynos_dsi *dsi)
dev_dbg(dsi->dev, "LCD size = %dx%d\n", vm->hactive, vm->vactive);
}
+static void exynos_dsi_enable_hs_clock(struct exynos_dsi *dsi,
+ bool enable)
+{
+ u32 reg = readl(dsi->reg_base + DSIM_CLKCTRL_REG);
+
+ reg &= ~DSIM_TX_REQUEST_HSCLK;
+ if (enable)
+ reg |= DSIM_TX_REQUEST_HSCLK;
+
+ writel(reg, dsi->reg_base + DSIM_CLKCTRL_REG);
+}
+
static void exynos_dsi_set_display_enable(struct exynos_dsi *dsi, bool enable)
{
u32 reg;
+ /*
+ * Set DSIM_TX_REQUEST_HSCLK. In case of video data, host controller
+ * will transmit the data in HS mode always.
+ */
+ if (enable)
+ exynos_dsi_enable_hs_clock(dsi, true);
+
reg = readl(dsi->reg_base + DSIM_MDRESOL_REG);
if (enable)
reg |= DSIM_MAIN_STAND_BY;
--
1.7.9.5
next prev parent reply other threads:[~2014-08-12 6:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-12 6:33 [PATCH 0/2] drm/mipi-dsi: consider low power transmission Inki Dae
2014-08-12 6:33 ` [PATCH 1/2] " Inki Dae
2014-08-12 6:33 ` Inki Dae [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-08-18 8:11 [PATCH 0/2] drm/mipi-dsi: support " Inki Dae
2014-08-18 8:11 ` [PATCH 2/2] drm/exynos: mipi-dsi: consider non-continuous clock mode Inki Dae
2014-08-18 10:13 ` Andrzej Hajda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1407825186-5792-3-git-send-email-inki.dae@samsung.com \
--to=inki.dae@samsung.com \
--cc=a.hajda@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox