ledtrig-ide-disk.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #include <linux/module.h>
  14. #include <linux/kernel.h>
  15. #include <linux/init.h>
  16. #include <linux/leds.h>
  17. #define BLINK_DELAY 30
  18. DEFINE_LED_TRIGGER(ledtrig_ide);
  19. static unsigned long ide_blink_delay = BLINK_DELAY;
  20. void ledtrig_ide_activity(void)
  21. {
  22. led_trigger_blink_oneshot(ledtrig_ide,
  23. &ide_blink_delay, &ide_blink_delay, 0);
  24. }
  25. EXPORT_SYMBOL(ledtrig_ide_activity);
  26. static int __init ledtrig_ide_init(void)
  27. {
  28. led_trigger_register_simple("ide-disk", &ledtrig_ide);
  29. return 0;
  30. }
  31. static void __exit ledtrig_ide_exit(void)
  32. {
  33. led_trigger_unregister_simple(ledtrig_ide);
  34. }
  35. module_init(ledtrig_ide_init);
  36. module_exit(ledtrig_ide_exit);
  37. MODULE_AUTHOR("Richard Purdie <rpurdie@openedhand.com>");
  38. MODULE_DESCRIPTION("LED IDE Disk Activity Trigger");
  39. MODULE_LICENSE("GPL");