Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164733
b: refs/heads/master
c: 2bec089
h: refs/heads/master
i:
  164731: 887a957
v: v3
  • Loading branch information
Adrian Hunter authored and Linus Torvalds committed Sep 23, 2009
1 parent aaa2487 commit ce9442c
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 28 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: b62f622812c5aaacad217fd8f4445562b917df6d
refs/heads/master: 2bec08937e3cdf6828d29421c7f870dca84f3b02
60 changes: 33 additions & 27 deletions trunk/drivers/mmc/host/omap_hsmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct omap_hsmmc_host {
int use_dma, dma_ch;
int dma_line_tx, dma_line_rx;
int slot_id;
int dbclk_enabled;
int got_dbclk;
int response_busy;
int context_loss;
int dpm_state;
Expand Down Expand Up @@ -742,22 +742,24 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
/* Disable the clocks */
clk_disable(host->fclk);
clk_disable(host->iclk);
clk_disable(host->dbclk);
if (host->got_dbclk)
clk_disable(host->dbclk);

/* Turn the power off */
ret = mmc_slot(host).set_power(host->dev, host->slot_id, 0, 0);
if (ret != 0)
goto err;

/* Turn the power ON with given VDD 1.8 or 3.0v */
ret = mmc_slot(host).set_power(host->dev, host->slot_id, 1, vdd);
if (!ret)
ret = mmc_slot(host).set_power(host->dev, host->slot_id, 1,
vdd);
clk_enable(host->iclk);
clk_enable(host->fclk);
if (host->got_dbclk)
clk_enable(host->dbclk);

if (ret != 0)
goto err;

clk_enable(host->fclk);
clk_enable(host->iclk);
clk_enable(host->dbclk);

OMAP_HSMMC_WRITE(host->base, HCTL,
OMAP_HSMMC_READ(host->base, HCTL) & SDVSCLR);
reg_val = OMAP_HSMMC_READ(host->base, HCTL);
Expand Down Expand Up @@ -1695,18 +1697,22 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
goto err1;
}

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
if (clk_enable(host->dbclk) != 0)
dev_dbg(mmc_dev(host->mmc), "Enabling debounce"
" clk failed\n");
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->dbclk_enabled = 1;
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");
}

/* Since we do only SG emulation, we can have as many segs
* as we want. */
Expand Down Expand Up @@ -1820,7 +1826,7 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev)
clk_disable(host->iclk);
clk_put(host->fclk);
clk_put(host->iclk);
if (host->dbclk_enabled) {
if (host->got_dbclk) {
clk_disable(host->dbclk);
clk_put(host->dbclk);
}
Expand Down Expand Up @@ -1854,7 +1860,7 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
clk_disable(host->iclk);
clk_put(host->fclk);
clk_put(host->iclk);
if (host->dbclk_enabled) {
if (host->got_dbclk) {
clk_disable(host->dbclk);
clk_put(host->dbclk);
}
Expand Down Expand Up @@ -1905,7 +1911,8 @@ static int omap_hsmmc_suspend(struct platform_device *pdev, pm_message_t state)
OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
mmc_host_disable(host->mmc);
clk_disable(host->iclk);
clk_disable(host->dbclk);
if (host->got_dbclk)
clk_disable(host->dbclk);
} else {
host->suspended = 0;
if (host->pdata->resume) {
Expand Down Expand Up @@ -1936,15 +1943,14 @@ static int omap_hsmmc_resume(struct platform_device *pdev)
if (ret)
goto clk_en_err;

if (clk_enable(host->dbclk) != 0)
dev_dbg(mmc_dev(host->mmc),
"Enabling debounce clk failed\n");

if (mmc_host_enable(host->mmc) != 0) {
clk_disable(host->iclk);
goto clk_en_err;
}

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

omap_hsmmc_conf_bus_power(host);

if (host->pdata->resume) {
Expand Down

0 comments on commit ce9442c

Please sign in to comment.