From: John Lenz <lenz@cs.wisc.edu>
To: Russell King <rmk+lkml@arm.linux.org.uk>
Cc: John Lenz <lenz@cs.wisc.edu>,
Jan-Benedict Glaw <jbglaw@lug-owl.de>,
linux-kernel@vger.kernel.org,
Kalin KOZHUHAROV <kalin@thinrope.net>
Subject: Re: [PATCH 2.6.8.1 0/2] leds: new class for led devices
Date: Fri, 03 Sep 2004 23:19:46 +0000 [thread overview]
Message-ID: <1094253586l.7429l.4l@hydra> (raw)
In-Reply-To: <20040903232507.A8810@flint.arm.linux.org.uk>
On 09/03/04 17:25:07, Russell King wrote:
> On Fri, Sep 03, 2004 at 06:47:23PM +0000, John Lenz wrote:
> > On 09/03/04 07:06:34, Jan-Benedict Glaw wrote:
> > > Is idle/timer/power hardware-controlled (eg. by a secondary
> processor,
> > > direct chipset implementation) or is switching on/off controlled by
> > > kernel (eg. heartbeat, IO and ethernet for the LEDs you can find on
> some
> > > PA-RISC machines)?
> >
> > Right now the kernel is in sole control. The device I am testing this
> on
> > is a Sharp Zaurus SL5500, which has two leds that by default are used
> to
>
> > light when new mail arrives and if the power is plugged in.
>
> The kernel is NOT in sole control today on ARM platforms:
>
> echo claim > /sys/devices/system/leds/leds0/event
> echo red on > /sys/devices/system/leds/leds0/event
> echo green on > /sys/devices/system/leds/leds0/event
> echo red off > /sys/devices/system/leds/leds0/event
> echo release > /sys/devices/system/leds/leds0/event
>
> etc
>
> Sure, we have a weird naming scheme (red, green, amber, blue) but
> that came around because that's what people were dealing with.
> There's nothing really stopping us from having any name for a LED
> in the existing scheme.
1) This is arm specific. Do any other arches want to provide access to
leds? Why should they implement some different api?
2) What happens when you have more than four leds? or 3 dual color leds?
3) no way to read the current status of the led. (could be added to read
from /sys/devices/system/leds/leds0 or something)
4) really wierd in-kernel api... The led is associated with a machine,
when that sometimes doesn't make sense; code duplication for the same
harware drivers. As an example, the led device on the Sharp Zauruses are
all the same... exact same code to control the led. Except one model is
sa1100 and two are pxa based, so leds-collie.c and leds-poodle.c are
exactly the same, except to be registered in the associated leds.c for that
mach. This model, instead of associating leds with a specific machine make
it a device/driver concept like every other device in the kernel.
We can easily provide backwards compatibility with the arm led code. I
have a semi-working driver to register with ledsbase.c and call the
leds_event function. As well, the old /sys/devices/system/leds/leds0/event
thing can also be emulated.
> I just don't buy the "we must have one sysfs node for every LED"
> argument.
well, we could just create one attribute per led in /sys/devices/system/
leds/leds0/, but that breaks conceptally what sysfs is trying to provide...
one device per attribute? 4 devices controlled by ONE attribute?
John
next prev parent reply other threads:[~2004-09-03 23:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-02 20:33 [PATCH 2.6.8.1 0/2] leds: new class for led devices John Lenz
2004-09-02 20:34 ` [PATCH 2.6.8.1 1/2] " John Lenz
2004-09-02 20:38 ` [PATCH 2.6.8.1 2/2] " John Lenz
2004-09-03 4:54 ` [PATCH 2.6.8.1 0/2] " Kalin KOZHUHAROV
2004-09-03 11:32 ` Geert Uytterhoeven
2004-09-03 12:06 ` Jan-Benedict Glaw
2004-09-03 18:47 ` John Lenz
2004-09-03 22:25 ` Russell King
2004-09-03 23:19 ` John Lenz [this message]
2004-09-04 11:12 ` Pavel Machek
2004-09-04 20:53 ` Russell King
2004-09-04 21:41 ` Pavel Machek
2004-09-06 7:36 ` John Lenz
2004-09-03 13:17 ` Robert Schwebel
2004-09-03 13:31 ` Robert Schwebel
2004-09-03 8:00 ` Oliver Neukum
2004-09-03 13:51 ` Pavel Machek
2004-09-03 18:38 ` John Lenz
2004-09-03 18:55 ` Russell King
2004-09-03 19:09 ` John Lenz
2004-09-03 19:51 ` Russell King
2004-09-03 20:35 ` John Lenz
2004-09-04 11:09 ` 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=1094253586l.7429l.4l@hydra \
--to=lenz@cs.wisc.edu \
--cc=jbglaw@lug-owl.de \
--cc=kalin@thinrope.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk+lkml@arm.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.