linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: tegra: paz00: Add host1x support
@ 2012-11-16 22:20 Marc Dietrich
       [not found] ` <ae44d3c1f4ceecb0f6a486d569608eec3c892ba1.1353104179.git.marvin24-Mmb7MZpHnFY@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Dietrich @ 2012-11-16 22:20 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA; +Cc: Stephen Warren

This adds host1x support which includes HDMI and LVDS support.

Signed-off-by: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org>
---
 arch/arm/boot/dts/tegra20-paz00.dts |   27 ++++++++++++++++++++++-----
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
index e884fa5..3f7f5a2 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts
@@ -244,7 +244,7 @@
 		clock-frequency = <216000000>;
 	};
 
-	i2c@7000c000 {
+	lvds_ddc: i2c@7000c000 {
 		status = "okay";
 		clock-frequency = <400000>;
 
@@ -256,9 +256,9 @@
 		};
 	};
 
-	i2c@7000c400 {
+	hdmi_ddc: i2c@7000c400 {
 		status = "okay";
-		clock-frequency = <400000>;
+		clock-frequency = <100000>;
 	};
 
 	nvec {
@@ -399,13 +399,13 @@
 					regulator-max-microvolt = <1800000>;
 				};
 
-				ldo7 {
+				hdmi_vdd_reg: ldo7 {
 					regulator-name = "+3.3vs_ldo7,avdd_hdmi";
 					regulator-min-microvolt = <3300000>;
 					regulator-max-microvolt = <3300000>;
 				};
 
-				ldo8 {
+				hdmi_pll_reg: ldo8 {
 					regulator-name = "+1.8vs_ldo8,avdd_hdmi_pll";
 					regulator-min-microvolt = <1800000>;
 					regulator-max-microvolt = <1800000>;
@@ -499,6 +499,23 @@
 		};
 	};
 
+	host1x {
+		dc@54200000 {
+			rgb {
+				status = "okay";
+				nvidia,ddc-i2c-bus = <&lvds_ddc>;
+			};
+		};
+
+		hdmi {
+			status = "okay";
+			vdd-supply = <&hdmi_vdd_reg>;
+			pll-supply = <&hdmi_pll_reg>;
+			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
+			nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
+		};
+	};
+
 	sound {
 		compatible = "nvidia,tegra-audio-alc5632-paz00",
 			"nvidia,tegra-audio-alc5632";
-- 
1.7.9.5

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

* [PATCH 2/2] ARM: tegra: paz00: enable backlight
       [not found] ` <ae44d3c1f4ceecb0f6a486d569608eec3c892ba1.1353104179.git.marvin24-Mmb7MZpHnFY@public.gmane.org>
@ 2012-11-16 22:20   ` Marc Dietrich
  2012-11-16 22:35   ` [PATCH 1/2] ARM: tegra: paz00: Add host1x support Thierry Reding
  2012-11-16 22:36   ` Stephen Warren
  2 siblings, 0 replies; 6+ messages in thread
From: Marc Dietrich @ 2012-11-16 22:20 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA; +Cc: Stephen Warren

This enables backlight using power sequences.

Signed-off-by: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org>
---
 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 3f7f5a2..76cfa5c 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts
@@ -504,6 +504,10 @@
 			rgb {
 				status = "okay";
 				nvidia,ddc-i2c-bus = <&lvds_ddc>;
+
+				display {
+					nvidia,backlight = <&backlight>;
+				};
 			};
 		};
 
@@ -535,4 +539,72 @@
 		nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
 		nvidia,spkr-en-gpios = <&paz00 0 0>;
 	};
+
+	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;
+				};
+			};
+		};
+	};
 };
-- 
1.7.9.5

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

* Re: [PATCH 1/2] ARM: tegra: paz00: Add host1x support
       [not found] ` <ae44d3c1f4ceecb0f6a486d569608eec3c892ba1.1353104179.git.marvin24-Mmb7MZpHnFY@public.gmane.org>
  2012-11-16 22:20   ` [PATCH 2/2] ARM: tegra: paz00: enable backlight Marc Dietrich
@ 2012-11-16 22:35   ` Thierry Reding
       [not found]     ` <20121116223510.GA21755-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
  2012-11-16 22:36   ` Stephen Warren
  2 siblings, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2012-11-16 22:35 UTC (permalink / raw)
  To: Marc Dietrich; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

[-- Attachment #1: Type: text/plain, Size: 2533 bytes --]

On Fri, Nov 16, 2012 at 11:20:55PM +0100, Marc Dietrich wrote:
> This adds host1x support which includes HDMI and LVDS support.
> 
> Signed-off-by: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org>
> ---
>  arch/arm/boot/dts/tegra20-paz00.dts |   27 ++++++++++++++++++++++-----
>  1 file changed, 22 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
> index e884fa5..3f7f5a2 100644
> --- a/arch/arm/boot/dts/tegra20-paz00.dts
> +++ b/arch/arm/boot/dts/tegra20-paz00.dts
> @@ -244,7 +244,7 @@
>  		clock-frequency = <216000000>;
>  	};
>  
> -	i2c@7000c000 {
> +	lvds_ddc: i2c@7000c000 {
>  		status = "okay";
>  		clock-frequency = <400000>;

You might want to change this to 100 kHz as well. I think some displays
don't like fast mode. Then again, if you've verified that this works on
AC100 I suppose it can just as well stay as is.

On a side-note, I've found that Tegra doesn't do proper 400 kHz either,
but rather something like 375 kHz. Stephen, is this a known issue or is
it actually supposed to be able to do exactly 400 kHz?

>  
> @@ -256,9 +256,9 @@
>  		};
>  	};
>  
> -	i2c@7000c400 {
> +	hdmi_ddc: i2c@7000c400 {
>  		status = "okay";
> -		clock-frequency = <400000>;
> +		clock-frequency = <100000>;
>  	};
>  
>  	nvec {
> @@ -399,13 +399,13 @@
>  					regulator-max-microvolt = <1800000>;
>  				};
>  
> -				ldo7 {
> +				hdmi_vdd_reg: ldo7 {
>  					regulator-name = "+3.3vs_ldo7,avdd_hdmi";
>  					regulator-min-microvolt = <3300000>;
>  					regulator-max-microvolt = <3300000>;
>  				};
>  
> -				ldo8 {
> +				hdmi_pll_reg: ldo8 {
>  					regulator-name = "+1.8vs_ldo8,avdd_hdmi_pll";
>  					regulator-min-microvolt = <1800000>;
>  					regulator-max-microvolt = <1800000>;
> @@ -499,6 +499,23 @@
>  		};
>  	};
>  
> +	host1x {

The host1x node should be sorted earlier, according to its bus address.

> +		dc@54200000 {
> +			rgb {
> +				status = "okay";
> +				nvidia,ddc-i2c-bus = <&lvds_ddc>;
> +			};
> +		};
> +
> +		hdmi {
> +			status = "okay";
> +			vdd-supply = <&hdmi_vdd_reg>;
> +			pll-supply = <&hdmi_pll_reg>;
> +			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
> +			nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
> +		};
> +	};

As Stephen already mentioned, and I think you already experienced,
tegra-drm has issues with two enabled outputs that run at different
resolutions, so you should probably keep HDMI disabled for now.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/2] ARM: tegra: paz00: Add host1x support
       [not found] ` <ae44d3c1f4ceecb0f6a486d569608eec3c892ba1.1353104179.git.marvin24-Mmb7MZpHnFY@public.gmane.org>
  2012-11-16 22:20   ` [PATCH 2/2] ARM: tegra: paz00: enable backlight Marc Dietrich
  2012-11-16 22:35   ` [PATCH 1/2] ARM: tegra: paz00: Add host1x support Thierry Reding
@ 2012-11-16 22:36   ` Stephen Warren
       [not found]     ` <50A6BFD4.5060802-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2 siblings, 1 reply; 6+ messages in thread
From: Stephen Warren @ 2012-11-16 22:36 UTC (permalink / raw)
  To: Marc Dietrich; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

On 11/16/2012 03:20 PM, Marc Dietrich wrote:
> This adds host1x support which includes HDMI and LVDS support.

> diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts

> +	host1x {

The position of this node in tegra20-paz00.dts doesn't match the order
from tegra20.dtsi.

> +		dc@54200000 {
> +			rgb {
> +				status = "okay";
> +				nvidia,ddc-i2c-bus = <&lvds_ddc>;
> +			};
> +		};
> +
> +		hdmi {
> +			status = "okay";
> +			vdd-supply = <&hdmi_vdd_reg>;
> +			pll-supply = <&hdmi_pll_reg>;
> +			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
> +			nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
> +		};

I think we shouldn't enable HDMI on Paz00 yet; tegradrm has an issue
where if two outputs are active, with different display timings (which
is almost guaranteed), both outputs send the wrong signal timing. The
easiest WAR for now is to only enable one output per board.

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

* Re: [PATCH 1/2] ARM: tegra: paz00: Add host1x support
       [not found]     ` <20121116223510.GA21755-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
@ 2012-11-16 22:38       ` Stephen Warren
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Warren @ 2012-11-16 22:38 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Marc Dietrich, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

On 11/16/2012 03:35 PM, Thierry Reding wrote:
> On Fri, Nov 16, 2012 at 11:20:55PM +0100, Marc Dietrich wrote:
>> This adds host1x support which includes HDMI and LVDS support.

>> diff --git a/arch/arm/boot/dts/tegra20-paz00.dts
>> b/arch/arm/boot/dts/tegra20-paz00.dts

>> -	i2c@7000c000 { +	lvds_ddc: i2c@7000c000 { status = "okay"; 
>> clock-frequency = <400000>;
> 
> You might want to change this to 100 kHz as well. I think some
> displays don't like fast mode. Then again, if you've verified that
> this works on AC100 I suppose it can just as well stay as is.
> 
> On a side-note, I've found that Tegra doesn't do proper 400 kHz
> either, but rather something like 375 kHz. Stephen, is this a known
> issue or is it actually supposed to be able to do exactly 400 kHz?

400KHz is the maximum clock per fast mode spec. The bus should work
anywhere down to 0Hz without issue. The fact we don't hit 400KHz is
most likely simply due to granularity of the clock divider for the I2C
block, combined with whatever rate the parent runs at.

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

* Re: [PATCH 1/2] ARM: tegra: paz00: Add host1x support
       [not found]     ` <50A6BFD4.5060802-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2012-11-17  7:33       ` Thierry Reding
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2012-11-17  7:33 UTC (permalink / raw)
  To: Stephen Warren
  Cc: Marc Dietrich, linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

On Fri, Nov 16, 2012 at 03:36:04PM -0700, Stephen Warren wrote:
> On 11/16/2012 03:20 PM, Marc Dietrich wrote:
> > This adds host1x support which includes HDMI and LVDS support.
> 
> > diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
> 
> > +	host1x {
> 
> The position of this node in tegra20-paz00.dts doesn't match the order
> from tegra20.dtsi.
> 
> > +		dc@54200000 {
> > +			rgb {
> > +				status = "okay";
> > +				nvidia,ddc-i2c-bus = <&lvds_ddc>;
> > +			};
> > +		};
> > +
> > +		hdmi {
> > +			status = "okay";
> > +			vdd-supply = <&hdmi_vdd_reg>;
> > +			pll-supply = <&hdmi_pll_reg>;
> > +			nvidia,ddc-i2c-bus = <&hdmi_ddc>;
> > +			nvidia,hpd-gpio = <&gpio 111 0>; /* PN7 */
> > +		};
> 
> I think we shouldn't enable HDMI on Paz00 yet; tegradrm has an issue
> where if two outputs are active, with different display timings (which
> is almost guaranteed), both outputs send the wrong signal timing. The
> easiest WAR for now is to only enable one output per board.

I don't think the timings are the problem. At least in the cases where
I've seen this problem, LVDS was still working fine, only the contents
were "skewed". The most likely reason for that would be a wrong stride
programmed for the smaller display.

But yes, I agree that for now we should keep only a single output
enabled to work around that issue. Unless I get completely swamped with
other stuff I expect to fix that before the final 3.8, but better safe
than sorry.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-11-17  7:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-16 22:20 [PATCH 1/2] ARM: tegra: paz00: Add host1x support Marc Dietrich
     [not found] ` <ae44d3c1f4ceecb0f6a486d569608eec3c892ba1.1353104179.git.marvin24-Mmb7MZpHnFY@public.gmane.org>
2012-11-16 22:20   ` [PATCH 2/2] ARM: tegra: paz00: enable backlight Marc Dietrich
2012-11-16 22:35   ` [PATCH 1/2] ARM: tegra: paz00: Add host1x support Thierry Reding
     [not found]     ` <20121116223510.GA21755-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-11-16 22:38       ` Stephen Warren
2012-11-16 22:36   ` Stephen Warren
     [not found]     ` <50A6BFD4.5060802-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-11-17  7:33       ` Thierry Reding

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).