summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Karlman <[email protected]>2026-07-09 23:02:41 +0000
committerPeng Fan <[email protected]>2026-07-12 16:18:32 +0800
commit9118fc77f088aa21bbdeb03344f0a576a0a835d2 (patch)
tree4b57b22fe2a54b0b10e0510fd0a82fffb5051a4b
parent10acd5bc9a6c453b86486156e76f1fbbe116e285 (diff)
mmc: dw_mmc: Allow use of in-spec voltage range for vqmmc-supply
The Rockchip RK3399 SoC SDMMC IO domain supports 1.8V and 3.0V mode, and the 3.0V mode is within SD Standards allowed 2.7V-3.6V range. However, the commit 0b75109b6aaf ("mmc: dw_mmc: return error for invalid voltage setting") help enforce strict 1.8V and 3.3V when setting vqmmc-supply making mmc_set_signal_voltage() now fail for MMC_SIGNAL_VOLTAGE_330 and leading to an improper switch to MMC_SIGNAL_VOLTAGE_180. Use regulator_set_value_clamp() to set an SD Standards voltage range, 1.70V-1.95V and 2.7V-3.6V, I/O voltage instead of requiring an exact regulator value to closer match Linux and to fix use of 3.3V signal voltage on Rockchip RK3399 boards using MMC_IO_VOLTAGE=y. Fixes: 0b75109b6aaf ("mmc: dw_mmc: return error for invalid voltage setting") Signed-off-by: Jonas Karlman <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
-rw-r--r--drivers/mmc/dw_mmc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index d9c05b223d5..c2424d7875c 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -645,9 +645,11 @@ static int dwmci_set_ios(struct mmc *mmc)
int ret;
if (mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
- ret = regulator_set_value(mmc->vqmmc_supply, 1800000);
+ ret = regulator_set_value_clamp(mmc->vqmmc_supply,
+ 1700000, 1800000, 1950000);
else
- ret = regulator_set_value(mmc->vqmmc_supply, 3300000);
+ ret = regulator_set_value_clamp(mmc->vqmmc_supply,
+ 2700000, 3300000, 3600000);
if (ret && ret != -ENOSYS)
return ret;
}