]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Fixes required for HSMMC driver to work as module
authorMadhusudhan Chikkature <madhu.cr@ti.com>
Fri, 8 Aug 2008 04:13:42 +0000 (09:43 +0530)
committerTony Lindgren <tony@atomide.com>
Fri, 8 Aug 2008 07:43:50 +0000 (10:43 +0300)
ARM: OMAP3: Fixes required to make HSMMC driver work as module.Complete the
previously applied patch.

This patch provides the necessary fixes to make the HSMMC driver work as
loadble module.

Signed-off-by: Madhusudhan Chikkature<madhu.cr@ti.com>
Signed-off-by: Romit Dasgupta <romit@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mmc/host/omap_hsmmc.c

index a8316ffdbbe98f63de6abadfe961c9230f52341d..1ff51b7060f646919c7b188e68efc32d6b24a76d 100644 (file)
@@ -901,9 +901,26 @@ err:
 static int omap_mmc_remove(struct platform_device *pdev)
 {
        struct mmc_omap_host *host = platform_get_drvdata(pdev);
+       struct resource *res;
+       u16 vdd = 0;
+
+       if (!(OMAP_HSMMC_READ(host->base, HCTL) & SDVSDET)) {
+       /*
+        * Set the vdd back to 3V,
+        * applicable for dual volt support.
+        */
+               vdd = fls(host->mmc->ocr_avail) - 1;
+               if (omap_mmc_switch_opcond(host, vdd) != 0)
+                       host->mmc->ios.vdd = vdd;
+       }
+
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (res)
+               release_mem_region(res->start, res->end - res->start + 1);
 
        platform_set_drvdata(pdev, NULL);
        if (host) {
+               mmc_remove_host(host->mmc);
                if (host->pdata->cleanup)
                        host->pdata->cleanup(&pdev->dev);
                free_irq(host->irq, host);