diff mbox

[1/2] sdhci: sdhci.[ch] support setting f_max clock via call back

Message ID 580F4454-57BF-4901-A151-248EB502F790@marvell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Philip Rakity Feb. 14, 2011, 7:10 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 7207b57..6d774cc 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1945,7 +1945,13 @@  int sdhci_add_host(struct sdhci_host *host)
 	else
 		mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200;
 
-	mmc->f_max = host->max_clk;
+	if (host->ops->get_f_max_clock) {
+		mmc->f_max = host->ops->get_f_max_clock(host);
+		if (mmc->f_max > host->max_clk)
+			mmc->f_max = host->max_clk;
+	} else
+		mmc->f_max = host->max_clk;
+
 	mmc->caps |= MMC_CAP_SDIO_IRQ;
 
 	/*
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 4f62505..2477118 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -224,6 +224,7 @@  struct sdhci_ops {
 	unsigned int    (*get_ro)(struct sdhci_host *host);
 	void	(*platform_reset_enter)(struct sdhci_host *host, u8 mask);
 	void	(*platform_reset_exit)(struct sdhci_host *host, u8 mask);
+	unsigned int	(*get_f_max_clock)(struct sdhci_host *host);
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS