2018-02-16 19:21:12

by Enric Balletbo i Serra

[permalink] [raw]
Subject: [RESEND PATCH v5 1/5] pwm-backlight: enable/disable the PWM before/after LCD enable toggle.

Before this patch the enable signal was set before the PWM signal and
vice-versa on power off. This sequence is wrong, at least, it is on
the different panels datasheets that I checked, so I inverted the sequence
to follow the specs.

For reference the following panels have the mentioned sequence:
- N133HSE-EA1 (Innolux)
- N116BGE (Innolux)
- N156BGE-L21 (Innolux)
- B101EAN0 (Auo)
- B101AW03 (Auo)
- LTN101NT05 (Samsung)
- CLAA101WA01A (Chunghwa)

Signed-off-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Daniel Thompson <[email protected]>
Acked-by: Jingoo Han <[email protected]>
---
Changes since v4:
- Rebase on top of mainline.
- Add the acks from Daniel Thompson and Jingoo Han.
Changes since v3:
- List the part numbers for the panel checked (Daniel Thompson)
Changes since v2:
- Add this as a separate patch (Thierry Reding)
Changes since v1:
- None

drivers/video/backlight/pwm_bl.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 1c2289ddd555..698ec68bcdc9 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -54,10 +54,11 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness)
if (err < 0)
dev_err(pb->dev, "failed to enable power supply\n");

+ pwm_enable(pb->pwm);
+
if (pb->enable_gpio)
gpiod_set_value_cansleep(pb->enable_gpio, 1);

- pwm_enable(pb->pwm);
pb->enabled = true;
}

@@ -66,12 +67,12 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb)
if (!pb->enabled)
return;

- pwm_config(pb->pwm, 0, pb->period);
- pwm_disable(pb->pwm);
-
if (pb->enable_gpio)
gpiod_set_value_cansleep(pb->enable_gpio, 0);

+ pwm_config(pb->pwm, 0, pb->period);
+ pwm_disable(pb->pwm);
+
regulator_disable(pb->power_supply);
pb->enabled = false;
}
--
2.15.1



2018-02-16 19:21:17

by Enric Balletbo i Serra

[permalink] [raw]
Subject: [RESEND PATCH v5 5/5] ARM: dts: rockchip: set PWM delay backlight settings for Minnie

The minnie devices comes with an AUO B101EAN01 panel which is different
from default veyron devices, thus the power on/off timing sequence is
slightly different. The datasheet specifies a pwm delay of 200 ms, so
update the PMW delay proprieties accordingly.

Signed-off-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Pavel Machek <[email protected]>
---
Changes since v4:
- Rebase on top of mainline.
Changes since v3:
- Use new -ms names for proprieties.
- Fix the delay, should be 200ms instead of 20ms (Pavel)
Changes since v2:
- Use new names for proprieties.
Changes since v1:
- Add this new patch as minnie has differents timings

arch/arm/boot/dts/rk3288-veyron-minnie.dts | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/rk3288-veyron-minnie.dts b/arch/arm/boot/dts/rk3288-veyron-minnie.dts
index 544de6027aaa..4c5307e62001 100644
--- a/arch/arm/boot/dts/rk3288-veyron-minnie.dts
+++ b/arch/arm/boot/dts/rk3288-veyron-minnie.dts
@@ -123,6 +123,8 @@
240 241 242 243 244 245 246 247
248 249 250 251 252 253 254 255>;
power-supply = <&backlight_regulator>;
+ post-pwm-on-delay-ms = <200>;
+ pwm-off-delay-ms = <200>;
};

&emmc {
--
2.15.1


2018-02-16 19:21:20

by Enric Balletbo i Serra

[permalink] [raw]
Subject: [RESEND PATCH v5 4/5] ARM: dts: rockchip: set PWM delay backlight settings for Veyron.

For veyron the binding should provide both PWM timings, the delay between
you enable the PWM and set the enable signal, and the delay between you
disable the PWM signal and clear the enable signal. Update the binding
accordingly, in this case the panels connected to the veyron boards have
a symmetric power sequence, hence the same value is used.

Signed-off-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Pavel Machek <[email protected]>
---
Changes since v4:
- Rebased on top of mainline.
Changes since v3:
- Use new -ms names for proprieties.
Changes since v2:
- Use new names for proprieties.
Changes since v1:
- Add this new patch to fix current binding on veyron.

arch/arm/boot/dts/rk3288-veyron-chromebook.dtsi | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/rk3288-veyron-chromebook.dtsi b/arch/arm/boot/dts/rk3288-veyron-chromebook.dtsi
index be487111d025..b16d570ff029 100644
--- a/arch/arm/boot/dts/rk3288-veyron-chromebook.dtsi
+++ b/arch/arm/boot/dts/rk3288-veyron-chromebook.dtsi
@@ -95,7 +95,8 @@
pinctrl-names = "default";
pinctrl-0 = <&bl_en>;
pwms = <&pwm0 0 1000000 0>;
- pwm-delay-us = <10000>;
+ post-pwm-on-delay-ms = <10>;
+ pwm-off-delay-ms = <10>;
};

gpio-charger {
--
2.15.1


2018-02-16 19:21:21

by Enric Balletbo i Serra

[permalink] [raw]
Subject: [RESEND PATCH v5 3/5] pwm-backlight: add support for PWM delays proprieties.

Some panels (i.e. N116BGE-L41), in their power sequence specifications,
request a delay between set the PWM signal and enable the backlight and
between clear the PWM signal and disable the backlight. Add support for
the new post-pwm-on-delay-ms and pwm-off-delay-ms proprieties to meet
the timings.

Signed-off-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Acked-by: Daniel Thompson <[email protected]>
Acked-by: Jingoo Han <[email protected]>
---
Changes since v4:
- Rebased on top of mainline.
- Added the acks from Pavel Machek, Daniel thompson and Jingoo Han
Changes since v3:
- Use two named members instead of pwm_delay[] (Daniel and Pavel)
- Use msleep instead of usleep_range. (Pavel)
Changes since v2:
- Move the pwm/enable sequence to another patch (Thierry Reding)
Changes since v1:
- As suggested by Daniel Thompson
- Do not assume power-on delay and power-off delay will be the same
- Move the check of dt property to the parse dt function.

drivers/video/backlight/pwm_bl.c | 19 +++++++++++++++++++
include/linux/pwm_backlight.h | 2 ++
2 files changed, 21 insertions(+)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 698ec68bcdc9..8e3f1245f5c5 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -10,6 +10,7 @@
* published by the Free Software Foundation.
*/

+#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio.h>
#include <linux/module.h>
@@ -35,6 +36,8 @@ struct pwm_bl_data {
struct gpio_desc *enable_gpio;
unsigned int scale;
bool legacy;
+ unsigned int post_pwm_on_delay;
+ unsigned int pwm_off_delay;
int (*notify)(struct device *,
int brightness);
void (*notify_after)(struct device *,
@@ -56,6 +59,9 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb, int brightness)

pwm_enable(pb->pwm);

+ if (pb->post_pwm_on_delay)
+ msleep(pb->post_pwm_on_delay);
+
if (pb->enable_gpio)
gpiod_set_value_cansleep(pb->enable_gpio, 1);

@@ -70,6 +76,9 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb)
if (pb->enable_gpio)
gpiod_set_value_cansleep(pb->enable_gpio, 0);

+ if (pb->pwm_off_delay)
+ msleep(pb->pwm_off_delay);
+
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);

@@ -178,6 +187,14 @@ static int pwm_backlight_parse_dt(struct device *dev,
data->max_brightness--;
}

+ /*
+ * These values are optional and set as 0 by default, the out values
+ * are modified only if a valid u32 value can be decoded.
+ */
+ of_property_read_u32(node, "post-pwm-on-delay-ms",
+ &data->post_pwm_on_delay);
+ of_property_read_u32(node, "pwm-off-delay-ms", &data->pwm_off_delay);
+
data->enable_gpio = -EINVAL;
return 0;
}
@@ -276,6 +293,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
pb->exit = data->exit;
pb->dev = &pdev->dev;
pb->enabled = false;
+ pb->post_pwm_on_delay = data->post_pwm_on_delay;
+ pb->pwm_off_delay = data->pwm_off_delay;

pb->enable_gpio = devm_gpiod_get_optional(&pdev->dev, "enable",
GPIOD_ASIS);
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index e8afbd71a140..8ea265a022fd 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -14,6 +14,8 @@ struct platform_pwm_backlight_data {
unsigned int lth_brightness;
unsigned int pwm_period_ns;
unsigned int *levels;
+ unsigned int post_pwm_on_delay;
+ unsigned int pwm_off_delay;
/* TODO remove once all users are switched to gpiod_* API */
int enable_gpio;
int (*init)(struct device *dev);
--
2.15.1


2018-02-16 19:21:45

by Enric Balletbo i Serra

[permalink] [raw]
Subject: [RESEND PATCH v5 2/5] dt-bindings: pwm-backlight: add PWM delay proprieties.

Hardware needs a delay between setting an initial (non-zero) PWM and
enabling the backlight using GPIO. The post-pwm-on-delay-ms specifies
this delay in milli seconds. Hardware also needs a delay between disabing
the backlight using GPIO and setting PWM value to 0. The pwm-off-delay-ms
is this delay in milli seconds.

Signed-off-by: Enric Balletbo i Serra <[email protected]>
Acked-by: Pavel Machek <[email protected]>
---
Based on the original Huang Lin <[email protected]> work.

Changes since v4:
- Rebase on top of mainline.
Changes since v3:
- Replace us for ms.
- Add Acked-by: Pavel Machek <[email protected]>
Changes since v2:
- Use separate properties (Rob Herring)
Changes since v1:
- As suggested by Daniel Thompson
- Do not assume power-on delay and power-off delay will be the same

Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
index 764db86d441a..310810906613 100644
--- a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
+++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
@@ -17,6 +17,10 @@ Optional properties:
"pwms" property (see PWM binding[0])
- enable-gpios: contains a single GPIO specifier for the GPIO which enables
and disables the backlight (see GPIO binding[1])
+ - post-pwm-on-delay-ms: Delay in ms between setting an initial (non-zero) PWM
+ and enabling the backlight using GPIO.
+ - pwm-off-delay-ms: Delay in ms between disabling the backlight using GPIO
+ and setting PWM value to 0.

[0]: Documentation/devicetree/bindings/pwm/pwm.txt
[1]: Documentation/devicetree/bindings/gpio/gpio.txt
@@ -32,4 +36,6 @@ Example:

power-supply = <&vdd_bl_reg>;
enable-gpios = <&gpio 58 0>;
+ post-pwm-on-delay-ms = <10>;
+ pwm-off-delay-ms = <10>;
};
--
2.15.1


2018-02-19 09:25:14

by Lee Jones

[permalink] [raw]
Subject: Re: [RESEND PATCH v5 2/5] dt-bindings: pwm-backlight: add PWM delay proprieties.

On Fri, 16 Feb 2018, Enric Balletbo i Serra wrote:

> Hardware needs a delay between setting an initial (non-zero) PWM and
> enabling the backlight using GPIO. The post-pwm-on-delay-ms specifies
> this delay in milli seconds. Hardware also needs a delay between disabing
> the backlight using GPIO and setting PWM value to 0. The pwm-off-delay-ms
> is this delay in milli seconds.
>
> Signed-off-by: Enric Balletbo i Serra <[email protected]>
> Acked-by: Pavel Machek <[email protected]>
> ---
> Based on the original Huang Lin <[email protected]> work.
>
> Changes since v4:
> - Rebase on top of mainline.
> Changes since v3:
> - Replace us for ms.
> - Add Acked-by: Pavel Machek <[email protected]>
> Changes since v2:
> - Use separate properties (Rob Herring)
> Changes since v1:
> - As suggested by Daniel Thompson
> - Do not assume power-on delay and power-off delay will be the same
>
> Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt | 6 ++++++
> 1 file changed, 6 insertions(+)

Looks like this still needs an Ack.

Also, you didn't supply a 0th (cover-letter) patch, so I have no idea
of patch history or your future intentions.

Are there build-time dependencies between them or can each patch be
merged via their respective trees without the fear of merge/build
failure?

--
Lee Jones
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2018-02-19 09:58:13

by Heiko Stuebner

[permalink] [raw]
Subject: Re: [RESEND PATCH v5 2/5] dt-bindings: pwm-backlight: add PWM delay proprieties.

Hi Lee,

Am Montag, 19. Februar 2018, 10:22:47 CET schrieb Lee Jones:
> On Fri, 16 Feb 2018, Enric Balletbo i Serra wrote:
>
> > Hardware needs a delay between setting an initial (non-zero) PWM and
> > enabling the backlight using GPIO. The post-pwm-on-delay-ms specifies
> > this delay in milli seconds. Hardware also needs a delay between disabing
> > the backlight using GPIO and setting PWM value to 0. The pwm-off-delay-ms
> > is this delay in milli seconds.
> >
> > Signed-off-by: Enric Balletbo i Serra <[email protected]>
> > Acked-by: Pavel Machek <[email protected]>
> > ---
> > Based on the original Huang Lin <[email protected]> work.
> >
> > Changes since v4:
> > - Rebase on top of mainline.
> > Changes since v3:
> > - Replace us for ms.
> > - Add Acked-by: Pavel Machek <[email protected]>
> > Changes since v2:
> > - Use separate properties (Rob Herring)
> > Changes since v1:
> > - As suggested by Daniel Thompson
> > - Do not assume power-on delay and power-off delay will be the same
> >
> > Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt | 6 ++++++
> > 1 file changed, 6 insertions(+)
>
> Looks like this still needs an Ack.
>
> Also, you didn't supply a 0th (cover-letter) patch, so I have no idea
> of patch history or your future intentions.
>
> Are there build-time dependencies between them or can each patch be
> merged via their respective trees without the fear of merge/build
> failure?

When looking at the patches, there do not seem to be any build-time
dependencies between the patch 1-3 (backlight) and 4+5 devicetree,
so after Rob hopefully has time to look at the binding change, I'd suspect
you take the code changes and I'll take the dts changes.


Heiko

2018-02-19 10:40:50

by Lee Jones

[permalink] [raw]
Subject: Re: [RESEND PATCH v5 2/5] dt-bindings: pwm-backlight: add PWM delay proprieties.

On Mon, 19 Feb 2018, Heiko Stuebner wrote:
> Am Montag, 19. Februar 2018, 10:22:47 CET schrieb Lee Jones:
> > On Fri, 16 Feb 2018, Enric Balletbo i Serra wrote:
> >
> > > Hardware needs a delay between setting an initial (non-zero) PWM and
> > > enabling the backlight using GPIO. The post-pwm-on-delay-ms specifies
> > > this delay in milli seconds. Hardware also needs a delay between disabing
> > > the backlight using GPIO and setting PWM value to 0. The pwm-off-delay-ms
> > > is this delay in milli seconds.
> > >
> > > Signed-off-by: Enric Balletbo i Serra <[email protected]>
> > > Acked-by: Pavel Machek <[email protected]>
> > > ---
> > > Based on the original Huang Lin <[email protected]> work.
> > >
> > > Changes since v4:
> > > - Rebase on top of mainline.
> > > Changes since v3:
> > > - Replace us for ms.
> > > - Add Acked-by: Pavel Machek <[email protected]>
> > > Changes since v2:
> > > - Use separate properties (Rob Herring)
> > > Changes since v1:
> > > - As suggested by Daniel Thompson
> > > - Do not assume power-on delay and power-off delay will be the same
> > >
> > > Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt | 6 ++++++
> > > 1 file changed, 6 insertions(+)
> >
> > Looks like this still needs an Ack.
> >
> > Also, you didn't supply a 0th (cover-letter) patch, so I have no idea
> > of patch history or your future intentions.
> >
> > Are there build-time dependencies between them or can each patch be
> > merged via their respective trees without the fear of merge/build
> > failure?
>
> When looking at the patches, there do not seem to be any build-time
> dependencies between the patch 1-3 (backlight) and 4+5 devicetree,
> so after Rob hopefully has time to look at the binding change, I'd suspect
> you take the code changes and I'll take the dts changes.

Works for me.

--
Lee Jones
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2018-02-19 11:12:36

by Daniel Thompson

[permalink] [raw]
Subject: Re: [RESEND PATCH v5 2/5] dt-bindings: pwm-backlight: add PWM delay proprieties.

On Fri, Feb 16, 2018 at 06:40:31PM +0100, Enric Balletbo i Serra wrote:
> Hardware needs a delay between setting an initial (non-zero) PWM and
> enabling the backlight using GPIO. The post-pwm-on-delay-ms specifies
> this delay in milli seconds. Hardware also needs a delay between disabing
> the backlight using GPIO and setting PWM value to 0. The pwm-off-delay-ms
> is this delay in milli seconds.
>
> Signed-off-by: Enric Balletbo i Serra <[email protected]>
> Acked-by: Pavel Machek <[email protected]>

Acked-by: Daniel Thompson <[email protected]>

> ---
> Based on the original Huang Lin <[email protected]> work.
>
> Changes since v4:
> - Rebase on top of mainline.
> Changes since v3:
> - Replace us for ms.
> - Add Acked-by: Pavel Machek <[email protected]>
> Changes since v2:
> - Use separate properties (Rob Herring)
> Changes since v1:
> - As suggested by Daniel Thompson
> - Do not assume power-on delay and power-off delay will be the same
>
> Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
> index 764db86d441a..310810906613 100644
> --- a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
> +++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
> @@ -17,6 +17,10 @@ Optional properties:
> "pwms" property (see PWM binding[0])
> - enable-gpios: contains a single GPIO specifier for the GPIO which enables
> and disables the backlight (see GPIO binding[1])
> + - post-pwm-on-delay-ms: Delay in ms between setting an initial (non-zero) PWM
> + and enabling the backlight using GPIO.
> + - pwm-off-delay-ms: Delay in ms between disabling the backlight using GPIO
> + and setting PWM value to 0.
>
> [0]: Documentation/devicetree/bindings/pwm/pwm.txt
> [1]: Documentation/devicetree/bindings/gpio/gpio.txt
> @@ -32,4 +36,6 @@ Example:
>
> power-supply = <&vdd_bl_reg>;
> enable-gpios = <&gpio 58 0>;
> + post-pwm-on-delay-ms = <10>;
> + pwm-off-delay-ms = <10>;
> };
> --
> 2.15.1
>

2018-03-09 10:16:01

by Enric Balletbo Serra

[permalink] [raw]
Subject: Re: [RESEND PATCH v5 2/5] dt-bindings: pwm-backlight: add PWM delay proprieties.

Hi Rob,

oh, devicetree mailing list is not added, sorry, so cc'ing ...

2018-02-19 12:11 GMT+01:00 Daniel Thompson <[email protected]>:
> On Fri, Feb 16, 2018 at 06:40:31PM +0100, Enric Balletbo i Serra wrote:
>> Hardware needs a delay between setting an initial (non-zero) PWM and
>> enabling the backlight using GPIO. The post-pwm-on-delay-ms specifies
>> this delay in milli seconds. Hardware also needs a delay between disabing
>> the backlight using GPIO and setting PWM value to 0. The pwm-off-delay-ms
>> is this delay in milli seconds.
>>
>> Signed-off-by: Enric Balletbo i Serra <[email protected]>
>> Acked-by: Pavel Machek <[email protected]>
>
> Acked-by: Daniel Thompson <[email protected]>
>

Lee, I guess that after Daniel ack the only ack missing here is one
from Rob Herring?

Rob, if you have a chance to look at this I'd appreciate.

Thanks,
Enric

>> ---
>> Based on the original Huang Lin <[email protected]> work.
>>
>> Changes since v4:
>> - Rebase on top of mainline.
>> Changes since v3:
>> - Replace us for ms.
>> - Add Acked-by: Pavel Machek <[email protected]>
>> Changes since v2:
>> - Use separate properties (Rob Herring)
>> Changes since v1:
>> - As suggested by Daniel Thompson
>> - Do not assume power-on delay and power-off delay will be the same
>>
>> Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
>> index 764db86d441a..310810906613 100644
>> --- a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
>> +++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt
>> @@ -17,6 +17,10 @@ Optional properties:
>> "pwms" property (see PWM binding[0])
>> - enable-gpios: contains a single GPIO specifier for the GPIO which enables
>> and disables the backlight (see GPIO binding[1])
>> + - post-pwm-on-delay-ms: Delay in ms between setting an initial (non-zero) PWM
>> + and enabling the backlight using GPIO.
>> + - pwm-off-delay-ms: Delay in ms between disabling the backlight using GPIO
>> + and setting PWM value to 0.
>>
>> [0]: Documentation/devicetree/bindings/pwm/pwm.txt
>> [1]: Documentation/devicetree/bindings/gpio/gpio.txt
>> @@ -32,4 +36,6 @@ Example:
>>
>> power-supply = <&vdd_bl_reg>;
>> enable-gpios = <&gpio 58 0>;
>> + post-pwm-on-delay-ms = <10>;
>> + pwm-off-delay-ms = <10>;
>> };
>> --
>> 2.15.1
>>

2018-03-12 09:11:52

by Lee Jones

[permalink] [raw]
Subject: Re: [RESEND PATCH v5 2/5] dt-bindings: pwm-backlight: add PWM delay proprieties.

FAO Thierry,

> oh, devicetree mailing list is not added, sorry, so cc'ing ...
>
> 2018-02-19 12:11 GMT+01:00 Daniel Thompson <[email protected]>:
> > On Fri, Feb 16, 2018 at 06:40:31PM +0100, Enric Balletbo i Serra wrote:
> >> Hardware needs a delay between setting an initial (non-zero) PWM and
> >> enabling the backlight using GPIO. The post-pwm-on-delay-ms specifies
> >> this delay in milli seconds. Hardware also needs a delay between disabing
> >> the backlight using GPIO and setting PWM value to 0. The pwm-off-delay-ms
> >> is this delay in milli seconds.
> >>
> >> Signed-off-by: Enric Balletbo i Serra <[email protected]>
> >> Acked-by: Pavel Machek <[email protected]>
> >
> > Acked-by: Daniel Thompson <[email protected]>
> >
>
> Lee, I guess that after Daniel ack the only ack missing here is one
> from Rob Herring?

I'd also like an ACK from the PWM Maintainer if possible.

> Rob, if you have a chance to look at this I'd appreciate.

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

2018-03-19 17:01:54

by Thierry Reding

[permalink] [raw]
Subject: Re: [RESEND PATCH v5 1/5] pwm-backlight: enable/disable the PWM before/after LCD enable toggle.

On Fri, Feb 16, 2018 at 06:40:30PM +0100, Enric Balletbo i Serra wrote:
> Before this patch the enable signal was set before the PWM signal and
> vice-versa on power off. This sequence is wrong, at least, it is on
> the different panels datasheets that I checked, so I inverted the sequence
> to follow the specs.
>
> For reference the following panels have the mentioned sequence:
> - N133HSE-EA1 (Innolux)
> - N116BGE (Innolux)
> - N156BGE-L21 (Innolux)
> - B101EAN0 (Auo)
> - B101AW03 (Auo)
> - LTN101NT05 (Samsung)
> - CLAA101WA01A (Chunghwa)
>
> Signed-off-by: Enric Balletbo i Serra <[email protected]>
> Acked-by: Daniel Thompson <[email protected]>
> Acked-by: Jingoo Han <[email protected]>
> ---
> Changes since v4:
> - Rebase on top of mainline.
> - Add the acks from Daniel Thompson and Jingoo Han.
> Changes since v3:
> - List the part numbers for the panel checked (Daniel Thompson)
> Changes since v2:
> - Add this as a separate patch (Thierry Reding)
> Changes since v1:
> - None
>
> drivers/video/backlight/pwm_bl.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)

I'm surprised that panels even care about this. Do you see actual
breakage if these are the other way around?

Anyway, this seems to me as legit as the other way around, so:

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (1.38 kB)
signature.asc (849.00 B)
Download all attachments

2018-03-19 17:02:22

by Thierry Reding

[permalink] [raw]
Subject: Re: [RESEND PATCH v5 2/5] dt-bindings: pwm-backlight: add PWM delay proprieties.

On Fri, Feb 16, 2018 at 06:40:31PM +0100, Enric Balletbo i Serra wrote:
> Hardware needs a delay between setting an initial (non-zero) PWM and
> enabling the backlight using GPIO. The post-pwm-on-delay-ms specifies
> this delay in milli seconds. Hardware also needs a delay between disabing
> the backlight using GPIO and setting PWM value to 0. The pwm-off-delay-ms
> is this delay in milli seconds.
>
> Signed-off-by: Enric Balletbo i Serra <[email protected]>
> Acked-by: Pavel Machek <[email protected]>
> ---
> Based on the original Huang Lin <[email protected]> work.
>
> Changes since v4:
> - Rebase on top of mainline.
> Changes since v3:
> - Replace us for ms.
> - Add Acked-by: Pavel Machek <[email protected]>
> Changes since v2:
> - Use separate properties (Rob Herring)
> Changes since v1:
> - As suggested by Daniel Thompson
> - Do not assume power-on delay and power-off delay will be the same
>
> Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt | 6 ++++++
> 1 file changed, 6 insertions(+)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (1.09 kB)
signature.asc (849.00 B)
Download all attachments

2018-03-19 19:03:33

by Enric Balletbo i Serra

[permalink] [raw]
Subject: Re: [RESEND PATCH v5 1/5] pwm-backlight: enable/disable the PWM before/after LCD enable toggle.

Hi Thierry,

Thanks for your ack.

On 19/03/18 17:58, Thierry Reding wrote:
> On Fri, Feb 16, 2018 at 06:40:30PM +0100, Enric Balletbo i Serra wrote:
>> Before this patch the enable signal was set before the PWM signal and
>> vice-versa on power off. This sequence is wrong, at least, it is on
>> the different panels datasheets that I checked, so I inverted the sequence
>> to follow the specs.
>>
>> For reference the following panels have the mentioned sequence:
>> - N133HSE-EA1 (Innolux)
>> - N116BGE (Innolux)
>> - N156BGE-L21 (Innolux)
>> - B101EAN0 (Auo)
>> - B101AW03 (Auo)
>> - LTN101NT05 (Samsung)
>> - CLAA101WA01A (Chunghwa)
>>
>> Signed-off-by: Enric Balletbo i Serra <[email protected]>
>> Acked-by: Daniel Thompson <[email protected]>
>> Acked-by: Jingoo Han <[email protected]>
>> ---
>> Changes since v4:
>> - Rebase on top of mainline.
>> - Add the acks from Daniel Thompson and Jingoo Han.
>> Changes since v3:
>> - List the part numbers for the panel checked (Daniel Thompson)
>> Changes since v2:
>> - Add this as a separate patch (Thierry Reding)
>> Changes since v1:
>> - None
>>
>> drivers/video/backlight/pwm_bl.c | 9 +++++----
>> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> I'm surprised that panels even care about this. Do you see actual
> breakage if these are the other way around?
>

At least the B116XTN02 requires enable first the PWM, wait 10ms and then BL_EN
to avoid garbage. I did not observe the issue on other panels but the datasheets
I checked specifies this sequence as correct.

> Anyway, this seems to me as legit as the other way around, so:
>
> Acked-by: Thierry Reding <[email protected]>
>

2018-03-20 01:39:53

by Thierry Reding

[permalink] [raw]
Subject: Re: [RESEND PATCH v5 3/5] pwm-backlight: add support for PWM delays proprieties.

On Fri, Feb 16, 2018 at 06:40:32PM +0100, Enric Balletbo i Serra wrote:
> Some panels (i.e. N116BGE-L41), in their power sequence specifications,
> request a delay between set the PWM signal and enable the backlight and
> between clear the PWM signal and disable the backlight. Add support for
> the new post-pwm-on-delay-ms and pwm-off-delay-ms proprieties to meet
> the timings.
>
> Signed-off-by: Enric Balletbo i Serra <[email protected]>
> Acked-by: Pavel Machek <[email protected]>
> Acked-by: Daniel Thompson <[email protected]>
> Acked-by: Jingoo Han <[email protected]>
> ---
> Changes since v4:
> - Rebased on top of mainline.
> - Added the acks from Pavel Machek, Daniel thompson and Jingoo Han
> Changes since v3:
> - Use two named members instead of pwm_delay[] (Daniel and Pavel)
> - Use msleep instead of usleep_range. (Pavel)
> Changes since v2:
> - Move the pwm/enable sequence to another patch (Thierry Reding)
> Changes since v1:
> - As suggested by Daniel Thompson
> - Do not assume power-on delay and power-off delay will be the same
> - Move the check of dt property to the parse dt function.
>
> drivers/video/backlight/pwm_bl.c | 19 +++++++++++++++++++
> include/linux/pwm_backlight.h | 2 ++
> 2 files changed, 21 insertions(+)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (1.34 kB)
signature.asc (849.00 B)
Download all attachments