]>
Commit | Line | Data |
---|---|---|
2bfb646c RP |
1 | /* |
2 | * LED IDE-Disk Activity Trigger | |
3 | * | |
4 | * Copyright 2006 Openedhand Ltd. | |
5 | * | |
6 | * Author: Richard Purdie <[email protected]> | |
7 | * | |
8 | * This program is free software; you can redistribute it and/or modify | |
9 | * it under the terms of the GNU General Public License version 2 as | |
10 | * published by the Free Software Foundation. | |
11 | * | |
12 | */ | |
13 | ||
14 | #include <linux/module.h> | |
15 | #include <linux/kernel.h> | |
16 | #include <linux/init.h> | |
2bfb646c RP |
17 | #include <linux/leds.h> |
18 | ||
3740e49c | 19 | #define BLINK_DELAY 30 |
2bfb646c RP |
20 | |
21 | DEFINE_LED_TRIGGER(ledtrig_ide); | |
3740e49c | 22 | static unsigned long ide_blink_delay = BLINK_DELAY; |
2bfb646c RP |
23 | |
24 | void ledtrig_ide_activity(void) | |
25 | { | |
3740e49c FB |
26 | led_trigger_blink_oneshot(ledtrig_ide, |
27 | &ide_blink_delay, &ide_blink_delay, 0); | |
2bfb646c RP |
28 | } |
29 | EXPORT_SYMBOL(ledtrig_ide_activity); | |
30 | ||
2bfb646c RP |
31 | static int __init ledtrig_ide_init(void) |
32 | { | |
33 | led_trigger_register_simple("ide-disk", &ledtrig_ide); | |
34 | return 0; | |
35 | } | |
36 | ||
37 | static void __exit ledtrig_ide_exit(void) | |
38 | { | |
39 | led_trigger_unregister_simple(ledtrig_ide); | |
40 | } | |
41 | ||
42 | module_init(ledtrig_ide_init); | |
43 | module_exit(ledtrig_ide_exit); | |
44 | ||
45 | MODULE_AUTHOR("Richard Purdie <[email protected]>"); | |
46 | MODULE_DESCRIPTION("LED IDE Disk Activity Trigger"); | |
47 | MODULE_LICENSE("GPL"); |