mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "John Lenz" <lenz@cs.wisc.edu>
To: "Pavel Machek" <pavel@suse.cz>
Cc: "Ben Dooks" <ben@fluff.org.uk>,
	vojtech@suse.cz, rpurdie@rpsys.net,
	"kernel list" <linux-kernel@vger.kernel.org>,
	"Russell King" <rmk@arm.linux.org.uk>
Subject: Re: best way to handle LEDs
Date: Wed, 2 Nov 2005 20:31:41 -0600 (CST)	[thread overview]
Message-ID: <43093.192.168.0.12.1130985101.squirrel@192.168.0.2> (raw)
In-Reply-To: <20051102095139.GB30220@elf.ucw.cz>

On Wed, November 2, 2005 3:51 am, Pavel Machek said:
> Hi!
>
>> > I think even slow blinking was used somewhere. I have some code from
>> > John Lenz (attached); it uses sysfs interface, exports led collor, and
>> > allows setting different frequencies.
>> >
>> > Is that acceptable, or should some other interface be used?
>>
>> there is already an LED interface for linux-arm, which is
>> used by a number of the extant machines in the sa11x0 and
>> pxa range.
>
> Where is that interface? I think that making collie use it is obvious
> first step...
> 								Pavel
>

I originally wrote the collie led code to use that interface, and you
might look at some of the old versions of the patch on my web site.  The
actual code is in arch/arm/kernel/time.c, but this code calls out to an
individual machine function through say arch/arm/mach-sa1100/leds.c... 
The problem for collie was that the device model for locomo did not allow
an easy way to do it... as you can see, in my patch it implements a driver
for those leds and the driver model takes care of it.

I just looked, and
http://www.cs.wisc.edu/~lenz/zaurus/files/patch-2.6.7-jl2.diff.gz contins
the implementation of the arm led interface for collie.... not sure if it
will still work anymore, but...

I then grew the led code to support more than four leds, multi color leds,
more than just the arm architecture, etc... Russell has been very critical
of my patch on the "waste" of memory (a struct device for each led, along
with a bunch of struct attributes for each led), where by contrast the arm
one has a single attribute.

But this led interface and the one arm provides can almost not even be
compared.  My patch correctly implements the sysfs model of one attribute,
one file (instead of all leds controlled through a single file).  My patch
also is more flexible and provides needed options for many leds.  The
downside is, it makes the leds hard to use for debugging, which is the
primary purpose of the original arm led code.

For debugging, the arm specific led code is a great tool, and I am not
meaning to replace it.  For debugging, you can just specifiy
CONFIG_CLASS_LEDS=n.

John


  reply	other threads:[~2005-11-03  2:32 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-01 23:44 Pavel Machek
2005-11-02  0:39 ` Richard Purdie
2005-11-02  1:03   ` John Lenz
2005-11-02  8:01   ` Chase Venters
2005-11-02 13:56   ` Pavel Machek
2005-11-02 14:38     ` Richard Purdie
2005-11-02 21:11       ` Pavel Machek
2005-11-02 22:05         ` Richard Purdie
2005-11-02  1:57 ` root
2005-11-02 11:40   ` Geert Uytterhoeven
2005-11-02  2:47 ` Ben Dooks
2005-11-02  9:48   ` Alessandro Zummo
2005-11-02  9:51   ` Pavel Machek
2005-11-03  2:31     ` John Lenz [this message]
2005-11-07 23:30       ` Pavel Machek
2005-11-08  0:27         ` John Lenz
2005-11-08  9:28           ` Pavel Machek
2005-11-08 12:07             ` Richard Purdie
2005-11-08 13:14               ` Pavel Machek
2005-11-02 10:18 ` Paul Mundt
2005-11-02 20:26 ` Robert Schwebel
2005-11-02 21:13   ` Pavel Machek
2005-11-02 21:33     ` Robert Schwebel
2005-11-03  2:52       ` John Lenz
2005-11-03  6:21         ` Robert Schwebel
2005-11-03  8:15         ` Russell King
2005-11-03  9:57           ` Pavel Machek
2005-11-03 14:49             ` Russell King
2005-11-03 15:34               ` Vojtech Pavlik
2005-11-03 16:01                 ` Russell King
2005-11-03 16:11                   ` Vojtech Pavlik
2005-11-03 16:38                   ` linux-os (Dick Johnson)
2005-11-03 16:35               ` Pavel Machek
2005-11-04  0:41                 ` Stefan Smietanowski
2005-11-03 14:26           ` Rich Walker
2005-11-03  3:09       ` Rob Landley
2005-11-03  8:37     ` Geert Uytterhoeven
2005-11-03  9:59       ` Pavel Machek

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=43093.192.168.0.12.1130985101.squirrel@192.168.0.2 \
    --to=lenz@cs.wisc.edu \
    --cc=ben@fluff.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    --cc=rmk@arm.linux.org.uk \
    --cc=rpurdie@rpsys.net \
    --cc=vojtech@suse.cz \
    /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®