From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Tony Makkiel <tony.makkiel@daqri.com>,
Linux LED Subsystem <linux-leds@vger.kernel.org>
Subject: Re: Brightness control irrespective of blink state.
Date: Fri, 6 May 2016 20:48:53 +0200 [thread overview]
Message-ID: <572CE715.6060504@gmail.com> (raw)
In-Reply-To: <572CE1B0.8040001@daqri.com>
Hi Tony,
The code you are using is outdated. It is likely that the issue
you are referring to was addressed while improving LED core few
months ago.
Best regards,
Jacek Anaszewski
On 05/06/2016 08:25 PM, Tony Makkiel wrote:
> Hi All,
> Is there a reason for rejecting brightness change requests when
> either of the blink_delays are set? Shouldn't the function be allowed to
> call "led_set_brightness_sync"?
>
> I am referring to "led_set_brightness" in led-core.c.
>
> With the following change, the brightness of led can be varied
> irrespective of blinking state. But wanted to check if that is a bad idea?
>
> Many Thanks,
> Tony
>
>
> --- a/drivers/leds/led-core.c
> +++ b/drivers/leds/led-core.c
> @@ -190,7 +191,15 @@ EXPORT_SYMBOL_GPL(led_stop_software_blink);
> void led_set_brightness(struct led_classdev *led_cdev,
> enum led_brightness brightness)
> {
> - int ret = 0;
> + int ret = -EINVAL;
> +
> + if (led_cdev->flags & SET_BRIGHTNESS_SYNC){
> + ret = led_set_brightness_sync(led_cdev, brightness);
> + if (ret < 0)
> + dev_dbg(led_cdev->dev,
> + "Setting LED brightness failed (%d)\n",
> ret);
> + return;
> + }
>
> /* delay brightness if soft-blink is active */
> if (led_cdev->blink_delay_on || led_cdev->blink_delay_off) {
> @@ -203,14 +212,8 @@ void led_set_brightness(struct led_classdev *led_cdev,
> if (led_cdev->flags & SET_BRIGHTNESS_ASYNC) {
> led_set_brightness_async(led_cdev, brightness);
> return;
> - } else if (led_cdev->flags & SET_BRIGHTNESS_SYNC)
> - ret = led_set_brightness_sync(led_cdev, brightness);
> - else
> - ret = -EINVAL;
> -
> - if (ret < 0)
> - dev_dbg(led_cdev->dev, "Setting LED brightness failed
> (%d)\n",
> - ret);
> + }
> + dev_dbg(led_cdev->dev, "Setting LED brightness failed (%d)\n",
> ret);
> }
> EXPORT_SYMBOL(led_set_brightness);
next prev parent reply other threads:[~2016-05-06 18:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-28 22:03 [PATCH v3 0/3] Extend the LED panic trigger Ezequiel Garcia
2016-04-28 22:03 ` [PATCH v3 1/3] leds: triggers: Allow to switch the trigger to "panic" on a kernel panic Ezequiel Garcia
2016-04-29 7:20 ` Jacek Anaszewski
[not found] ` <57230B26.9010300-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-05-06 9:03 ` Jacek Anaszewski
2016-05-06 13:05 ` Ezequiel Garcia
2016-05-06 18:25 ` Brightness control irrespective of blink state Tony Makkiel
2016-05-06 18:48 ` Jacek Anaszewski [this message]
2016-05-09 13:27 ` Tony Makkiel
2016-05-09 14:45 ` Jacek Anaszewski
2016-05-10 9:36 ` Tony Makkiel
2016-05-10 13:26 ` Jacek Anaszewski
2016-05-10 16:55 ` Tony Makkiel
2016-05-11 9:41 ` Jacek Anaszewski
2016-05-11 13:42 ` Tony Makkiel
2016-05-12 10:26 ` Jacek Anaszewski
2016-05-13 14:20 ` Tony Makkiel
2016-05-16 9:21 ` Jacek Anaszewski
2016-05-16 13:43 ` Tony Makkiel
2016-05-16 14:23 ` Jacek Anaszewski
2016-05-16 14:32 ` Jacek Anaszewski
2016-04-28 22:03 ` [PATCH v3 2/3] devicetree: leds: Introduce "panic-indicator" optional property Ezequiel Garcia
2016-04-28 22:03 ` [PATCH v3 3/3] leds: gpio: Support the "panic-indicator" firmware property Ezequiel Garcia
2016-05-03 16:53 ` Rob Herring
2016-04-28 22:22 ` [PATCH v3 0/3] Extend the LED panic trigger Pavel Machek
[not found] ` <1461881020-13964-1-git-send-email-ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org>
2016-04-29 18:57 ` Matthias Brugger
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=572CE715.6060504@gmail.com \
--to=jacek.anaszewski@gmail.com \
--cc=linux-leds@vger.kernel.org \
--cc=tony.makkiel@daqri.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).