summaryrefslogtreecommitdiff
path: root/board/motionpro/motionpro.c
diff options
context:
space:
mode:
authorBartlomiej Sieka <tur@semihalf.com>2007-05-27 16:51:48 +0200
committerBartlomiej Sieka <tur@semihalf.com>2007-05-27 16:51:48 +0200
commita11c0b85dc3664bb3c1e781137118730c8f619ab (patch)
treea23d0232443f5bd4aa2dc6f2c4ff254a9f141dc2 /board/motionpro/motionpro.c
parent7d98ba770a7eaefa29ce927f31a0956df85bf650 (diff)
downloadu-boot-imx-a11c0b85dc3664bb3c1e781137118730c8f619ab.zip
u-boot-imx-a11c0b85dc3664bb3c1e781137118730c8f619ab.tar.gz
u-boot-imx-a11c0b85dc3664bb3c1e781137118730c8f619ab.tar.bz2
Motion-PRO: Add LED support.
Signed-off-by: Jan Wrobel <wrr@semihalf.com> Signed-off-by: Marian Balakowicz <m8@semihalf.com> Acked-by: Bartlomiej Sieka <tur@semihalf.com>
Diffstat (limited to 'board/motionpro/motionpro.c')
-rw-r--r--board/motionpro/motionpro.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/board/motionpro/motionpro.c b/board/motionpro/motionpro.c
index 887aade..98357c7 100644
--- a/board/motionpro/motionpro.c
+++ b/board/motionpro/motionpro.c
@@ -33,6 +33,10 @@
#include <ft_build.h>
#endif
+#if defined(CONFIG_STATUS_LED)
+#include <status_led.h>
+#endif /* CONFIG_STATUS_LED */
+
/* Kollmorgen DPR initialization data */
struct init_elem {
unsigned long addr;
@@ -180,3 +184,29 @@ void ft_board_setup(void *blob, bd_t *bd)
ft_cpu_setup(blob, bd);
}
#endif /* defined(CONFIG_OF_FLAT_TREE) && defined(CONFIG_OF_BOARD_SETUP) */
+
+
+#if defined(CONFIG_STATUS_LED)
+void __led_init (led_id_t regaddr, int state)
+{
+ *((vu_long *) regaddr) |= ENABLE_GPIO_OUT;
+
+ if (state == STATUS_LED_ON)
+ *((vu_long *) regaddr) |= LED_ON;
+ else
+ *((vu_long *) regaddr) &= ~LED_ON;
+}
+
+void __led_set (led_id_t regaddr, int state)
+{
+ if (state == STATUS_LED_ON)
+ *((vu_long *) regaddr) |= LED_ON;
+ else
+ *((vu_long *) regaddr) &= ~LED_ON;
+}
+
+void __led_toggle (led_id_t regaddr)
+{
+ *((vu_long *) regaddr) ^= LED_ON;
+}
+#endif /* CONFIG_STATUS_LED */