mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 23:24:50 +00:00
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>
This commit is contained in:
parent
e72dcde72c
commit
4190f6a51f
1 changed files with 7 additions and 2 deletions
|
@ -1040,9 +1040,14 @@ static int bfin_spi_setup(struct spi_device *spi)
|
||||||
*/
|
*/
|
||||||
chip->baud = hz_to_spi_baud(spi->max_speed_hz);
|
chip->baud = hz_to_spi_baud(spi->max_speed_hz);
|
||||||
chip->chip_select_num = spi->chip_select;
|
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;
|
chip->flag = (1 << spi->chip_select) << 8;
|
||||||
else
|
} else
|
||||||
chip->cs_gpio = chip->chip_select_num - MAX_CTRL_CS;
|
chip->cs_gpio = chip->chip_select_num - MAX_CTRL_CS;
|
||||||
|
|
||||||
if (chip->enable_dma && chip->pio_interrupt) {
|
if (chip->enable_dma && chip->pio_interrupt) {
|
||||||
|
|
Loading…
Reference in a new issue