leds: allow led-drivers to use a variable range of brightness values
This patch allows drivers to override the default maximum brightness value of 255. We take care to preserve backwards-compatibility as much as possible, so that user-space ABI doesn't change for existing drivers. LED trigger code has also been updated to use the per-LED maximum. Signed-off-by: Guennadi Liakhovetski <lg@denx.de> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:

committed by
Richard Purdie

parent
a7d878af94
commit
1bd465e6b0
@@ -37,7 +37,8 @@ static void ledtrig_ide_timerfunc(unsigned long data)
|
||||
{
|
||||
if (ide_lastactivity != ide_activity) {
|
||||
ide_lastactivity = ide_activity;
|
||||
led_trigger_event(ledtrig_ide, LED_FULL);
|
||||
/* INT_MAX will set each LED to its maximum brightness */
|
||||
led_trigger_event(ledtrig_ide, INT_MAX);
|
||||
mod_timer(&ledtrig_ide_timer, jiffies + msecs_to_jiffies(10));
|
||||
} else {
|
||||
led_trigger_event(ledtrig_ide, LED_OFF);
|
||||
|
Reference in New Issue
Block a user