aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/sdhci.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-06-04 12:51:15 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-06-19 08:05:08 -0400
commita3fd4a1b9ced850ac1a9d5bb9f8fab494d07f3fa (patch)
treedc2b9354fe087663cc862a966d12824601702c29 /drivers/mmc/sdhci.c
parent12223dabc617a4babfba4e17feb1ed88e8cfeb8f (diff)
[MMC] Convert all hosts except mmci to use data->blksz
The MMC specification allows non-power of two block sizes. As such, we should not pass the log2 block size to host drivers, but instead pass the byte size. However, ARM MMCI can only work with log2 block size, so continue to pass both the log2 block size and byte block size. This means that for the moment, the byte block size must remain a power of two, but this is the first stage of removing this restriction for other hosts. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc/sdhci.c')
-rw-r--r--drivers/mmc/sdhci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 6bfcdbc7491e..8e9100bd57ef 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -268,7 +268,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
268 } 268 }
269 269
270 DBG("blksz %04x blks %04x flags %08x\n", 270 DBG("blksz %04x blks %04x flags %08x\n",
271 1 << data->blksz_bits, data->blocks, data->flags); 271 data->blksz, data->blocks, data->flags);
272 DBG("tsac %d ms nsac %d clk\n", 272 DBG("tsac %d ms nsac %d clk\n",
273 data->timeout_ns / 1000000, data->timeout_clks); 273 data->timeout_ns / 1000000, data->timeout_clks);
274 274
@@ -282,7 +282,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
282 282
283 writew(mode, host->ioaddr + SDHCI_TRANSFER_MODE); 283 writew(mode, host->ioaddr + SDHCI_TRANSFER_MODE);
284 284
285 writew(1 << data->blksz_bits, host->ioaddr + SDHCI_BLOCK_SIZE); 285 writew(data->blksz, host->ioaddr + SDHCI_BLOCK_SIZE);
286 writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT); 286 writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT);
287 287
288 if (host->flags & SDHCI_USE_DMA) { 288 if (host->flags & SDHCI_USE_DMA) {
@@ -294,7 +294,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
294 294
295 writel(sg_dma_address(data->sg), host->ioaddr + SDHCI_DMA_ADDRESS); 295 writel(sg_dma_address(data->sg), host->ioaddr + SDHCI_DMA_ADDRESS);
296 } else { 296 } else {
297 host->size = (1 << data->blksz_bits) * data->blocks; 297 host->size = data->blksz * data->blocks;
298 298
299 host->cur_sg = data->sg; 299 host->cur_sg = data->sg;
300 host->num_sg = data->sg_len; 300 host->num_sg = data->sg_len;
@@ -335,7 +335,7 @@ static void sdhci_finish_data(struct sdhci_host *host)
335 blocks = 0; 335 blocks = 0;
336 else 336 else
337 blocks = readw(host->ioaddr + SDHCI_BLOCK_COUNT); 337 blocks = readw(host->ioaddr + SDHCI_BLOCK_COUNT);
338 data->bytes_xfered = (1 << data->blksz_bits) * (data->blocks - blocks); 338 data->bytes_xfered = data->blksz * (data->blocks - blocks);
339 339
340 if ((data->error == MMC_ERR_NONE) && blocks) { 340 if ((data->error == MMC_ERR_NONE) && blocks) {
341 printk(KERN_ERR "%s: Controller signalled completion even " 341 printk(KERN_ERR "%s: Controller signalled completion even "