sdhci: Enable card clock after setting uhs mode
Pavan Kunapuli [Tue, 15 Nov 2011 15:37:34 +0000 (20:37 +0530)]
After setting uhs mode and preset values, enabling
only the card clock is sufficient. The host clock
and internal clocks need not be set again.

Bug 899940

Change-Id: Ie7627333e4155b695e58887f20524a13197e08e9
Reviewed-on: http://git-master/r/64485
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: R8790df5e2f6d62726193c63b13cfeb8d20a564da

drivers/mmc/host/sdhci.c

index 29ab393..0291ab3 100644 (file)
@@ -1388,9 +1388,9 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                        sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
 
                        /* Re-enable SD Clock */
-                       clock = host->clock;
-                       host->clock = 0;
-                       sdhci_set_clock(host, clock);
+                       clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
+                       clk |= SDHCI_CLOCK_CARD_EN;
+                       sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
                }
 
 
@@ -1419,9 +1419,9 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
                }
 
                /* Re-enable SD Clock */
-               clock = host->clock;
-               host->clock = 0;
-               sdhci_set_clock(host, clock);
+               clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
+               clk |= SDHCI_CLOCK_CARD_EN;
+               sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
        } else
                sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);