Commit 0f310a05 authored by Thomas Abraham's avatar Thomas Abraham Committed by Chris Ball

mmc: sdhci-s3c: use clk_prepare_enable and clk_disable_unprepare

Convert clk_enable/clk_disable to clk_prepare_enable/clk_disable_unprepare
calls as required by common clock framework.
Signed-off-by: default avatarThomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent 8e2b36ea
...@@ -211,8 +211,8 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock) ...@@ -211,8 +211,8 @@ static void sdhci_s3c_set_clock(struct sdhci_host *host, unsigned int clock)
if (ourhost->cur_clk != best_src) { if (ourhost->cur_clk != best_src) {
struct clk *clk = ourhost->clk_bus[best_src]; struct clk *clk = ourhost->clk_bus[best_src];
clk_enable(clk); clk_prepare_enable(clk);
clk_disable(ourhost->clk_bus[ourhost->cur_clk]); clk_disable_unprepare(ourhost->clk_bus[ourhost->cur_clk]);
/* turn clock off to card before changing clock source */ /* turn clock off to card before changing clock source */
writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL); writew(0, host->ioaddr + SDHCI_CLOCK_CONTROL);
...@@ -607,7 +607,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) ...@@ -607,7 +607,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
} }
/* enable the local io clock and keep it running for the moment. */ /* enable the local io clock and keep it running for the moment. */
clk_enable(sc->clk_io); clk_prepare_enable(sc->clk_io);
for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) { for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
struct clk *clk; struct clk *clk;
...@@ -638,7 +638,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) ...@@ -638,7 +638,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
} }
#ifndef CONFIG_PM_RUNTIME #ifndef CONFIG_PM_RUNTIME
clk_enable(sc->clk_bus[sc->cur_clk]); clk_prepare_enable(sc->clk_bus[sc->cur_clk]);
#endif #endif
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
...@@ -747,13 +747,13 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) ...@@ -747,13 +747,13 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
sdhci_s3c_setup_card_detect_gpio(sc); sdhci_s3c_setup_card_detect_gpio(sc);
#ifdef CONFIG_PM_RUNTIME #ifdef CONFIG_PM_RUNTIME
clk_disable(sc->clk_io); clk_disable_unprepare(sc->clk_io);
#endif #endif
return 0; return 0;
err_req_regs: err_req_regs:
#ifndef CONFIG_PM_RUNTIME #ifndef CONFIG_PM_RUNTIME
clk_disable(sc->clk_bus[sc->cur_clk]); clk_disable_unprepare(sc->clk_bus[sc->cur_clk]);
#endif #endif
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) { for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
if (sc->clk_bus[ptr]) { if (sc->clk_bus[ptr]) {
...@@ -762,7 +762,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) ...@@ -762,7 +762,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
} }
err_no_busclks: err_no_busclks:
clk_disable(sc->clk_io); clk_disable_unprepare(sc->clk_io);
clk_put(sc->clk_io); clk_put(sc->clk_io);
err_io_clk: err_io_clk:
...@@ -794,7 +794,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) ...@@ -794,7 +794,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
gpio_free(sc->ext_cd_gpio); gpio_free(sc->ext_cd_gpio);
#ifdef CONFIG_PM_RUNTIME #ifdef CONFIG_PM_RUNTIME
clk_enable(sc->clk_io); clk_prepare_enable(sc->clk_io);
#endif #endif
sdhci_remove_host(host, 1); sdhci_remove_host(host, 1);
...@@ -802,14 +802,14 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) ...@@ -802,14 +802,14 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
#ifndef CONFIG_PM_RUNTIME #ifndef CONFIG_PM_RUNTIME
clk_disable(sc->clk_bus[sc->cur_clk]); clk_disable_unprepare(sc->clk_bus[sc->cur_clk]);
#endif #endif
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) { for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
if (sc->clk_bus[ptr]) { if (sc->clk_bus[ptr]) {
clk_put(sc->clk_bus[ptr]); clk_put(sc->clk_bus[ptr]);
} }
} }
clk_disable(sc->clk_io); clk_disable_unprepare(sc->clk_io);
clk_put(sc->clk_io); clk_put(sc->clk_io);
if (pdev->dev.of_node) { if (pdev->dev.of_node) {
...@@ -849,8 +849,8 @@ static int sdhci_s3c_runtime_suspend(struct device *dev) ...@@ -849,8 +849,8 @@ static int sdhci_s3c_runtime_suspend(struct device *dev)
ret = sdhci_runtime_suspend_host(host); ret = sdhci_runtime_suspend_host(host);
clk_disable(ourhost->clk_bus[ourhost->cur_clk]); clk_disable_unprepare(ourhost->clk_bus[ourhost->cur_clk]);
clk_disable(busclk); clk_disable_unprepare(busclk);
return ret; return ret;
} }
...@@ -861,8 +861,8 @@ static int sdhci_s3c_runtime_resume(struct device *dev) ...@@ -861,8 +861,8 @@ static int sdhci_s3c_runtime_resume(struct device *dev)
struct clk *busclk = ourhost->clk_io; struct clk *busclk = ourhost->clk_io;
int ret; int ret;
clk_enable(busclk); clk_prepare_enable(busclk);
clk_enable(ourhost->clk_bus[ourhost->cur_clk]); clk_prepare_enable(ourhost->clk_bus[ourhost->cur_clk]);
ret = sdhci_runtime_resume_host(host); ret = sdhci_runtime_resume_host(host);
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