From patchwork Mon Jul 28 02:00:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 4631821 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2D63D9F32F for ; Mon, 28 Jul 2014 02:01:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 357B1200F0 for ; Mon, 28 Jul 2014 02:01:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9717F2012B for ; Mon, 28 Jul 2014 02:01:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751418AbaG1CBC (ORCPT ); Sun, 27 Jul 2014 22:01:02 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:9405 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480AbaG1CBB (ORCPT ); Sun, 27 Jul 2014 22:01:01 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9E007WUG9NUF00@mailout2.samsung.com> for linux-samsung-soc@vger.kernel.org; Mon, 28 Jul 2014 11:00:59 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.116]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id B8.E8.19786.ADEA5D35; Mon, 28 Jul 2014 11:00:59 +0900 (KST) X-AuditID: cbfee68e-b7fab6d000004d4a-ce-53d5aedaad63 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id D8.94.04943.ADEA5D35; Mon, 28 Jul 2014 11:00:58 +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 <0N9E00GAEG9LZJA0@mmp2.samsung.com>; Mon, 28 Jul 2014 11:00:58 +0900 (KST) From: Inki Dae To: dri-devel@lists.freedesktop.org Cc: airlied@linux.ie, linux-samsung-soc@vger.kernel.org, a.hajda@samsung.com, treding@nvidia.com, Inki Dae Subject: [PATCH v2 1/2] drm/mipi-dsi: add (LPM) Low Power Mode transfer support Date: Mon, 28 Jul 2014 11:00:56 +0900 Message-id: <1406512857-7213-2-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1406512857-7213-1-git-send-email-inki.dae@samsung.com> References: <1406512857-7213-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrALMWRmVeSWpSXmKPExsWyRsSkRPf2uqvBBveb2CxurTvHatF77iST xZWv79ksJt2fwGIx4/w+Jovbv/kc2Dy2f3vA6nG/+ziTR2/zOzaPvi2rGD0+b5ILYI3isklJ zcksSy3St0vgyth/oJ29YKJwxdcLDYwNjHf5uxg5OSQETCRWHtzJBGGLSVy4t54NxBYSWMoo sXFjJUzNjBWtrF2MXEDx6YwSD3/NYIZwupkken5+AetgE1CVmLjiPpgtIqAs8XfiKkaQImaB ZkaJeSsXs4IkhAX8JZ5sPAZWxALUsORaJwuIzSvgLNH6aC9QAwfQOgWJOZNsQMKcAi4SO/bf ZIS4yFni/sXXbCAzJQT62SVWvX/GBDFHQOLb5EMsEL2yEpsOMENcLSlxcMUNlgmMwgsYGVYx iqYWJBcUJ6UXGekVJ+YWl+al6yXn525iBIb26X/P+nYw3jxgfYgxGWjcRGYp0eR8YGzklcQb GpsZWZiamBobmVuakSasJM676GFSkJBAemJJanZqakFqUXxR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ai4kQAoLmvVrMCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 below two flags for LPM transfer, and it attaches LPM flags to a msg in accordance with master's mode_flags set by LCD Panel driver. MIPI_DSI_MODE_CMD_LPM - If this flag is set by Panel driver, MIPI-DSI controller will tranfer command data to Panel device in Low Power Mode. MIPI_DSI_MODE_VIDEO_LPM - If this flag is set by Panel driver, MIPI-DSI controller will tranfer image data to Panel device in Low Power Mode. And above two flags can be combined together to transfer command and video data to Panel device. MIPI DSI spec says, "the host processor controls the desired mode of clock operation. Host protocol and applications control Clock Lane operating mode (High Speed or Low Power mode). System designers are responsible for understanding the clock requirements for peripherals attached to DSI and controlling clock behavior in accordance with those requirements." Some LCD Panel devices, nt35502a, would need LPM transfer support because they should receive some initial commands with LPM by default hardware setting. Changelog v2: just add more descriptions. Signed-off-by: Inki Dae Acked-by: Kyungmin Park --- drivers/gpu/drm/drm_mipi_dsi.c | 3 +++ include/drm/drm_mipi_dsi.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index e633df2..6b2bbda 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -232,6 +232,9 @@ int mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, unsigned int channel, break; } + if (dsi->mode_flags & MIPI_DSI_MODE_CMD_LPM) + msg.flags = MIPI_DSI_MSG_USE_LPM; + return ops->transfer(dsi->host, &msg); } EXPORT_SYMBOL(mipi_dsi_dcs_write); diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 944f33f..1c41e49 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -94,6 +94,10 @@ void mipi_dsi_host_unregister(struct mipi_dsi_host *host); #define MIPI_DSI_MODE_VSYNC_FLUSH BIT(8) /* disable EoT packets in HS mode */ #define MIPI_DSI_MODE_EOT_PACKET BIT(9) +/* command low power mode */ +#define MIPI_DSI_MODE_CMD_LPM BIT(10) +/* video low power mode */ +#define MIPI_DSI_MODE_VIDEO_LPM BIT(11) enum mipi_dsi_pixel_format { MIPI_DSI_FMT_RGB888,