Blackfin: switch to common GPIO LED driver
authorMike Frysinger <vapier@gentoo.org>
Wed, 2 Jun 2010 09:12:11 +0000 (05:12 -0400)
committerMike Frysinger <vapier@gentoo.org>
Mon, 5 Jul 2010 09:30:07 +0000 (05:30 -0400)
Now that we have a unified gpio layer, the different status led
implementations can be switched to the common gpio led driver.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
board/bf526-ezbrd/Makefile
board/bf526-ezbrd/status-led.c [deleted file]
board/bf533-stamp/bf533-stamp.c
include/configs/bf526-ezbrd.h
include/configs/bf533-stamp.h

index a9ff760073b46c1a1ca8ab7dc4f4570b0b1884a1..f2bd2c247d4ab5ca14d7101a238c5d17fee8988b 100644 (file)
@@ -30,7 +30,6 @@ include $(TOPDIR)/config.mk
 LIB    = $(obj)lib$(BOARD).a
 
 COBJS-y        := $(BOARD).o
-COBJS-$(CONFIG_STATUS_LED) += status-led.o
 
 SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y))
diff --git a/board/bf526-ezbrd/status-led.c b/board/bf526-ezbrd/status-led.c
deleted file mode 100644 (file)
index 6327022..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * U-boot - status leds
- *
- * Copyright (c) 2005-2009 Analog Devices Inc.
- *
- * Licensed under the GPL-2 or later.
- */
-
-#include <common.h>
-#include <config.h>
-#include <command.h>
-#include <status_led.h>
-
-static void set_led_f(int pf, int state)
-{
-       switch (state) {
-               case STATUS_LED_OFF:      bfin_write_PORTFIO_CLEAR(pf);  break;
-               case STATUS_LED_BLINKING: bfin_write_PORTFIO_TOGGLE(pf); break;
-               case STATUS_LED_ON:       bfin_write_PORTFIO_SET(pf);    break;
-       }
-}
-static void set_led_g(int pf, int state)
-{
-       switch (state) {
-               case STATUS_LED_OFF:      bfin_write_PORTGIO_CLEAR(pf);  break;
-               case STATUS_LED_BLINKING: bfin_write_PORTGIO_TOGGLE(pf); break;
-               case STATUS_LED_ON:       bfin_write_PORTGIO_SET(pf);    break;
-       }
-}
-
-static void set_leds(led_id_t mask, int state)
-{
-       if (mask & 0x1) set_led_f(PF8, state);
-       if (mask & 0x2) set_led_g(PG11, state);
-       if (mask & 0x4) set_led_g(PG12, state);
-}
-
-void __led_init(led_id_t mask, int state)
-{
-       bfin_write_PORTF_FER(bfin_read_PORTF_FER() & ~(PF8));
-       bfin_write_PORTG_FER(bfin_read_PORTG_FER() & ~(PG11 | PG12));
-       bfin_write_PORTFIO_INEN(bfin_read_PORTFIO_INEN() & ~(PF8));
-       bfin_write_PORTGIO_INEN(bfin_read_PORTGIO_INEN() & ~(PG11 | PG12));
-       bfin_write_PORTFIO_DIR(bfin_read_PORTFIO_DIR() | (PF8));
-       bfin_write_PORTGIO_DIR(bfin_read_PORTGIO_DIR() | (PG11 | PG12));
-}
-
-void __led_set(led_id_t mask, int state)
-{
-       set_leds(mask, state);
-}
-
-void __led_toggle(led_id_t mask)
-{
-       set_leds(mask, STATUS_LED_BLINKING);
-}
index 4abad08cd9d9db8751859c742ec1740e40606332..fd10eae2f1223923ff7176d79e6090bd774e7521 100644 (file)
@@ -134,43 +134,6 @@ void show_boot_progress(int status)
 }
 #endif
 
-#ifdef CONFIG_STATUS_LED
-#include <status_led.h>
-
-static void set_led(int pf, int state)
-{
-       switch (state) {
-               case STATUS_LED_OFF:      bfin_write_FIO_FLAG_S(pf); break;
-               case STATUS_LED_BLINKING: bfin_write_FIO_FLAG_T(pf); break;
-               case STATUS_LED_ON:       bfin_write_FIO_FLAG_C(pf); break;
-       }
-}
-
-static void set_leds(led_id_t mask, int state)
-{
-       if (mask & 0x1) set_led(PF2, state);
-       if (mask & 0x2) set_led(PF3, state);
-       if (mask & 0x4) set_led(PF4, state);
-}
-
-void __led_init(led_id_t mask, int state)
-{
-       bfin_write_FIO_INEN(bfin_read_FIO_INEN() & ~(PF2 | PF3 | PF4));
-       bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (PF2 | PF3 | PF4));
-}
-
-void __led_set(led_id_t mask, int state)
-{
-       set_leds(mask, state);
-}
-
-void __led_toggle(led_id_t mask)
-{
-       set_leds(mask, STATUS_LED_BLINKING);
-}
-
-#endif
-
 #ifdef CONFIG_SMC91111
 int board_eth_init(bd_t *bis)
 {
index 52aeb5cdfe8b1a56aa806bb04c3894f54b3b2fba..ecda21689d8bfcc6556d293949bf33d666107cfa 100644 (file)
 /* define to enable run status via led */
 /* #define CONFIG_STATUS_LED */
 #ifdef CONFIG_STATUS_LED
+#define CONFIG_GPIO_LED
 #define CONFIG_BOARD_SPECIFIC_LED
 /* use LED0 to indicate booting/alive */
 #define STATUS_LED_BOOT 0
-#define STATUS_LED_BIT 1
+#define STATUS_LED_BIT GPIO_PF8
 #define STATUS_LED_STATE STATUS_LED_ON
 #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 4)
 /* use LED1 to indicate crash */
 #define STATUS_LED_CRASH 1
-#define STATUS_LED_BIT1 2
+#define STATUS_LED_BIT1 GPIO_PG11
 #define STATUS_LED_STATE1 STATUS_LED_ON
 #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2)
+/* #define STATUS_LED_BIT2 GPIO_PG12 */
 #endif
 
 
index d5e82cae1b835cabbb57048b814b14784dac51cc..2ec9c422aa44ded7b3a7d62fbde87d792d75ced3 100644 (file)
 /* define to enable run status via led */
 /* #define CONFIG_STATUS_LED */
 #ifdef CONFIG_STATUS_LED
+#define CONFIG_GPIO_LED
 #define CONFIG_BOARD_SPECIFIC_LED
-/* use LED1 to indicate booting/alive */
+/* use LED0 to indicate booting/alive */
 #define STATUS_LED_BOOT 0
-#define STATUS_LED_BIT 1
+#define STATUS_LED_BIT GPIO_PF2
 #define STATUS_LED_STATE STATUS_LED_ON
 #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 4)
-/* use LED2 to indicate crash */
+/* use LED1 to indicate crash */
 #define STATUS_LED_CRASH 1
-#define STATUS_LED_BIT1 2
+#define STATUS_LED_BIT1 GPIO_PF3
 #define STATUS_LED_STATE1 STATUS_LED_ON
 #define STATUS_LED_PERIOD1 (CONFIG_SYS_HZ / 2)
+/* #define STATUS_LED_BIT2 GPIO_PF4 */
 #endif
 
 /* define to enable splash screen support */