Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154590
b: refs/heads/master
c: 70d6027
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Linus Torvalds committed Jul 1, 2009
1 parent 8b5fc88 commit 37c43f7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b55f627feeb9d48fdbde3835e18afbc76712e49b
refs/heads/master: 70d6027ff2bc8bab180273b77e7ab3e8a62cca51
6 changes: 6 additions & 0 deletions trunk/drivers/mmc/host/mmc_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,12 @@ static int mmc_spi_probe(struct spi_device *spi)
struct mmc_spi_host *host;
int status;

/* We rely on full duplex transfers, mostly to reduce
* per-transfer overheads (by making fewer transfers).
*/
if (spi->master->flags & SPI_MASTER_HALF_DUPLEX)
return -EINVAL;

/* MMC and SD specs only seem to care that sampling is on the
* rising edge ... meaning SPI modes 0 or 3. So either SPI mode
* should be legit. We'll use mode 0 since the steady state is 0,
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/spi/omap_uwire.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ static int __init uwire_probe(struct platform_device *pdev)
/* the spi->mode bits understood by this driver: */
master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;

master->flags = SPI_MASTER_HALF_DUPLEX;

master->bus_num = 2; /* "official" */
master->num_chipselect = 4;
master->setup = uwire_setup;
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/spi/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ struct spi_master {
/* spi_device.mode flags understood by this controller driver */
u16 mode_bits;

/* other constraints relevant to this driver */
u16 flags;
#define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */

/* Setup mode and clock, etc (spi driver may call many times).
*
* IMPORTANT: this may be called when transfers to another
Expand Down

0 comments on commit 37c43f7

Please sign in to comment.