Title: [8604] trunk/drivers/spi/spi_bfin5xx.c: [#5903], limit users to use gpio cs while CHPA = 0
Revision
8604
Author
bhsong
Date
2010-04-05 23:36:24 -0400 (Mon, 05 Apr 2010)

Log Message

[#5903], limit users to use gpio cs while CHPA = 0

Modified Paths

Diff

Modified: trunk/drivers/spi/spi_bfin5xx.c (8603 => 8604)


--- trunk/drivers/spi/spi_bfin5xx.c	2010-04-02 16:00:12 UTC (rev 8603)
+++ trunk/drivers/spi/spi_bfin5xx.c	2010-04-06 03:36:24 UTC (rev 8604)
@@ -1139,9 +1139,13 @@
 	 */
 	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 (chip->chip_select_num < MAX_CTRL_CS) {
+		if (!(spi->mode & SPI_CPHA)) {
+			dev_err(&spi->dev, "unsupported non-gpio chipselect while CPHA is 0\n");
+			goto error;
+		}
 		chip->flag = (1 << spi->chip_select) << 8;
-	else
+	} else
 		chip->cs_gpio = chip->chip_select_num - MAX_CTRL_CS;
 
 	if (chip->enable_dma && chip->pio_interrupt) {
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to