leds-mx1ads.c 982 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * linux/arch/arm/mach-imx/leds-mx1ads.c
  3. *
  4. * Copyright (c) 2004 Sascha Hauer <sascha@saschahauer.de>
  5. *
  6. * Original (leds-footbridge.c) by Russell King
  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/kernel.h>
  14. #include <linux/init.h>
  15. #include <asm/hardware.h>
  16. #include <asm/system.h>
  17. #include <asm/io.h>
  18. #include <asm/leds.h>
  19. #include "leds.h"
  20. /*
  21. * The MX1ADS Board has only one usable LED,
  22. * so select only the timer led or the
  23. * cpu usage led
  24. */
  25. void
  26. mx1ads_leds_event(led_event_t ledevt)
  27. {
  28. unsigned long flags;
  29. local_irq_save(flags);
  30. switch (ledevt) {
  31. #ifdef CONFIG_LEDS_CPU
  32. case led_idle_start:
  33. DR(0) &= ~(1<<2);
  34. break;
  35. case led_idle_end:
  36. DR(0) |= 1<<2;
  37. break;
  38. #endif
  39. #ifdef CONFIG_LEDS_TIMER
  40. case led_timer:
  41. DR(0) ^= 1<<2;
  42. #endif
  43. default:
  44. break;
  45. }
  46. local_irq_restore(flags);
  47. }