blob: 2cd7c0cf5924fe17807446d12287058566fadd36 [file] [log] [blame]
Richard Purdie2bfb6462006-03-31 02:31:16 -08001/*
2 * LED IDE-Disk Activity Trigger
3 *
4 * Copyright 2006 Openedhand Ltd.
5 *
6 * Author: Richard Purdie <rpurdie@openedhand.com>
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>
Richard Purdie2bfb6462006-03-31 02:31:16 -080015#include <linux/kernel.h>
16#include <linux/init.h>
Richard Purdie2bfb6462006-03-31 02:31:16 -080017#include <linux/leds.h>
18
Fabio Baltieri3740e492012-05-27 07:19:23 +080019#define BLINK_DELAY 30
Richard Purdie2bfb6462006-03-31 02:31:16 -080020
21DEFINE_LED_TRIGGER(ledtrig_ide);
Fabio Baltieri3740e492012-05-27 07:19:23 +080022static unsigned long ide_blink_delay = BLINK_DELAY;
Richard Purdie2bfb6462006-03-31 02:31:16 -080023
24void ledtrig_ide_activity(void)
25{
Fabio Baltieri3740e492012-05-27 07:19:23 +080026 led_trigger_blink_oneshot(ledtrig_ide,
27 &ide_blink_delay, &ide_blink_delay, 0);
Richard Purdie2bfb6462006-03-31 02:31:16 -080028}
29EXPORT_SYMBOL(ledtrig_ide_activity);
30
Richard Purdie2bfb6462006-03-31 02:31:16 -080031static int __init ledtrig_ide_init(void)
32{
33 led_trigger_register_simple("ide-disk", &ledtrig_ide);
34 return 0;
35}
36
37static void __exit ledtrig_ide_exit(void)
38{
39 led_trigger_unregister_simple(ledtrig_ide);
40}
41
42module_init(ledtrig_ide_init);
43module_exit(ledtrig_ide_exit);
44
45MODULE_AUTHOR("Richard Purdie <rpurdie@openedhand.com>");
46MODULE_DESCRIPTION("LED IDE Disk Activity Trigger");
47MODULE_LICENSE("GPL");