aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/omap_hsmmc.c
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2011-07-24 15:57:47 -0400
committerPaolo Pisati <paolo.pisati@canonical.com>2012-08-17 04:18:03 -0400
commit37ebde996aa6c080eba4518b5e67d36275d9b5b8 (patch)
tree6992135094a64f03a0e4ab8083bad9a261c85504 /drivers/mmc/host/omap_hsmmc.c
parentc4210b69286bea72b1c4e973d32a285b69f13ca8 (diff)
Merge branch 'v3.0-4460-fixes' into omap-pm-integration
Diffstat (limited to 'drivers/mmc/host/omap_hsmmc.c')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 922c77196d6..2f54e4b6d72 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -166,6 +166,7 @@ struct omap_hsmmc_host {
166 unsigned int id; 166 unsigned int id;
167 unsigned int dma_len; 167 unsigned int dma_len;
168 unsigned int dma_sg_idx; 168 unsigned int dma_sg_idx;
169 unsigned int master_clock;
169 unsigned char bus_mode; 170 unsigned char bus_mode;
170 unsigned char power_mode; 171 unsigned char power_mode;
171 u32 *buffer; 172 u32 *buffer;
@@ -676,11 +677,11 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
676 } 677 }
677 678
678 if (ios->clock) { 679 if (ios->clock) {
679 dsor = OMAP_MMC_MASTER_CLOCK / ios->clock; 680 dsor = host->master_clock / ios->clock;
680 if (dsor < 1) 681 if (dsor < 1)
681 dsor = 1; 682 dsor = 1;
682 683
683 if (OMAP_MMC_MASTER_CLOCK / dsor > ios->clock) 684 if (host->master_clock / dsor > ios->clock)
684 dsor++; 685 dsor++;
685 686
686 if (dsor > 250) 687 if (dsor > 250)
@@ -1593,11 +1594,11 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1593 } 1594 }
1594 1595
1595 if (ios->clock) { 1596 if (ios->clock) {
1596 dsor = OMAP_MMC_MASTER_CLOCK / ios->clock; 1597 dsor = host->master_clock / ios->clock;
1597 if (dsor < 1) 1598 if (dsor < 1)
1598 dsor = 1; 1599 dsor = 1;
1599 1600
1600 if (OMAP_MMC_MASTER_CLOCK / dsor > ios->clock) 1601 if (host->master_clock / dsor > ios->clock)
1601 dsor++; 1602 dsor++;
1602 1603
1603 if (dsor > 250) 1604 if (dsor > 250)
@@ -2078,6 +2079,10 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
2078 host->base = ioremap(host->mapbase, SZ_4K); 2079 host->base = ioremap(host->mapbase, SZ_4K);
2079 host->power_mode = -1; 2080 host->power_mode = -1;
2080 2081
2082 host->master_clock = OMAP_MMC_MASTER_CLOCK;
2083 if (mmc_slot(host).features & HSMMC_HAS_48MHZ_MASTER_CLK)
2084 host->master_clock = OMAP_MMC_MASTER_CLOCK / 2;
2085
2081 platform_set_drvdata(pdev, host); 2086 platform_set_drvdata(pdev, host);
2082 INIT_WORK(&host->mmc_carddetect_work, omap_hsmmc_detect); 2087 INIT_WORK(&host->mmc_carddetect_work, omap_hsmmc_detect);
2083 2088