omap_hsmmc: Fix response type for busy after response
authorAdrian Hunter <adrian.hunter@nokia.com>
Mon, 12 Jan 2009 14:13:08 +0000 (16:13 +0200)
committerPierre Ossman <drzeus@drzeus.cx>
Tue, 24 Mar 2009 20:30:04 +0000 (21:30 +0100)
commit4a694dc915c9a223044ce21fc0d99e63facd1d64
tree8dda15d5620b189c9e40ebed37a60e722653ffa3
parent82788ff532f75ecd23166e677c970139ff61c363
omap_hsmmc: Fix response type for busy after response

Some MMC commands result in the card becoming busy after
the response is received.  This needs to be specified
for the omap_hsmmc host controller, which is what this
patch does.  However, the effect is that some commands
with no data will cause a Transfer Complete (TC) interrupt
in addition to the Command Complete (CC) interrupt.
In order to deal with that, the irq handler has needed
a few changes also.

The benefit of this change is that the omap_hsmmc host
controller driver now waits for the TC interrupt while
the card is busy, so the mmc_block driver needs to poll
the card status just once instead of repeatedly.
i.e. the net result is more sleep and less cpu.

The command sequence for open-ended multi-block write
with DMA is now:

Issue write command CMD25
Receive CC interrupt
Data is sent
Receive TC interrupt (DMA is done)
Issue stop command CMD12
Receive CC interrupt
Card is busy
Receive TC interrupt
Card is now ready for next transfer

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
drivers/mmc/host/omap_hsmmc.c