From patchwork Fri Mar 14 09:12:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Carikli X-Patchwork-Id: 3831411 Return-Path: X-Original-To: patchwork-linux-fbdev@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 13B10BF540 for ; Fri, 14 Mar 2014 09:13:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B258E20306 for ; Fri, 14 Mar 2014 09:13:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B553202E9 for ; Fri, 14 Mar 2014 09:13:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755823AbaCNJNF (ORCPT ); Fri, 14 Mar 2014 05:13:05 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:39907 "EHLO smtp1-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755773AbaCNJND (ORCPT ); Fri, 14 Mar 2014 05:13:03 -0400 Received: from denis-N73SV.local.eukrea.com (unknown [88.170.243.169]) by smtp1-g21.free.fr (Postfix) with ESMTP id B64AD94004B; Fri, 14 Mar 2014 10:12:56 +0100 (CET) From: Denis Carikli To: Jean-Christophe Plagniol-Villard , Tomi Valkeinen Cc: =?UTF-8?q?Eric=20B=C3=A9nard?= , Shawn Guo , Sascha Hauer , linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, Denis Carikli Subject: [PATCH v7][ 2/5] video: mx3fb: Add device tree suport. Date: Fri, 14 Mar 2014 10:12:46 +0100 Message-Id: <1394788369-5096-2-git-send-email-denis@eukrea.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1394788369-5096-1-git-send-email-denis@eukrea.com> References: <1394788369-5096-1-git-send-email-denis@eukrea.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 is based on: 838bdf7 video: mxsfb: fix broken videomode selection Signed-off-by: Denis Carikli --- ChangeLog v6->v7: - Removed the Cc from the patch, they went into git send-email instead. ChangeLog v5->v6: - Shrinked the Cc list. - de-active and pixelclk-active dt properties are now handled in this patch to get rid of the "fbdev: Add the lacking FB_SYNC_* for matching the DISPLAY_FLAGS_*" patch 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/fbdev/Kconfig | 2 + drivers/video/fbdev/mx3fb.c | 185 +++++++++++++++++--- 3 files changed, 208 insertions(+), 23 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/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 67409e0..c996b96 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -2330,6 +2330,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/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c index ee95de8..952d2b5 100644 --- a/drivers/video/fbdev/mx3fb.c +++ b/drivers/video/fbdev/mx3fb.c @@ -31,6 +31,10 @@ #include #include +#include