Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752956AbcL0JHq (ORCPT ); Tue, 27 Dec 2016 04:07:46 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:51001 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750858AbcL0JGl (ORCPT ); Tue, 27 Dec 2016 04:06:41 -0500 X-AuditID: b6c32a2c-f79ad6d000007a0b-9a-58622efebde2 From: Hoegeun Kwon To: robh@kernel.org, thierry.reding@gmail.com, airlied@linux.ie, kgene@kernel.org, krzk@kernel.org Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, inki.dae@samsung.com, cw00.choi@samsung.com, Hoegeun Kwon , Donghwa Lee , Hyungwon Hwang Subject: [PATCH v2 1/2] drm/panel: Add support for S6E3HA2 panel driver on TM2 board Date: Tue, 27 Dec 2016 18:05:47 +0900 Message-id: <1482829548-20842-2-git-send-email-hoegeun.kwon@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1482829548-20842-1-git-send-email-hoegeun.kwon@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFKsWRmVeSWpSXmKPExsWy7bCmhu4/vaQIg+vb+S16z51ksrj+5Tmr xfwj51gtrp+3s7jy9T2bxfvlXWwWS2f0sVpMuj+BxaL/8Wtmi/PnN7BbXN41h81ixvl9TBb/ 9+xgt/i5ax6LA5/Hzll32T02repk89j+7QGrx/3u40wefVtWMXp83iQXwBaVapORmpiSWqSQ mpecn5KZl26r5B0c7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkDdK2SQlliTilQKCCxuFhJ 386mKL+0JFUhI7+4xFYp2tDQSM/QwFzPyMhIz8Q41srIFKgkITXj+aQdTAVv3zFWnLv+ibWB cdVhxi5GTg4JAROJj/9boWwxiQv31rN1MXJxCAksZZT49fY4K4TTziTx+dhzFpiO5YeeMkIk ljN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wpSxCywhkniStNbZpCEsECYRNekRWwgNouAqkT/xnMs IDavgIdE27cGVoh1chInj00GszkFPCV+Lu8D6xUCqlk65zvrBEbeBYwMqxglUguSC4qT0nON 8lLL9YoTc4tL89L1kvNzNzGCI+WZ9A7Gw7vcDzEKcDAq8fBGbEyMEGJNLCuuzD3EKMHBrCTC u0M7KUKINyWxsiq1KD++qDQntfgQoynQYROZpUST84FRnFcSb2hibmJubGBhbmlpYqQkzts4 +1m4kEB6YklqdmpqQWoRTB8TB6dUA+N6prNu63XUpjOYzlhy+cYm5VfBWZ4NwcXuGT9/Lq7/ GKxwYP7Ed/YRPedjFinntGyR2v3vhPNWb1O1V+9Y5iw8cDbpSKOpz+KtVU/tL53PizA/qqzx zLVwqse20zWT1P4usN0z1d7IzyCKuyXT642saWP3hPTWxPmOQhZ9yQxSkWcL+Uv4ZiixFGck GmoxFxUnAgDC4rkLqgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161227090606epcas5p2d71e13cc6d1bcd7f47bc5d92387f4e32 X-Msg-Generator: CA X-Sender-IP: 203.254.230.27 X-Local-Sender: =?UTF-8?B?6raM7ZqM6re8G1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbUzMo7IKs7JuQKS/sgqzsm5A=?= X-Global-Sender: =?UTF-8?B?SG9lZ2V1biBLd29uG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTMy9Bc3Npc3RhbnQgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1NUQUYbQzEwVjgxMTE=?= CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-HopCount: 7 X-CMS-RootMailID: 20161227090606epcas5p2d71e13cc6d1bcd7f47bc5d92387f4e32 X-RootMTR: 20161227090606epcas5p2d71e13cc6d1bcd7f47bc5d92387f4e32 References: <1482829548-20842-1-git-send-email-hoegeun.kwon@samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 29688 Lines: 883 This patch add support for MIPI-DSI based S6E3HA2 AMOLED panel driver. This panel has 1440x2560 resolution in 5.7-inch physical panel in the TM2 device. Signed-off-by: Donghwa Lee Signed-off-by: Hyungwon Hwang Signed-off-by: Hoegeun Kwon --- Changes for V2: - Fixed the samsung,s6e3ha2.txt DT document. - Added active high or low after the description of the GPIOs. - Removed the reg and added a description of the virtual channel number of a DSI peripheral. .../bindings/display/panel/samsung,s6e3ha2.txt | 62 ++ drivers/gpu/drm/panel/Kconfig | 6 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c | 756 +++++++++++++++++++++ 4 files changed, 825 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2.txt create mode 100644 drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2.txt b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2.txt new file mode 100644 index 0000000..6e989ee --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha2.txt @@ -0,0 +1,62 @@ +Samsung S6E3HA2 5.7" 1440x2560 AMOLED panel + +Required properties: + - compatible: "samsung,s6e3ha2" + - vdd3-supply: core voltage supply + - vci-supply: voltage supply for analog circuits + - reset-gpios: a GPIO spec for the reset pin (active high) + - enable-gpios: a GPIO spec for the panel enable pin (active high) + - te-gpios: a GPIO spec for the tearing effect synchronization signal + gpio pin (active high) + +Optional properties: + - display-timings: timings for the connected panel as described by [1] + +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. + +The virtual channel number of a DSI peripheral as described by [3]. +Must be in the range from 0 to 3. +/* peripheral responds to virtual channel 0 */ +peripheral@0 { + compatible = "..."; + reg = <0>; +}; + +[1]: Documentation/devicetree/bindings/display/panel/display-timing.txt +[2]: Documentation/devicetree/bindings/media/video-interfaces.txt +[3]: Documentation/devicetree/bindings/display/mipi-dsi-bus.txt + +Example: + + panel@0 { + ... + + compatible = "samsung,s6e3ha2"; + vdd3-supply = <&ldo27_reg>; + vci-supply = <&ldo28_reg>; + reset-gpios = <&gpg0 0 GPIO_ACTIVE_HIGH>; + enable-gpios = <&gpf1 5 GPIO_ACTIVE_HIGH>; + te-gpios = <&gpf1 3 GPIO_ACTIVE_HIGH>; + + display-timings { + timing-0 { + clock-frequency = <0>; + hactive = <1440>; + vactive = <2560>; + hfront-porch = <1>; + hback-porch = <1>; + hsync-len = <1>; + vfront-porch = <1>; + vback-porch = <15>; + vsync-len = <1>; + }; + }; + + port { + dsi_in: endpoint { + remote-endpoint = <&dsi_out>; + }; + }; + }; diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 62aba97..e1a2fcd 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -58,6 +58,12 @@ config DRM_PANEL_SAMSUNG_S6E8AA0 select DRM_MIPI_DSI select VIDEOMODE_HELPERS +config DRM_PANEL_SAMSUNG_S6E3HA2 + tristate "Samsung S6E3HA2 DSI video mode panel" + depends on OF + select DRM_MIPI_DSI + select VIDEOMODE_HELPERS + config DRM_PANEL_SHARP_LQ101R1SX01 tristate "Sharp LQ101R1SX01 panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index a5c7ec0..993699b 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -4,5 +4,6 @@ obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += panel-panasonic-vvx10f034n00.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o obj-$(CONFIG_DRM_PANEL_SHARP_LS043T1LE01) += panel-sharp-ls043t1le01.o diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c new file mode 100644 index 0000000..a6ad63b --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha2.c @@ -0,0 +1,756 @@ +/* + * MIPI-DSI based s6e3ha2 AMOLED 5.7 inch panel driver. + * + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Donghwa Lee + * Hyungwon Hwang + * Hoegeun Kwon + * + * 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