diff options
| -rw-r--r-- | drivers/spi/spi-xilinx.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c index 6d4ce4615163..4eb1ed9ab6da 100644 --- a/drivers/spi/spi-xilinx.c +++ b/drivers/spi/spi-xilinx.c | |||
| @@ -209,26 +209,11 @@ static void xilinx_spi_chipselect(struct spi_device *spi, int is_on) | |||
| 209 | } | 209 | } |
| 210 | 210 | ||
| 211 | /* spi_bitbang requires custom setup_transfer() to be defined if there is a | 211 | /* spi_bitbang requires custom setup_transfer() to be defined if there is a |
| 212 | * custom txrx_bufs(). We have nothing to setup here as the SPI IP block | 212 | * custom txrx_bufs(). |
| 213 | * supports 8 or 16 bits per word which cannot be changed in software. | ||
| 214 | * SPI clock can't be changed in software either. | ||
| 215 | * Check for correct bits per word. Chip select delay calculations could be | ||
| 216 | * added here as soon as bitbang_work() can be made aware of the delay value. | ||
| 217 | */ | 213 | */ |
| 218 | static int xilinx_spi_setup_transfer(struct spi_device *spi, | 214 | static int xilinx_spi_setup_transfer(struct spi_device *spi, |
| 219 | struct spi_transfer *t) | 215 | struct spi_transfer *t) |
| 220 | { | 216 | { |
| 221 | struct xilinx_spi *xspi = spi_master_get_devdata(spi->master); | ||
| 222 | u8 bits_per_word; | ||
| 223 | |||
| 224 | bits_per_word = (t && t->bits_per_word) | ||
| 225 | ? t->bits_per_word : spi->bits_per_word; | ||
| 226 | if (bits_per_word != xspi->bits_per_word) { | ||
| 227 | dev_err(&spi->dev, "%s, unsupported bits_per_word=%d\n", | ||
| 228 | __func__, bits_per_word); | ||
| 229 | return -EINVAL; | ||
| 230 | } | ||
| 231 | |||
| 232 | return 0; | 217 | return 0; |
| 233 | } | 218 | } |
| 234 | 219 | ||
| @@ -407,6 +392,7 @@ static int xilinx_spi_probe(struct platform_device *pdev) | |||
| 407 | xspi->write_fn = xspi_write32_be; | 392 | xspi->write_fn = xspi_write32_be; |
| 408 | } | 393 | } |
| 409 | 394 | ||
| 395 | master->bits_per_word_mask = SPI_BPW_MASK(bits_per_word); | ||
| 410 | xspi->bits_per_word = bits_per_word; | 396 | xspi->bits_per_word = bits_per_word; |
| 411 | if (xspi->bits_per_word == 8) { | 397 | if (xspi->bits_per_word == 8) { |
| 412 | xspi->tx_fn = xspi_tx8; | 398 | xspi->tx_fn = xspi_tx8; |
