Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307939
b: refs/heads/master
c: cd03d9a
h: refs/heads/master
i:
  307937: c282992
  307935: e2949cd
v: v3
  • Loading branch information
Rajendra Nayak authored and Chris Ball committed Apr 22, 2012
1 parent 40a22fe commit 012ca5e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 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: 31463b141587001781d86b2ef360544f101bd998
refs/heads/master: cd03d9a85802c0023e522c21a1dabaf3e5785010
39 changes: 17 additions & 22 deletions trunk/drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ struct omap_hsmmc_host {
int use_dma, dma_ch;
int dma_line_tx, dma_line_rx;
int slot_id;
int got_dbclk;
int response_busy;
int context_loss;
int vdd;
Expand Down Expand Up @@ -1097,7 +1096,7 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)

/* Disable the clocks */
pm_runtime_put_sync(host->dev);
if (host->got_dbclk)
if (host->dbclk)
clk_disable(host->dbclk);

/* Turn the power off */
Expand All @@ -1108,7 +1107,7 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
ret = mmc_slot(host).set_power(host->dev, host->slot_id, 1,
vdd);
pm_runtime_get_sync(host->dev);
if (host->got_dbclk)
if (host->dbclk)
clk_enable(host->dbclk);

if (ret != 0)
Expand Down Expand Up @@ -1902,21 +1901,17 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)

omap_hsmmc_context_save(host);

if (cpu_is_omap2430()) {
host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
/*
* MMC can still work without debounce clock.
*/
if (IS_ERR(host->dbclk))
dev_warn(mmc_dev(host->mmc),
"Failed to get debounce clock\n");
else
host->got_dbclk = 1;

if (host->got_dbclk)
if (clk_enable(host->dbclk) != 0)
dev_dbg(mmc_dev(host->mmc), "Enabling debounce"
" clk failed\n");
host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
/*
* MMC can still work without debounce clock.
*/
if (IS_ERR(host->dbclk)) {
dev_warn(mmc_dev(host->mmc), "Failed to get debounce clk\n");
host->dbclk = NULL;
} else if (clk_enable(host->dbclk) != 0) {
dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n");
clk_put(host->dbclk);
host->dbclk = NULL;
}

/* Since we do only SG emulation, we can have as many segs
Expand Down Expand Up @@ -2036,7 +2031,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
pm_runtime_put_sync(host->dev);
pm_runtime_disable(host->dev);
clk_put(host->fclk);
if (host->got_dbclk) {
if (host->dbclk) {
clk_disable(host->dbclk);
clk_put(host->dbclk);
}
Expand Down Expand Up @@ -2069,7 +2064,7 @@ static int __devexit omap_hsmmc_remove(struct platform_device *pdev)
pm_runtime_put_sync(host->dev);
pm_runtime_disable(host->dev);
clk_put(host->fclk);
if (host->got_dbclk) {
if (host->dbclk) {
clk_disable(host->dbclk);
clk_put(host->dbclk);
}
Expand Down Expand Up @@ -2127,7 +2122,7 @@ static int omap_hsmmc_suspend(struct device *dev)
OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
}

if (host->got_dbclk)
if (host->dbclk)
clk_disable(host->dbclk);
err:
pm_runtime_put_sync(host->dev);
Expand All @@ -2148,7 +2143,7 @@ static int omap_hsmmc_resume(struct device *dev)

pm_runtime_get_sync(host->dev);

if (host->got_dbclk)
if (host->dbclk)
clk_enable(host->dbclk);

if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER))
Expand Down

0 comments on commit 012ca5e

Please sign in to comment.