From patchwork Mon Jan 19 07:52:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hyungwon Hwang X-Patchwork-Id: 5655231 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AEA98C058F for ; Mon, 19 Jan 2015 07:52:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D81D32037C for ; Mon, 19 Jan 2015 07:52:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9E7FD20361 for ; Mon, 19 Jan 2015 07:52:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C013789EF7; Sun, 18 Jan 2015 23:52:51 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by gabe.freedesktop.org (Postfix) with ESMTP id A2A2989F33 for ; Sun, 18 Jan 2015 23:52:50 -0800 (PST) MIME-version: 1.0 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NIE00BGTZ814A10@mailout3.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 19 Jan 2015 16:52:49 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.113]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 90.64.18167.0D7BCB45; Mon, 19 Jan 2015 16:52:49 +0900 (KST) X-AuditID: cbfee690-f79ab6d0000046f7-c4-54bcb7d04e35 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 84.7A.20081.0D7BCB45; Mon, 19 Jan 2015 16:52:48 +0900 (KST) Received: from localhost.localdomain ([10.252.82.145]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NIE00KRBZ7SU710@mmp2.samsung.com>; Mon, 19 Jan 2015 16:52:48 +0900 (KST) From: Hyungwon Hwang To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 2/3] drm/panel: add s6e63j0x03 LCD panel driver Date: Mon, 19 Jan 2015 16:52:32 +0900 Message-id: <1421653953-8187-2-git-send-email-human.hwang@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1421653953-8187-1-git-send-email-human.hwang@samsung.com> References: <1421653953-8187-1-git-send-email-human.hwang@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkkeLIzCtJLcpLzFFi42JZI2JSqHtx+54Qg5f9bBZXvr5ns1g6o4/V YtL9CSwWt3/zObB43O8+zuTR2/yOzaNvyyrGAOYoLpuU1JzMstQifbsEroze+RvZC77PYKyY sCWngfFDTRcjJ4eEgInEgp7vLBC2mMSFe+vZuhi5OIQEljJKPH3+kRWuaMJkFojEdEaJnTPf MoMkeAUEJX5MvgeU4OBgFpCXOHIpGyTMLKAuMWneImaI+jYmiSMnr7ODJNgE9CQWXPsBZosI KEv8nbiKEaIhQmLW1RVgVwgLOEmcbutjArFZBFQlvv44ywixy03i6Km5bBAHyUmcPDYZ7DhO AXeJiWf2gtUIAdXMnzQHbLGEwDJ2iaZd+9khBglIfJt8COxQCQFZiU0HmCHmSEocXHGDZQKj 2Cwk78xCeGcWkncWMDKvYhRNLUguKE5KLzLRK07MLS7NS9dLzs/dxAiModP/nk3YwXjvgPUh RgEORiUe3g2+e0KEWBPLiitzDzGaAh0xkVlKNDkfGKl5JfGGxmZGFqYmpsZG5pZmSuK8r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YehL0Nljcb3tQJBck2Jm5v3CnFLVZ0osxRmJhlrMRcWJ AA3v9hnmAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: treding@nvidia.com, Hyungwon Hwang X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, T_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 From: Inki Dae This patch adds MIPI-DSI based S6E63J0X03 AMOLED LCD panel driver which uses mipi_dsi bus to communicate with panel. The panel has 320×320 resolution in 1.63-inch physical panel. This panel is used in Samsung Galaxy Gear 2. Signed-off-by: Inki Dae Signed-off-by: Hyungwon Hwang Acked-by: Kyungmin Park --- Changes for v2: - Change the gamma table to 2-dimensional array - Change the way to make index for brightness - Make command functions to an array so that it can be called simply - Change command id for reading device ID - Change the way to handle the error condition - Remove power variable, and use the same name variable in bl_dev - Add the state FB_BLANK_NORMAL to represent the state which the panel is working but blanked - Miscellaneous changes to increase the readability and follow the coding-style standard Changes for v3: - Add DT binding documentation - Add the code getting DT properties of 'panel-width-mm' and 'panel-height-mm' - Remove the code getting unnecessary DT properties flip-* .../bindings/panel/samsung,s6e63j0x03.txt | 55 +++ drivers/gpu/drm/panel/Kconfig | 6 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-s6e63j0x03.c | 546 +++++++++++++++++++++ 4 files changed, 608 insertions(+) create mode 100644 Documentation/devicetree/bindings/panel/samsung,s6e63j0x03.txt create mode 100644 drivers/gpu/drm/panel/panel-s6e63j0x03.c -- 1.9.1 diff --git a/Documentation/devicetree/bindings/panel/samsung,s6e63j0x03.txt b/Documentation/devicetree/bindings/panel/samsung,s6e63j0x03.txt new file mode 100644 index 0000000..f8215e4 --- /dev/null +++ b/Documentation/devicetree/bindings/panel/samsung,s6e63j0x03.txt @@ -0,0 +1,55 @@ +Samsung S6E63J0X03 1.63" 320x320 TFT LCD panel + +Required properties: + - compatible: "samsung,s6e63j0x03" + - reg: the virtual channel number of a DSI peripheral + - vdd3-supply: core voltage supply + - vci-supply: voltage supply for analog circuits + - reset-gpios: a GPIO spec for the reset pin + - te-gpios: a GPIO spec for the tearing effect synchronization signal gpio pin + +Optional properties: + - display-timings: timings for the connected panel as described by [1] + - power-on-delay: delay after turning regulators on [ms] + - power-off-delay: delay after turning regulators off [ms] + - reset-delay: delay after reset sequence [ms] + - panel-width-mm: physical panel width [mm] + - panel-height-mm: physical panel height [mm] + +The device node can contain one 'port' child node with one child +'endpoint' node, according to the bindings defined in [2]. This +node should describe panel's video bus. + +[1]: Documentation/devicetree/bindings/video/display-timing.txt +[2]: Documentation/devicetree/bindings/media/video-interfaces.txt + +Example: + +panel@0 { + compatible = "samsung,s6e63j0x03"; + reg = <0>; + vdd3-supply = <&ldo16_reg>; + vci-supply = <&ldo20_reg>; + reset-gpios = <&gpe0 1 0>; + te-gpios = <&gpx0 6 0>; + power-on-delay= <30>; + power-off-delay= <120>; + reset-delay = <5>; + init-delay = <100>; + panel-width-mm = <29>; + panel-height-mm = <29>; + + display-timings { + timing-0 { + clock-frequency = <0>; + hactive = <320>; + vactive = <320>; + hfront-porch = <1>; + hback-porch = <1>; + hsync-len = <1>; + vfront-porch = <150>; + vback-porch = <1>; + vsync-len = <2>; + }; + }; +}; diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 3df9b9b..8fa7610 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -46,4 +46,10 @@ config DRM_PANEL_S6E3HA2 select DRM_MIPI_DSI select VIDEOMODE_HELPERS +config DRM_PANEL_S6E63J0X03 + tristate "S6E63J0X03 DSI video mode panel" + depends on OF + select DRM_MIPI_DSI + select VIDEOMODE_HELPERS + endmenu diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 16ff312..9054da1 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -3,3 +3,4 @@ obj-$(CONFIG_DRM_PANEL_LD9040) += panel-ld9040.o obj-$(CONFIG_DRM_PANEL_S6E8AA0) += panel-s6e8aa0.o obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o obj-$(CONFIG_DRM_PANEL_S6E3HA2) += panel-s6e3ha2.o +obj-$(CONFIG_DRM_PANEL_S6E63J0X03) += panel-s6e63j0x03.o diff --git a/drivers/gpu/drm/panel/panel-s6e63j0x03.c b/drivers/gpu/drm/panel/panel-s6e63j0x03.c new file mode 100644 index 0000000..51cf1f6 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-s6e63j0x03.c @@ -0,0 +1,546 @@ +/* + * MIPI-DSI based S6E63J0X03 AMOLED lcd 1.63 inch panel driver. + * + * Copyright (c) 2014 Samsung Electronics Co., Ltd + * + * Inki Dae, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. +*/ + +#include +#include +#include + +#include +#include +#include +#include + +#include