Patchwork [v4,2/2] ARM: tegra: paz00: enable backlight

login
register
mail settings
Submitter Marc Dietrich
Date Nov. 16, 2012, 11:20 p.m.
Message ID <4de446eaf895ffa01d397cf70cec02620e16f690.1353107865.git.marvin24@gmx.de>
Download mbox | patch
Permalink /patch/199806/
State Superseded, archived
Headers show

Comments

Marc Dietrich - Nov. 16, 2012, 11:20 p.m.
This enables backlight using power sequences.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
---
 arch/arm/boot/dts/tegra20-paz00.dts |   72 +++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)
Thierry Reding - Nov. 17, 2012, 7:35 a.m.
On Sat, Nov 17, 2012 at 12:20:32AM +0100, Marc Dietrich wrote:
[...]
> +				step1 {
> +					type = "gpio";
> +					gpio = <&gpio 4 0>;   /* gpio PA4, en_vdd_pnl  */
> +					value = <1>;
> +				};
> +				step2 {
> +					type = "gpio";
> +					gpio = <&gpio 176 0>; /* gpio PW0, bl_vdd */
> +					value = <1>;
> +				};

These look like regulators, so maybe they should be abstracted as such?

Thierry
Marc Dietrich - Nov. 17, 2012, 2:23 p.m.
On Saturday 17 November 2012 08:35:34 Thierry Reding wrote:
> On Sat, Nov 17, 2012 at 12:20:32AM +0100, Marc Dietrich wrote:
> [...]
> 
> > +				step1 {
> > +					type = "gpio";
> > +					gpio = <&gpio 4 0>;   /* gpio PA4, en_vdd_pnl  */
> > +					value = <1>;
> > +				};
> > +				step2 {
> > +					type = "gpio";
> > +					gpio = <&gpio 176 0>; /* gpio PW0, bl_vdd */
> > +					value = <1>;
> > +				};
> 
> These look like regulators, so maybe they should be abstracted as such?

Honstly, I never understood why we need to redefine a gpio as a regulator. 
IMHO, gpios don't regulate, they switch 0/1. But yes, these gpios just go to 
some FET which switches on some supply voltage.

Marc
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Marc Dietrich - Nov. 17, 2012, 3:04 p.m.
Hi,

since backlight will only come in 3.9, I can add some remarks myself, so I 
don't forget them next time.

On Saturday 17 November 2012 00:20:32 Marc Dietrich wrote:
> This enables backlight using power sequences.
> 
> Signed-off-by: Marc Dietrich <marvin24@gmx.de>
> ---
>  arch/arm/boot/dts/tegra20-paz00.dts |   72
> +++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/tegra20-paz00.dts
> b/arch/arm/boot/dts/tegra20-paz00.dts index 8a14e1d..7349aa3 100644
> --- a/arch/arm/boot/dts/tegra20-paz00.dts
> +++ b/arch/arm/boot/dts/tegra20-paz00.dts
> @@ -15,6 +15,10 @@
>  			rgb {
>  				status = "okay";
>  				nvidia,ddc-i2c-bus = <&lvds_ddc>;
> +
> +				display {
> +					nvidia,backlight = <&backlight>;
> +				};
>  			};
>  		};
>  	};
> @@ -461,6 +465,74 @@
>  		};
>  	};
> 
> +	backlight: backlight {
> +		compatible = "pwm-backlight";
> +		brightness-levels = <0 16 32 48 64 80 96 112 128 144 160 176 192 208 
224
> 240 255>; +		default-brightness-level = <12>;
> +
> +		/* resources used by the power sequences */
> +		pwms = <&pwm 0 5000000>;
> +		pwm-names = "backlight";
> +
> +		power-sequences {
> +			power-on {
> +				step0 {
> +					type = "pwm";
> +					id = "backlight";
> +					enable;
> +				};
> +				step1 {
> +					type = "gpio";
> +					gpio = <&gpio 4 0>;   /* gpio PA4, en_vdd_pnl  */
> +					value = <1>;
> +				};
> +				step2 {
> +					type = "gpio";
> +					gpio = <&gpio 176 0>; /* gpio PW0, bl_vdd */

this one needs to be removed as it is not used. There is bl_pwm (gpio U3) 
however which I cannot sort in here.

> +					value = <1>;
> +				};
> +				step3 {
> +					type = "gpio";
> +					gpio = <&gpio 102 0>; /* gpio PM6, lvds_shdn */
> +					value = <1>;
> +				};
> +				step4 {
> +					type = "gpio";
> +					gpio = <&gpio 164 0>; /* gpio PU4, bl_enb */
> +					value = <1>;
> +				};
> +			};
> +
> +			power-off {
> +				step4 {
> +					type = "gpio";
> +					gpio = <&gpio 164 0>; /* gpio PU4, bl_enb */
> +					value = <0>;

and this is totally bogus.

/me notes: better do not send patches after midnight!

Marc

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
index 8a14e1d..7349aa3 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts
@@ -15,6 +15,10 @@ 
 			rgb {
 				status = "okay";
 				nvidia,ddc-i2c-bus = <&lvds_ddc>;
+
+				display {
+					nvidia,backlight = <&backlight>;
+				};
 			};
 		};
 	};
@@ -461,6 +465,74 @@ 
 		};
 	};
 
+	backlight: backlight {
+		compatible = "pwm-backlight";
+		brightness-levels = <0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 255>;
+		default-brightness-level = <12>;
+
+		/* resources used by the power sequences */
+		pwms = <&pwm 0 5000000>;
+		pwm-names = "backlight";
+
+		power-sequences {
+			power-on {
+				step0 {
+					type = "pwm";
+					id = "backlight";
+					enable;
+				};
+				step1 {
+					type = "gpio";
+					gpio = <&gpio 4 0>;   /* gpio PA4, en_vdd_pnl  */
+					value = <1>;
+				};
+				step2 {
+					type = "gpio";
+					gpio = <&gpio 176 0>; /* gpio PW0, bl_vdd */
+					value = <1>;
+				};
+				step3 {
+					type = "gpio";
+					gpio = <&gpio 102 0>; /* gpio PM6, lvds_shdn */
+					value = <1>;
+				};
+				step4 {
+					type = "gpio";
+					gpio = <&gpio 164 0>; /* gpio PU4, bl_enb */
+					value = <1>;
+				};
+			};
+
+			power-off {
+				step4 {
+					type = "gpio";
+					gpio = <&gpio 164 0>; /* gpio PU4, bl_enb */
+					value = <0>;
+				};
+				step0 {
+					type = "gpio";
+					gpio = <&gpio 102 0>; /* gpio PM6, lvds_shdn */
+					value = <0>;
+				};
+				step1 {
+					type = "gpio";
+					gpio = <&gpio 176 0>; /* gpio PW0, bl_vdd */
+					value = <0>;
+				};
+				step2 {
+					type = "gpio";
+					gpio = <&gpio 4 0>;   /* gpio PA4, en_vdd_pnl  */
+					value = <0>;
+				};
+				step3 {
+					type = "pwm";
+					id = "backlight";
+					disable;
+				};
+			};
+		};
+	};
+
 	regulators {
 		compatible = "simple-bus";
 		#address-cells = <1>;