[PATCH RFC] leds: Allow heartbeat trigger to use user-defined brightness.
From: ygeorgie
Date: Thu Jan 27 2011 - 10:23:18 EST
From: Yury Georgievskiy <ygeorgie@xxxxxxxxx>
Led brightness for PWM leds can be dynamically adjusted.
GPIO leds are not affected as only on/off states are possible.
Checked with PWM leds.
Writing new value in /sys/class/leds/led-pwm::/brightness
alter PWM led brightness as expected.
Signed-off-by: Yury Georgievskiy <ygeorgie@xxxxxxxxx>
---
drivers/leds/ledtrig-heartbeat.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c
index 759c0bb..74afb5a 100644
--- a/drivers/leds/ledtrig-heartbeat.c
+++ b/drivers/leds/ledtrig-heartbeat.c
@@ -48,7 +48,7 @@ static void led_heartbeat_function(unsigned long data)
msecs_to_jiffies(heartbeat_data->period);
delay = msecs_to_jiffies(70);
heartbeat_data->phase++;
- brightness = led_cdev->max_brightness;
+ brightness = led_cdev->brightness;
break;
case 1:
delay = heartbeat_data->period / 4 - msecs_to_jiffies(70);
@@ -57,7 +57,7 @@ static void led_heartbeat_function(unsigned long data)
case 2:
delay = msecs_to_jiffies(70);
heartbeat_data->phase++;
- brightness = led_cdev->max_brightness;
+ brightness = led_cdev->brightness;
break;
default:
delay = heartbeat_data->period - heartbeat_data->period / 4 -
@@ -66,7 +66,7 @@ static void led_heartbeat_function(unsigned long data)
break;
}
- led_set_brightness(led_cdev, brightness);
+ led_cdev->brightness_set(led_cdev, brightness);
mod_timer(&heartbeat_data->timer, jiffies + delay);
}
--
1.7.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/