diff options
| -rw-r--r-- | drivers/spi/atmel_spi.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index c4e04428992d..5c03a5bb168a 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c | |||
| @@ -654,6 +654,8 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg) | |||
| 654 | struct spi_transfer *xfer; | 654 | struct spi_transfer *xfer; |
| 655 | unsigned long flags; | 655 | unsigned long flags; |
| 656 | struct device *controller = spi->master->dev.parent; | 656 | struct device *controller = spi->master->dev.parent; |
| 657 | u8 bits; | ||
| 658 | struct atmel_spi_device *asd; | ||
| 657 | 659 | ||
| 658 | as = spi_master_get_devdata(spi->master); | 660 | as = spi_master_get_devdata(spi->master); |
| 659 | 661 | ||
| @@ -672,8 +674,18 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg) | |||
| 672 | return -EINVAL; | 674 | return -EINVAL; |
| 673 | } | 675 | } |
| 674 | 676 | ||
| 677 | if (xfer->bits_per_word) { | ||
| 678 | asd = spi->controller_state; | ||
| 679 | bits = (asd->csr >> 4) & 0xf; | ||
| 680 | if (bits != xfer->bits_per_word - 8) { | ||
| 681 | dev_dbg(&spi->dev, "you can't yet change " | ||
| 682 | "bit_per_word in transfers\n"); | ||
| 683 | return -ENOPROTOOPT; | ||
| 684 | } | ||
| 685 | } | ||
| 686 | |||
| 675 | /* FIXME implement these protocol options!! */ | 687 | /* FIXME implement these protocol options!! */ |
| 676 | if (xfer->bits_per_word || xfer->speed_hz) { | 688 | if (xfer->speed_hz) { |
| 677 | dev_dbg(&spi->dev, "no protocol options yet\n"); | 689 | dev_dbg(&spi->dev, "no protocol options yet\n"); |
| 678 | return -ENOPROTOOPT; | 690 | return -ENOPROTOOPT; |
| 679 | } | 691 | } |
