From patchwork Wed Dec 10 08:37:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Ying X-Patchwork-Id: 5467471 Return-Path: X-Original-To: patchwork-dri-devel@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 5DF7C9F2E8 for ; Wed, 10 Dec 2014 08:49:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 25E55200C6 for ; Wed, 10 Dec 2014 08:49:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A597420160 for ; Wed, 10 Dec 2014 08:49:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D3C766E3C8; Wed, 10 Dec 2014 00:49:16 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0113.outbound.protection.outlook.com [157.56.111.113]) by gabe.freedesktop.org (Postfix) with ESMTP id 660E66E3C8 for ; Wed, 10 Dec 2014 00:49:15 -0800 (PST) Received: from BY2PR03CA057.namprd03.prod.outlook.com (10.141.249.30) by CY1PR0301MB0636.namprd03.prod.outlook.com (25.160.158.142) with Microsoft SMTP Server (TLS) id 15.1.31.17; Wed, 10 Dec 2014 08:34:23 +0000 Received: from BN1AFFO11FD058.protection.gbl (2a01:111:f400:7c10::131) by BY2PR03CA057.outlook.office365.com (2a01:111:e400:2c5d::30) with Microsoft SMTP Server (TLS) id 15.1.31.17 via Frontend Transport; Wed, 10 Dec 2014 08:34:23 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD058.mail.protection.outlook.com (10.58.53.73) with Microsoft SMTP Server (TLS) id 15.1.26.17 via Frontend Transport; Wed, 10 Dec 2014 08:34:22 +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 sBA8XhYJ001904; Wed, 10 Dec 2014 01:34:18 -0700 From: Liu Ying To: Subject: [PATCH RFC 09/15] drm: imx: Add MIPI DSI host controller driver Date: Wed, 10 Dec 2014 16:37:22 +0800 Message-ID: <1418200648-32656-10-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 X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(479174003)(86362001)(48376002)(50466002)(4396001)(64706001)(47776003)(20776003)(104016003)(97736003)(68736005)(62966003)(21056001)(575784001)(77156002)(36756003)(110136001)(77096005)(99396003)(46102003)(120916001)(106466001)(19580395003)(19580405001)(87936001)(89996001)(105606002)(84676001)(31966008)(76176999)(229853001)(50986999)(92566001)(50226001)(6806004)(107046002)(2351001)(2004002)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB0636; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0636; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(602002); SRVR:CY1PR0301MB0636; X-Forefront-PRVS: 0421BF7135 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-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB0636; X-OriginatorOrg: freescale.com Cc: devicetree@vger.kernel.org, linux@arm.linux.org.uk, kernel@pengutronix.de, linux-kernel@vger.kernel.org, mturquette@linaro.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 i.MX MIPI DSI host controller driver support. Currently, the driver supports the burst with sync pulses mode only. Signed-off-by: Liu Ying --- .../devicetree/bindings/drm/imx/mipi_dsi.txt | 81 ++ drivers/gpu/drm/imx/Kconfig | 6 + drivers/gpu/drm/imx/Makefile | 1 + drivers/gpu/drm/imx/imx-mipi-dsi.c | 1017 ++++++++++++++++++++ 4 files changed, 1105 insertions(+) create mode 100644 Documentation/devicetree/bindings/drm/imx/mipi_dsi.txt create mode 100644 drivers/gpu/drm/imx/imx-mipi-dsi.c diff --git a/Documentation/devicetree/bindings/drm/imx/mipi_dsi.txt b/Documentation/devicetree/bindings/drm/imx/mipi_dsi.txt new file mode 100644 index 0000000..3d07fd7 --- /dev/null +++ b/Documentation/devicetree/bindings/drm/imx/mipi_dsi.txt @@ -0,0 +1,81 @@ +Device-Tree bindings for MIPI DSI host controller + +MIPI DSI host controller +======================== + +The MIPI DSI host controller is a Synopsys DesignWare IP. +It is a digital core that implements all protocol functions defined +in the MIPI DSI specification, providing an interface between the +system and the MIPI DPHY, and allowing communication with a MIPI DSI +compliant display. + +Required properties: + - #address-cells : Should be <1>. + - #size-cells : Should be <0>. + - compatible : Should be "fsl,imx6q-mipi-dsi" for i.MX6q/sdl SoCs. + - reg : Physical base address of the controller and length of memory + mapped region. + - interrupts : The controller's interrupt number to the CPU(s). + - gpr : Should be <&gpr>. + The phandle points to the iomuxc-gpr region containing the + multiplexer control register for the controller. + - clocks, clock-names : Phandles to the controller pllref, pllref_gate + and core_cfg clocks, as described in [1] and [2]. + - panel@0 : A panel node which contains a display-timings child node as + defined in [3]. + - port@[0-4] : Up to four port nodes with endpoint definitions as defined + in [4], corresponding to the four inputs to the controller multiplexer. + Note that each port node should contain the input-port property to + distinguish it from the panel node, as described in [5]. + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt +[2] Documentation/devicetree/bindings/clock/imx6q-clock.txt +[3] Documentation/devicetree/bindings/video/display-timing.txt +[4] Documentation/devicetree/bindings/media/video-interfaces.txt +[5] Documentation/devicetree/bindings/mipi/dsi/mipi-dsi-bus.txt + +example: + gpr: iomuxc-gpr@020e0000 { + /* ... */ + }; + + mipi_dsi: mipi@021e0000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,imx6q-mipi-dsi"; + reg = <0x021e0000 0x4000>; + interrupts = <0 102 IRQ_TYPE_LEVEL_HIGH>; + gpr = <&gpr>; + clocks = <&clks IMX6QDL_CLK_VIDEO_27M>, + <&clks IMX6QDL_CLK_HSI_TX>, + <&clks IMX6QDL_CLK_HSI_TX>; + clock-names = "pllref", "pllref_gate", "core_cfg"; + + port@0 { + reg = <0>; + input-port; + + mipi_mux_0: endpoint { + remote-endpoint = <&ipu1_di0_mipi>; + }; + }; + + port@1 { + reg = <1>; + input-port; + + mipi_mux_1: endpoint { + remote-endpoint = <&ipu1_di1_mipi>; + }; + }; + + panel@0 { + compatible = "himax,hx8369a-dsi"; + reg = <0>; + /* ... */ + + display-timings { + /* ... */ + }; + }; + }; diff --git a/drivers/gpu/drm/imx/Kconfig b/drivers/gpu/drm/imx/Kconfig index 82fb758..03f04fb 100644 --- a/drivers/gpu/drm/imx/Kconfig +++ b/drivers/gpu/drm/imx/Kconfig @@ -51,3 +51,9 @@ config DRM_IMX_HDMI depends on DRM_IMX help Choose this if you want to use HDMI on i.MX6. + +config DRM_IMX_MIPI_DSI + tristate "Freescale i.MX DRM MIPI DSI" + depends on DRM_IMX && MFD_SYSCON + help + Choose this if you want to use MIPI DSI on i.MX6. diff --git a/drivers/gpu/drm/imx/Makefile b/drivers/gpu/drm/imx/Makefile index 582c438..4571d52 100644 --- a/drivers/gpu/drm/imx/Makefile +++ b/drivers/gpu/drm/imx/Makefile @@ -10,3 +10,4 @@ obj-$(CONFIG_DRM_IMX_LDB) += imx-ldb.o imx-ipuv3-crtc-objs := ipuv3-crtc.o ipuv3-plane.o obj-$(CONFIG_DRM_IMX_IPUV3) += imx-ipuv3-crtc.o obj-$(CONFIG_DRM_IMX_HDMI) += imx-hdmi.o +obj-$(CONFIG_DRM_IMX_MIPI_DSI) += imx-mipi-dsi.o diff --git a/drivers/gpu/drm/imx/imx-mipi-dsi.c b/drivers/gpu/drm/imx/imx-mipi-dsi.c new file mode 100644 index 0000000..c8ebeca --- /dev/null +++ b/drivers/gpu/drm/imx/imx-mipi-dsi.c @@ -0,0 +1,1017 @@ +/* + * i.MX drm driver - MIPI DSI Host Controller + * + * 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include