From: Barry Song <[email protected]>

When the hardware is controlling the CS, there are some SPI options
we are unable to support.  So issue a warning in the hopes that the
user will change to a SPI mode where we can support things sanely.

Signed-off-by: Barry Song <[email protected]>
Signed-off-by: Mike Frysinger <[email protected]>
---
 drivers/spi/spi_bfin5xx.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi_bfin5xx.c b/drivers/spi/spi_bfin5xx.c
index 7882afc..21de860 100644
--- a/drivers/spi/spi_bfin5xx.c
+++ b/drivers/spi/spi_bfin5xx.c
@@ -1040,9 +1040,14 @@ static int bfin_spi_setup(struct spi_device *spi)
         */
        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_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
+       } else
                chip->cs_gpio = chip->chip_select_num - MAX_CTRL_CS;
 
        if (chip->enable_dma && chip->pio_interrupt) {
-- 
1.7.3.1


------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
spi-devel-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to