From patchwork Fri Jul 18 10:56:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 4582561 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 79882C0514 for ; Fri, 18 Jul 2014 10:56:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B61602018E for ; Fri, 18 Jul 2014 10:56:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D9A4A20103 for ; Fri, 18 Jul 2014 10:56:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 485D26E756; Fri, 18 Jul 2014 03:56:12 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 931FB6E009 for ; Fri, 18 Jul 2014 03:56:08 -0700 (PDT) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N8W007HSMDH8WB0@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Fri, 18 Jul 2014 19:56:06 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.116]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id CB.44.24374.54DF8C35; Fri, 18 Jul 2014 19:56:05 +0900 (KST) X-AuditID: cbfee68d-b7fd46d000005f36-28-53c8fd459a9a Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 2A.12.04943.54DF8C35; Fri, 18 Jul 2014 19:56:05 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.83.67]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N8W005VCMDGBK90@mmp2.samsung.com>; Fri, 18 Jul 2014 19:56:05 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/exynos: dsi: add LPM (Low Power Mode) transfer support Date: Fri, 18 Jul 2014 19:56:04 +0900 Message-id: <1405680964-6869-3-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1405680964-6869-1-git-send-email-inki.dae@samsung.com> References: <1405680964-6869-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsWyRsSkRNf174lgg+krLC1urTvHatF77iST xZWv79ksJt2fwGIx4/w+JgdWj+3fHrB63O8+zuTRt2UVo8fnTXIBLFFcNimpOZllqUX6dglc Ga/XbGcqWMpXMXvmB6YGxnfcXYycHBICJhJz+u8zQthiEhfurWfrYuTiEBJYyigxp/kCK0zR oV3LWSES0xklriw6yA6SEBLoZpL489wIxGYTUJWYuOI+G4gtImAq0TFpKQuIzSwQK3H+9iaw uLCAv8T1041gQ1mA6nefvMMEYvMKOEuc7uhg7mLkAFqmIDFnkg1ImFPARaLx3TSwsBBQydzH yhDnNLNLdHfoQUwRkPg2+RALRKesxKYDzBAlkhIHV9xgmcAovICRYRWjaGpBckFxUnqRoV5x Ym5xaV66XnJ+7iZGYAif/vesdwfj7QPWhxiTgcZNZJYSTc4HxkBeSbyhsZmRhamJqbGRuaUZ acJK4rxJD5OChATSE0tSs1NTC1KL4otKc1KLDzEycXBKNTBO/XuN/ZB/lfd8vaOZdl4bPPP4 jD613H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ected Cc: a.hajda@samsung.com, linux-samsung-soc@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds LPM transfer support for video or command data. With this patch, Exynos MIPI DSI controller can transfer command or video data with HS or LP mode in accordance with mode_flags set by LCD Panel driver. Signed-off-by: Inki Dae Acked-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 2df3592..b120554 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -426,13 +426,28 @@ 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); + + if (!(dsi->mode_flags & MIPI_DSI_MODE_CMD_LPM)) + reg |= DSIM_TX_REQUEST_HSCLK; + writel(reg, dsi->reg_base + DSIM_CLKCTRL_REG); return 0; } +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_disable_clock(struct exynos_dsi *dsi) { u32 reg; @@ -575,6 +590,9 @@ static void exynos_dsi_set_display_enable(struct exynos_dsi *dsi, bool enable) { u32 reg; + if (!(dsi->mode_flags & MIPI_DSI_MODE_VIDEO_LPM)) + exynos_dsi_enable_hs_clock(dsi, true); + reg = readl(dsi->reg_base + DSIM_MDRESOL_REG); if (enable) reg |= DSIM_MAIN_STAND_BY;