Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 | |
| 14 | #include <linux/kernel.h> |
| 15 | #include <linux/init.h> |
Russell King | fced80c | 2008-09-06 12:10:45 +0100 | [diff] [blame] | 16 | #include <linux/io.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 17 | #include <mach/hardware.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <asm/system.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #include <asm/leds.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #include "leds.h" |
| 21 | |
| 22 | /* |
| 23 | * The MX1ADS Board has only one usable LED, |
| 24 | * so select only the timer led or the |
| 25 | * cpu usage led |
| 26 | */ |
| 27 | void |
| 28 | mx1ads_leds_event(led_event_t ledevt) |
| 29 | { |
| 30 | unsigned long flags; |
| 31 | |
| 32 | local_irq_save(flags); |
| 33 | |
| 34 | switch (ledevt) { |
| 35 | #ifdef CONFIG_LEDS_CPU |
| 36 | case led_idle_start: |
| 37 | DR(0) &= ~(1<<2); |
| 38 | break; |
| 39 | |
| 40 | case led_idle_end: |
| 41 | DR(0) |= 1<<2; |
| 42 | break; |
| 43 | #endif |
| 44 | |
| 45 | #ifdef CONFIG_LEDS_TIMER |
| 46 | case led_timer: |
| 47 | DR(0) ^= 1<<2; |
| 48 | #endif |
| 49 | default: |
| 50 | break; |
| 51 | } |
| 52 | local_irq_restore(flags); |
| 53 | } |