From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932320AbbFHINo (ORCPT ); Mon, 8 Jun 2015 04:13:44 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:49018 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752686AbbFHIN2 (ORCPT ); Mon, 8 Jun 2015 04:13:28 -0400 X-Auth-Info: qwNvzmUtjIRqlgakHduYlLRqSZM8o6NSbetny7LH2SU= Message-ID: <55754EA1.40009@denx.de> Date: Mon, 08 Jun 2015 10:13:21 +0200 From: Heiko Schocher Reply-To: hs@denx.de Organization: DENX Software Engineering User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Thierry Reding CC: linux-kernel@vger.kernel.org, David Airlie , dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/panel: add lg4573 driver References: <1430898573-14783-1-git-send-email-hs@denx.de> <20150605121934.GA26656@ulmo.nvidia.com> In-Reply-To: <20150605121934.GA26656@ulmo.nvidia.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Thierry, Am 05.06.2015 14:19, schrieb Thierry Reding: > On Wed, May 06, 2015 at 09:49:33AM +0200, Heiko Schocher wrote: >> The patch adds LG4573 parallel RGB panel driver with SPI control interface. >> The driver uses drm_panel framework. > > This should be obvious by the location of the driver. Can you instead > provide information about the type or resolution of the panel? > >> .../devicetree/bindings/panel/lg,lg4573.txt | 42 +++ >> drivers/gpu/drm/panel/Kconfig | 8 + >> drivers/gpu/drm/panel/Makefile | 1 + >> drivers/gpu/drm/panel/panel-lg4573.c | 367 +++++++++++++++++++++ >> 4 files changed, 418 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/panel/lg,lg4573.txt >> create mode 100644 drivers/gpu/drm/panel/panel-lg4573.c >> >> diff --git a/Documentation/devicetree/bindings/panel/lg,lg4573.txt b/Documentation/devicetree/bindings/panel/lg,lg4573.txt >> new file mode 100644 >> index 0000000..55f495d >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/panel/lg,lg4573.txt >> @@ -0,0 +1,42 @@ >> +LG LG4573 TFT liquid crystal display with SPI control bus > > Please capitalize "Liquid Crystal Display". done. >> + >> +Required properties: >> + - compatible: "lg4573" > > This is missing the vendor prefix. fixed. >> + - reg: address of the panel on SPI bus > > "on the" fixed. >> + - display-timings: timings for the connected panel according to [1] > > The timings are already implied by the compatible value, so there's no > need to list them in DT. I look into it ... is there an example for a panel driver with fixed timings? Should I do it like it is done in the drivers/gpu/drm/panel/panel-simple.c driver? >> +The panel must obey rules for SPI slave device specified in document [2]. >> + >> +Optional properties: >> + - power-on-delay: delay after turning regulators on [ms] > > How is this a board-specific property? I'd assume that the same panel > always requires the same delay. Perhaps if this is board-specific it > really should be in the corresponding regulator's > regulator-enable-ramp-delay? Then again the binding doesn't describe any > regulators, so what exactly is this delay used for? I rework this, and drop it. >> + >> +[1]: Documentation/devicetree/bindings/video/display-timing.txt >> +[2]: Documentation/devicetree/bindings/spi/spi-bus.txt >> + >> +Example: >> + >> + lcd_panel: display@0 { >> + #address-cells = <1>; >> + #size-cells = <1>; >> + compatible = "lg,lg4573"; >> + spi-max-frequency = <10000000>; >> + reset-gpios = <&gpio2 11 0>; > > This isn't documented above. removed. >> + reg = <0>; >> + power-on-delay = <10>; >> + display-timings { >> + 480x800p57 { >> + native-mode; >> + clock-frequency = <27000027>; >> + hactive = <480>; >> + vactive = <800>; >> + hfront-porch = <10>; >> + hback-porch = <59>; >> + hsync-len = <10>; >> + vback-porch = <15>; >> + vfront-porch = <15>; >> + vsync-len = <15>; >> + hsync-active = <1>; >> + vsync-active = <1>; >> + }; >> + }; >> + }; >> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig >> index 6d64c7b..29c3407 100644 >> --- a/drivers/gpu/drm/panel/Kconfig >> +++ b/drivers/gpu/drm/panel/Kconfig >> @@ -23,6 +23,14 @@ config DRM_PANEL_LD9040 >> depends on OF && SPI >> select VIDEOMODE_HELPERS >> >> +config DRM_PANEL_LG4573 >> + tristate "LG4573 RGB/SPI panel" > > I'd like to get into the habit of prefixing the panels with a vendor > prefix, so this should become something like: > > config DRM_PANEL_LG_LG4573 > tristate "LG LG4573 RGB/SPI panel" > > I have a local patch that converts existing boards, so with this > conversion it'd fit right it. done. >> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile >> index 4b2a043..715b95d 100644 >> --- a/drivers/gpu/drm/panel/Makefile >> +++ b/drivers/gpu/drm/panel/Makefile >> @@ -1,4 +1,5 @@ >> obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o >> obj-$(CONFIG_DRM_PANEL_LD9040) += panel-ld9040.o >> +obj-$(CONFIG_DRM_PANEL_LG4573) += panel-lg4573.o > > Similarly for filenames, this would become: panel-lg-lg4573.c done. >> obj-$(CONFIG_DRM_PANEL_S6E8AA0) += panel-s6e8aa0.o >> obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o >> diff --git a/drivers/gpu/drm/panel/panel-lg4573.c b/drivers/gpu/drm/panel/panel-lg4573.c >> new file mode 100644 >> index 0000000..9d5e5a5 >> --- /dev/null >> +++ b/drivers/gpu/drm/panel/panel-lg4573.c >> @@ -0,0 +1,367 @@ >> +/* >> + * >> + * Copyright (C) 2015 Heiko Schocher >> + * >> + * from: >> + * drivers/gpu/drm/panel/panel-ld9040.c >> + * ld9040 AMOLED LCD drm_panel driver. >> + * >> + * Copyright (c) 2014 Samsung Electronics Co., Ltd >> + * Derived from drivers/video/backlight/ld9040.c >> + * >> + * Andrzej Hajda >> + * >> + * 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