From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Raul Piper <raulpblooper@gmail.com>
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>,
Linux LED Subsystem <linux-leds@vger.kernel.org>
Subject: Re: Creating sysfs brightness for every led channels
Date: Thu, 8 Sep 2016 21:17:18 +0200 [thread overview]
Message-ID: <c8e8f7bd-5a7a-c663-bcc1-eb5b7a34af29@gmail.com> (raw)
In-Reply-To: <CAEwN+MBdfu+n60U6J-prhCzETV=NJDC3Zfs3dGJTL9HFhj_2Kw@mail.gmail.com>
On 09/08/2016 12:56 PM, Raul Piper wrote:
> On Thu, Sep 8, 2016 at 1:57 AM, Jacek Anaszewski
> <jacek.anaszewski@gmail.com> wrote:
>> Hi Raul,
>>
>> On 09/05/2016 08:32 PM, Raul Piper wrote:
>>>
>>> Hi,
>>> I am trying to send the brightness value ( for 5 channels) by
>>> echo "val1val2val3val4val5" > brightness ,
>>
>>
>> How did you infer this format?
> Val1 is for channel #1 brightness, Val2 is for channel #2 .I un-parse
> it in the _set_brightness_ method , but as written I think I have to
> create a separate brightness sysfs for each channel. Thankyou for the
> example documentation.
>
> But what if I want to change the brightness of all the channels
> simultaneously?Is it supported?
> Is the Brightness sysfs implementation guaranteed to change the
> brightness of the leds as soon as it is written by some user space
> script.Can we not just store the values every time a channel is
> written with the brightness value and then sync all the brightness by
> some other sysfs(custom) with all those values.- In case of
> simultaneous brightness change?
This is the problem that emerges from time to time. We've had few
discussions about it. The last one took place few months ago,
when we were trying to merge generic support for RGB LEDs:
http://www.spinics.net/lists/linux-leds/msg05938.html
We've even managed to agree on possible solution to the problem
but nobody was eager to take the chance and implement it. Maybe you
will be the one ? :)
>> Please get acquainted with Documentation/leds/leds-class.txt
>> and Documentation/ABI/testing/sysfs-class-led.
>>
>>> But seems like even if I change the brightness type to enum or int in
>>> my driver ,I will never be able to send the brightness string because
>>> led class defines the brightness value as enum.
>>
>>
>> One LED class device can control one channel.
>>
>>>
>>> extern void led_set_brightness(struct led_classdev *led_cdev,
>>> enum led_brightness brightness);
>>>
>>> Only possible way I am finding is to create attributes for each
>>> channel like brightness,default trigger,max_brightness and any user
>>> defined attributes, but i am not getting how to do this.
>>> Can some on please comment or post the link to the example driver.
>>> Do i have to call led_class_register for every channel and I have to
>>> define every channel in the device tree?
>>
>>
>> Just grep through drivers/leds and Documentation/devicetree/bindings/leds/.
> Thank-you for this.
>> --
>> Best regards,
>> Jacek Anaszewski
>
> Thanks and Regards,
> Rp
>
--
Best regards,
Jacek Anaszewski
next prev parent reply other threads:[~2016-09-08 19:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-05 18:32 Creating sysfs brightness for every led channels Raul Piper
2016-09-07 20:27 ` Jacek Anaszewski
[not found] ` <CAEwN+MBdfu+n60U6J-prhCzETV=NJDC3Zfs3dGJTL9HFhj_2Kw@mail.gmail.com>
2016-09-08 19:17 ` Jacek Anaszewski [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-09-05 18:27 Raul Piper
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=c8e8f7bd-5a7a-c663-bcc1-eb5b7a34af29@gmail.com \
--to=jacek.anaszewski@gmail.com \
--cc=kernelnewbies@kernelnewbies.org \
--cc=linux-leds@vger.kernel.org \
--cc=raulpblooper@gmail.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).