Thread (15 messages) flat view 15 messages, 2 authors, 2021-07-23

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

From: Marek Vasut <marex@denx.de>
Date: 2021-07-21 20:10:31
Also in: dri-devel, linux-pwm

On 7/21/21 9:01 PM, Marek Vasut wrote:

[...]
quoted
quoted
quoted
@@ -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 either 1 or -EINVAL, 
change the
-     * direction to output and set the GPIO as active.
-     * Do not force the GPIO to active when it was already output 
as it
-     * could cause backlight flickering or we would enable the 
backlight too
-     * early. Leave the decision of the initial backlight state for 
later.
-     */
-    if (pb->enable_gpio &&
-        gpiod_get_direction(pb->enable_gpio) != 0)
-        gpiod_direction_output(pb->enable_gpio, 1);
pwm_backlight_initial_power_state() is still called after 
pwm_apply_state()
in pwm_backlight_probe(), so that might still be too late, no ?
The initial pwm_apply_state() is essentially a nop or, perhaps, a sanity
check if you prefer to think if it that way.

It can change the PWM period in some (non-DT) cases but only if the PWM
is not already running... and the change of period should not start it
running.
All right, let me give this a try.
ACK, for this case I have here, this works too. Can you submit a proper 
patch, including my AB/TB and I think also the Fixes tag ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help