[aadk-commits] dbailey: uClinux/trunk r118 - /uClinux/trunk/uClinux-dist/linux-2.6.x/drivers...

aadk-commits at lists.digium.com aadk-commits at lists.digium.com
Tue Jan 9 08:29:04 MST 2007


Author: dbailey
Date: Tue Jan  9 09:29:03 2007
New Revision: 118

URL: http://svn.digium.com/view/aadk?view=rev&rev=118
Log:
allowed for chip select 0 to activate clock and data without any chip selects being active.  (Used in MMC synchronization.)

Modified:
    uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/spi/spi_bfin5xx.c

Modified: uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/spi/spi_bfin5xx.c
URL: http://svn.digium.com/view/aadk/uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/spi/spi_bfin5xx.c?view=diff&rev=118&r1=117&r2=118
==============================================================================
--- uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/spi/spi_bfin5xx.c (original)
+++ uClinux/trunk/uClinux-dist/linux-2.6.x/drivers/spi/spi_bfin5xx.c Tue Jan  9 09:29:03 2007
@@ -98,7 +98,14 @@
 #define QUEUE_STOPPED 1
 
 int dma_requested;
-char chip_select_flag;
+
+/* 
+ * Supports SPI chip selects 0-7.
+ * Chip selects 1-7 correspond to blackfin SSEL 1-7 signals.
+ * Chip Select 0 (Dummy chip select) allows data & clock to be driven without 
+ *	any chip select being active.  (Required for MMC synchronization.)
+ */
+unsigned short chip_select_flag;
 
 struct driver_data {
 	/* Driver model hookup */
@@ -243,6 +250,8 @@
 		__builtin_bfin_ssync();
 		bfin_write_PORTF_FER(bfin_read_PORTF_FER() | 0x3800);
 		__builtin_bfin_ssync();
+	} else if (chip->chip_select_num == 0) {	
+		/* Nothing to be done for the dummy select */
 	}
 #endif
 
@@ -820,8 +829,12 @@
 	/* Notice: for blackfin, the speed_hz is the value of register
 	   SPI_BAUD, not the real baudrate */
 	chip->baud = spi->max_speed_hz;
-	spi_flg = ~(1 << (spi->chip_select));
-	chip->flag = ((u16)spi_flg << 8 ) | (1 << (spi->chip_select));
+	if(spi->chip_select == 0){
+		chip->flag = 0xff00;	/* no chip selects active */
+	} else {
+		spi_flg = ~(1 << (spi->chip_select));
+		chip->flag = ((u16)spi_flg << 8 ) | (1 << (spi->chip_select));
+	}
 	chip->chip_select_num = spi->chip_select;
 
 	if (chip->bits_per_word <= 8) {



More information about the aadk-commits mailing list