Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755300AbaLJItl (ORCPT ); Wed, 10 Dec 2014 03:49:41 -0500 Received: from mail-bl2on0137.outbound.protection.outlook.com ([65.55.169.137]:65478 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752378AbaLJItg (ORCPT ); Wed, 10 Dec 2014 03:49:36 -0500 From: Liu Ying To: CC: , , , , , , , , , 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 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 Content-Type: text/plain 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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