diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 17:37:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 17:37:00 -0400 |
commit | 70ada77920723fbc2b35e9b301022fb1e166b41b (patch) | |
tree | f30f24135eff89020d8ae21d6c7a83cf5c812585 /drivers/spi/atmel_spi.c | |
parent | b22793f7fdc38d73c4bb4299a313deef56dcfe66 (diff) | |
parent | 2764c500be0c1f057349ee6c81557239de060f87 (diff) |
Merge branch 'next-spi' of git://git.secretlab.ca/git/linux-2.6
* 'next-spi' of git://git.secretlab.ca/git/linux-2.6: (53 commits)
spi/omap2_mcspi: Verify TX reg is empty after TX only xfer with DMA
spi/omap2_mcspi: disable channel after TX_ONLY transfer in PIO mode
spi/bfin_spi: namespace local structs
spi/bfin_spi: init early
spi/bfin_spi: check per-transfer bits_per_word
spi/bfin_spi: warn when CS is driven by hardware (CPHA=0)
spi/bfin_spi: cs should be always low when a new transfer begins
spi/bfin_spi: fix typo in comment
spi/bfin_spi: reject unsupported SPI modes
spi/bfin_spi: use dma_disable_irq_nosync() in irq handler
spi/bfin_spi: combine duplicate SPI_CTL read/write logic
spi/bfin_spi: reset ctl_reg bits when setup is run again on a device
spi/bfin_spi: push all size checks into the transfer function
spi/bfin_spi: use nosync when disabling the IRQ from the IRQ handler
spi/bfin_spi: sync hardware state before reprogramming everything
spi/bfin_spi: save/restore state when suspending/resuming
spi/bfin_spi: redo GPIO CS handling
Blackfin: SPI: expand SPI bitmasks
spi/bfin_spi: use the SPI namespaced bit names
spi/bfin_spi: drop extra memory we don't need
...
Diffstat (limited to 'drivers/spi/atmel_spi.c')
-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..154529aacc03 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 | "bits_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 | } |