ARM: tegra: ventana: enable internal display
Subsystems (2)
PATCH v2 1/1 ARM: tegra: ventana: enable internal display
Enable host1x and add the rgb output, providing EDID as a binary blob.
Also add the power sequence that controls the backlight and panel. The sequence strictly follows the order and timings of the panel specification.
Currently the backlight device controls both backlight and panel, this needs to be fixed once the panel framework supports power sequences.
--- arch/arm/boot/dts/tegra20-ventana.dts | 107 ++++++++++++++++++++++++++++++++- arch/arm/boot/dts/tegra20-ventana.edid | Bin 0 -> 128 bytes 2 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 arch/arm/boot/dts/tegra20-ventana.edid
arch/arm/boot/dts/tegra20-ventana.dts +105 -2
@@ -10,6 +10,16 @@ reg = <0x00000000 0x40000000>; }; + host1x { + dc@54200000 { + rgb { + status = "okay"; + nvidia,edid = /incbin/("tegra20-ventana.edid"); + backlight = <&backlight>; + }; + }; + }; + pinmux { pinctrl-names = "default"; pinctrl-0 = <&state_default>;
@@ -469,6 +479,99 @@ bus-width = <8>; }; + 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 2 5000000>; + pwm-names = "backlight"; + power-supply = <&vdd_bl_reg>; + panel-supply = <&vdd_panel_reg>; + + power-sequences { + power-on { + /* + * Panel power and LVDS enable. + * TODO: move into the panel device as soon as + * panel framework supports power sequences. + */ + step0 { + type = "regulator"; + id = "panel"; + enable; + }; + step1 { + type = "gpio"; + gpio = <&gpio 10 0>; + value = <1>; + }; + step2 { + type = "delay"; + delay = <200000>; + }; + /* Backlight sequence. This belongs here. */ + step3 { + type = "regulator"; + id = "power"; + enable; + }; + step4 { + type = "delay"; + delay = <10000>; + }; + step5 { + type = "pwm"; + id = "backlight"; + enable; + }; + step6 { + type = "gpio"; + gpio = <&gpio 28 0>; + value = <1>; + }; + }; + + power-off { + step0 { + type = "gpio"; + gpio = <&gpio 28 0>; + value = <0>; + }; + step1 { + type = "pwm"; + id = "backlight"; + disable; + }; + step2 { + type = "delay"; + delay = <10000>; + }; + step3 { + type = "regulator"; + id = "power"; + disable; + }; + /* This also belongs to the panel sequence */ + step4 { + type = "delay"; + delay = <200000>; + }; + step5 { + type = "gpio"; + gpio = <&gpio 10 0>; + value = <0>; + }; + step6 { + type = "regulator"; + id = "panel"; + disable; + }; + }; + }; + }; + regulators { compatible = "simple-bus"; #address-cells = <1>;
@@ -502,7 +605,7 @@ enable-active-high; }; - regulator@3 { + vdd_panel_reg: regulator@3 { compatible = "regulator-fixed"; reg = <3>; regulator-name = "vdd_pnl";
@@ -512,7 +615,7 @@ enable-active-high; }; - regulator@4 { + vdd_bl_reg: regulator@4 { compatible = "regulator-fixed"; reg = <4>; regulator-name = "vdd_bl";
arch/arm/boot/dts/tegra20-ventana.edid new file binary +0 -0
Signature · 1 line
1.8.0
A message that is not in the archive (sent off-list or not yet received): 1353051891-26725-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
Quoted 1 line · On Friday 16 November 2012 15:44:51 Alexandre Courbot wrote:
Enable host1x and add the rgb output, providing EDID as a binary blob.
I would really prefer to have the EDID data fetched from DDC, but all my attempts have failed so far. I don't even see the DDC wires on the platform design guide. Mark, are you sure the EDID data you fetched with i2cget was actually on Ventana? I can see that the DDC lines of T2 are connected to the corresponding lines of the HDMI interface, but nothing similar regarding internal display.
Maybe we can work this out privately, on IRC?
Alex.
Quoted 9 lines · Alex Courbot
Quoted 1 line · On Friday 16 November 2012 15:44:51 Alexandre Courbot wrote:
Enable host1x and add the rgb output, providing EDID as a binary blob.
I would really prefer to have the EDID data fetched from DDC, but all my attempts have failed so far. I don't even see the DDC wires on the platform design guide. Mark, are you sure the EDID data you fetched with i2cget was actually on Ventana? I can see that the DDC lines of T2 are connected to the corresponding lines of the HDMI interface, but nothing similar regarding internal display.
Yes, there is an EDID EEPROM on Ventana. We should certainly use that.
Assuming you have CONFIG_I2C_CHARDEV=y in the kernel's .config, and the latest Ventana .dts file which enables the I2C bus mux, then the following command dumps the EDID:
i2cdump -f -y 5 0x50
That should be equivalent to something like:
nvidia,ddc-i2c-bus = <&lcd_ddc>;
with lcd_ddc pointing at /i2cmux/i2c@1
That seems to work fine for me; how about you?
For reference, the patch below, although all the whitespace is screwed up due to pasting it; I should really start using a "proper" email client...:
Quoted 22 lines
arch/arm/boot/dts/tegra20-ventana.dts +2
-2@@ -14,7 +14,7 @@ dc@54200000 { rgb { status = "okay"; - nvidia,edid = /incbin/("tegra20-ventana.edid"); + nvidia,ddc-i2c-bus = <&lcd_ddc>; backlight = <&backlight>; }; };@@ -351,7 +351,7 @@ #size-cells = <0>; }; - i2c@1 { + lcd_ddc: i2c@1 { reg = <1>; #address-cells = <1>; #size-cells = <0>;
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · On Saturday 17 November 2012 01:07:43 Stephen Warren wrote:
That should be equivalent to something like:
nvidia,ddc-i2c-bus = <&lcd_ddc>;with
lcd_ddcpointing at /i2cmux/i2c@1That seems to work fine for me; how about you?
Yep, this is working! DC probing gets delayed probably because i2c is not available when it first tries to initialize it, and as a result fb0 becomes available 1 second later than when we feed the EDID data from the DT. But it work and is the most elegant solution, so we should definitely do this.
Alex.
Yep, I remember that I fetched EDID data by i2cget several months ago. But I'll try this again today to make sure.
Mark
Quoted 14 lines · Alex Courbot
Quoted 1 line · On Friday 16 November 2012 15:44:51 Alexandre Courbot wrote:
Enable host1x and add the rgb output, providing EDID as a binary blob.
I would really prefer to have the EDID data fetched from DDC, but all my attempts have failed so far. I don't even see the DDC wires on the platform design guide. Mark, are you sure the EDID data you fetched with i2cget was actually on Ventana? I can see that the DDC lines of T2 are connected to the corresponding lines of the HDMI interface, but nothing similar regarding internal display.
Maybe we can work this out privately, on IRC?
Alex.
On Fri, Nov 16, 2012 at 04:44:51PM +0900, Alexandre Courbot wrote:
[...]
arch/arm/boot/dts/tegra20-ventana.dts line 18
Quoted 6 lines
arch/arm/boot/dts/tegra20-ventana.dts +6
-0+ host1x { + dc@54200000 { + rgb { + status = "okay"; + nvidia,edid = /incbin/("tegra20-ventana.edid"); + backlight = <&backlight>;
Note that the backlight property is actually named nvidia,backlight and needs to go into the rgb's display subnode. Also, to make this work a patch is required to hook up the backlight with tegra-drm, which hasn't gone into 3.8 yet, I think.
Thierry