summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/dw_mmc.h
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2011-06-24 14:57:18 +0200
committerChris Ball <cjb@laptop.org>2011-07-20 23:20:59 +0200
commitb86d825323b4c5d0c406e5b1a85af614acf0cf5a (patch)
tree15d9f279e07948eb0649bafa0c14d9a785afda0a /drivers/mmc/host/dw_mmc.h
parentmmc: dw_mmc: brackets in register access macros (diff)
downloadlinux-b86d825323b4c5d0c406e5b1a85af614acf0cf5a.tar.xz
linux-b86d825323b4c5d0c406e5b1a85af614acf0cf5a.zip
mmc: dw_mmc: don't hard code fifo depth, fix usage
The FIFO_DEPTH hardware configuration parameter can be found from the power-on value of RX_WMark in the FIFOTH register. This is used to initialise the watermarks, but when calculating the number of free fifo spaces a preprocessor definition is used which is hard coded to 32. Fix reading the value out of FIFOTH (the default value in the RX_WMark field is FIFO_DEPTH-1 not FIFO_DEPTH). Allow the fifo depth to be overriden by platform data (since a bootloader may have changed FIFOTH making auto-detection unreliable). Store the fifo_depth for later use. Also fix the calculation to find the number of free bytes in the fifo to include the fifo depth in the left shift by the data shift, since the fifo depth is measured in fifo items not bytes. Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/dw_mmc.h')
-rw-r--r--drivers/mmc/host/dw_mmc.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h
index bb9e5de76ae9..027d37735394 100644
--- a/drivers/mmc/host/dw_mmc.h
+++ b/drivers/mmc/host/dw_mmc.h
@@ -118,7 +118,6 @@
#define SDMMC_CMD_INDX(n) ((n) & 0x1F)
/* Status register defines */
#define SDMMC_GET_FCNT(x) (((x)>>17) & 0x1FF)
-#define SDMMC_FIFO_SZ 32
/* Internal DMAC interrupt defines */
#define SDMMC_IDMAC_INT_AI BIT(9)
#define SDMMC_IDMAC_INT_NI BIT(8)