Richard Purdie | 2bfb646 | 2006-03-31 02:31:16 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
Richard Purdie | 2bfb646 | 2006-03-31 02:31:16 -0800 | [diff] [blame] | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/init.h> |
Richard Purdie | 2bfb646 | 2006-03-31 02:31:16 -0800 | [diff] [blame] | 16 | #include <linux/leds.h> |
| 17 | |
Fabio Baltieri | 3740e49 | 2012-05-27 07:19:23 +0800 | [diff] [blame] | 18 | #define BLINK_DELAY 30 |
Richard Purdie | 2bfb646 | 2006-03-31 02:31:16 -0800 | [diff] [blame] | 19 | |
| 20 | DEFINE_LED_TRIGGER(ledtrig_ide); |
Fabio Baltieri | 3740e49 | 2012-05-27 07:19:23 +0800 | [diff] [blame] | 21 | static unsigned long ide_blink_delay = BLINK_DELAY; |
Richard Purdie | 2bfb646 | 2006-03-31 02:31:16 -0800 | [diff] [blame] | 22 | |
| 23 | void ledtrig_ide_activity(void) |
| 24 | { |
Fabio Baltieri | 3740e49 | 2012-05-27 07:19:23 +0800 | [diff] [blame] | 25 | led_trigger_blink_oneshot(ledtrig_ide, |
| 26 | &ide_blink_delay, &ide_blink_delay, 0); |
Richard Purdie | 2bfb646 | 2006-03-31 02:31:16 -0800 | [diff] [blame] | 27 | } |
| 28 | EXPORT_SYMBOL(ledtrig_ide_activity); |
| 29 | |
Richard Purdie | 2bfb646 | 2006-03-31 02:31:16 -0800 | [diff] [blame] | 30 | static int __init ledtrig_ide_init(void) |
| 31 | { |
| 32 | led_trigger_register_simple("ide-disk", &ledtrig_ide); |
| 33 | return 0; |
| 34 | } |
Paul Gortmaker | 067a8f3 | 2015-12-13 16:45:50 -0500 | [diff] [blame] | 35 | device_initcall(ledtrig_ide_init); |