aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/pxamci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/pxamci.c')
-rw-r--r--drivers/mmc/host/pxamci.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 9fb480bb0e0a..0ed48959b590 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -29,6 +29,7 @@
29#include <linux/io.h> 29#include <linux/io.h>
30#include <linux/regulator/consumer.h> 30#include <linux/regulator/consumer.h>
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/gfp.h>
32 33
33#include <asm/sizes.h> 34#include <asm/sizes.h>
34 35
@@ -43,6 +44,9 @@
43#define NR_SG 1 44#define NR_SG 1
44#define CLKRT_OFF (~0) 45#define CLKRT_OFF (~0)
45 46
47#define mmc_has_26MHz() (cpu_is_pxa300() || cpu_is_pxa310() \
48 || cpu_is_pxa935())
49
46struct pxamci_host { 50struct pxamci_host {
47 struct mmc_host *mmc; 51 struct mmc_host *mmc;
48 spinlock_t lock; 52 spinlock_t lock;
@@ -457,7 +461,7 @@ static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
457 clk_enable(host->clk); 461 clk_enable(host->clk);
458 462
459 if (ios->clock == 26000000) { 463 if (ios->clock == 26000000) {
460 /* to support 26MHz on pxa300/pxa310 */ 464 /* to support 26MHz */
461 host->clkrt = 7; 465 host->clkrt = 7;
462 } else { 466 } else {
463 /* to handle (19.5MHz, 26MHz) */ 467 /* to handle (19.5MHz, 26MHz) */
@@ -608,8 +612,7 @@ static int pxamci_probe(struct platform_device *pdev)
608 * Calculate minimum clock rate, rounding up. 612 * Calculate minimum clock rate, rounding up.
609 */ 613 */
610 mmc->f_min = (host->clkrate + 63) / 64; 614 mmc->f_min = (host->clkrate + 63) / 64;
611 mmc->f_max = (cpu_is_pxa300() || cpu_is_pxa310()) ? 26000000 615 mmc->f_max = (mmc_has_26MHz()) ? 26000000 : host->clkrate;
612 : host->clkrate;
613 616
614 pxamci_init_ocr(host); 617 pxamci_init_ocr(host);
615 618
@@ -618,7 +621,7 @@ static int pxamci_probe(struct platform_device *pdev)
618 if (!cpu_is_pxa25x()) { 621 if (!cpu_is_pxa25x()) {
619 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ; 622 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_SDIO_IRQ;
620 host->cmdat |= CMDAT_SDIO_INT_EN; 623 host->cmdat |= CMDAT_SDIO_INT_EN;
621 if (cpu_is_pxa300() || cpu_is_pxa310()) 624 if (mmc_has_26MHz())
622 mmc->caps |= MMC_CAP_MMC_HIGHSPEED | 625 mmc->caps |= MMC_CAP_MMC_HIGHSPEED |
623 MMC_CAP_SD_HIGHSPEED; 626 MMC_CAP_SD_HIGHSPEED;
624 } 627 }
@@ -826,7 +829,7 @@ static int pxamci_resume(struct device *dev)
826 return ret; 829 return ret;
827} 830}
828 831
829static struct dev_pm_ops pxamci_pm_ops = { 832static const struct dev_pm_ops pxamci_pm_ops = {
830 .suspend = pxamci_suspend, 833 .suspend = pxamci_suspend,
831 .resume = pxamci_resume, 834 .resume = pxamci_resume,
832}; 835};