ARM: dts: da850-evm: Enable LCD and Backlight
PATCH v3 1/1 ARM: dts: da850-evm: 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.
The EVM has a gpio for the regulator and a gpio enable. The LCD and the vpif display pins are mutually exclusive, so if using the LCD, do not load the vpif driver.
---
V3: Fix errant GPIO, label GPIO pins, and rename the regulator to be more explict to
backlight which better matches the schematic. Updated the description to explain that it cannot be used at the same time as the vpif driver.
V2: Add regulator and GPIO enable pins. Remove PWM backlight and replace with GPIO
arch/arm/boot/dts/da850-evm.dts +58 -0
@@ -27,6 +27,50 @@ spi0 = &spi1; }; + backlight { + compatible = "gpio-backlight"; + enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; /* GP0[7] */ + }; + + panel { + compatible = "ti,tilcdc,panel"; + pinctrl-names = "default"; + pinctrl-0 = <&lcd_pins>; + status = "okay"; + enable-gpios = <&gpio 40 GPIO_ACTIVE_HIGH>; /* GP2[8] */ + + 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 { + native-mode = <&timing0>; + timing0: 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";
@@ -35,6 +79,16 @@ regulator-boot-on; }; + backlight_reg: backlight-regulator { + compatible = "regulator-fixed"; + regulator-name = "lcd_backlight_pwr"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; /* GP2[15] */ + regulator-always-on; + enable-active-high; + }; + sound { compatible = "simple-audio-card"; simple-audio-card,name = "DA850/OMAP-L138 EVM";
@@ -109,6 +163,10 @@ status = "okay"; }; +&lcdc { + status = "okay"; +}; + &i2c0 { status = "okay"; clock-frequency = <100000>;
Signature · 1 line
2.17.0
PATCH v3 1/1 ARM: dts: da850-evm: Enable LCD and Backlight
Hi Adam,
Quoted 7 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.
The EVM has a gpio for the regulator and a gpio enable. The LCD and the vpif display pins are mutually exclusive, so if using the LCD, do not load the vpif driver.
Its not sufficient just note this in patch description.
a) Disable (status = "disabled") the VPIF node which clashes for pins with LCD.
b) Add a comment on top of the status = "disabled" giving information on how user can enable it (disable lcdc node and then change to status = "okay").
Quoted 14 lines
Signed-off-by Adam Ford <[email protected]>---
V3: Fix errant GPIO, label GPIO pins, and rename the regulator to be more explict to
backlight which better matches the schematic. Updated the description to explain that it cannot be used at the same time as the vpif driver.V2: Add regulator and GPIO enable pins. Remove PWM backlight and replace with GPIO
arch/arm/boot/dts/da850-evm.dts +0
-0
arch/arm/boot/dts/da850-evm.dts line 32
Quoted 6 lines
arch/arm/boot/dts/da850-evm.dts +3
-0@@ -27,6 +27,50 @@ spi0 = &spi1; }; + backlight { + compatible = "gpio-backlight"; + enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; /* GP0[7] */
The gpio-backlight binding does not describe a property called enable-gpios. It should just be gpios.
a) Are you using gpio-backlight because you are not able to get the PWM to work?
b) What is GP0[7] connected to in the schematic you have? In the schematic I have I see LCD_PWM0 is connected to SPI1_SCS[0]/EPWM1B/GP2[14]/TM64P3_IN12.
c) The /* GP0[7] */ comment is not really useful on its own as it can be computed. What I wanted to see is the schematic symbol like "LCD_PWM0". Same for other places like this below.
arch/arm/boot/dts/da850-evm.dts line 88
Quoted 11 lines
arch/arm/boot/dts/da850-evm.dts +7
-0@@ -35,6 +79,16 @@ regulator-boot-on; }; + backlight_reg: backlight-regulator { + compatible = "regulator-fixed"; + regulator-name = "lcd_backlight_pwr"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; /* GP2[15] */ + regulator-always-on;
Why should this regulator never be disabled?
Thanks,
Sekhar
PATCH v3 1/1 ARM: dts: da850-evm: Enable LCD and Backlight
Quoted 36 lines · Sekhar Nori
Hi Adam,
Quoted 7 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.
The EVM has a gpio for the regulator and a gpio enable. The LCD and the vpif display pins are mutually exclusive, so if using the LCD, do not load the vpif driver.
Its not sufficient just note this in patch description.
a) Disable (status = "disabled") the VPIF node which clashes for pins with LCD.
b) Add a comment on top of the status = "disabled" giving information on how user can enable it (disable lcdc node and then change to status = "okay").Quoted 17 lines
Signed-off-by Adam Ford <[email protected]>---
V3: Fix errant GPIO, label GPIO pins, and rename the regulator to be more explict to
backlight which better matches the schematic. Updated the description to explain that it cannot be used at the same time as the vpif driver.V2: Add regulator and GPIO enable pins. Remove PWM backlight and replace with GPIO
arch/arm/boot/dts/da850-evm.dts +0
-0@@ -27,6 +27,50 @@ spi0 = &spi1; };
Quoted 6 lines
arch/arm/boot/dts/da850-evm.dts line 32
Quoted 3 lines
arch/arm/boot/dts/da850-evm.dts +3
-0+ backlight { + compatible = "gpio-backlight"; + enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; /* GP0[7] */The gpio-backlight binding does not describe a property called enable-gpios. It should just be gpios.
I will fix that.
Quoted 4 lines
a) Are you using gpio-backlight because you are not able to get the PWM to work?
Yes, You told me not to worry about doing a PWM backlight because the legacy board does not PWM either.
Quoted 3 lines
b) What is GP0[7] connected to in the schematic you have? In the schematic I have I see
LCD_PWM0is connected to SPI1_SCS[0]/EPWM1B/GP2[14]/TM64P3_IN12.
I have schematic 1016572 dated Wednesday, August 18, 2010. According to it, AXR15 / EPWMN0_TZ[0] / ECAP2_APWM2 / GPIO0[7] connects to U25, Pin 46 to generate M_LCD_PWM0. You might have one of the early, pre-release versions.
Quoted 4 lines
c) The /* GP0[7] */ comment is not really useful on its own as it can be computed. What I wanted to see is the schematic symbol like "
LCD_PWM0". Same for other places like this below.
I can do that.
Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +0
-0@@ -35,6 +79,16 @@ regulator-boot-on; };
Quoted 9 lines
arch/arm/boot/dts/da850-evm.dts line 88
Quoted 7 lines
arch/arm/boot/dts/da850-evm.dts +7
-0+ backlight_reg: backlight-regulator { + compatible = "regulator-fixed"; + regulator-name = "lcd_backlight_pwr"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; /* GP2[15] */ + regulator-always-on;Why should this regulator never be disabled?
The gpio-backlight does not have a way that I can see to associate the regulator to it. I read through the bindings, but I didn't see an option to associate a regulator it. I use this regulator to drive lcd_backlight_pwr and the backlight driver to write lcd_pwm0. Without this option, the system disables lcd_backlight_pwr and the screen is blank
adam
Quoted 3 lines
Thanks,
Sekhar
PATCH v3 1/1 ARM: dts: da850-evm: Enable LCD and Backlight
Quoted 44 lines · Adam Ford
Quoted 36 lines · Sekhar Nori
Hi Adam,
Quoted 7 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.
The EVM has a gpio for the regulator and a gpio enable. The LCD and the vpif display pins are mutually exclusive, so if using the LCD, do not load the vpif driver.
Its not sufficient just note this in patch description.
a) Disable (status = "disabled") the VPIF node which clashes for pins with LCD.
b) Add a comment on top of the status = "disabled" giving information on how user can enable it (disable lcdc node and then change to status = "okay").Quoted 17 lines
Signed-off-by Adam Ford <[email protected]>---
V3: Fix errant GPIO, label GPIO pins, and rename the regulator to be more explict to
backlight which better matches the schematic. Updated the description to explain that it cannot be used at the same time as the vpif driver.V2: Add regulator and GPIO enable pins. Remove PWM backlight and replace with GPIO
arch/arm/boot/dts/da850-evm.dts +0
-0@@ -27,6 +27,50 @@ spi0 = &spi1; };Quoted 6 lines
arch/arm/boot/dts/da850-evm.dts line 32
Quoted 3 lines
arch/arm/boot/dts/da850-evm.dts +3
-0+ backlight { + compatible = "gpio-backlight"; + enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; /* GP0[7] */The gpio-backlight binding does not describe a property called enable-gpios. It should just be gpios.
Quoted 8 lines
I will fix that.
Quoted 4 lines
a) Are you using gpio-backlight because you are not able to get the PWM to work?
Yes, You told me not to worry about doing a PWM backlight because the legacy board does not PWM either.
Yeah, I meant not to add backlight control till the time we are able to get it working using PWM. Is this needed for the basic LCD functionality to work? I would like to avoid the churn of adding it using GPIO now and changing to PWM later, if possible.
Quoted 9 lines
Quoted 4 lines
b) What is GP0[7] connected to in the schematic you have? In the schematic I have I see
LCD_PWM0is connected to SPI1_SCS[0]/EPWM1B/GP2[14]/TM64P3_IN12.I have schematic 1016572 dated Wednesday, August 18, 2010. According to it, AXR15 / EPWMN0_TZ[0] /
ECAP2_APWM2/ GPIO0[7] connects to U25, Pin 46 to generateM_LCD_PWM0. You might have one of the early, pre-release versions.
Ah, okay. In your schematic, is GP2[14] connected to anything?
Quoted 22 lines
Quoted 5 lines
c) The /* GP0[7] */ comment is not really useful on its own as it can be computed. What I wanted to see is the schematic symbol like "
LCD_PWM0". Same for other places like this below.I can do that.
Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +0
-0@@ -35,6 +79,16 @@ regulator-boot-on; };Quoted 9 lines
arch/arm/boot/dts/da850-evm.dts line 88
Quoted 7 lines
arch/arm/boot/dts/da850-evm.dts +7
-0+ backlight_reg: backlight-regulator { + compatible = "regulator-fixed"; + regulator-name = "lcd_backlight_pwr"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; /* GP2[15] */ + regulator-always-on;Why should this regulator never be disabled?
Quoted 6 lines
The gpio-backlight does not have a way that I can see to associate the regulator to it. I read through the bindings, but I didn't see an option to associate a regulator it. I use this regulator to drive
lcd_backlight_pwrand the backlight driver to writelcd_pwm0. Without this option, the system disableslcd_backlight_pwrand the screen is blank
It sounds like this is a hack to enable backlight on this board. I think either the backlight driver needs to gain functionality to enable the GPIO. Or backlight could be treated as part of the panel and enabled using enable-gpios property in the panel. TBH, I will be okay either way. Can you check with Jyri, Tomi and rest of the DRM folks on what should be right way of dealing with this?
Thanks,
Sekhar
PATCH v3 1/1 ARM: dts: da850-evm: Enable LCD and Backlight
Quoted 3 lines · Sekhar Nori
Quoted 2 lines · Adam Ford
Quoted 1 line · Sekhar Nori
Hi Adam,
Added Tomi, Laurent, and Jyri for feedback.
Quoted 97 lines
Quoted 42 lines
Quoted 35 lines · Adam Ford
Quoted 7 lines
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.
The EVM has a gpio for the regulator and a gpio enable. The LCD and the vpif display pins are mutually exclusive, so if using the LCD, do not load the vpif driver.
Its not sufficient just note this in patch description.
a) Disable (status = "disabled") the VPIF node which clashes for pins with LCD.
b) Add a comment on top of the status = "disabled" giving information on how user can enable it (disable lcdc node and then change to status = "okay").Quoted 17 lines
Signed-off-by Adam Ford <[email protected]>---
V3: Fix errant GPIO, label GPIO pins, and rename the regulator to be more explict to
backlight which better matches the schematic. Updated the description to explain that it cannot be used at the same time as the vpif driver.V2: Add regulator and GPIO enable pins. Remove PWM backlight and replace with GPIO
arch/arm/boot/dts/da850-evm.dts +0
-0@@ -27,6 +27,50 @@ spi0 = &spi1; };Quoted 6 lines
arch/arm/boot/dts/da850-evm.dts line 32
Quoted 3 lines
arch/arm/boot/dts/da850-evm.dts +3
-0+ backlight { + compatible = "gpio-backlight"; + enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; /* GP0[7] */The gpio-backlight binding does not describe a property called enable-gpios. It should just be gpios.
Quoted 8 lines
I will fix that.
Quoted 4 lines
a) Are you using gpio-backlight because you are not able to get the PWM to work?
Yes, You told me not to worry about doing a PWM backlight because the legacy board does not PWM either.
Yeah, I meant not to add backlight control till the time we are able to get it working using PWM. Is this needed for the basic LCD functionality to work? I would like to avoid the churn of adding it using GPIO now and changing to PWM later, if possible.
Quoted 9 lines
Quoted 4 lines
b) What is GP0[7] connected to in the schematic you have? In the schematic I have I see
LCD_PWM0is connected to SPI1_SCS[0]/EPWM1B/GP2[14]/TM64P3_IN12.I have schematic 1016572 dated Wednesday, August 18, 2010. According to it, AXR15 / EPWMN0_TZ[0] /
ECAP2_APWM2/ GPIO0[7] connects to U25, Pin 46 to generateM_LCD_PWM0. You might have one of the early, pre-release versions.Ah, okay. In your schematic, is GP2[14] connected to anything?
Quoted 22 lines
Quoted 5 lines
c) The /* GP0[7] */ comment is not really useful on its own as it can be computed. What I wanted to see is the schematic symbol like "
LCD_PWM0". Same for other places like this below.I can do that.
Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +0
-0@@ -35,6 +79,16 @@ regulator-boot-on; };Quoted 9 lines
arch/arm/boot/dts/da850-evm.dts line 88
Quoted 7 lines
arch/arm/boot/dts/da850-evm.dts +7
-0+ backlight_reg: backlight-regulator { + compatible = "regulator-fixed"; + regulator-name = "lcd_backlight_pwr"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; /* GP2[15] */ + regulator-always-on;Why should this regulator never be disabled?
Quoted 6 lines
The gpio-backlight does not have a way that I can see to associate the regulator to it. I read through the bindings, but I didn't see an option to associate a regulator it. I use this regulator to drive
lcd_backlight_pwrand the backlight driver to writelcd_pwm0. Without this option, the system disableslcd_backlight_pwrand the screen is blank
Quoted 6 lines
It sounds like this is a hack to enable backlight on this board. I think either the backlight driver needs to gain functionality to enable the GPIO. Or backlight could be treated as part of the panel and enabled using enable-gpios property in the panel. TBH, I will be okay either way. Can you check with Jyri, Tomi and rest of the DRM folks on what should be right way of dealing with this?
Per your request I added them into this thread. I added Tomi, Jyri, and Laurent to this as Laurent's name is associated with the gpio backlight driver.
I am not sure why you think it's a hack. I pulled up the schematic for the LCD to see what it's doing, and the lcd_backlight_pwr pin controls the power-on sequence of the back-light controller. Without this, there is no power, so it seems to me that the 'regulator-fixed' device is the correct way to do it.
The separate pin associated to the gpio is used to tell the backlight IC to actually turn on/off the back-light. Ideally it seems like it would nice to have the gpio-backlight driver be able to specify the regulator, so when the backlight is in use, it would power the regulator, but until that's available, the it seems like 'regulator-always-on' is the way to make it stay on.
Laurent, Jyri, Tomi, do you have any thoughts on this matter?
Thanks,
adam
Quoted 3 lines
Thanks,
Sekhar
PATCH v3 1/1 ARM: dts: da850-evm: Enable LCD and Backlight
Quoted 111 lines · Adam Ford
Quoted 3 lines · Sekhar Nori
Quoted 2 lines · Adam Ford
Quoted 1 line · Sekhar Nori
Hi Adam,
Added Tomi, Laurent, and Jyri for feedback.
Quoted 97 lines
Quoted 42 lines
Quoted 35 lines · Adam Ford
Quoted 7 lines
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.
The EVM has a gpio for the regulator and a gpio enable. The LCD and the vpif display pins are mutually exclusive, so if using the LCD, do not load the vpif driver.
Its not sufficient just note this in patch description.
a) Disable (status = "disabled") the VPIF node which clashes for pins with LCD.
b) Add a comment on top of the status = "disabled" giving information on how user can enable it (disable lcdc node and then change to status = "okay").Quoted 17 lines
Signed-off-by Adam Ford <[email protected]>---
V3: Fix errant GPIO, label GPIO pins, and rename the regulator to be more explict to
backlight which better matches the schematic. Updated the description to explain that it cannot be used at the same time as the vpif driver.V2: Add regulator and GPIO enable pins. Remove PWM backlight and replace with GPIO
arch/arm/boot/dts/da850-evm.dts +0
-0@@ -27,6 +27,50 @@ spi0 = &spi1; };Quoted 6 lines
arch/arm/boot/dts/da850-evm.dts line 32
Quoted 3 lines
arch/arm/boot/dts/da850-evm.dts +3
-0+ backlight { + compatible = "gpio-backlight"; + enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; /* GP0[7] */The gpio-backlight binding does not describe a property called enable-gpios. It should just be gpios.
Quoted 8 lines
I will fix that.
Quoted 4 lines
a) Are you using gpio-backlight because you are not able to get the PWM to work?
Yes, You told me not to worry about doing a PWM backlight because the legacy board does not PWM either.
Yeah, I meant not to add backlight control till the time we are able to get it working using PWM. Is this needed for the basic LCD functionality to work? I would like to avoid the churn of adding it using GPIO now and changing to PWM later, if possible.
Quoted 9 lines
Quoted 4 lines
b) What is GP0[7] connected to in the schematic you have? In the schematic I have I see
LCD_PWM0is connected to SPI1_SCS[0]/EPWM1B/GP2[14]/TM64P3_IN12.I have schematic 1016572 dated Wednesday, August 18, 2010. According to it, AXR15 / EPWMN0_TZ[0] /
ECAP2_APWM2/ GPIO0[7] connects to U25, Pin 46 to generateM_LCD_PWM0. You might have one of the early, pre-release versions.Ah, okay. In your schematic, is GP2[14] connected to anything?
Quoted 22 lines
Quoted 5 lines
c) The /* GP0[7] */ comment is not really useful on its own as it can be computed. What I wanted to see is the schematic symbol like "
LCD_PWM0". Same for other places like this below.I can do that.
Quoted 5 lines
Quoted 5 lines
arch/arm/boot/dts/da850-evm.dts +0
-0@@ -35,6 +79,16 @@ regulator-boot-on; };Quoted 9 lines
arch/arm/boot/dts/da850-evm.dts line 88
Quoted 7 lines
arch/arm/boot/dts/da850-evm.dts +7
-0+ backlight_reg: backlight-regulator { + compatible = "regulator-fixed"; + regulator-name = "lcd_backlight_pwr"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; /* GP2[15] */ + regulator-always-on;Why should this regulator never be disabled?
Quoted 6 lines
The gpio-backlight does not have a way that I can see to associate the regulator to it. I read through the bindings, but I didn't see an option to associate a regulator it. I use this regulator to drive
lcd_backlight_pwrand the backlight driver to writelcd_pwm0. Without this option, the system disableslcd_backlight_pwrand the screen is blankQuoted 6 lines
It sounds like this is a hack to enable backlight on this board. I think either the backlight driver needs to gain functionality to enable the GPIO. Or backlight could be treated as part of the panel and enabled using enable-gpios property in the panel. TBH, I will be okay either way. Can you check with Jyri, Tomi and rest of the DRM folks on what should be right way of dealing with this?
Quoted 3 lines
Per your request I added them into this thread. I added Tomi, Jyri, and Laurent to this as Laurent's name is associated with the gpio backlight driver.
Okay. The reason I did not loop them in myself is because I thought a fresh thread with background will be better. But okay.
Quoted 5 lines
I am not sure why you think it's a hack. I pulled up the schematic for the LCD to see what it's doing, and the
lcd_backlight_pwrpin controls the power-on sequence of the back-light controller. Without this, there is no power, so it seems to me that the 'regulator-fixed' device is the correct way to do it.
Not questioning modeling the GPIO as a regulator.
Quoted 7 lines
The separate pin associated to the gpio is used to tell the backlight IC to actually turn on/off the back-light. Ideally it seems like it would nice to have the gpio-backlight driver be able to specify the regulator, so when the backlight is in use, it would power the regulator, but until that's available, the it seems like 'regulator-always-on' is the way to make it stay on.
We need to add support for this in backlight driver. Using regulator-always-on to paper over this lack of support in backlight driver is what I am calling a hack. 'regulator-always-on' means the regulator cannot be turned off. Thats certainly not the case as you have pointed out.
Thanks,
Sekhar
PATCH v3 1/1 ARM: dts: da850-evm: Enable LCD and Backlight
In reply to Adam FordHi Adam,
Quoted 112 lines · On Monday, 14 May 2018 21:04:07 EEST Adam Ford wrote:
Quoted 3 lines · Sekhar Nori
Quoted 2 lines · Adam Ford
Quoted 1 line · Sekhar Nori
Hi Adam,
Added Tomi, Laurent, and Jyri for feedback.
Quoted 94 lines
Quoted 43 lines
Quoted 36 lines · Adam Ford
Quoted 7 lines
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.
The EVM has a gpio for the regulator and a gpio enable. The LCD and the vpif display pins are mutually exclusive, so if using the LCD, do not load the vpif driver.
Its not sufficient just note this in patch description.
a) Disable (status = "disabled") the VPIF node which clashes for pins with LCD.
b) Add a comment on top of the status = "disabled" giving information on how user can enable it (disable lcdc node and then change to status = "okay").Quoted 19 lines
Signed-off-by Adam Ford <[email protected]>---
V3: Fix errant GPIO, label GPIO pins, and rename the regulator to be
more explict to backlight which better matches the schematic. Updated the description to explain that it cannot be used at the same time as the vpif driver.V2: Add regulator and GPIO enable pins. Remove PWM backlight and
replace with GPIO(quoted diff) +0
-0
b/arch/arm/boot/dts/da850-evm.dtsindex2e817da37fdb..3f1c8be07efe100644arch/arm/boot/dts/da850-evm.dts +0
-0@@ -27,6 +27,50 @@ spi0 = &spi1; };Quoted 6 lines
arch/arm/boot/dts/da850-evm.dts line 32
Quoted 3 lines
arch/arm/boot/dts/da850-evm.dts +3
-0+ backlight { + compatible = "gpio-backlight"; + enable-gpios = <&gpio 7 GPIO_ACTIVE_HIGH>; /* GP0[7] */The gpio-backlight binding does not describe a property called enable-gpios. It should just be gpios.
Quoted 7 lines
I will fix that.
Quoted 2 lines
a) Are you using gpio-backlight because you are not able to get the PWM to work?
Yes, You told me not to worry about doing a PWM backlight because the legacy board does not PWM either.
Yeah, I meant not to add backlight control till the time we are able to get it working using PWM. Is this needed for the basic LCD functionality to work? I would like to avoid the churn of adding it using GPIO now and changing to PWM later, if possible.
Quoted 8 lines
Quoted 3 lines
b) What is GP0[7] connected to in the schematic you have? In the schematic I have I see
LCD_PWM0is connected to SPI1_SCS[0]/EPWM1B/GP2[14]/TM64P3_IN12.I have schematic 1016572 dated Wednesday, August 18, 2010. According to it, AXR15 / EPWMN0_TZ[0] /
ECAP2_APWM2/ GPIO0[7] connects to U25, Pin 46 to generateM_LCD_PWM0. You might have one of the early, pre-release versions.Ah, okay. In your schematic, is GP2[14] connected to anything?
Quoted 20 lines
Quoted 3 lines
c) The /* GP0[7] */ comment is not really useful on its own as it can be computed. What I wanted to see is the schematic symbol like "
LCD_PWM0". Same for other places like this below.I can do that.
Quoted 4 lines
Quoted 4 lines
arch/arm/boot/dts/da850-evm.dts +0
-0@@ -35,6 +79,16 @@ regulator-boot-on; };Quoted 9 lines
arch/arm/boot/dts/da850-evm.dts line 88
Quoted 7 lines
arch/arm/boot/dts/da850-evm.dts +7
-0+ backlight_reg: backlight-regulator { + compatible = "regulator-fixed"; + regulator-name = "lcd_backlight_pwr"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio 47 GPIO_ACTIVE_HIGH>; /* GP2[15] */ + regulator-always-on;Why should this regulator never be disabled?
Quoted 6 lines
The gpio-backlight does not have a way that I can see to associate the regulator to it. I read through the bindings, but I didn't see an option to associate a regulator it. I use this regulator to drive
lcd_backlight_pwrand the backlight driver to writelcd_pwm0. Without this option, the system disableslcd_backlight_pwrand the screen is blankQuoted 6 lines
It sounds like this is a hack to enable backlight on this board. I think either the backlight driver needs to gain functionality to enable the GPIO. Or backlight could be treated as part of the panel and enabled using enable-gpios property in the panel. TBH, I will be okay either way. Can you check with Jyri, Tomi and rest of the DRM folks on what should be right way of dealing with this?
Per your request I added them into this thread. I added Tomi, Jyri, and Laurent to this as Laurent's name is associated with the gpio backlight driver.
Quoted 5 lines
I am not sure why you think it's a hack. I pulled up the schematic for the LCD to see what it's doing, and the
lcd_backlight_pwrpin controls the power-on sequence of the back-light controller. Without this, there is no power, so it seems to me that the 'regulator-fixed' device is the correct way to do it.
It's a hack because keeping the backlight power on when the display is off will consume power unnecessarily. The backlight power should be turned off in that case.
Quoted 8 lines
The separate pin associated to the gpio is used to tell the backlight IC to actually turn on/off the back-light. Ideally it seems like it would nice to have the gpio-backlight driver be able to specify the regulator, so when the backlight is in use, it would power the regulator, but until that's available, the it seems like 'regulator-always-on' is the way to make it stay on.
Laurent, Jyri, Tomi, do you have any thoughts on this matter?
This has been attempted 6 years ago, and got rejected. See https://lwn.net/
Articles/525422/.
The problem is that the number of power supplies, the order in which they need to be sequenced, and the related timings (as in delays required between turning power supplies on/off) is highly hardware-specific. We can't hardcode a specific sequence and specific timings in the gpio-backlight (or pwm- backlight) driver, and specifying the sequence in DT was considered to be over-engineered.
You thus have two options, either creating a custom backlight driver that will handle the power supplies specific to your backlight controller, or integrating backlight power supply control in your panel driver. If the power supplies also power the panel and not just the backlight, or if their sequencing depends in any way on the panel model in which the backlight controller is integrated, I'd go for the latter, otherwise you can pick any of the two methods.
Signature · 3 lines
Regards, Laurent Pinchart