Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756521AbaLJODs (ORCPT ); Wed, 10 Dec 2014 09:03:48 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:53025 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755290AbaLJODo (ORCPT ); Wed, 10 Dec 2014 09:03:44 -0500 Date: Wed, 10 Dec 2014 15:03:39 +0100 From: Thierry Reding To: Liu Ying Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, p.zabel@pengutronix.de, shawn.guo@linaro.org, kernel@pengutronix.de, linux@arm.linux.org.uk, mturquette@linaro.org, airlied@linux.ie Subject: Re: [PATCH RFC 10/15] drm: panel: Add support for Himax HX8369A MIPI DSI panel Message-ID: <20141210140334.GE23558@ulmo.nvidia.com> References: <1418200648-32656-1-git-send-email-Ying.Liu@freescale.com> <1418200648-32656-11-git-send-email-Ying.Liu@freescale.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d8Lz2Tf5e5STOWUP" Content-Disposition: inline In-Reply-To: <1418200648-32656-11-git-send-email-Ying.Liu@freescale.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --d8Lz2Tf5e5STOWUP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 10, 2014 at 04:37:23PM +0800, Liu Ying wrote: > This patch adds support for Himax HX8369A MIPI DSI panel. >=20 > Signed-off-by: Liu Ying > --- > .../devicetree/bindings/panel/himax,hx8369a.txt | 86 +++ > drivers/gpu/drm/panel/Kconfig | 6 + > drivers/gpu/drm/panel/Makefile | 1 + > drivers/gpu/drm/panel/panel-hx8369a.c | 627 +++++++++++++++= ++++++ > 4 files changed, 720 insertions(+) > create mode 100644 Documentation/devicetree/bindings/panel/himax,hx8369a= =2Etxt > create mode 100644 drivers/gpu/drm/panel/panel-hx8369a.c >=20 > diff --git a/Documentation/devicetree/bindings/panel/himax,hx8369a.txt b/= Documentation/devicetree/bindings/panel/himax,hx8369a.txt > new file mode 100644 > index 0000000..6fe251e > --- /dev/null > +++ b/Documentation/devicetree/bindings/panel/himax,hx8369a.txt > @@ -0,0 +1,86 @@ > +Himax HX8369A WVGA 16.7M color TFT single chip driver with internal GRAM > + > +Himax HX8369A is a WVGA resolution driving controller. > +It is designed to provide a single chip solution that combines a source > +driver and power supply circuits to drive a TFT dot matrix LCD with > +480RGBx864 dots at the maximum. > + > +The HX8369A supports several interface modes, including MPU MIPI DBI Type > +A/B mode, MIPI DPI/DBI Type C mode, MIPI DSI video mode, MIPI DSI command > +mode and MDDI mode. The interface mode is selected by the external hardw= are > +pins BS[3:0]. > + > +Currently, only the MIPI DSI video mode is supported. > + > +Required properties: > + - compatible: "himax,hx8369a-dsi" > + - reg: the virtual channel number of a DSI peripheral > + - reset-gpios: a GPIO spec for the reset pin > + - data-lanes: the data lane number of a DSI peripheral This is implied by the compatible already. > + - display-timings: timings for the connected panel as described by [1] Also implied by the compatible value. > + - bs: the interface mode number described by the following table > + -------------------------- > + | DBI_TYPE_A_8BIT | 0 | > + | DBI_TYPE_A_9BIT | 1 | > + | DBI_TYPE_A_16BIT | 2 | > + | DBI_TYPE_A_18BIT | 3 | > + | DBI_TYPE_B_8BIT | 4 | > + | DBI_TYPE_B_9BIT | 5 | > + | DBI_TYPE_B_16BIT | 6 | > + | DBI_TYPE_B_18BIT | 7 | > + | DSI_CMD_MODE | 8 | > + | DBI_TYPE_B_24BIT | 9 | > + | DSI_VIDEO_MODE | 10 | > + | MDDI | 11 | > + | DPI_DBI_TYPE_C_OPT1 | 12 | > + | DPI_DBI_TYPE_C_OPT2 | 13 | > + | DPI_DBI_TYPE_C_OPT3 | 14 | > + -------------------------- Can this not be inferred by the driver? If it's a DSI driver can't it select between DSI_VIDEO_MODE or DSI_CMD_MODE based on its capabilities? That is, if the panel driver can setup command mode, shouldn't it be using command mode in that case? And use DSI_VIDEO_MODE otherwise? > +Optional properties: > + - power-on-delay: delay after turning regulators on [ms] > + - reset-delay: delay after reset sequence [ms] Surely these are constant for this panel? > + - panel-width-mm: physical panel width [mm] > + - panel-height-mm: physical panel height [mm] These are also implied by compatible. > +Example: > + panel@0 { > + compatible =3D "himax,hx8369a-dsi"; > + reg =3D <0>; > + pinctrl-names =3D "default"; > + pinctrl-0 =3D <&pinctrl_mipi_panel>; > + reset-gpios =3D <&gpio6 11 GPIO_ACTIVE_LOW>; > + reset-delay =3D <120>; > + bs2-gpios =3D <&gpio6 14 GPIO_ACTIVE_HIGH>; > + data-lanes =3D <2>; > + panel-width-mm =3D <45>; > + panel-height-mm =3D <76>; > + bs =3D <10>; > + status =3D "okay"; status =3D "okay" is the default, so it probably shouldn't be in this example. > diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig > index 024e98e..f1a5b58 100644 > --- a/drivers/gpu/drm/panel/Kconfig > +++ b/drivers/gpu/drm/panel/Kconfig > @@ -40,4 +40,10 @@ config DRM_PANEL_SHARP_LQ101R1SX01 > To compile this driver as a module, choose M here: the module > will be called panel-sharp-lq101r1sx01. > =20 > +config DRM_PANEL_HX8369A > + tristate "HX8369A panel" > + depends on OF > + select DRM_MIPI_DSI > + select VIDEOMODE_HELPERS > + This should be sorted alphabetically. I think it would also be a good idea to use a HIMAX prefix here, just to reduce the potential for name clashes. > diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makef= ile > index 4b2a043..d6768ca 100644 > --- a/drivers/gpu/drm/panel/Makefile > +++ b/drivers/gpu/drm/panel/Makefile > @@ -2,3 +2,4 @@ obj-$(CONFIG_DRM_PANEL_SIMPLE) +=3D panel-simple.o > obj-$(CONFIG_DRM_PANEL_LD9040) +=3D panel-ld9040.o > obj-$(CONFIG_DRM_PANEL_S6E8AA0) +=3D panel-s6e8aa0.o > obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) +=3D panel-sharp-lq101r1sx01.o > +obj-$(CONFIG_DRM_PANEL_HX8369A) +=3D panel-hx8369a.o Needs to be sorted alphabetically, too. > diff --git a/drivers/gpu/drm/panel/panel-hx8369a.c b/drivers/gpu/drm/pane= l/panel-hx8369a.c [...] > +#include > +#include > +#include > + > +#include > +#include > + > +#include