linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee@kernel.org>
To: FUKAUMI Naoki <naoki@radxa.com>
Cc: linux-leds@vger.kernel.org, pavel@ucw.cz
Subject: Re: [PATCH] leds: pwm-multicolor: fix multicolor PWM LED lights up without any setting
Date: Wed, 21 Aug 2024 17:11:19 +0100	[thread overview]
Message-ID: <20240821161119.GC6858@google.com> (raw)
In-Reply-To: <20240816102626.826-1-naoki@radxa.com>

On Fri, 16 Aug 2024, FUKAUMI Naoki wrote:

> from drivers/leds/leds-pwm.c:led_pwm_set(),
> 
> /*
>  * Disabling a PWM doesn't guarantee that it emits the inactive level.
>  * So keep it on. Only for suspending the PWM should be disabled because
>  * otherwise it refuses to suspend. The possible downside is that the
>  * LED might stay (or even go) on.
>  */
> 
> do the same in led_pwm_mc_set().
> 
> this fixes LEDs light up without any setting (i.e. brightness is 0) on
> Radxa E25.

Please redraft the commit message into proper sentences, complete with
correct grammar.  All sentences should start with an uppercase char.

Copying comment-blocks into commit messages to save authors from writing
one isn't really the done thing.

> Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
> ---
>  drivers/leds/rgb/leds-pwm-multicolor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/leds/rgb/leds-pwm-multicolor.c b/drivers/leds/rgb/leds-pwm-multicolor.c
> index e1a81e0109e8..7155339c075e 100644
> --- a/drivers/leds/rgb/leds-pwm-multicolor.c
> +++ b/drivers/leds/rgb/leds-pwm-multicolor.c
> @@ -50,7 +50,7 @@ static int led_pwm_mc_set(struct led_classdev *cdev,
>  			duty = priv->leds[i].state.period - duty;
>  
>  		priv->leds[i].state.duty_cycle = duty;
> -		priv->leds[i].state.enabled = duty > 0;
> +		priv->leds[i].state.enabled = !(cdev->flags & LED_SUSPENDED);
>  		ret = pwm_apply_might_sleep(priv->leds[i].pwm,
>  					    &priv->leds[i].state);
>  		if (ret)
> -- 
> 2.43.0
> 

-- 
Lee Jones [李琼斯]

  reply	other threads:[~2024-08-21 16:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-16 10:26 [PATCH] leds: pwm-multicolor: fix multicolor PWM LED lights up without any setting FUKAUMI Naoki
2024-08-21 16:11 ` Lee Jones [this message]
2024-08-21 21:26   ` FUKAUMI Naoki
2024-08-22  7:22     ` FUKAUMI Naoki
2024-08-22  8:24       ` Lee Jones
2024-12-10  7:36       ` FUKAUMI Naoki
2024-12-12 19:04         ` Lee Jones
2024-12-12 21:19           ` FUKAUMI Naoki
2024-12-13 16:35             ` Lee Jones
2024-12-13 21:11               ` FUKAUMI Naoki
2024-12-16  9:51                 ` Lee Jones

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=20240821161119.GC6858@google.com \
    --to=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=naoki@radxa.com \
    --cc=pavel@ucw.cz \
    /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).