Skip to contentSkip to conversation

DTS: davinci: da850evm: Enable LCD and Backlight

PATCH New Adam Ford 2 participants 2 messages Apr 27, 2018 – May 1, 2018 Device tree bindings

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH v2 1/1 DTS: davinci: da850evm: Enable LCD and Backlight

When using the board files the LCD works, but not with the DT. This adds enables the original da850-evm to work with the same LCD in device tree mode.

---
V2: Add regulator and GPIO enable pins. Remove PWM backlight and replace with GPIO

 arch/arm/boot/dts/da850-evm.dts | 63 +++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
arch/arm/boot/dts/da850-evm.dts +63 -0
index 11cf3765214f..4c59dab3362e 100644
@@ -164,6 +164,51 @@
 			status = "okay";
 		};
 	};
+
+	backlight {
+		compatible = "gpio-backlight";
+		enable-gpios = <&gpio 48 GPIO_ACTIVE_HIGH>;
+		default-on;
+	};
+
+	panel {
+		compatible = "ti,tilcdc,panel";
+		pinctrl-names = "default";
+		pinctrl-0 = <&lcd_pins>;
+		status = "okay";
+		enable-gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
+
+		panel-info {
+			ac-bias		= <255>;
+			ac-bias-intrpt	= <0>;
+			dma-burst-sz	= <16>;
+			bpp		= <16>;
+			fdd		= <0x80>;
+			sync-edge	= <0>;
+			sync-ctrl	= <1>;
+			raster-order	= <0>;
+			fifo-th		= <0>;
+		};
+
+		display-timings {
+			480x272 {
+				clock-frequency = <9000000>;
+				hactive = <480>;
+				vactive = <272>;
+				hfront-porch = <3>;
+				hback-porch = <2>;
+				hsync-len = <42>;
+				vback-porch = <3>;
+				vfront-porch = <4>;
+				vsync-len = <11>;
+				hsync-active = <0>;
+				vsync-active = <0>;
+				de-active = <1>;
+				pixelclk-active = <1>;
+			};
+		};
+	};
+
 	vbat: fixedregulator0 {
 		compatible = "regulator-fixed";
 		regulator-name = "vbat";
@@ -172,6 +217,16 @@
 		regulator-boot-on;
 	};
 
+	lcd_reg: lcdregulator {
+		compatible = "regulator-fixed";
+		regulator-name = "m_lcd_panel_pwr";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio 40 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
+	};
+
 	sound {
 		compatible = "simple-audio-card";
 		simple-audio-card,name = "DA850/OMAP-L138 EVM";
@@ -255,6 +310,14 @@
 	};
 };
 
+&gpio {
+	status = "okay";
+};
+
+&lcdc {
+	status = "okay";
+};
+
 &mcasp0 {
 	#sound-dai-cells = <0>;
 	status = "okay";
Signature · 1 line
2.17.0
#1 lore raw

PATCH v2 1/1 DTS: davinci: da850evm: Enable LCD and Backlight

Hi Adam,

Quoted 5 lines · Adam Ford

When using the board files the LCD works, but not with the DT. This adds enables the original da850-evm to work with the same LCD in device tree mode.

Can you please cc the devicetree list too for next time? Also, please watch the subject prefix. Just do 'git log --oneline' on the file you are touching - its impossible to remember the right one to use.

Quoted 10 lines

---
V2: Add regulator and GPIO enable pins. Remove PWM backlight and replace with GPIO

 arch/arm/boot/dts/da850-evm.dts | 63 +++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
arch/arm/boot/dts/da850-evm.dts +0 -0
index 11cf3765214f..4c59dab3362e 100644

arch/arm/boot/dts/da850-evm.dts line 170

Quoted 7 lines
arch/arm/boot/dts/da850-evm.dts +4 -0
@@ -164,6 +164,51 @@
 			status = "okay";
 		};
 	};
+
+	backlight {
+		compatible = "gpio-backlight";
+		enable-gpios = <&gpio 48 GPIO_ACTIVE_HIGH>;

Which schematic symbol does this correspond to? In the schematic I have GP3[0] does not look connected to anything related to LCD.

arch/arm/boot/dts/da850-evm.dts line 178

Quoted 8 lines
arch/arm/boot/dts/da850-evm.dts +8 -0
+		default-on;
+	};
+
+	panel {
+		compatible = "ti,tilcdc,panel";
+		pinctrl-names = "default";
+		pinctrl-0 = <&lcd_pins>;
+		status = "okay";
		/* M_LCD_BACKLIGHT_PWR */
Quoted 37 lines
arch/arm/boot/dts/da850-evm.dts +33 -0
+		enable-gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
+
+		panel-info {
+			ac-bias		= <255>;
+			ac-bias-intrpt	= <0>;
+			dma-burst-sz	= <16>;
+			bpp		= <16>;
+			fdd		= <0x80>;
+			sync-edge	= <0>;
+			sync-ctrl	= <1>;
+			raster-order	= <0>;
+			fifo-th		= <0>;
+		};
+
+		display-timings {
+			480x272 {
+				clock-frequency = <9000000>;
+				hactive = <480>;
+				vactive = <272>;
+				hfront-porch = <3>;
+				hback-porch = <2>;
+				hsync-len = <42>;
+				vback-porch = <3>;
+				vfront-porch = <4>;
+				vsync-len = <11>;
+				hsync-active = <0>;
+				vsync-active = <0>;
+				de-active = <1>;
+				pixelclk-active = <1>;
+			};
+		};
+	};
+
 	vbat: fixedregulator0 {
 		compatible = "regulator-fixed";
 		regulator-name = "vbat";

arch/arm/boot/dts/da850-evm.dts line 220

Quoted 4 lines
arch/arm/boot/dts/da850-evm.dts +1 -0
@@ -172,6 +217,16 @@
 		regulator-boot-on;
 	};
 
+	lcd_reg: lcdregulator {

lcd-regulator is more readable.

arch/arm/boot/dts/da850-evm.dts line 222

Quoted 2 lines
arch/arm/boot/dts/da850-evm.dts +2 -0
+		compatible = "regulator-fixed";
+		regulator-name = "m_lcd_panel_pwr"

Just "lcd_panel_pwr" should be fine. The "m_" prefix seems to be related to the fact that its the signal before the resistor pack (or some such temporary state).

arch/arm/boot/dts/da850-evm.dts line 227

Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +5 -0
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio 40 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;

why always on? It cannot be disabled?

arch/arm/boot/dts/da850-evm.dts line 315

Quoted 12 lines
arch/arm/boot/dts/da850-evm.dts +5 -0
+	};
+
 	sound {
 		compatible = "simple-audio-card";
 		simple-audio-card,name = "DA850/OMAP-L138 EVM";
@@ -255,6 +310,14 @@
 	};
 };
 
+&gpio {
+	status = "okay";
+};

We already have this in the file.

Thanks,
Sekhar