From patchwork Sun Apr 7 18:44:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 2403251 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 68623DF2A1 for ; Sun, 7 Apr 2013 19:50:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933384Ab3DGTum (ORCPT ); Sun, 7 Apr 2013 15:50:42 -0400 Received: from mail-ye0-f178.google.com ([209.85.213.178]:38635 "EHLO mail-ye0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933279Ab3DGTum (ORCPT ); Sun, 7 Apr 2013 15:50:42 -0400 X-Greylist: delayed 3911 seconds by postgrey-1.27 at vger.kernel.org; Sun, 07 Apr 2013 15:50:41 EDT Received: by mail-ye0-f178.google.com with SMTP id q1so825567yen.37 for ; Sun, 07 Apr 2013 12:50:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=4xrhVEs0LhLaO8hSBGCprcAF6AZpw6RGnA1noeKOTnA=; b=kBOA6SxW/lEwEMWD81aZ+Lmvv7GI2Xd9Z5nf0JpEZr0MzrwfHrmzWM3EWXsMuRJukb HFs4hCwxScULLEIf/A+RYJ6o6XJR2OMaSYNGhrgLvF6WjQDOtBd0JF3xgttgZ+74kIZO I27aB2G59mCe3u9r6B/aRCWEUj4zoUYSlkVZiHWGlblgg166Xzj1ZwK4GiCGXbkt/amZ VvZ4AVEQSfhEd+pX4bG9fblr0NOBFzUDiVDwhcr4TFaV4STE5tQ/drhkja8R4yQaK5D3 UlnTs+aBnv6lwTLOMi272rE1/MfeeIsHVwBF4JeDqJ9WDz0DSrioIz/OcH2GXfXlHm6y o2/w== X-Received: by 10.236.222.69 with SMTP id s65mr11151116yhp.59.1365360330553; Sun, 07 Apr 2013 11:45:30 -0700 (PDT) Received: from localhost.localdomain ([187.64.220.204]) by mx.google.com with ESMTPS id f70sm33463073yhi.12.2013.04.07.11.45.28 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 07 Apr 2013 11:45:29 -0700 (PDT) From: Fabio Estevam To: shawn.guo@linaro.org Cc: FlorianSchandinat@gmx.de, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, Fabio Estevam Subject: [PATCH v6] video: mxsfb: Introduce regulator support Date: Sun, 7 Apr 2013 15:44:59 -0300 Message-Id: <1365360299-8707-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Fabio Estevam Instead of using a custom binding for retrieving the GPIO that activates the LCD from devicetree, use a standard regulator. This approach has the advantage to be more generic. For example: in the case of a board that has a PMIC supplying the LCD voltage, the current approach would not work, as it only searches for a GPIO pin. Signed-off-by: Fabio Estevam --- Changes since v5: - Remove 'Optional properties' line from mxsfb.txt - Place regultar_disable in the end of mxsfb_disable_controller - Check for IS_ERR((IS_ERR(host->reg_lcd)) inside probe Chages since v4: - Merged the 2 previous patches into one in order not to break keep mxsfb functionality - Remove unneeded change in mxsfb.txt - Use regulator_disable to pair with regulator_enable Changes since v3: - None Changes since v2: - Use devm_regulator_get() Changes since v1: - No changes Documentation/devicetree/bindings/fb/mxsfb.txt | 4 --- arch/arm/boot/dts/imx23-evk.dts | 11 ++++++- arch/arm/boot/dts/imx28-evk.dts | 11 ++++++- drivers/video/mxsfb.c | 41 +++++++++++++----------- 4 files changed, 43 insertions(+), 24 deletions(-) diff --git a/Documentation/devicetree/bindings/fb/mxsfb.txt b/Documentation/devicetree/bindings/fb/mxsfb.txt index 7ba3b76..96ec517 100644 --- a/Documentation/devicetree/bindings/fb/mxsfb.txt +++ b/Documentation/devicetree/bindings/fb/mxsfb.txt @@ -7,9 +7,6 @@ Required properties: - 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: @@ -25,7 +22,6 @@ lcdif@80030000 { compatible = "fsl,imx28-lcdif"; reg = <0x80030000 2000>; interrupts = <38 86>; - panel-enable-gpios = <&gpio3 30 0>; display: display { bits-per-pixel = <32>; diff --git a/arch/arm/boot/dts/imx23-evk.dts b/arch/arm/boot/dts/imx23-evk.dts index 7880e17..da0588a 100644 --- a/arch/arm/boot/dts/imx23-evk.dts +++ b/arch/arm/boot/dts/imx23-evk.dts @@ -59,7 +59,7 @@ lcdif@80030000 { pinctrl-names = "default"; pinctrl-0 = <&lcdif_24bit_pins_a>; - panel-enable-gpios = <&gpio1 18 0>; + lcd-supply = <®_lcd_3v3>; display = <&display>; status = "okay"; @@ -120,6 +120,15 @@ regulator-max-microvolt = <3300000>; gpio = <&gpio1 29 0>; }; + + reg_lcd_3v3: lcd-3v3 { + compatible = "regulator-fixed"; + regulator-name = "lcd-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio1 18 0>; + enable-active-high; + }; }; backlight { diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts index 2d4ea3b..3637bf3 100644 --- a/arch/arm/boot/dts/imx28-evk.dts +++ b/arch/arm/boot/dts/imx28-evk.dts @@ -123,7 +123,7 @@ pinctrl-names = "default"; pinctrl-0 = <&lcdif_24bit_pins_a &lcdif_pins_evk>; - panel-enable-gpios = <&gpio3 30 0>; + lcd-supply = <®_lcd_3v3>; display = <&display>; status = "okay"; @@ -310,6 +310,15 @@ gpio = <&gpio3 8 0>; enable-active-high; }; + + reg_lcd_3v3: lcd-3v3 { + compatible = "regulator-fixed"; + regulator-name = "lcd-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio3 30 0>; + enable-active-high; + }; }; sound { diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index eac7c1a..1b2c26d 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -42,7 +42,6 @@ #include #include #include -#include #include