ARM: OMAP: hsmmc: add max_freq field
authorDaniel Mack <zonque@gmail.com>
Sun, 19 Feb 2012 12:20:33 +0000 (13:20 +0100)
committerChris Ball <cjb@laptop.org>
Tue, 27 Mar 2012 16:19:56 +0000 (12:19 -0400)
External circuitry like level shifters may limit the maximum operation
speed of the hsmmc controller. Add a field to struct omap2_hsmmc_info
so boards can adjust the setting on demand.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
arch/arm/mach-omap2/hsmmc.c
arch/arm/mach-omap2/hsmmc.h
drivers/mmc/host/omap_hsmmc.c

index 19dd1657245c58634dc3ac1e8005e823e7360dd5..9abab0f52f799483bfb7ea6b533d31eb6919a581 100644 (file)
@@ -316,6 +316,7 @@ static int omap_hsmmc_pdata_init(struct omap2_hsmmc_info *c,
        mmc->slots[0].pm_caps = c->pm_caps;
        mmc->slots[0].internal_clock = !c->ext_clock;
        mmc->dma_mask = 0xffffffff;
+       mmc->max_freq = c->max_freq;
        if (cpu_is_omap44xx())
                mmc->reg_offset = OMAP4_MMC_REG_OFFSET;
        else
index c4409730c4bb6ea18d4c0b93f9bd7fab612e20a5..0017ae24995e8b44074d9e32638331f88891d38a 100644 (file)
@@ -26,6 +26,8 @@ struct omap2_hsmmc_info {
        char    *name;          /* or NULL for default */
        struct device *dev;     /* returned: pointer to mmc adapter */
        int     ocr_mask;       /* temporary HACK */
+       int     max_freq;       /* maximum clock, if constrained by external
+                                * circuitry, or 0 for default */
        /* Remux (pad configuration) when powering on/off */
        void (*remux)(struct device *dev, int slot, int power_on);
        /* init some special card */
index fd0c661bbad38a7152a37955146ff6068d4d7137..36e7f5bc58a35432772ab52c693097678cd6f2b3 100644 (file)
@@ -1912,8 +1912,12 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
        if (mmc_slot(host).vcc_aux_disable_is_sleep)
                mmc_slot(host).no_off = 1;
 
-       mmc->f_min      = OMAP_MMC_MIN_CLOCK;
-       mmc->f_max      = OMAP_MMC_MAX_CLOCK;
+       mmc->f_min = OMAP_MMC_MIN_CLOCK;
+
+       if (pdata->max_freq > 0)
+               mmc->f_max = pdata->max_freq;
+       else
+               mmc->f_max = OMAP_MMC_MAX_CLOCK;
 
        spin_lock_init(&host->irq_lock);