aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-08-27 08:51:28 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-09-16 06:50:29 -0400
commit3bc87f243f64c953717bea058f4b458a57fc1a29 (patch)
treedcc194a21ec5c95059b2b8afc6fa2dece871e587 /drivers/mmc
parent63b98080daa35f0d682db04f4fb7ada010888752 (diff)
[MMC] Convert mmci to use data->blksz rather than data->blksz_bits
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/mmci.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c
index 1886562abdd4..8419489e7744 100644
--- a/drivers/mmc/mmci.c
+++ b/drivers/mmc/mmci.c
@@ -69,12 +69,13 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
69 unsigned int datactrl, timeout, irqmask; 69 unsigned int datactrl, timeout, irqmask;
70 unsigned long long clks; 70 unsigned long long clks;
71 void __iomem *base; 71 void __iomem *base;
72 int blksz_bits;
72 73
73 DBG(host, "blksz %04x blks %04x flags %08x\n", 74 DBG(host, "blksz %04x blks %04x flags %08x\n",
74 1 << data->blksz_bits, data->blocks, data->flags); 75 data->blksz, data->blocks, data->flags);
75 76
76 host->data = data; 77 host->data = data;
77 host->size = data->blocks << data->blksz_bits; 78 host->size = data->blksz;
78 host->data_xfered = 0; 79 host->data_xfered = 0;
79 80
80 mmci_init_sg(host, data); 81 mmci_init_sg(host, data);
@@ -88,7 +89,10 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data)
88 writel(timeout, base + MMCIDATATIMER); 89 writel(timeout, base + MMCIDATATIMER);
89 writel(host->size, base + MMCIDATALENGTH); 90 writel(host->size, base + MMCIDATALENGTH);
90 91
91 datactrl = MCI_DPSM_ENABLE | data->blksz_bits << 4; 92 blksz_bits = ffs(data->blksz) - 1;
93 BUG_ON(1 << blksz_bits != data->blksz);
94
95 datactrl = MCI_DPSM_ENABLE | blksz_bits << 4;
92 if (data->flags & MMC_DATA_READ) { 96 if (data->flags & MMC_DATA_READ) {
93 datactrl |= MCI_DPSM_DIRECTION; 97 datactrl |= MCI_DPSM_DIRECTION;
94 irqmask = MCI_RXFIFOHALFFULLMASK; 98 irqmask = MCI_RXFIFOHALFFULLMASK;
@@ -145,7 +149,7 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
145 unsigned int status) 149 unsigned int status)
146{ 150{
147 if (status & MCI_DATABLOCKEND) { 151 if (status & MCI_DATABLOCKEND) {
148 host->data_xfered += 1 << data->blksz_bits; 152 host->data_xfered += data->blksz;
149 } 153 }
150 if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) { 154 if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_TXUNDERRUN|MCI_RXOVERRUN)) {
151 if (status & MCI_DATACRCFAIL) 155 if (status & MCI_DATACRCFAIL)