[lkml]   [2007]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] input: extend EV_LED
On Thu, 15 Feb 2007, Richard Purdie wrote:
> This has been discussed in several places several times. The problem
> with hardware accelerated flashing is that you're are often limited to
> certain constraints (this case being no exception) and indicating what
> these are to userspace in a generic fashion is difficult.

The hability to blinking at one rate is *very* common on laptops. Blinking
at a few discrete rates is also common enough. They should be supported in
a generic way.

I want to convert ibm-acpi to the led interface, but if it means I have to
provide custom attributes on top of the led class, it sort of defeats most
of the purpose of using the led class to begin with -- it will NOT be

If I have to provide those attributes elsewhere in the sysfs tree other than
somewhere in the led class, then it defeats the purpose of using the led
class completely: I will just scrap the idea. I am not going to remove
functionality. And I am not going to emulate in software something the
hardware can do, especially when that means bothering the EC with a slow
ACPI-subsystem-gated LPC bus IO port access for no good reason.

Here's a suggestion for a simple, non-overengineered interface: a "blink"
attribute (on/off) for leds which can hardware-blink. Only one blink
frequency is common enough that this attribute by itself is very useful
(e.g. it is all a ThinkPad and most WiFi/network card leds need).

For hardware-blink leds with various frequencies, there is the typical way
to provide such things: give us a RO blink_available_frequencies attribute
which says which discrete frequencies are allowed (space separated), and a
RW blink_frequency attribute to set the frequency. If instead of
blink_available_frequencies, the driver provides RO blink_frequency_min and
_max attributes, then it means it can blink on that range of freqs.

That is simple enough to implement and use, and generic enough. You just
need to set in stone if you want the freq in Hz, or a submultiple. You can
even implement an optional "blink" software emulation that drivers can hook
into for systems where the driver *knows* that led access is fast, but there
is no hardware blinking emulation.

> One way I've come up with is adds capability to the class to have LED
> specific triggers and you can then expose these hardware capabilities as
> an extra trigger specific to the LED.

How would that look like? It doesn't sound too bad. Could you give us an
example of what the tree would look like, and what the attributes would be
(and do)?

> Another proposal more specific to this use case was to have some
> information behind the scenes which the software timer based trigger
> could use to turn on the "hardware acceleration" if present and capable
> of the requested mode. This might just need a function pointer in the
> core so could be quite neat.

This looks like a severely overengineered way to deal with the problem at
first glance.

"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-02-16 04:15    [W:0.128 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site