From patchwork Wed Dec 10 08:37:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 5467251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E0B19F2E8 for ; Wed, 10 Dec 2014 08:43:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 578D520160 for ; Wed, 10 Dec 2014 08:43:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 726BF20121 for ; Wed, 10 Dec 2014 08:43:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xycnt-0005Um-GD; Wed, 10 Dec 2014 08:39:25 +0000 Received: from mail-bn1on0131.outbound.protection.outlook.com ([157.56.110.131] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XycjS-0001Ia-4j for linux-arm-kernel@lists.infradead.org; Wed, 10 Dec 2014 08:34:53 +0000 Received: from CH1PR03CA006.namprd03.prod.outlook.com (10.255.156.151) by BY2PR0301MB0632.namprd03.prod.outlook.com (25.160.63.12) with Microsoft SMTP Server (TLS) id 15.1.31.17; Wed, 10 Dec 2014 08:34:27 +0000 Received: from BY2FFO11FD041.protection.gbl (10.255.156.132) by CH1PR03CA006.outlook.office365.com (10.255.156.151) with Microsoft SMTP Server (TLS) id 15.1.31.17 via Frontend Transport; Wed, 10 Dec 2014 08:34:26 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BY2FFO11FD041.mail.protection.outlook.com (10.1.14.226) with Microsoft SMTP Server (TLS) id 15.1.26.17 via Frontend Transport; Wed, 10 Dec 2014 08:34:26 +0000 Received: from victor.ap.freescale.net (victor.ap.freescale.net [10.192.241.62]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id sBA8XhYK001904; Wed, 10 Dec 2014 01:34:22 -0700 From: Liu Ying To: Subject: [PATCH RFC 10/15] drm: panel: Add support for Himax HX8369A MIPI DSI panel Date: Wed, 10 Dec 2014 16:37:23 +0800 Message-ID: <1418200648-32656-11-git-send-email-Ying.Liu@freescale.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1418200648-32656-1-git-send-email-Ying.Liu@freescale.com> References: <1418200648-32656-1-git-send-email-Ying.Liu@freescale.com> X-EOPAttributedMessage: 0 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=Ying.Liu@freescale.com; X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(199003)(189002)(6806004)(19580405001)(85426001)(19580395003)(89996001)(46102003)(2351001)(229853001)(107046002)(87936001)(97736003)(106466001)(99396003)(105606002)(84676001)(68736005)(50466002)(48376002)(77096005)(50986999)(76176999)(64706001)(104016003)(575784001)(86362001)(20776003)(47776003)(110136001)(36756003)(120916001)(31966008)(62966003)(92566001)(21056001)(4396001)(77156002)(50226001)(2004002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0301MB0632; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB0632; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(602002); SRVR:BY2PR0301MB0632; X-Forefront-PRVS: 0421BF7135 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB0632; X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141210_003450_579200_A4FC1C2F X-CRM114-Status: GOOD ( 16.15 ) X-Spam-Score: -0.0 (/) Cc: devicetree@vger.kernel.org, linux@arm.linux.org.uk, kernel@pengutronix.de, airlied@linux.ie, linux-kernel@vger.kernel.org, thierry.reding@gmail.com, p.zabel@pengutronix.de, mturquette@linaro.org, shawn.guo@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 This patch adds support for Himax HX8369A MIPI DSI panel. 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.txt create mode 100644 drivers/gpu/drm/panel/panel-hx8369a.c 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 hardware +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 + - display-timings: timings for the connected panel as described by [1] + - 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 | + -------------------------- + +Optional properties: + - power-on-delay: delay after turning regulators on [ms] + - reset-delay: delay after reset sequence [ms] + - vdd1-supply: I/O and interface power supply + - vdd2-supply: analog power supply + - vdd3-supply: logic power supply + - dsi-vcc-supply: DSI and MDDI power supply + - vpp-supply: OTP programming voltage + - bs0-gpios: a GPIO spec for the pin BS0 + - bs1-gpios: a GPIO spec for the pin BS1 + - bs2-gpios: a GPIO spec for the pin BS2 + - bs3-gpios: a GPIO spec for the pin BS3 + - panel-width-mm: physical panel width [mm] + - panel-height-mm: physical panel height [mm] + +[1]: Documentation/devicetree/bindings/video/display-timing.txt + +Example: + panel@0 { + compatible = "himax,hx8369a-dsi"; + reg = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mipi_panel>; + reset-gpios = <&gpio6 11 GPIO_ACTIVE_LOW>; + reset-delay = <120>; + bs2-gpios = <&gpio6 14 GPIO_ACTIVE_HIGH>; + data-lanes = <2>; + panel-width-mm = <45>; + panel-height-mm = <76>; + bs = <10>; + status = "okay"; + + display-timings { + native-mode = <&timing1>; + timing1: truly-tft480800-16-e { + clock-frequency = <26400000>; + hactive = <480>; + vactive = <800>; + hfront-porch = <8>; + hback-porch = <8>; + hsync-len = <8>; + vfront-porch = <6>; + vback-porch = <6>; + vsync-len = <6>; + }; + }; +}; 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. +config DRM_PANEL_HX8369A + tristate "HX8369A 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 4b2a043..d6768ca 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -2,3 +2,4 @@ obj-$(CONFIG_DRM_PANEL_SIMPLE) += panel-simple.o 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_HX8369A) += panel-hx8369a.o diff --git a/drivers/gpu/drm/panel/panel-hx8369a.c b/drivers/gpu/drm/panel/panel-hx8369a.c new file mode 100644 index 0000000..a8cdaea --- /dev/null +++ b/drivers/gpu/drm/panel/panel-hx8369a.c @@ -0,0 +1,627 @@ +/* + * Himax HX8369A panel driver. + * + * Copyright (C) 2011-2014 Freescale Semiconductor, Inc. + * + * 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. + * + * This driver is based on Samsung s6e8aa0 panel driver. + */ + +#include +#include +#include + +#include +#include + +#include