diff mbox

sdhci: add support for hardware clock gating

Message ID 219B8EAC-935D-4AFD-8AF0-353D4CE6EEB6@marvell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Philip Rakity Jan. 21, 2011, 7:36 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci-pxa.c b/drivers/mmc/host/sdhci-pxa.c
index 2a6b156..b31d3d5 100644
--- a/drivers/mmc/host/sdhci-pxa.c
+++ b/drivers/mmc/host/sdhci-pxa.c
@@ -138,10 +138,23 @@  static void platform_reset_exit(struct sdhci_host *host, u8 mask)
 	}
 }
 
+#ifdef CONFIG_MMC_CLKGATE
+static void platform_hw_clk_gate(struct sdhci_host *host)
+{
+	int enable;
+
+	enable = host->mmc->clk_gated;
+	programFIFO(host, enable);
+}
+#endif
+
 static struct sdhci_ops sdhci_pxa_ops = {
 	.get_f_max_clock = NULL,
 	.set_signaling_voltage = set_signaling_voltage,
 	.platform_reset_exit = platform_reset_exit,
+#ifdef CONFIG_MMC_CLKGATE
+	.platform_hw_clk_gate = platform_hw_clk_gate,
+#endif
 };
 
 /*****************************************************************************\
@@ -209,8 +222,11 @@  static int __devinit sdhci_pxa_probe(struct platform_device *pdev)
 	host->irq = irq;
 	host->quirks = SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
-	/* enable mmc bus width testing */
+#ifdef CONFIG_MMC_CLKGATE
+	host->mmc->caps |= MMC_CAP_HW_CLOCK_GATING | MMC_CAP_BUS_WIDTH_TEST;
+#else
 	host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST;
+#endif
 
 	/* If slot design supports 8 bit data, indicate this to MMC. */
 	if (pdata->flags & PXA_FLAG_SD_8_BIT_CAPABLE_SLOT)