From: Jacek Anaszewski <jacek.anaszewski-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Jelle Martijn Kok <jmkok-i3KCcyIX/XtmR6Xm/wNWPw@public.gmane.org>,
Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
Cc: linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH] leds-pwm: the startup brightness can be specified
Date: Tue, 14 Feb 2017 22:13:11 +0100 [thread overview]
Message-ID: <ffb0057e-c35d-fbb9-c50d-95a324b3cf0d@gmail.com> (raw)
In-Reply-To: <74325158-79f6-ff2a-832e-9f2ece1cf853-i3KCcyIX/XtmR6Xm/wNWPw@public.gmane.org>
Hi Jelle.
On 02/14/2017 11:34 AM, Jelle Martijn Kok wrote:
>
> On 10-02-17 21:56, Pavel Machek wrote:
>> Hi!
>>
>>>> + led.default_brightness = LED_OFF;
>>>> + of_property_read_u32(child, "brightness",
>>>> + &led.default_brightness);
>>> At first you would have to submit a patch for
>>> Documentation/devicetree/bindings/leds/common.txt that would add
>>> brightness property. The question is whether it is really needed?
>>> You can set brightness from userspace via sysfs API.
>>>
>>> By the way, I have a question to DT maintainers: is DT a proper
>>> place for defining this type of configuration that can be set via
>>> userspace scripts? Shouldn't DT describe only hardware properties and
>>> constraints resulting from board configuration?
>> Well, if the hardware has label "half - power, full - transmitting" on
>> a LED, we might want kernel to turn it to half power on bootup.
>>
>> If you have a "disk activity LED" on a PC, it is driven by
>> hardware. On arm notebook, it would be nice if "disk activity LED"
>> worked, too. Preferably even when running fsck in init=/bin/bash
>> mode. We already provide that, AFAICT, so having ability to set
>> constant brightness sounds sane to me.
> There is also some delay between kernel and user space where the leds
> are too bright or simply off... (which is quite ugly for a simple "power
> on" led)
It seems to be sufficient justification for introducing the property.
Please submit a patch adding DT documentation for it. I'd call it
default-brightness to match the one used already in backlight subsystem.
> One thing that I have seen is that several led triggers do not play
> along with the brightness. For example, the "heartbeat" trigger always
> sets the brightness to LED_FULL. Which negates the set brightness on
> each blink...
I posted the patch [0] addressing that few months ago, but I must have
forgotten to reapply it to linux-leds.git after previously withdrawing
it due to set_brightness_delayed work locking issues.
I've just applied this patch to the for-next branch of linux-leds.git.
> So would it not be an idea to add a "led_set_on_off(led,
> state)" function which retains "brightness" and additionally takes an
> "invert" parameter into account. This might also simplify code in other
> led triggers.
[0] https://patchwork.kernel.org/patch/9418701/
--
Best regards,
Jacek Anaszewski
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2017-02-14 21:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <aed1129a-993a-91d9-7b14-13c3424ee0f4@solutionsradio.com>
[not found] ` <aed1129a-993a-91d9-7b14-13c3424ee0f4-Cb7RZHV19h6nMLx/lKYAZdBPR1lH4CV8@public.gmane.org>
2017-02-09 21:31 ` [PATCH] leds-pwm: the startup brightness can be specified Jacek Anaszewski
[not found] ` <c4aebca4-d5a1-aaa7-d69b-8d0e4d4d8ba8-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-02-10 20:56 ` Pavel Machek
2017-02-14 10:34 ` Jelle Martijn Kok
[not found] ` <74325158-79f6-ff2a-832e-9f2ece1cf853-i3KCcyIX/XtmR6Xm/wNWPw@public.gmane.org>
2017-02-14 21:13 ` Jacek Anaszewski [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=ffb0057e-c35d-fbb9-c50d-95a324b3cf0d@gmail.com \
--to=jacek.anaszewski-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jmkok-i3KCcyIX/XtmR6Xm/wNWPw@public.gmane.org \
--cc=linux-leds-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pavel-+ZI9xUNit7I@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/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).