summaryrefslogtreecommitdiff
path: root/arch/arm/kernel/leds.c
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@stericsson.com>2012-06-04 19:46:24 +0800
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-06-04 19:46:24 +0800
commit29a3e1ef73daaa91cbf5cce2fb475f1878254402 (patch)
treefbd1df992706a4786633a7986a31b9cf78b3dced /arch/arm/kernel/leds.c
parent564119271649aa2d1840e79badf743e957b497e6 (diff)
parent3c16bd7bb0a2b00b71f65bb0075e0c94d0fcc777 (diff)
Merge Linaro Android branch ' jstultz/linaro-android-3.4
' into integration-android-ux500 Signed-off-by: Philippe Langlais <philippe.langlais@stericsson.com>
Diffstat (limited to 'arch/arm/kernel/leds.c')
-rw-r--r--arch/arm/kernel/leds.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/kernel/leds.c b/arch/arm/kernel/leds.c
index 1911dae19e4..2050399ebd0 100644
--- a/arch/arm/kernel/leds.c
+++ b/arch/arm/kernel/leds.c
@@ -10,6 +10,8 @@
#include <linux/export.h>
#include <linux/init.h>
#include <linux/device.h>
+#include <linux/notifier.h>
+#include <linux/cpu.h>
#include <linux/syscore_ops.h>
#include <linux/string.h>
@@ -103,6 +105,25 @@ static struct syscore_ops leds_syscore_ops = {
.resume = leds_resume,
};
+static int leds_idle_notifier(struct notifier_block *nb, unsigned long val,
+ void *data)
+{
+ switch (val) {
+ case IDLE_START:
+ leds_event(led_idle_start);
+ break;
+ case IDLE_END:
+ leds_event(led_idle_end);
+ break;
+ }
+
+ return 0;
+}
+
+static struct notifier_block leds_idle_nb = {
+ .notifier_call = leds_idle_notifier,
+};
+
static int __init leds_init(void)
{
int ret;
@@ -111,8 +132,11 @@ static int __init leds_init(void)
ret = device_register(&leds_device);
if (ret == 0)
ret = device_create_file(&leds_device, &dev_attr_event);
- if (ret == 0)
+ if (ret == 0) {
register_syscore_ops(&leds_syscore_ops);
+ idle_notifier_register(&leds_idle_nb);
+ }
+
return ret;
}