Blackfin: blackstamp: convert eth/flash swap logic to gpio framework
authorMike Frysinger <vapier@gentoo.org>
Wed, 2 Jun 2010 10:19:19 +0000 (06:19 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 13 Jul 2010 21:50:50 +0000 (17:50 -0400)
Rather than bang MMRs directly, use the new portmux framework to handle
the details.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
board/blackstamp/blackstamp.c

index 6355c10959d804c06087ce3fc75e7adcfbd0c56e..06d004a39eb72841728b4fc14acf9417dd514ac4 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <common.h>
 #include <netdev.h>
-#include <asm/io.h>
+#include <asm/gpio.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -27,14 +27,8 @@ int checkboard(void)
 #ifdef SHARED_RESOURCES
 void swap_to(int device_id)
 {
-       bfin_write_FIO_DIR(bfin_read_FIO_DIR() | PF0);
-       SSYNC();
-       if (device_id == ETHERNET)
-               bfin_write_FIO_FLAG_S(PF0);
-       else if (device_id == FLASH)
-               bfin_write_FIO_FLAG_C(PF0);
-       else
-               printf("Unknown device to switch\n");
+       gpio_request(GPIO_PF0, "eth_flash_swap");
+       gpio_direction_output(GPIO_PF0, device_id == ETHERNET);
        SSYNC();
 }
 #endif