From patchwork Fri Nov 8 13:01:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denis Carikli X-Patchwork-Id: 3158781 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1DBC8C045C for ; Fri, 8 Nov 2013 15:31:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 622432065E for ; Fri, 8 Nov 2013 13:03:10 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F1F9F2065D for ; Fri, 8 Nov 2013 13:03:04 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Velhl-00010i-Ao; Fri, 08 Nov 2013 13:02:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Velhc-0003Lk-0c; Fri, 08 Nov 2013 13:02:20 +0000 Received: from smtp1-g21.free.fr ([2a01:e0c:1:1599::10]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VelhT-0003K4-0a for linux-arm-kernel@lists.infradead.org; Fri, 08 Nov 2013 13:02:14 +0000 Received: from denis-N73SV.local.eukrea.com (unknown [88.170.243.169]) by smtp1-g21.free.fr (Postfix) with ESMTP id 1CBD394007F; Fri, 8 Nov 2013 14:01:43 +0100 (CET) From: Denis Carikli To: Jean-Christophe Plagniol-Villard Subject: [PATCHv5][ 2/5] video: mx3fb: Add device tree suport. Date: Fri, 8 Nov 2013 14:01:30 +0100 Message-Id: <1383915693-9422-2-git-send-email-denis@eukrea.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1383915693-9422-1-git-send-email-denis@eukrea.com> References: <1383915693-9422-1-git-send-email-denis@eukrea.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131108_080211_888650_E06CA501 X-CRM114-Status: GOOD ( 26.07 ) X-Spam-Score: -1.2 (-) Cc: Mark Rutland , devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org, =?UTF-8?q?Eric=20B=C3=A9nard?= , Pawel Moll , Stephen Warren , Ian Campbell , Rob Herring , Denis Carikli , Tomi Valkeinen , Sascha Hauer , Grant Likely , Shawn Guo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Cc: linux-fbdev@vger.kernel.org Cc: Rob Herring Cc: Pawel Moll Cc: Mark Rutland Cc: Stephen Warren Cc: Ian Campbell Cc: Grant Likely Cc: devicetree@vger.kernel.org Cc: Sascha Hauer Cc: Shawn Guo Cc: linux-arm-kernel@lists.infradead.org Cc: Eric BĂ©nard Signed-off-by: Denis Carikli --- ChangeLog v4->v5: - Added some people in the Cc list. - The full ipu register range is now passed to the driver, the code and the documentation were adapted to it. - Updated the documentation not to mention the lcd controller, the ipu was mentioned instead. - The ipu patch was removed from this patchset, as a consequence the mx3fb code has been adapted not to expect the dma ipu driver to be probed trough the device tree. ChangeLog v3->v4: - Updated bindings. - Updated documentation accordinly. - Updated code accordinly. - Fixed the lack of "ret =" in of_property_read_string(display_np, "model", &name); - Supressed some compilation warnings. ChangeLog v2->v3: - The device tree bindings were reworked in order to make it look more like the IPUv3 bindings. - The interface_pix_fmt property now looks like the IPUv3 one. --- .../devicetree/bindings/video/fsl,mx3-fb.txt | 44 +++++++ drivers/video/Kconfig | 2 + drivers/video/mx3fb.c | 123 +++++++++++++++++--- 3 files changed, 151 insertions(+), 18 deletions(-) create mode 100644 Documentation/devicetree/bindings/video/fsl,mx3-fb.txt diff --git a/Documentation/devicetree/bindings/video/fsl,mx3-fb.txt b/Documentation/devicetree/bindings/video/fsl,mx3-fb.txt new file mode 100644 index 0000000..c0409a4 --- /dev/null +++ b/Documentation/devicetree/bindings/video/fsl,mx3-fb.txt @@ -0,0 +1,44 @@ +Freescale MX3 IPU. +================== + +Required properties: +- compatible: Should be "fsl,-ipu". compatible chips include the imx31 and the + imx35. +- reg: should be register base and length as documented in the datasheet. +- clocks: Handle to the ipu_gate clock. +- display: Phandle to a "fsl,mx3-parallel-display" compatible display node + which is described below. + +Example: + +ipu: ipu@53fc0000 { + compatible = "fsl,imx35-ipu"; + reg = <0x53fc0000 0x4000>; + clocks = <&clks 55>; +}; + +Parallel display support +======================== + +Required properties: +- compatible: Should be "fsl,mx3-parallel-display". +- model : The user-visible name of the display. + +Optional properties: +- interface_pix_fmt: How this display is connected to the + crtc. Currently supported types: "rgb24", "rgb565", "rgb666". + +It can also have an optional timing subnode as described in + Documentation/devicetree/bindings/video/display-timing.txt. + +Example: + +display0: display@di0 { + compatible = "fsl,mx3-parallel-display"; + interface-pix-fmt = "rgb666"; + model = "CMO-QVGA"; +}; + +&ipu { + display = <&display0>; +} diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 84b685f..edcfa33 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -2357,6 +2357,8 @@ config FB_MX3 select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select VIDEOMODE_HELPERS + select FB_MODE_HELPERS default y help This is a framebuffer device for the i.MX31 LCD Controller. So diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c index cfdb380..7620e4f 100644 --- a/drivers/video/mx3fb.c +++ b/drivers/video/mx3fb.c @@ -31,6 +31,8 @@ #include #include +#include