aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/pxamci.c
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@marvell.com>2009-08-31 09:52:53 -0400
committerEric Miao <eric.y.miao@gmail.com>2009-11-30 20:02:33 -0500
commitfa3f99384c20751c66962848807403ff171dc02f (patch)
tree8a6469d9a2058a45e2aa78fe6756e1bfcf5cfa25 /drivers/mmc/host/pxamci.c
parentc41562b1626b578e9ce2aae5b3363ee2f142c635 (diff)
pxamci: introduce mmc_has_26mhz() and include pxa935
Along with more processor supporting 26MHz mode (including pxa935), introduce an individual macro mmc_has_26mhz() for this. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'drivers/mmc/host/pxamci.c')
-rw-r--r--drivers/mmc/host/pxamci.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index b00d67319058..c85f6166056e 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -43,6 +43,9 @@
43#define NR_SG 1 43#define NR_SG 1
44#define CLKRT_OFF (~0) 44#define CLKRT_OFF (~0)
45 45
46#define mmc_has_26MHz() (cpu_is_pxa300() || cpu_is_pxa310() \
47 || cpu_is_pxa935())
48
46struct pxamci_host { 49struct pxamci_host {
47 struct mmc_host *mmc; 50 struct mmc_host *mmc;
48 spinlock_t lock; 51 spinlock_t lock;
@@ -457,7 +460,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
457 clk_enable(host->clk); 460 clk_enable(host->clk);
458 461
459 if (ios->clock == 26000000) { 462 if (ios->clock == 26000000) {
460 /* to support 26MHz on pxa300/pxa310 */ 463 /* to support 26MHz */
461 host->clkrt = 7; 464 host->clkrt = 7;
462 } else { 465 } else {
463 /* to handle (19.5MHz, 26MHz) */ 466 /* to handle (19.5MHz, 26MHz) */
@@ -608,8 +611,7 @@ static int pxamci_probe(struct platform_device *pdev)
608 * Calculate minimum clock rate, rounding up. 611 * Calculate minimum clock rate, rounding up.
609 */ 612 */
610 mmc->f_min = (host->clkrate + 63) / 64; 613 mmc->f_min = (host->clkrate + 63) / 64;
611 mmc->f_max = (cpu_is_pxa300() || cpu_is_pxa310()) ? 26000000 614 mmc->f_max = (mmc_has_26MHz()) ? 26000000 : host->clkrate;
612 : host->clkrate;
613 615
614 pxamci_init_ocr(host); 616 pxamci_init_ocr(host);
615 617
@@ -618,7 +620,7 @@ static int pxamci_probe(struct platform_device *pdev)
618 if (!cpu_is_pxa25x()) { 620 if (!cpu_is_pxa25x()) {
619 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; 621 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ;
620 host->cmdat |= CMDAT_SDIO_INT_EN; 622 host->cmdat |= CMDAT_SDIO_INT_EN;
621 if (cpu_is_pxa300() || cpu_is_pxa310()) 623 if (mmc_has_26MHz())
622 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | 624 mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
623 MMC_CAP_SD_HIGHSPEED; 625 MMC_CAP_SD_HIGHSPEED;
624 } 626 }