Title: [6002] trunk/arch/blackfin: Fix bug[#4775] extend bfin_gpio_reset_spi0_ssel1() to support other SELs

Diff

Modified: trunk/arch/blackfin/include/asm/reboot.h (6001 => 6002)


--- trunk/arch/blackfin/include/asm/reboot.h	2009-01-12 22:09:16 UTC (rev 6001)
+++ trunk/arch/blackfin/include/asm/reboot.h	2009-01-13 05:35:16 UTC (rev 6002)
@@ -15,6 +15,6 @@
 extern void native_machine_power_off(void);
 
 /* common reboot workarounds */
-extern void bfin_gpio_reset_spi0_ssel1(void);
+extern void bfin_gpio_reset_spi0(unsigned int ssel);
 
 #endif

Modified: trunk/arch/blackfin/kernel/bfin_gpio.c (6001 => 6002)


--- trunk/arch/blackfin/kernel/bfin_gpio.c	2009-01-12 22:09:16 UTC (rev 6001)
+++ trunk/arch/blackfin/kernel/bfin_gpio.c	2009-01-13 05:35:16 UTC (rev 6002)
@@ -1172,10 +1172,36 @@
  * lives here as we need to force all the GPIO states w/out going through
  * BUG() checks and such.
  */
-void bfin_gpio_reset_spi0_ssel1(void)
+void bfin_gpio_reset_spi0(unsigned int ssel)
 {
-	u16 gpio = P_IDENT(P_SPI0_SSEL1);
+	u16 gpio;
 
+	switch (ssel) {
+	case 1:
+		gpio = P_IDENT(P_SPI0_SSEL1);
+		break;
+	case 2:
+		gpio = P_IDENT(P_SPI0_SSEL2);
+		break;
+	case 3:
+		gpio = P_IDENT(P_SPI0_SSEL3);
+		break;
+	case 4:
+		gpio = P_IDENT(P_SPI0_SSEL4);
+		break;
+	case 5:
+		gpio = P_IDENT(P_SPI0_SSEL5);
+		break;
+	case 6:
+		gpio = P_IDENT(P_SPI0_SSEL6);
+		break;
+	case 7:
+		gpio = P_IDENT(P_SPI0_SSEL7);
+		break;
+	default:
+		return;
+	}
+
 	port_setup(gpio, GPIO_USAGE);
 	gpio_array[gpio_bank(gpio)]->data_set = gpio_bit(gpio);
 	AWA_DUMMY_READ(data_set);

Modified: trunk/arch/blackfin/mach-bf518/boards/ezbrd.c (6001 => 6002)


--- trunk/arch/blackfin/mach-bf518/boards/ezbrd.c	2009-01-12 22:09:16 UTC (rev 6001)
+++ trunk/arch/blackfin/mach-bf518/boards/ezbrd.c	2009-01-13 05:35:16 UTC (rev 6002)
@@ -649,7 +649,7 @@
 {
 	/* workaround reboot hang when booting from SPI */
 	if ((bfin_read_SYSCR() & 0x7) == 0x3)
-		bfin_gpio_reset_spi0_ssel1();
+		bfin_gpio_reset_spi0(2);
 }
 
 void bfin_get_ether_addr(char *addr)

Modified: trunk/arch/blackfin/mach-bf527/boards/cm_bf527.c (6001 => 6002)


--- trunk/arch/blackfin/mach-bf527/boards/cm_bf527.c	2009-01-12 22:09:16 UTC (rev 6001)
+++ trunk/arch/blackfin/mach-bf527/boards/cm_bf527.c	2009-01-13 05:35:16 UTC (rev 6002)
@@ -988,7 +988,7 @@
 {
 	/* workaround reboot hang when booting from SPI */
 	if ((bfin_read_SYSCR() & 0x7) == 0x3)
-		bfin_gpio_reset_spi0_ssel1();
+		bfin_gpio_reset_spi0(1);
 }
 
 void bfin_get_ether_addr(char *addr)

Modified: trunk/arch/blackfin/mach-bf527/boards/ezbrd.c (6001 => 6002)


--- trunk/arch/blackfin/mach-bf527/boards/ezbrd.c	2009-01-12 22:09:16 UTC (rev 6001)
+++ trunk/arch/blackfin/mach-bf527/boards/ezbrd.c	2009-01-13 05:35:16 UTC (rev 6002)
@@ -784,7 +784,7 @@
 {
 	/* workaround reboot hang when booting from SPI */
 	if ((bfin_read_SYSCR() & 0x7) == 0x3)
-		bfin_gpio_reset_spi0_ssel1();
+		bfin_gpio_reset_spi0(1);
 }
 
 void bfin_get_ether_addr(char *addr)

Modified: trunk/arch/blackfin/mach-bf527/boards/ezkit.c (6001 => 6002)


--- trunk/arch/blackfin/mach-bf527/boards/ezkit.c	2009-01-12 22:09:16 UTC (rev 6001)
+++ trunk/arch/blackfin/mach-bf527/boards/ezkit.c	2009-01-13 05:35:16 UTC (rev 6002)
@@ -1068,7 +1068,7 @@
 {
 	/* workaround reboot hang when booting from SPI */
 	if ((bfin_read_SYSCR() & 0x7) == 0x3)
-		bfin_gpio_reset_spi0_ssel1();
+		bfin_gpio_reset_spi0(1);
 }
 
 void bfin_get_ether_addr(char *addr)

Modified: trunk/arch/blackfin/mach-bf537/boards/generic_board.c (6001 => 6002)


--- trunk/arch/blackfin/mach-bf537/boards/generic_board.c	2009-01-12 22:09:16 UTC (rev 6001)
+++ trunk/arch/blackfin/mach-bf537/boards/generic_board.c	2009-01-13 05:35:16 UTC (rev 6002)
@@ -726,7 +726,7 @@
 {
 	/* workaround reboot hang when booting from SPI */
 	if ((bfin_read_SYSCR() & 0x7) == 0x3)
-		bfin_gpio_reset_spi0_ssel1();
+		bfin_gpio_reset_spi0(1);
 }
 
 #if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)

Modified: trunk/arch/blackfin/mach-bf537/boards/minotaur.c (6001 => 6002)


--- trunk/arch/blackfin/mach-bf537/boards/minotaur.c	2009-01-12 22:09:16 UTC (rev 6001)
+++ trunk/arch/blackfin/mach-bf537/boards/minotaur.c	2009-01-13 05:35:16 UTC (rev 6002)
@@ -377,5 +377,5 @@
 {
 	/* workaround reboot hang when booting from SPI */
 	if ((bfin_read_SYSCR() & 0x7) == 0x3)
-		bfin_gpio_reset_spi0_ssel1();
+		bfin_gpio_reset_spi0(1);
 }

Modified: trunk/arch/blackfin/mach-bf537/boards/stamp.c (6001 => 6002)


--- trunk/arch/blackfin/mach-bf537/boards/stamp.c	2009-01-12 22:09:16 UTC (rev 6001)
+++ trunk/arch/blackfin/mach-bf537/boards/stamp.c	2009-01-13 05:35:16 UTC (rev 6002)
@@ -1307,7 +1307,7 @@
 {
 	/* workaround reboot hang when booting from SPI */
 	if ((bfin_read_SYSCR() & 0x7) == 0x3)
-		bfin_gpio_reset_spi0_ssel1();
+		bfin_gpio_reset_spi0(1);
 }
 
 /*
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to