Commit fa3f9938 authored by Haojian Zhuang's avatar Haojian Zhuang Committed by Eric Miao

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: default avatarHaojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent c41562b1
...@@ -43,6 +43,9 @@ ...@@ -43,6 +43,9 @@
#define NR_SG 1 #define NR_SG 1
#define CLKRT_OFF (~0) #define CLKRT_OFF (~0)
#define mmc_has_26MHz() (cpu_is_pxa300() || cpu_is_pxa310() \
|| cpu_is_pxa935())
struct pxamci_host { struct pxamci_host {
struct mmc_host *mmc; struct mmc_host *mmc;
spinlock_t lock; spinlock_t lock;
...@@ -457,7 +460,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ...@@ -457,7 +460,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
clk_enable(host->clk); clk_enable(host->clk);
if (ios->clock == 26000000) { if (ios->clock == 26000000) {
/* to support 26MHz on pxa300/pxa310 */ /* to support 26MHz */
host->clkrt = 7; host->clkrt = 7;
} else { } else {
/* to handle (19.5MHz, 26MHz) */ /* to handle (19.5MHz, 26MHz) */
...@@ -608,8 +611,7 @@ static int pxamci_probe(struct platform_device *pdev) ...@@ -608,8 +611,7 @@ static int pxamci_probe(struct platform_device *pdev)
* Calculate minimum clock rate, rounding up. * Calculate minimum clock rate, rounding up.
*/ */
mmc->f_min = (host->clkrate + 63) / 64; mmc->f_min = (host->clkrate + 63) / 64;
mmc->f_max = (cpu_is_pxa300() || cpu_is_pxa310()) ? 26000000 mmc->f_max = (mmc_has_26MHz()) ? 26000000 : host->clkrate;
: host->clkrate;
pxamci_init_ocr(host); pxamci_init_ocr(host);
...@@ -618,7 +620,7 @@ static int pxamci_probe(struct platform_device *pdev) ...@@ -618,7 +620,7 @@ static int pxamci_probe(struct platform_device *pdev)
if (!cpu_is_pxa25x()) { if (!cpu_is_pxa25x()) {
mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ;
host->cmdat |= CMDAT_SDIO_INT_EN; host->cmdat |= CMDAT_SDIO_INT_EN;
if (cpu_is_pxa300() || cpu_is_pxa310()) if (mmc_has_26MHz())
mmc->caps |= MMC_CAP_MMC_HIGHSPEED | mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
MMC_CAP_SD_HIGHSPEED; MMC_CAP_SD_HIGHSPEED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment