mmc: mmc: fix issue with clock scaling in HS200 mode

The scaling logic for HS400 is triggered when the card timing
mode is HS400 or when the clock rate is MMC_HS200_MAX_DTR. But
this is the same rate used in HS200 mode as well. Due to this,
in HS200 mode also, the card enters into the scaling logic meant
for HS400 which is not correct.

Correct this logic by checking the card timing in addition to the
clock rate in HS400 clock scaling logic.

Change-Id: If6261c0e42178d331184ac605c192d48a76e1e29
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
This commit is contained in:
Sahitya Tummala 2016-04-21 16:04:09 +05:30 committed by Kyle Yan
parent ecce69193d
commit b3ab0db2c7

View file

@ -1711,7 +1711,7 @@ static int mmc_change_bus_speed(struct mmc_host *host, unsigned long *freq)
* for other timings we can simply do clock frequency change * for other timings we can simply do clock frequency change
*/ */
if (mmc_card_hs400(card) || if (mmc_card_hs400(card) ||
(*freq == MMC_HS200_MAX_DTR)) { (!mmc_card_hs200(host->card) && *freq == MMC_HS200_MAX_DTR)) {
err = mmc_set_clock_bus_speed(card, *freq); err = mmc_set_clock_bus_speed(card, *freq);
if (err) { if (err) {
pr_err("%s: %s: failed (%d)to set bus and clock speed (freq=%lu)\n", pr_err("%s: %s: failed (%d)to set bus and clock speed (freq=%lu)\n",