Commit da764f97 authored by Viresh Kumar's avatar Viresh Kumar Committed by Chris Ball

mmc: sdhci-spear: Add clk_{un}prepare() support

clk_{un}prepare is mandatory for platforms using common clock framework.
Since this driver is used by SPEAr platform, which supports common clock
framework, add clk_{un}prepare() support for it.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 067bf748
...@@ -9,13 +9,10 @@ Required properties: ...@@ -9,13 +9,10 @@ Required properties:
Optional properties: Optional properties:
- cd-gpios: card detect gpio, with zero flags. - cd-gpios: card detect gpio, with zero flags.
If your board don't support these gpios then don't pass the entry.
Example: Example:
sdhci@fc000000 { sdhci@fc000000 {
compatible = "st,spear300-sdhci"; compatible = "st,spear300-sdhci";
reg = <0xfc000000 0x1000>; reg = <0xfc000000 0x1000>;
cd-gpios = <&gpio0 6 0>;
cd-gpios = <&gpio0 6 0>
}; };
...@@ -140,7 +140,7 @@ static int __devinit sdhci_probe(struct platform_device *pdev) ...@@ -140,7 +140,7 @@ static int __devinit sdhci_probe(struct platform_device *pdev)
goto err; goto err;
} }
ret = clk_enable(sdhci->clk); ret = clk_prepare_enable(sdhci->clk);
if (ret) { if (ret) {
dev_dbg(&pdev->dev, "Error enabling clock\n"); dev_dbg(&pdev->dev, "Error enabling clock\n");
goto put_clk; goto put_clk;
...@@ -260,7 +260,7 @@ static int __devinit sdhci_probe(struct platform_device *pdev) ...@@ -260,7 +260,7 @@ static int __devinit sdhci_probe(struct platform_device *pdev)
free_host: free_host:
sdhci_free_host(host); sdhci_free_host(host);
disable_clk: disable_clk:
clk_disable(sdhci->clk); clk_disable_unprepare(sdhci->clk);
put_clk: put_clk:
clk_put(sdhci->clk); clk_put(sdhci->clk);
err: err:
...@@ -282,7 +282,7 @@ static int __devexit sdhci_remove(struct platform_device *pdev) ...@@ -282,7 +282,7 @@ static int __devexit sdhci_remove(struct platform_device *pdev)
sdhci_remove_host(host, dead); sdhci_remove_host(host, dead);
sdhci_free_host(host); sdhci_free_host(host);
clk_disable(sdhci->clk); clk_disable_unprepare(sdhci->clk);
clk_put(sdhci->clk); clk_put(sdhci->clk);
return 0; return 0;
...@@ -297,7 +297,7 @@ static int sdhci_suspend(struct device *dev) ...@@ -297,7 +297,7 @@ static int sdhci_suspend(struct device *dev)
ret = sdhci_suspend_host(host); ret = sdhci_suspend_host(host);
if (!ret) if (!ret)
clk_disable(sdhci->clk); clk_disable_unprepare(sdhci->clk);
return ret; return ret;
} }
...@@ -308,7 +308,7 @@ static int sdhci_resume(struct device *dev) ...@@ -308,7 +308,7 @@ static int sdhci_resume(struct device *dev)
struct spear_sdhci *sdhci = dev_get_platdata(dev); struct spear_sdhci *sdhci = dev_get_platdata(dev);
int ret; int ret;
ret = clk_enable(sdhci->clk); ret = clk_prepare_enable(sdhci->clk);
if (ret) { if (ret) {
dev_dbg(dev, "Resume: Error enabling clock\n"); dev_dbg(dev, "Resume: Error enabling clock\n");
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment