From patchwork Thu Mar 14 05:53:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2267551 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 4F25CDFB79 for ; Thu, 14 Mar 2013 05:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753515Ab3CNFxV (ORCPT ); Thu, 14 Mar 2013 01:53:21 -0400 Received: from va3ehsobe002.messaging.microsoft.com ([216.32.180.12]:8695 "EHLO va3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753492Ab3CNFxU (ORCPT ); Thu, 14 Mar 2013 01:53:20 -0400 Received: from mail221-va3-R.bigfish.com (10.7.14.250) by VA3EHSOBE008.bigfish.com (10.7.40.28) with Microsoft SMTP Server id 14.1.225.23; Thu, 14 Mar 2013 05:53:19 +0000 Received: from mail221-va3 (localhost [127.0.0.1]) by mail221-va3-R.bigfish.com (Postfix) with ESMTP id 058E664019D; Thu, 14 Mar 2013 05:53:19 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275dhz2dh87h2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail221-va3 (localhost.localdomain [127.0.0.1]) by mail221-va3 (MessageSwitch) id 1363240395642545_6800; Thu, 14 Mar 2013 05:53:15 +0000 (UTC) Received: from VA3EHSMHS005.bigfish.com (unknown [10.7.14.237]) by mail221-va3.bigfish.com (Postfix) with ESMTP id 9805A30007C; Thu, 14 Mar 2013 05:53:15 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by VA3EHSMHS005.bigfish.com (10.7.99.15) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 14 Mar 2013 05:53:11 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.328.11; Thu, 14 Mar 2013 05:53:11 +0000 Received: from S2101-09.ap.freescale.net ([10.192.185.71]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r2E5qure002272; Wed, 13 Mar 2013 22:53:08 -0700 From: Shawn Guo To: , , CC: Florian Tobias Schandinat , Andrew Morton , Shawn Guo Subject: [PATCH 4/6] video: mxsfb: get display timings from device tree Date: Thu, 14 Mar 2013 13:53:28 +0800 Message-ID: <1363240410-16865-5-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363240410-16865-1-git-send-email-shawn.guo@linaro.org> References: <1363240410-16865-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Use videomode helpers to get display timings and configurations from device tree when platform_data is absent. Signed-off-by: Shawn Guo --- Documentation/devicetree/bindings/fb/mxsfb.txt | 34 +++++++ drivers/video/Kconfig | 2 + drivers/video/mxsfb.c | 118 ++++++++++++++++++++++-- 3 files changed, 144 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/fb/mxsfb.txt b/Documentation/devicetree/bindings/fb/mxsfb.txt index b41e5e52..7ba3b76 100644 --- a/Documentation/devicetree/bindings/fb/mxsfb.txt +++ b/Documentation/devicetree/bindings/fb/mxsfb.txt @@ -5,10 +5,20 @@ Required properties: imx23 and imx28. - reg: Address and length of the register set for lcdif - interrupts: Should contain lcdif interrupts +- display : phandle to display node (see below for details) Optional properties: - panel-enable-gpios : Should specify the gpio for panel enable +* display node + +Required properties: +- bits-per-pixel : <16> for RGB565, <32> for RGB888/666. +- bus-width : number of data lines. Could be <8>, <16>, <18> or <24>. + +Required sub-node: +- display-timings : Refer to binding doc display-timing.txt for details. + Examples: lcdif@80030000 { @@ -16,4 +26,28 @@ lcdif@80030000 { reg = <0x80030000 2000>; interrupts = <38 86>; panel-enable-gpios = <&gpio3 30 0>; + + display: display { + bits-per-pixel = <32>; + bus-width = <24>; + + display-timings { + native-mode = <&timing0>; + timing0: timing0 { + clock-frequency = <33500000>; + hactive = <800>; + vactive = <480>; + hfront-porch = <164>; + hback-porch = <89>; + hsync-len = <10>; + vback-porch = <23>; + vfront-porch = <10>; + vsync-len = <10>; + hsync-active = <0>; + vsync-active = <0>; + de-active = <1>; + pixelclk-active = <0>; + }; + }; + }; }; diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 4c1546f..e7718fd 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -2437,6 +2437,8 @@ config FB_MXS select FB_CFB_FILLRECT select FB_CFB_COPYAREA select FB_CFB_IMAGEBLIT + select FB_MODE_HELPERS + select OF_VIDEOMODE help Framebuffer support for the MXS SoC. diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 001983a..cf968c6 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -43,12 +43,14 @@ #include #include #include +#include