summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/tmio_mmc.h
diff options
context:
space:
mode:
authorSimon Horman2011-06-21 01:00:10 +0200
committerChris Ball2011-07-20 23:20:57 +0200
commit973ed3af1a570612771ed10dec6506c757767668 (patch)
treedb993034cacfcc3f3388c43d96459a123adc32a2 /drivers/mmc/host/tmio_mmc.h
parentmmc: tmio: Share register access functions (diff)
downloadkernel-qcow2-linux-973ed3af1a570612771ed10dec6506c757767668.tar.gz
kernel-qcow2-linux-973ed3af1a570612771ed10dec6506c757767668.tar.xz
kernel-qcow2-linux-973ed3af1a570612771ed10dec6506c757767668.zip
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>
Diffstat (limited to 'drivers/mmc/host/tmio_mmc.h')
-rw-r--r--drivers/mmc/host/tmio_mmc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 0c22df0f954d..211ef6e7a820 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -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));
}