Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-23 Thread Marek Vasut
On 7/23/21 1:17 PM, Daniel Thompson wrote: On Fri, Jul 23, 2021 at 11:15:10AM +0100, Daniel Thompson wrote: On Thu, Jul 22, 2021 at 09:02:04PM +0200, Marek Vasut wrote: On 7/22/21 1:28 PM, Daniel Thompson wrote: On Wed, Jul 21, 2021 at 08:46:42PM +0200, Marek Vasut wrote: On 7/21/21 6:12 PM,

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-23 Thread Daniel Thompson
On Fri, Jul 23, 2021 at 11:15:10AM +0100, Daniel Thompson wrote: > On Thu, Jul 22, 2021 at 09:02:04PM +0200, Marek Vasut wrote: > > On 7/22/21 1:28 PM, Daniel Thompson wrote: > > > On Wed, Jul 21, 2021 at 08:46:42PM +0200, Marek Vasut wrote: > > > > On 7/21/21 6:12 PM, Daniel Thompson wrote: > > >

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-23 Thread Daniel Thompson
On Thu, Jul 22, 2021 at 09:02:04PM +0200, Marek Vasut wrote: > On 7/22/21 1:28 PM, Daniel Thompson wrote: > > On Wed, Jul 21, 2021 at 08:46:42PM +0200, Marek Vasut wrote: > > > On 7/21/21 6:12 PM, Daniel Thompson wrote: > > > > On Wed, Jul 21, 2021 at 05:09:57PM +0200, Marek Vasut wrote: > > > > >

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-22 Thread Marek Vasut
On 7/22/21 1:28 PM, Daniel Thompson wrote: On Wed, Jul 21, 2021 at 08:46:42PM +0200, Marek Vasut wrote: On 7/21/21 6:12 PM, Daniel Thompson wrote: On Wed, Jul 21, 2021 at 05:09:57PM +0200, Marek Vasut wrote: On 7/21/21 12:49 PM, Daniel Thompson wrote: I'm not sure that's correct, we can simpl

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-22 Thread Daniel Thompson
On Wed, Jul 21, 2021 at 08:46:42PM +0200, Marek Vasut wrote: > On 7/21/21 6:12 PM, Daniel Thompson wrote: > > On Wed, Jul 21, 2021 at 05:09:57PM +0200, Marek Vasut wrote: > > > On 7/21/21 12:49 PM, Daniel Thompson wrote: > > > > > I'm not sure that's correct, we can simply say that any new uses of

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-21 Thread Marek Vasut
On 7/21/21 9:01 PM, Marek Vasut wrote: [...] @@ -486,18 +500,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)    goto err_alloc;    } -    /* - * If the GPIO is not known to be already configured as output, that - * is, if gpiod_get_direction returns eithe

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-21 Thread Marek Vasut
On 7/21/21 6:43 PM, Daniel Thompson wrote: On Wed, Jul 21, 2021 at 05:09:57PM +0200, Marek Vasut wrote: On 7/21/21 12:49 PM, Daniel Thompson wrote: However, on the basis of making things less fragile, I think the underlying problem here is the assumption that it is safe to modify enable_gpio be

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-21 Thread Marek Vasut
On 7/21/21 6:12 PM, Daniel Thompson wrote: On Wed, Jul 21, 2021 at 05:09:57PM +0200, Marek Vasut wrote: On 7/21/21 12:49 PM, Daniel Thompson wrote: I'm not sure that's correct, we can simply say that any new uses of the pwm-backlight should specify the initial GPIO configuration, and for the le

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-21 Thread Daniel Thompson
On Wed, Jul 21, 2021 at 05:09:57PM +0200, Marek Vasut wrote: > On 7/21/21 12:49 PM, Daniel Thompson wrote: > > > > However, on the basis of making things less fragile, I think the > > > > underlying problem here is the assumption that it is safe to modify > > > > enable_gpio before the driver has i

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-21 Thread Daniel Thompson
On Wed, Jul 21, 2021 at 05:09:57PM +0200, Marek Vasut wrote: > On 7/21/21 12:49 PM, Daniel Thompson wrote: > > > I'm not sure that's correct, we can simply say that any new uses of the > > > pwm-backlight should specify the initial GPIO configuration, and for the > > > legacy ones, use whatever is

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-21 Thread Marek Vasut
On 7/21/21 12:49 PM, Daniel Thompson wrote: [...] NOTE: I think this whole auto-detection scheme should just be replaced by a DT prop, because it is very fragile. I have some sympathy for this view... although I think the boat has already set sail. I'm not sure that's correct, we can

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-21 Thread Daniel Thompson
On Tue, Jul 20, 2021 at 10:28:32PM +0200, Marek Vasut wrote: > On 7/19/21 1:22 PM, Daniel Thompson wrote: > > On Sun, Jul 18, 2021 at 11:14:15PM +0200, Marek Vasut wrote: > > > If the backlight enable GPIO is configured as input, the driver currently > > > unconditionally forces the GPIO to output-

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-20 Thread Marek Vasut
On 7/19/21 1:22 PM, Daniel Thompson wrote: On Sun, Jul 18, 2021 at 11:14:15PM +0200, Marek Vasut wrote: If the backlight enable GPIO is configured as input, the driver currently unconditionally forces the GPIO to output-enable. This can cause backlight flicker on boot e.g. in case the GPIO shoul

Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-19 Thread Daniel Thompson
On Sun, Jul 18, 2021 at 11:14:15PM +0200, Marek Vasut wrote: > If the backlight enable GPIO is configured as input, the driver currently > unconditionally forces the GPIO to output-enable. This can cause backlight > flicker on boot e.g. in case the GPIO should not be enabled before the PWM > is con

[PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input

2021-07-18 Thread Marek Vasut
If the backlight enable GPIO is configured as input, the driver currently unconditionally forces the GPIO to output-enable. This can cause backlight flicker on boot e.g. in case the GPIO should not be enabled before the PWM is configured and is correctly pulled low by external resistor. Fix this b