linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding
@ 2013-04-03 22:01 Fabio Estevam
  2013-04-03 22:01 ` [PATCH 2/3] video: mxsfb: Remove custom method for retrieving GPIO Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fabio Estevam @ 2013-04-03 22:01 UTC (permalink / raw)
  To: linux-arm-kernel

From: Fabio Estevam <fabio.estevam@freescale.com>

Instead of using a custom binding for turning on a GPIO that activates the 
panel, use the standard one.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 Documentation/devicetree/bindings/fb/mxsfb.txt |    5 +----
 arch/arm/boot/dts/imx23-evk.dts                |    8 +++++++-
 arch/arm/boot/dts/imx28-evk.dts                |    8 +++++++-
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/fb/mxsfb.txt b/Documentation/devicetree/bindings/fb/mxsfb.txt
index 7ba3b76..b15230c 100644
--- a/Documentation/devicetree/bindings/fb/mxsfb.txt
+++ b/Documentation/devicetree/bindings/fb/mxsfb.txt
@@ -8,9 +8,7 @@ Required properties:
 - display : phandle to display node (see below for details)
 
 Optional properties:
-- panel-enable-gpios : Should specify the gpio for panel enable
-
-* display node
+- display node
 
 Required properties:
 - bits-per-pixel : <16> for RGB565, <32> for RGB888/666.
@@ -25,7 +23,6 @@ lcdif at 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..28f9766 100644
--- a/arch/arm/boot/dts/imx23-evk.dts
+++ b/arch/arm/boot/dts/imx23-evk.dts
@@ -59,7 +59,7 @@
 			lcdif at 80030000 {
 				pinctrl-names = "default";
 				pinctrl-0 = <&lcdif_24bit_pins_a>;
-				panel-enable-gpios = <&gpio1 18 0>;
+				resets = <&gpio_reset 0>;
 				display = <&display>;
 				status = "okay";
 
@@ -89,6 +89,12 @@
 			};
 		};
 
+		gpio_reset: gpio-reset {
+			compatible = "gpio-reset";
+			reset-gpios = <&gpio1 18 1>;
+			#reset-cells = <1>;
+		};
+
 		apbx at 80040000 {
 			pwm: pwm at 80064000 {
 				pinctrl-names = "default";
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
index 2d4ea3b..e373dd6 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>;
+				resets = <&gpio_reset 0>;
 				display = <&display>;
 				status = "okay";
 
@@ -152,6 +152,12 @@
 				};
 			};
 
+			gpio_reset: gpio-reset {
+				compatible = "gpio-reset";
+				reset-gpios = <&gpio3 30 1>;
+				#reset-cells = <1>;
+			};
+
 			can0: can at 80032000 {
 				pinctrl-names = "default";
 				pinctrl-0 = <&can0_pins_a>;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/3] video: mxsfb: Remove custom method for retrieving GPIO
  2013-04-03 22:01 [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding Fabio Estevam
@ 2013-04-03 22:01 ` Fabio Estevam
  2013-04-03 22:01 ` [PATCH 3/3] ARM: mxs_defconfig: Enable CONFIG_RESET_GPIO Fabio Estevam
  2013-04-04  7:58 ` [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding Philipp Zabel
  2 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2013-04-03 22:01 UTC (permalink / raw)
  To: linux-arm-kernel

From: Fabio Estevam <fabio.estevam@freescale.com>

mxs device tree files should use the standard gpio reset binding, so no need to
have this code inside the driver anymore.

Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/video/mxsfb.c |   19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index eac7c1a..acfb871 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -42,7 +42,6 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/of_device.h>
-#include <linux/of_gpio.h>
 #include <video/of_display_timing.h>
 #include <linux/platform_device.h>
 #include <linux/clk.h>
@@ -859,8 +858,6 @@ static int mxsfb_probe(struct platform_device *pdev)
 	struct fb_info *fb_info;
 	struct fb_modelist *modelist;
 	struct pinctrl *pinctrl;
-	int panel_enable;
-	enum of_gpio_flags flags;
 	int ret;
 
 	if (of_id)
@@ -904,22 +901,6 @@ static int mxsfb_probe(struct platform_device *pdev)
 		goto fb_release;
 	}
 
-	panel_enable = of_get_named_gpio_flags(pdev->dev.of_node,
-					       "panel-enable-gpios", 0, &flags);
-	if (gpio_is_valid(panel_enable)) {
-		unsigned long f = GPIOF_OUT_INIT_HIGH;
-		if (flags == OF_GPIO_ACTIVE_LOW)
-			f = GPIOF_OUT_INIT_LOW;
-		ret = devm_gpio_request_one(&pdev->dev, panel_enable,
-					    f, "panel-enable");
-		if (ret) {
-			dev_err(&pdev->dev,
-				"failed to request gpio %d: %d\n",
-				panel_enable, ret);
-			goto fb_release;
-		}
-	}
-
 	fb_info->pseudo_palette = devm_kzalloc(&pdev->dev, sizeof(u32) * 16,
 					       GFP_KERNEL);
 	if (!fb_info->pseudo_palette) {
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/3] ARM: mxs_defconfig: Enable CONFIG_RESET_GPIO
  2013-04-03 22:01 [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding Fabio Estevam
  2013-04-03 22:01 ` [PATCH 2/3] video: mxsfb: Remove custom method for retrieving GPIO Fabio Estevam
@ 2013-04-03 22:01 ` Fabio Estevam
  2013-04-04  7:58 ` [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding Philipp Zabel
  2 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2013-04-03 22:01 UTC (permalink / raw)
  To: linux-arm-kernel

From: Fabio Estevam <fabio.estevam@freescale.com>

CONFIG_RESET_GPIO is required in order to enable a GPIO to turn on a LCD, for
example.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 arch/arm/configs/mxs_defconfig |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
index b5f6e55..d2c4105 100644
--- a/arch/arm/configs/mxs_defconfig
+++ b/arch/arm/configs/mxs_defconfig
@@ -147,6 +147,8 @@ CONFIG_COMMON_CLK_DEBUG=y
 CONFIG_IIO=y
 CONFIG_PWM=y
 CONFIG_PWM_MXS=y
+CONFIG_RESET_CONTROLLER=y
+CONFIG_RESET_GPIO=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT3_FS=y
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding
  2013-04-03 22:01 [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding Fabio Estevam
  2013-04-03 22:01 ` [PATCH 2/3] video: mxsfb: Remove custom method for retrieving GPIO Fabio Estevam
  2013-04-03 22:01 ` [PATCH 3/3] ARM: mxs_defconfig: Enable CONFIG_RESET_GPIO Fabio Estevam
@ 2013-04-04  7:58 ` Philipp Zabel
  2013-04-04 11:33   ` Fabio Estevam
  2 siblings, 1 reply; 6+ messages in thread
From: Philipp Zabel @ 2013-04-04  7:58 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Fabio,

Am Mittwoch, den 03.04.2013, 19:01 -0300 schrieb Fabio Estevam:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Instead of using a custom binding for turning on a GPIO that activates the 
> panel, use the standard one.

While this might fit well code wise, is a reset GPIO the right
abstraction for those panel enable GPIOs?

I guess the distinction between a GPIO that only holds the panel
controller in reset and one that also enables power supplies internally
can't be always made easily.

regards
Philipp

> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  Documentation/devicetree/bindings/fb/mxsfb.txt |    5 +----
>  arch/arm/boot/dts/imx23-evk.dts                |    8 +++++++-
>  arch/arm/boot/dts/imx28-evk.dts                |    8 +++++++-
>  3 files changed, 15 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/fb/mxsfb.txt b/Documentation/devicetree/bindings/fb/mxsfb.txt
> index 7ba3b76..b15230c 100644
> --- a/Documentation/devicetree/bindings/fb/mxsfb.txt
> +++ b/Documentation/devicetree/bindings/fb/mxsfb.txt
> @@ -8,9 +8,7 @@ Required properties:
>  - display : phandle to display node (see below for details)
>  
>  Optional properties:
> -- panel-enable-gpios : Should specify the gpio for panel enable
> -
> -* display node
> +- display node
>  
>  Required properties:
>  - bits-per-pixel : <16> for RGB565, <32> for RGB888/666.
> @@ -25,7 +23,6 @@ lcdif at 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..28f9766 100644
> --- a/arch/arm/boot/dts/imx23-evk.dts
> +++ b/arch/arm/boot/dts/imx23-evk.dts
> @@ -59,7 +59,7 @@
>  			lcdif at 80030000 {
>  				pinctrl-names = "default";
>  				pinctrl-0 = <&lcdif_24bit_pins_a>;
> -				panel-enable-gpios = <&gpio1 18 0>;
> +				resets = <&gpio_reset 0>;
>  				display = <&display>;
>  				status = "okay";
>  
> @@ -89,6 +89,12 @@
>  			};
>  		};
>  
> +		gpio_reset: gpio-reset {
> +			compatible = "gpio-reset";
> +			reset-gpios = <&gpio1 18 1>;
> +			#reset-cells = <1>;
> +		};
> +
>  		apbx at 80040000 {
>  			pwm: pwm at 80064000 {
>  				pinctrl-names = "default";
> diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
> index 2d4ea3b..e373dd6 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>;
> +				resets = <&gpio_reset 0>;
>  				display = <&display>;
>  				status = "okay";
>  
> @@ -152,6 +152,12 @@
>  				};
>  			};
>  
> +			gpio_reset: gpio-reset {
> +				compatible = "gpio-reset";
> +				reset-gpios = <&gpio3 30 1>;
> +				#reset-cells = <1>;
> +			};
> +
>  			can0: can at 80032000 {
>  				pinctrl-names = "default";
>  				pinctrl-0 = <&can0_pins_a>;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding
  2013-04-04  7:58 ` [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding Philipp Zabel
@ 2013-04-04 11:33   ` Fabio Estevam
  2013-04-04 11:50     ` Fabio Estevam
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2013-04-04 11:33 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Philipp,

On Thu, Apr 4, 2013 at 4:58 AM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
> Hi Fabio,
>
> Am Mittwoch, den 03.04.2013, 19:01 -0300 schrieb Fabio Estevam:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> Instead of using a custom binding for turning on a GPIO that activates the
>> panel, use the standard one.
>
> While this might fit well code wise, is a reset GPIO the right
> abstraction for those panel enable GPIOs?
>
> I guess the distinction between a GPIO that only holds the panel
> controller in reset and one that also enables power supplies internally
> can't be always made easily.

Would gpio-regulator binding fit better in the case a GPIO is needed
for activating the LCD backlight?

Regards,

Fabio Estevam

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding
  2013-04-04 11:33   ` Fabio Estevam
@ 2013-04-04 11:50     ` Fabio Estevam
  0 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2013-04-04 11:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Apr 4, 2013 at 8:33 AM, Fabio Estevam <festevam@gmail.com> wrote:
> Hi Philipp,
>
> On Thu, Apr 4, 2013 at 4:58 AM, Philipp Zabel <p.zabel@pengutronix.de> wrote:
>> Hi Fabio,
>>
>> Am Mittwoch, den 03.04.2013, 19:01 -0300 schrieb Fabio Estevam:
>>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>>
>>> Instead of using a custom binding for turning on a GPIO that activates the
>>> panel, use the standard one.
>>
>> While this might fit well code wise, is a reset GPIO the right
>> abstraction for those panel enable GPIOs?
>>
>> I guess the distinction between a GPIO that only holds the panel
>> controller in reset and one that also enables power supplies internally
>> can't be always made easily.
>
> Would gpio-regulator binding fit better in the case a GPIO is needed
> for activating the LCD backlight?

It seems that "regulator-fixed" seems to fit better for this purpose.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-04 11:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03 22:01 [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding Fabio Estevam
2013-04-03 22:01 ` [PATCH 2/3] video: mxsfb: Remove custom method for retrieving GPIO Fabio Estevam
2013-04-03 22:01 ` [PATCH 3/3] ARM: mxs_defconfig: Enable CONFIG_RESET_GPIO Fabio Estevam
2013-04-04  7:58 ` [PATCH 1/3] ARM: dts: imx28-evk: Use the standard gpio reset binding Philipp Zabel
2013-04-04 11:33   ` Fabio Estevam
2013-04-04 11:50     ` Fabio Estevam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).