Skip to content

Commit

Permalink
mmc: msm_sdcc: Enable SDC host->clk only after setting the rate.
Browse files Browse the repository at this point in the history
For clocks that support rates which can be set (most clocks other
than _pclk AHB clocks), a rate must be set using clk_set_rate()
before the clock is enabled for the first time with clk_enable().
Subsequent calls to clk_enable() need not be preceded with the
clk_set_rate() calls unless we wish to change the clock rate that
is set previously.

SDC host->clk is currently enabled without setting the clock rate
even once. This patch fixes this, by ensuring that the clock rate
for this clock is first set before enabling the clock.

Signed-off-by: Murali Palnati <palnatim@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Sahitya Tummala authored and Chris Ball committed Oct 26, 2011
1 parent dce7c75 commit 514d9ed
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/mmc/host/msm_sdcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,17 +1247,17 @@ msmsdcc_probe(struct platform_device *pdev)
goto pclk_put;
}

/* Enable clocks */
ret = msmsdcc_enable_clocks(host);
if (ret)
goto clk_put;

ret = clk_set_rate(host->clk, msmsdcc_fmin);
if (ret) {
pr_err("%s: Clock rate set failed (%d)\n", __func__, ret);
goto clk_disable;
goto clk_put;
}

/* Enable clocks */
ret = msmsdcc_enable_clocks(host);
if (ret)
goto clk_put;

host->pclk_rate = clk_get_rate(host->pclk);
host->clk_rate = clk_get_rate(host->clk);

Expand Down

0 comments on commit 514d9ed

Please sign in to comment.