mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Bryan Wu <cooloney@gmail.com>
Cc: Greg KH <greg@kroah.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Joe Xue <lgxue@hotmail.com>,
	"rpurdie@rpsys.net" <rpurdie@rpsys.net>,
	"rob@landley.net" <rob@landley.net>,
	"milo.kim@ti.com" <milo.kim@ti.com>,
	"linux-leds@vger.kernel.org" <linux-leds@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Subject: Re: how to represent sequence of brightnesses in /sys (was Re: [PATCH] Add the LED burst trigger)
Date: Mon, 6 Jan 2014 01:37:14 +0100	[thread overview]
Message-ID: <20140106003714.GD27517@amd.pavel.ucw.cz> (raw)
In-Reply-To: <CAK5ve-LOFE6h5w=+pSgfYMaW5GZQfayVfpRzP0NAfMPWZkk5iw@mail.gmail.com>

Hi!

> >> > Reason to do it in kernel is that some machines actually have
> >> > "coprocessor" on i2c that can do it while main CPU is suspended. (For
> >> > more reasons, see beggining of thread).
> >>
> >> Ick ick.
> >>
> >> > Binary attribute with array of bytes should be acceptable, rights?
> >>
> >> Not at all.
> >>
> >> > (IOW write(..., buf, size) )
> >> >
> >> > Ascii array of decimal integers -- no so, right?
> >> >
> >> > (IOW printf("%d %d ..", buf[0], buf[1]) )
> >>
> >> Use an ioctl with a structure to get things correct as a character
> >> device.  As odds are, you aren't going to be able to create a "generic"
> >> format for all of this for all types of devices that support such a
> >> "co-processor".
> >
> > Well, we already do have hw-specific driver in the tree,
> > drivers/leds/leds-lp55xx-common.c . But the interface is
> > "interesting" and I believe we should have generic interface and it
> > should use existing trigger framework -- array of brightnesses does
> > not seem too complicated.
> >
> > Do you have suggestion how to pass the brightnesses over sysfs?
> >
> 
> What about send those binary stuff as firmware through kernel firmware
> interface and LED trigger sysfs is just for parameters setup and
> enable/disable controlling.

That might be a bit too heavy. LED patterns do change quite often.

lp5523 driver uses this to push binary data through /sys. (It is code
for lp5523 processor in this case). Something like that would still be
better than firmware loader... 

cd /sys/class/i2c-adapter/i2c-2/2-0032 
echo load > engine1_mode 
echo cd /sys/class/i2c-adapter/i2c-2/2-0032 
echo 9d804000427f0d7f7f007f0042000000  > engine1_load 
echo run > engine1_mode
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2014-01-06  0:37 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-24 14:30 [PATCH] Add the LED burst trigger lgxue
2013-12-25 23:09 ` Pavel Machek
2013-12-26  1:02   ` Joe Xue
2013-12-26 14:26     ` Pavel Machek
2013-12-26 15:02       ` Joe Xue
2013-12-26 16:58         ` Joe Xue
2013-12-27 12:39           ` Rob Landley
2013-12-27 13:05             ` Pavel Machek
2013-12-27  0:31       ` Joe Xue
2013-12-27  9:57         ` Pavel Machek
2013-12-28  2:08           ` Joe Xue
2013-12-28 10:16             ` Pavel Machek
2013-12-28 13:39               ` Joe Xue
2013-12-28 19:26                 ` Pavel Machek
2013-12-29  0:23                   ` Joe Xue
2013-12-29 10:58                     ` Pavel Machek
2013-12-28 18:51               ` Geert Uytterhoeven
2013-12-28 19:29                 ` how to represent sequence of brightnesses in /sys (was Re: [PATCH] Add the LED burst trigger) Pavel Machek
2013-12-28 19:34                   ` Geert Uytterhoeven
2013-12-28 21:25                     ` Pavel Machek
2013-12-28 21:50                       ` Greg KH
2013-12-28 23:50                         ` Pavel Machek
2013-12-29  1:43                           ` Greg KH
2013-12-29 11:21                             ` Pavel Machek
2014-01-03  0:16                               ` Bryan Wu
2014-01-06  0:37                                 ` Pavel Machek [this message]
2013-12-27 12:33         ` [PATCH] Add the LED burst trigger Geert Uytterhoeven
2013-12-27 11:57     ` One Thousand Gnomes
2013-12-27 12:57       ` Pavel Machek
2013-12-27 14:18         ` One Thousand Gnomes
2013-12-27 15:23           ` Pavel Machek
2013-12-27 18:13             ` One Thousand Gnomes
2013-12-27 18:34               ` Geert Uytterhoeven
2013-12-27 19:37               ` Pavel Machek
2013-12-27 22:45               ` Richard Purdie
2013-12-26 11:18 ` Geert Uytterhoeven
2013-12-30  0:15 ` Joe Xue

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=20140106003714.GD27517@amd.pavel.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=cooloney@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=greg@kroah.com \
    --cc=lgxue@hotmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=milo.kim@ti.com \
    --cc=rob@landley.net \
    --cc=rpurdie@rpsys.net \
    /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

all inboxes | Powered by JetHome®