diff options
author | Bryan Wu <bryan.wu@canonical.com> | 2011-06-25 06:33:50 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@canonical.com> | 2012-07-31 09:23:31 -0400 |
commit | 8f88731d052d2b14f332249a9332690ac1b365ac (patch) | |
tree | af9704aab65f98b0942a2c61cd857b35dbf86457 /include/linux/leds.h | |
parent | 28a33cbc24e4256c143dce96c7d93bf423229f92 (diff) |
led-triggers: create a trigger for CPU activity
Attempting to consolidate the ARM LED code, this removes the
custom RealView LED trigger code to turn LEDs on and off in
response to CPU activity and replace it with a standard trigger.
(bryan.wu@canonical.com:
It introduces several syscore stubs into this trigger.
It also provides ledtrig_cpu trigger event stub in <linux/leds.h>.
Although it was inspired by ARM work, it can be used in other arch.)
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Reviewed-by: Jamie Iles <jamie@jamieiles.com>
Tested-by: Jochen Friedrich <jochen@scram.de>
Diffstat (limited to 'include/linux/leds.h')
-rw-r--r-- | include/linux/leds.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/leds.h b/include/linux/leds.h index 39eee41d8c6f..cd545580e069 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -212,4 +212,20 @@ struct gpio_led_platform_data { | |||
212 | struct platform_device *gpio_led_register_device( | 212 | struct platform_device *gpio_led_register_device( |
213 | int id, const struct gpio_led_platform_data *pdata); | 213 | int id, const struct gpio_led_platform_data *pdata); |
214 | 214 | ||
215 | enum cpu_led_event { | ||
216 | CPU_LED_IDLE_START, /* CPU enters idle */ | ||
217 | CPU_LED_IDLE_END, /* CPU idle ends */ | ||
218 | CPU_LED_START, /* Machine starts, especially resume */ | ||
219 | CPU_LED_STOP, /* Machine stops, especially suspend */ | ||
220 | CPU_LED_HALTED, /* Machine shutdown */ | ||
221 | }; | ||
222 | #ifdef CONFIG_LEDS_TRIGGER_CPU | ||
223 | extern void ledtrig_cpu(enum cpu_led_event evt); | ||
224 | #else | ||
225 | static inline void ledtrig_cpu(enum cpu_led_event evt) | ||
226 | { | ||
227 | return; | ||
228 | } | ||
229 | #endif | ||
230 | |||
215 | #endif /* __LINUX_LEDS_H_INCLUDED */ | 231 | #endif /* __LINUX_LEDS_H_INCLUDED */ |