[PATCH 9/23] Alternative mmc structure to support pxa168, pxa910, mmp2 family SD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From 9ccabe23202613b20370374ed282f25b96a4d57f Mon Sep 17 00:00:00 2001
From: Philip Rakity <prakity@xxxxxxxxxxx>
Date: Tue, 14 Dec 2010 17:02:19 -0800
Subject: [PATCH] sdhci: add platform support for setting f_max clock

Signed-off-by: Philip Rakity <prakity@xxxxxxxxxxx>
---
 drivers/mmc/host/sdhci-pxa.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxa.c b/drivers/mmc/host/sdhci-pxa.c
index 0afc763..4c2a252 100644
--- a/drivers/mmc/host/sdhci-pxa.c
+++ b/drivers/mmc/host/sdhci-pxa.c
@@ -53,7 +53,15 @@ static void enable_clock(struct sdhci_host *host)
 	}
 }
 
+static unsigned int get_f_max_clock(struct sdhci_host *host)
+{
+	struct sdhci_pxa *pxa = sdhci_priv(host);
+
+	return pxa->pdata->max_speed;
+}
+
 static struct sdhci_ops sdhci_pxa_ops = {
+	.get_f_max_clock = NULL,
 };
 
 /*****************************************************************************\
@@ -131,15 +139,17 @@ static int __devinit sdhci_pxa_probe(struct platform_device *pdev)
 	/* do not rely on u-boot to enable the clocks */
 	enable_clock(host);
 
+	if (pxa->pdata->max_speed)
+		sdhci_pxa_ops.get_f_max_clock = get_f_max_clock;
+	else
+		sdhci_pxa_ops.get_f_max_clock = NULL;
+
 	ret = sdhci_add_host(host);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to add host\n");
 		goto out;
 	}
 
-	if (pxa->pdata->max_speed)
-		host->mmc->f_max = pxa->pdata->max_speed;
-
 	platform_set_drvdata(pdev, host);
 
 	return 0;
-- 
1.6.0.4

Attachment: 0009-sdhci-add-platform-support-for-setting-f_max-clock.patch
Description: 0009-sdhci-add-platform-support-for-setting-f_max-clock.patch


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux