mmc: sdhi: Add write16_hook

Some controllers require waiting for the bus to become idle
before writing to some registers. I have implemented this
by adding a hook to sd_ctrl_write16() and implementing
a hook for SDHI which waits for the bus to become idle.

Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Chris Ball <cjb@laptop.org>
This commit is contained in:
Simon Horman
2011-06-21 08:00:10 +09:00
committed by Chris Ball
parent a11862d338
commit 973ed3af1a
4 changed files with 50 additions and 0 deletions

View File

@@ -153,6 +153,11 @@ static inline u32 sd_ctrl_read32(struct tmio_mmc_host *host, int addr)
static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val)
{
/* If there is a hook and it returns non-zero then there
* is an error and the write should be skipped
*/
if (host->pdata->write16_hook && host->pdata->write16_hook(host, addr))
return;
writew(val, host->ctl + (addr << host->bus_shift));
}