diff options
author | Barry Song <barry.song@analog.com> | 2010-04-05 23:36:24 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2010-10-18 02:49:43 -0400 |
commit | 4190f6a51f3f9c7c8298202d31b3ead9381c33f1 (patch) | |
tree | b1afa6ba60935d2a8036714ea46d4acd8b36a877 /drivers/spi | |
parent | e72dcde72c712708e2145ab0ecff539ff4a4c7fb (diff) |
spi/bfin_spi: warn when CS is driven by hardware (CPHA=0)
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 <barry.song@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | 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 7882afcd580f..21de8605dbce 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) | |||
1040 | */ | 1040 | */ |
1041 | chip->baud = hz_to_spi_baud(spi->max_speed_hz); | 1041 | chip->baud = hz_to_spi_baud(spi->max_speed_hz); |
1042 | chip->chip_select_num = spi->chip_select; | 1042 | chip->chip_select_num = spi->chip_select; |
1043 | if (chip->chip_select_num < MAX_CTRL_CS) | 1043 | if (chip->chip_select_num < MAX_CTRL_CS) { |
1044 | if (!(spi->mode & SPI_CPHA)) | ||
1045 | dev_warn(&spi->dev, "Warning: SPI CPHA not set:" | ||
1046 | " Slave Select not under software control!\n" | ||
1047 | " See Documentation/blackfin/bfin-spi-notes.txt"); | ||
1048 | |||
1044 | chip->flag = (1 << spi->chip_select) << 8; | 1049 | chip->flag = (1 << spi->chip_select) << 8; |
1045 | else | 1050 | } else |
1046 | chip->cs_gpio = chip->chip_select_num - MAX_CTRL_CS; | 1051 | chip->cs_gpio = chip->chip_select_num - MAX_CTRL_CS; |
1047 | 1052 | ||
1048 | if (chip->enable_dma && chip->pio_interrupt) { | 1053 | if (chip->enable_dma && chip->pio_interrupt) { |