Skip to contentSkip to conversation

s3c6410: sdhci: Set parent clock, source clock and sdhci module speed.

PATCH New thomas.ab at samsung.com 2 participants 2 messages Sep 8, 2009 – Sep 16, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 3/8 s3c6410: sdhci: Set parent clock, source clock and sdhci module speed.

From: Thomas Abraham <[email protected]>

This patch sets the parent clock, source clock and sdhci module clock speed for 6410 sdhci controller.

---
 drivers/mmc/host/sdhci-s3c.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-s3c.c +13 -0
index 50997d2..db1bb93 100644
@@ -22,6 +22,8 @@
 
 #include <plat/sdhci.h>
 #include <plat/regs-sdhci.h>
+#include <plat/clock.h>
+#include <plat/cpu.h>
 
 #include "sdhci.h"
 
@@ -221,6 +223,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 	struct sdhci_host *host;
 	struct sdhci_s3c *sc;
 	struct resource *res;
+	struct clk *clk_mmc, *clk_parent;
 	int ret, irq, ptr, clks;
 
 	if (!pdata) {
@@ -240,6 +243,16 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 		return -ENOENT;
 	}
 
+	/* Set the SDHCI controller clock rate */
+	clk_mmc = clk_get(dev, pdata->clk_source_name);
+	clk_parent = clk_get(dev, pdata->clk_parent_name);
+        if (!clk_mmc || !clk_parent) {
+                dev_err(dev, "could not obtain clock information");
+                return -ENXIO;
+        }
+	clk_set_parent(clk_mmc, clk_parent);
+	clk_set_rate(clk_mmc, pdata->clk_speed);
+
 	host = sdhci_alloc_host(dev, sizeof(struct sdhci_s3c));
 	if (IS_ERR(host)) {
 		dev_err(dev, "sdhci_alloc_host() failed\n");
Signature · 1 line
1.5.3.4
maintainer
#1 lore raw

PATCH 3/8 s3c6410: sdhci: Set parent clock, source clock and sdhci module speed.

Quoted 4 lines · On Tue, Sep 08, 2009 at 03:51:26PM +0900, [email protected] wrote:

From: Thomas Abraham <[email protected]>

This patch sets the parent clock, source clock and sdhci module clock speed for 6410 sdhci controller.

The driver should really be presented with a correct list of sources for mmc_bus in the platform data (ok, the last post was incorrect as I forgot the mux on mmc_bus as well as the mux in the driver block).

Any static setup of mmc_bus can be done in the machine setup code, otherwise please look at how the choices for the SDHCI mux is presented.

Quoted 51 lines
---
 drivers/mmc/host/sdhci-s3c.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci-s3c.c +13 -0
index 50997d2..db1bb93 100644
@@ -22,6 +22,8 @@
 
 #include <plat/sdhci.h>
 #include <plat/regs-sdhci.h>
+#include <plat/clock.h>
+#include <plat/cpu.h>
 
 #include "sdhci.h"
 
@@ -221,6 +223,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 	struct sdhci_host *host;
 	struct sdhci_s3c *sc;
 	struct resource *res;
+	struct clk *clk_mmc, *clk_parent;
 	int ret, irq, ptr, clks;
 
 	if (!pdata) {
@@ -240,6 +243,16 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 		return -ENOENT;
 	}
 
+	/* Set the SDHCI controller clock rate */
+	clk_mmc = clk_get(dev, pdata->clk_source_name);
+	clk_parent = clk_get(dev, pdata->clk_parent_name);
+        if (!clk_mmc || !clk_parent) {
+                dev_err(dev, "could not obtain clock information");
+                return -ENXIO;
+        }
+	clk_set_parent(clk_mmc, clk_parent);
+	clk_set_rate(clk_mmc, pdata->clk_speed);
+
 	host = sdhci_alloc_host(dev, sizeof(struct sdhci_s3c));
 	if (IS_ERR(host)) {
 		dev_err(dev, "sdhci_alloc_host() failed\n");
Signature · 7 lines
1.5.3.4


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.