From patchwork Sun May 26 10:35:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Pargmann X-Patchwork-Id: 2614951 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id D82C1DFB79 for ; Sun, 26 May 2013 10:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752263Ab3EZKgs (ORCPT ); Sun, 26 May 2013 06:36:48 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:41697 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752178Ab3EZKgr (ORCPT ); Sun, 26 May 2013 06:36:47 -0400 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1UgYJd-0006Cg-Sb; Sun, 26 May 2013 12:36:41 +0200 Received: from mpa by dude.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1UgYJc-0005hA-Gr; Sun, 26 May 2013 12:36:40 +0200 From: Markus Pargmann To: Florian Tobias Schandinat Cc: Sascha Hauer , Jean-Christophe PLAGNIOL-VILLARD , Rob Herring , Grant Likely , linux-fbdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Markus Pargmann , Fabio Estevam , Mark Rutland Subject: [PATCH v6] video: imxfb: Add DT support Date: Sun, 26 May 2013 12:35:38 +0200 Message-Id: <1369564538-21835-1-git-send-email-mpa@pengutronix.de> X-Mailer: git-send-email 1.8.2.rc2 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:21e:67ff:fe11:9c5c X-SA-Exim-Mail-From: mpa@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-fbdev@vger.kernel.org Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Add devicetree support for imx framebuffer driver. It uses the generic display bindings and helper functions. Signed-off-by: Markus Pargmann Cc: Fabio Estevam Cc: Mark Rutland Acked-by: Jean-Christophe PLAGNIOL-VILLARD Acked-by: Sascha Hauer --- Notes: Changed in v6: - Rebased onto v3.10-rc2 - Dropped alpha support patch in this series Changed in v5: - Fix compatible property of the example - Rename property fsl,bpp to bits-per-pixel - Add selects for FB_MODE_HELPERS and VIDEOMODE_HELPERS to Kconfig FB_IMX Changes in v4: - Remove eukrea specific dmacr property. - Add optional dmacr property. If not present, the dmacr reset value is not changed. Changes in v3: - Fix returncodes of of_read_mode function and print error messages - Introduce a lower bound check for bits per pixel - Calculate correct bytes per pixel value before using it for the calculation of memory size - Change DT property names Changes in v2: - Removed pwmr register property - Cleanup of devicetree binding documentation - Use default values for pwmr and lscr1 .../devicetree/bindings/video/fsl,imx-fb.txt | 51 ++++++ drivers/video/Kconfig | 2 + drivers/video/imxfb.c | 194 +++++++++++++++++---- 3 files changed, 212 insertions(+), 35 deletions(-) create mode 100644 Documentation/devicetree/bindings/video/fsl,imx-fb.txt diff --git a/Documentation/devicetree/bindings/video/fsl,imx-fb.txt b/Documentation/devicetree/bindings/video/fsl,imx-fb.txt new file mode 100644 index 0000000..46da08d --- /dev/null +++ b/Documentation/devicetree/bindings/video/fsl,imx-fb.txt @@ -0,0 +1,51 @@ +Freescale imx21 Framebuffer + +This framebuffer driver supports devices imx1, imx21, imx25, and imx27. + +Required properties: +- compatible : "fsl,-fb", chip should be imx1 or imx21 +- reg : Should contain 1 register ranges(address and length) +- interrupts : One interrupt of the fb dev + +Required nodes: +- display: Phandle to a display node as described in + Documentation/devicetree/bindings/video/display-timing.txt + Additional, the display node has to define properties: + - bits-per-pixel: Bits per pixel + - fsl,pcr: LCDC PCR value + +Optional properties: +- fsl,dmacr: DMA Control Register value. This is optional. By default, the + register is not modified as recommended by the datasheet. +- fsl,lscr1: LCDC Sharp Configuration Register value. + +Example: + + imxfb: fb@10021000 { + compatible = "fsl,imx21-fb"; + interrupts = <61>; + reg = <0x10021000 0x1000>; + display = <&display0>; + }; + + ... + + display0: display0 { + model = "Primeview-PD050VL1"; + native-mode = <&timing_disp0>; + bits-per-pixel = <16>; + fsl,pcr = <0xf0c88080>; /* non-standard but required */ + display-timings { + timing_disp0: 640x480 { + hactive = <640>; + vactive = <480>; + hback-porch = <112>; + hfront-porch = <36>; + hsync-len = <32>; + vback-porch = <33>; + vfront-porch = <33>; + vsync-len = <2>; + clock-frequency = <25000000>; + }; + }; + }; diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index d71d60f..588af1d 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -367,6 +367,8 @@ config FB_IMX select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_MODE_HELPERS + select VIDEOMODE_HELPERS config FB_CYBER2000 tristate "CyberPro 2000/2010/5000 support" diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 0abf2bf..a2ed71d 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c @@ -31,6 +31,12 @@ #include #include #include +#include +#include + +#include