mmc: msm_sdcc: minimum card clock selection
If card clock rate passed by set_ios() is less than
minimum clock rate supported by the host controller,
set the clock rate to minimum clock rate supported by host.
Change-Id: I22f2a7413dfdb8c9a5188992aed99726c3c3d7a7
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index f20ae4b..2a2290b 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -2228,6 +2228,11 @@
{
unsigned int sel_clk = -1;
+ if (req_clk < msmsdcc_get_min_sup_clk_rate(host)) {
+ sel_clk = msmsdcc_get_min_sup_clk_rate(host);
+ goto out;
+ }
+
if (host->plat->sup_clk_table && host->plat->sup_clk_cnt) {
unsigned char cnt;
@@ -2248,6 +2253,7 @@
sel_clk = req_clk;
}
+out:
return sel_clk;
}