aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/pxamci.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 1654a3330340..80df4b047c81 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -375,14 +375,23 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
375 if (host->clkrt == CLKRT_OFF) 375 if (host->clkrt == CLKRT_OFF)
376 clk_enable(host->clk); 376 clk_enable(host->clk);
377 377
378 /* 378 if (ios->clock == 26000000) {
379 * clk might result in a lower divisor than we 379 /* to support 26MHz on pxa300/pxa310 */
380 * desire. check for that condition and adjust 380 host->clkrt = 7;
381 * as appropriate. 381 } else {
382 */ 382 /* to handle (19.5MHz, 26MHz) */
383 if (rate / clk > ios->clock) 383 if (!clk)
384 clk <<= 1; 384 clk = 1;
385 host->clkrt = fls(clk) - 1; 385
386 /*
387 * clk might result in a lower divisor than we
388 * desire. check for that condition and adjust
389 * as appropriate.
390 */
391 if (rate / clk > ios->clock)
392 clk <<= 1;
393 host->clkrt = fls(clk) - 1;
394 }
386 395
387 /* 396 /*
388 * we write clkrt on the next command 397 * we write clkrt on the next command
@@ -519,7 +528,8 @@ static int pxamci_probe(struct platform_device *pdev)
519 * Calculate minimum clock rate, rounding up. 528 * Calculate minimum clock rate, rounding up.
520 */ 529 */
521 mmc->f_min = (host->clkrate + 63) / 64; 530 mmc->f_min = (host->clkrate + 63) / 64;
522 mmc->f_max = host->clkrate; 531 mmc->f_max = (cpu_is_pxa300() || cpu_is_pxa310()) ? 26000000
532 : host->clkrate;
523 533
524 mmc->ocr_avail = host->pdata ? 534 mmc->ocr_avail = host->pdata ?
525 host->pdata->ocr_mask : 535 host->pdata->ocr_mask :
@@ -529,6 +539,9 @@ static int pxamci_probe(struct platform_device *pdev)
529 if (!cpu_is_pxa21x() && !cpu_is_pxa25x()) { 539 if (!cpu_is_pxa21x() && !cpu_is_pxa25x()) {
530 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; 540 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ;
531 host->cmdat |= CMDAT_SDIO_INT_EN; 541 host->cmdat |= CMDAT_SDIO_INT_EN;
542 if (cpu_is_pxa300() || cpu_is_pxa310())
543 mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
544 MMC_CAP_SD_HIGHSPEED;
532 } 545 }
533 546
534 host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL); 547 host->sg_cpu = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, &host->sg_dma, GFP_KERNEL);