leds-mx1ads.c 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 <asm/mach-types.h>
  20. #include "leds.h"
  21. /*
  22. * The MX1ADS Board has only one usable LED,
  23. * so select only the timer led or the
  24. * cpu usage led
  25. */
  26. void
  27. mx1ads_leds_event(led_event_t ledevt)
  28. {
  29. unsigned long flags;
  30. local_irq_save(flags);
  31. switch (ledevt) {
  32. #ifdef CONFIG_LEDS_CPU
  33. case led_idle_start:
  34. DR(0) &= ~(1<<2);
  35. break;
  36. case led_idle_end:
  37. DR(0) |= 1<<2;
  38. break;
  39. #endif
  40. #ifdef CONFIG_LEDS_TIMER
  41. case led_timer:
  42. DR(0) ^= 1<<2;
  43. #endif
  44. default:
  45. break;
  46. }
  47. local_irq_restore(flags);
  48. }