kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: jacek.anaszewski@gmail.com (Jacek Anaszewski)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Creating sysfs brightness for every led channels
Date: Wed, 7 Sep 2016 22:27:21 +0200	[thread overview]
Message-ID: <094425d1-4e0f-f702-4d57-94c21ca75217@gmail.com> (raw)
In-Reply-To: <CAEwN+MAKgvtdB-tgoxzwAZgUk9rUp+YFaCY7qbKk4sg87zdDYQ@mail.gmail.com>

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?

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/.

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2016-09-07 20:27 UTC|newest]

Thread overview: 5+ 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 [this message]
2016-09-08 10:56   ` Raul Piper
2016-09-08 19:17     ` Jacek Anaszewski
  -- 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=094425d1-4e0f-f702-4d57-94c21ca75217@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.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).