Title: [8976] trunk: Add SPI MODE_0/MODE_2 Warning:
Revision
8976
Author
hennerich
Date
2010-07-06 09:57:12 -0400 (Tue, 06 Jul 2010)

Log Message

Add SPI MODE_0/MODE_2 Warning:
With the Blackfin on-chip SPI peripheral, there is some logic tied to
the CPHA bit whether the Slave Select Line is controlled by hardware (CPHA=0) or 
controlled by software (CPHA=1). However, the Linux SPI bus driver
assumes that the Slave Select being asserted during the entire SPI transfer.

Modified Paths

Added Paths

Diff

Modified: trunk/Documentation/blackfin/00-INDEX (8975 => 8976)


--- trunk/Documentation/blackfin/00-INDEX	2010-07-06 13:01:06 UTC (rev 8975)
+++ trunk/Documentation/blackfin/00-INDEX	2010-07-06 13:57:12 UTC (rev 8976)
@@ -1,5 +1,8 @@
 00-INDEX
 	- This file
 
-bfin-gpio-note.txt
+bfin-gpio-notes.txt
 	- Notes in developing/using bfin-gpio driver.
+
+bfin-spi-notes.txt
+	- Notes for using bfin spi bus driver.

Added: trunk/Documentation/blackfin/bfin-spi-notes.txt (0 => 8976)


--- trunk/Documentation/blackfin/bfin-spi-notes.txt	                        (rev 0)
+++ trunk/Documentation/blackfin/bfin-spi-notes.txt	2010-07-06 13:57:12 UTC (rev 8976)
@@ -0,0 +1,13 @@
+SPI Chip Select behavior:
+
+With the Blackfin on-chip SPI peripheral, there is some logic tied to the CPHA
+bit whether the Slave Select Line is controlled by hardware (CPHA=0) or
+controlled by software (CPHA=1). However, the Linux SPI bus driver assumes that
+the Slave Select being asserted during the entire SPI transfer.
+
+In most cases you can utilize SPI MODE_3 instead of MODE_0 to work-around this
+behavior. If your SPI slave device in question requires SPI MODE_0 or MODE_2
+timing, you can utilize the GPIO controlled SPI Slave Select option instead.
+
+You can even use the same pin whose peripheral role is a SSEL,
+but use it as a GPIO instead.

Modified: trunk/drivers/spi/spi_bfin5xx.c (8975 => 8976)


--- trunk/drivers/spi/spi_bfin5xx.c	2010-07-06 13:01:06 UTC (rev 8975)
+++ trunk/drivers/spi/spi_bfin5xx.c	2010-07-06 13:57:12 UTC (rev 8976)
@@ -1149,10 +1149,11 @@
 	chip->baud = hz_to_spi_baud(spi->max_speed_hz);
 	chip->chip_select_num = spi->chip_select;
 	if (chip->chip_select_num < MAX_CTRL_CS) {
-		if (!(spi->mode & SPI_CPHA)) {
-			dev_err(&spi->dev, "please use a GPIO as chipselect while CPHA is 0\n");
-			goto error;
-		}
+		if (!(spi->mode & SPI_CPHA))
+			dev_warn(&spi->dev, "Warning: SPI CPHA not set:"
+			" Slave Select not under software control!\n"
+			" See Documentation/blackfin/bfin-spi-notes.txt");
+
 		chip->flag = (1 << spi->chip_select) << 8;
 	} else
 		chip->cs_gpio = chip->chip_select_num - MAX_CTRL_CS;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to