Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754379AbcL0Lhp (ORCPT ); Tue, 27 Dec 2016 06:37:45 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:45684 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753574AbcL0Lhi (ORCPT ); Tue, 27 Dec 2016 06:37:38 -0500 X-AuditID: cbfec7f5-f79676d00000294c-c0-586252537e99 Subject: Re: [PATCH v2 1/2] drm/panel: Add support for S6E3HA2 panel driver on TM2 board To: Hoegeun Kwon , robh@kernel.org, thierry.reding@gmail.com, airlied@linux.ie, kgene@kernel.org, krzk@kernel.org Cc: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Donghwa Lee , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, cw00.choi@samsung.com, Hyungwon Hwang From: Andrzej Hajda Message-id: <693d8abd-12f4-2e04-fdf1-182a99056808@samsung.com> Date: Tue, 27 Dec 2016 12:36:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-version: 1.0 In-reply-to: <1482829548-20842-2-git-send-email-hoegeun.kwon@samsung.com> Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Sa0hTYRjHeXfO2Y7myeO89GSmNAjL0BQUDiV2M1hIYfVBMaNmnrykU3ZU VPygFN5GLuxmFmXQLGalTrMpIrpslqHLJkl4pchLQ7xNSWLatjPBb7/nff7/5+H/8JKYuI3w JdPkOaxCLsuQCF3xNsO6MfjihaT4UFNVOHN78LOAGbHMEMyz3kGCGTFGMcOrC0Jm4WWlkFHX VBGM6pcZY4zGJhFj6ngiZGqMXQJms1MnYtY7nuLHKWl77bhIqtVUCKXv16YI6aSyTyCtatUg 6YrWP1aY4BqZzGak5bGKw1FXXVNb+jWC7IFyQb6+cUFUjPpNqBK5kECHw0q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v5JtAsDg5e ATuJj1fkQcIsAqoSf6+9ZQEJiwpESDQcTgcJ8woISvyYfA9sGaeAp8T9t8/BSpgF1CWmTMkF CTMLyEtsXvOWeQKjwCwkHbMQqmYhqVrAyLyKUSS1tDg3PbfYUK84Mbe4NC9dLzk/dxMjMEa3 Hfu5eQfjpY3BhxgFOBiVeHgDViVGCLEmlhVX5h5ilOBgVhLhXeGTFCHEm5JYWZValB9fVJqT WnyI0RTog4nMUqLJ+cD0kVcSb2hiaG5paGRsYWFuZKQkzlvy4Uq4kEB6YklqdmpqQWoRTB8T B6dUA2MrW0Xaq8cp7d3/FC5Ln+n5/Hf1oz9OG0xPRjGcWnj1z8ZLih9cZHKjLt+81nxc6Pq3 KNOpt+ct9c8rfs6QNOmc7HYLlc8XX2W8uyNTxhFlVnxnssKOSiGtz6Jr3Vu2l/pZHWC2Etp1 ZP8UkexVM6bK5l4wv7U2qN7Ht89KaZdwzvn9R3/IbHqoxFKckWioxVxUnAgASn6PEOcCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161227113651eucas1p1dbf2d5213c0769930f5eba86b7f90392 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRvsgrw=?= =?UTF-8?B?7ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?QW5kcnplaiBIYWpkYRtTUlBPTC1LZXJuZWwgKFRQKRtTYW1z?= =?UTF-8?B?dW5nIEVsZWN0cm9uaWNzG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161227090606epcas5p2d71e13cc6d1bcd7f47bc5d92387f4e32 X-RootMTR: 20161227090606epcas5p2d71e13cc6d1bcd7f47bc5d92387f4e32 References: <1482829548-20842-1-git-send-email-hoegeun.kwon@samsung.com> <1482829548-20842-2-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: 32928 Lines: 939 Hi Hoegeun Kwon, Thanks for the patch. On 27.12.2016 10:05, Hoegeun Kwon wrote: > 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. I do not understand this change, according to Rob's comment for previous patch: > reg doesn't really work here unless this node is a child of the DSI > controller node. But if it is a child node, then you don't need the OF > graph. As the panel is controlled via DSI bus the node should be a child of DSI controller, and therefore 'reg' property is required. Nice novum for me is that OF graph is not required in that case. > > .../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 Shouldn't be 'I/O voltage supply' ? > + - vci-supply: voltage supply for analog circuits > + - reset-gpios: a GPIO spec for the reset pin (active high) According to specs it is active low, logic in the driver should be also adjusted. > + - 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] In case of panels timings should be provided by device driver, not by dts. > + > +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. This could be dropped according to Rob's advice. > + > +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 It should be "depends on" in case of panels. > + 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 Shoudn't it be sorted? > 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