Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332851
b: refs/heads/master
c: 2abeb5c
h: refs/heads/master
i:
  332849: ce527b7
  332847: 5085fad
v: v3
  • Loading branch information
Chander Kashyap authored and Chris Ball committed Oct 7, 2012
1 parent af3930d commit 5eb96be
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9cde5b7a49a88939d648c361ec938fa8a633a045
refs/heads/master: 2abeb5c5ded2e7f7d288058426fb0ae852adc77f
29 changes: 27 additions & 2 deletions trunk/drivers/mmc/host/sdhci-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,9 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
goto err_no_busclks;
}

#ifndef CONFIG_PM_RUNTIME
clk_enable(sc->clk_bus[sc->cur_clk]);
#endif

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
host->ioaddr = devm_request_and_ioremap(&pdev->dev, res);
Expand Down Expand Up @@ -744,10 +746,15 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
gpio_is_valid(pdata->ext_cd_gpio))
sdhci_s3c_setup_card_detect_gpio(sc);

#ifdef CONFIG_PM_RUNTIME
clk_disable(sc->clk_io);
#endif
return 0;

err_req_regs:
#ifndef CONFIG_PM_RUNTIME
clk_disable(sc->clk_bus[sc->cur_clk]);
#endif
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
if (sc->clk_bus[ptr]) {
clk_put(sc->clk_bus[ptr]);
Expand Down Expand Up @@ -786,12 +793,17 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
if (gpio_is_valid(sc->ext_cd_gpio))
gpio_free(sc->ext_cd_gpio);

#ifdef CONFIG_PM_RUNTIME
clk_enable(sc->clk_io);
#endif
sdhci_remove_host(host, 1);

pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_disable(&pdev->dev);

#ifndef CONFIG_PM_RUNTIME
clk_disable(sc->clk_bus[sc->cur_clk]);
#endif
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
if (sc->clk_bus[ptr]) {
clk_put(sc->clk_bus[ptr]);
Expand Down Expand Up @@ -831,15 +843,28 @@ static int sdhci_s3c_resume(struct device *dev)
static int sdhci_s3c_runtime_suspend(struct device *dev)
{
struct sdhci_host *host = dev_get_drvdata(dev);
struct sdhci_s3c *ourhost = to_s3c(host);
struct clk *busclk = ourhost->clk_io;
int ret;

ret = sdhci_runtime_suspend_host(host);

return sdhci_runtime_suspend_host(host);
clk_disable(ourhost->clk_bus[ourhost->cur_clk]);
clk_disable(busclk);
return ret;
}

static int sdhci_s3c_runtime_resume(struct device *dev)
{
struct sdhci_host *host = dev_get_drvdata(dev);
struct sdhci_s3c *ourhost = to_s3c(host);
struct clk *busclk = ourhost->clk_io;
int ret;

return sdhci_runtime_resume_host(host);
clk_enable(busclk);
clk_enable(ourhost->clk_bus[ourhost->cur_clk]);
ret = sdhci_runtime_resume_host(host);
return ret;
}
#endif

Expand Down

0 comments on commit 5eb96be

Please sign in to comment.