Commit e8151555 authored by Haibo Chen's avatar Haibo Chen Committed by Ulf Hansson

mmc: sdio: fix clock rate setting for SDR12/SDR25 mode

In current code logic, when work in SDR12/SDR25 mode, the final clock
rate is incorrect, just the legancy 400KHz, because the
card->sw_caps.sd3_bus_mode do not has the flag SD_MODE_UHS_SDR12 or
SD_MODE_UHS_SDR25. Besides, SDIO_SPEED_SDR12 is actually value 0, and
every mode need to config the timing and clock rate, so remove the
‘if’ operator.
Signed-off-by: default avatarHaibo Chen <haibo.chen@nxp.com>
Tested-by: default avatarPali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/1592813959-5914-1-git-send-email-haibo.chen@nxp.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 61d9c4aa
...@@ -176,15 +176,18 @@ static int sdio_read_cccr(struct mmc_card *card, u32 ocr) ...@@ -176,15 +176,18 @@ static int sdio_read_cccr(struct mmc_card *card, u32 ocr)
if (mmc_host_uhs(card->host)) { if (mmc_host_uhs(card->host)) {
if (data & SDIO_UHS_DDR50) if (data & SDIO_UHS_DDR50)
card->sw_caps.sd3_bus_mode card->sw_caps.sd3_bus_mode
|= SD_MODE_UHS_DDR50; |= SD_MODE_UHS_DDR50 | SD_MODE_UHS_SDR50
| SD_MODE_UHS_SDR25 | SD_MODE_UHS_SDR12;
if (data & SDIO_UHS_SDR50) if (data & SDIO_UHS_SDR50)
card->sw_caps.sd3_bus_mode card->sw_caps.sd3_bus_mode
|= SD_MODE_UHS_SDR50; |= SD_MODE_UHS_SDR50 | SD_MODE_UHS_SDR25
| SD_MODE_UHS_SDR12;
if (data & SDIO_UHS_SDR104) if (data & SDIO_UHS_SDR104)
card->sw_caps.sd3_bus_mode card->sw_caps.sd3_bus_mode
|= SD_MODE_UHS_SDR104; |= SD_MODE_UHS_SDR104 | SD_MODE_UHS_SDR50
| SD_MODE_UHS_SDR25 | SD_MODE_UHS_SDR12;
} }
ret = mmc_io_rw_direct(card, 0, 0, ret = mmc_io_rw_direct(card, 0, 0,
...@@ -537,10 +540,8 @@ static int sdio_set_bus_speed_mode(struct mmc_card *card) ...@@ -537,10 +540,8 @@ static int sdio_set_bus_speed_mode(struct mmc_card *card)
max_rate = min_not_zero(card->quirk_max_rate, max_rate = min_not_zero(card->quirk_max_rate,
card->sw_caps.uhs_max_dtr); card->sw_caps.uhs_max_dtr);
if (bus_speed) {
mmc_set_timing(card->host, timing); mmc_set_timing(card->host, timing);
mmc_set_clock(card->host, max_rate); mmc_set_clock(card->host, max_rate);
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment