linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Sven Schwermer <sven@svenschwermer.de>, linux-leds@vger.kernel.org
Cc: Sven Schwermer <sven.schwermer@disruptive-technologies.com>,
	schuchmann@schleissheimer.de, pavel@ucw.cz
Subject: Re: [PATCH] led: multicolor: Don't set brightness when blinking
Date: Wed, 18 May 2022 21:36:39 +0200	[thread overview]
Message-ID: <7446cf35-497d-b233-cb6d-e8f3e73a4145@gmail.com> (raw)
In-Reply-To: <76883915-8c7f-a14d-1a34-f41ed7899d62@gmail.com>

On 5/18/22 21:29, Jacek Anaszewski wrote:
> Hi Sven,
> 
> On 5/18/22 10:22, Sven Schwermer wrote:
>> From: Sven Schwermer <sven.schwermer@disruptive-technologies.com>
>>
>> When writing to the multi_intensity file, don't unconditionally call
>> led_set_brightness. By only doing this if blinking is inactive we
>> prevent blinking from stopping if the blinking is in its off phase while
>> the file is written.
>>
>> Instead, if blinking is active, the changed intensity values are applied
>> upon the next blink. This is consistent with changing the brightness on
>> monochrome LEDs with active blinking.
>>
>> Suggested-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
>> Signed-off-by: Sven Schwermer 
>> <sven.schwermer@disruptive-technologies.com>
>> ---
>>   drivers/leds/led-class-multicolor.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/leds/led-class-multicolor.c 
>> b/drivers/leds/led-class-multicolor.c
>> index e317408583df..5b1479b5d32c 100644
>> --- a/drivers/leds/led-class-multicolor.c
>> +++ b/drivers/leds/led-class-multicolor.c
>> @@ -59,7 +59,8 @@ static ssize_t multi_intensity_store(struct device 
>> *dev,
>>       for (i = 0; i < mcled_cdev->num_colors; i++)
>>           mcled_cdev->subled_info[i].intensity = intensity_value[i];
>> -    led_set_brightness(led_cdev, led_cdev->brightness);
>> +    if (!test_bit(LED_BLINK_SW, &led_cdev->work_flags))
>> +        led_set_brightness(led_cdev, led_cdev->brightness);
>>       ret = size;
>>   err_out:
>>       mutex_unlock(&led_cdev->led_access);
>>
>> base-commit: 210e04ff768142b96452030c4c2627512b30ad95
> 
> Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
> 

However I'd change patch title because now it is misleading.

How about

"led: multicolor: Fix intensity setting while SW blinking"

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2022-05-18 19:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 12:16 Setting multi-color intensities stops software blink Sven Schwermer
2022-05-17 10:29 ` AW: " Sven Schuchmann
2022-05-17 21:43   ` Jacek Anaszewski
2022-05-18  6:26     ` Sven Schwermer
2022-05-18  8:22     ` [PATCH] led: multicolor: Don't set brightness when blinking Sven Schwermer
2022-05-18 14:06       ` AW: " Sven Schuchmann
2022-05-18 19:29       ` Jacek Anaszewski
2022-05-18 19:36         ` Jacek Anaszewski [this message]
2022-05-18 19:54     ` [PATCH v2] led: multicolor: Fix intensity setting while SW blinking Sven Schwermer

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=7446cf35-497d-b233-cb6d-e8f3e73a4145@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=schuchmann@schleissheimer.de \
    --cc=sven.schwermer@disruptive-technologies.com \
    --cc=sven@svenschwermer.de \
    /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).