linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Daniel Thompson <daniel.thompson@linaro.org>
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	Christian Gmeiner <christian.gmeiner@gmail.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Thierry Reding <treding@nvidia.com>,
	linux-pwm@vger.kernel.org
Subject: Re: [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input
Date: Wed, 21 Jul 2021 22:10:26 +0200	[thread overview]
Message-ID: <7c354dc1-11d5-ed80-ed74-59c1aa6a9a31@denx.de> (raw)
In-Reply-To: <f8b2bc71-2d2d-09f1-913d-0a6b93a1da31@denx.de>

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 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 ?

      reply	other threads:[~2021-07-21 20:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-18 21:14 [PATCH] backlight: pwm_bl: Avoid backlight flicker if backlight control GPIO is input Marek Vasut
2021-07-19 11:22 ` Daniel Thompson
2021-07-20 20:28   ` Marek Vasut
2021-07-21 10:49     ` Daniel Thompson
2021-07-21 15:09       ` Marek Vasut
2021-07-21 16:12         ` Daniel Thompson
2021-07-21 18:46           ` Marek Vasut
2021-07-22 11:28             ` Daniel Thompson
2021-07-22 19:02               ` Marek Vasut
2021-07-23 10:15                 ` Daniel Thompson
2021-07-23 11:17                   ` Daniel Thompson
2021-07-23 12:27                     ` Marek Vasut
2021-07-21 16:43         ` Daniel Thompson
2021-07-21 19:01           ` Marek Vasut
2021-07-21 20:10             ` Marek Vasut [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c354dc1-11d5-ed80-ed74-59c1aa6a9a31@denx.de \
    --to=marex@denx.de \
    --cc=christian.gmeiner@gmail.com \
    --cc=daniel.thompson@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).