Hi, On lun., août 28 2017, Adrian Hunter <adrian.hunter@xxxxxxxxx> wrote: > On 21/08/17 21:02, Zhoujie Wu wrote: >> Xenon sdh controller requests proper SD bus voltage select >> bits programmed even with vmmc power supply. Any reserved >> value(100b-000b) programmed in this field will lead to controller >> ignore SD bus power bit and keep its value at zero. >> Add set_power callback to handle this. >> >> Signed-off-by: Zhoujie Wu <zjwu@xxxxxxxxxxx> > > Acked-by: Adrian Hunter <adrian.hunter@xxxxxxxxx> I tested this patch on the Armada 3720 DB board. And thanks to this patch and by adding a vmmc regulator in the device tree I did not have anymore the issue UHS card not detected on warm reset. Tested-by: Gregory CLEMENT <gregory.clement@xxxxxxxxxxxxxxxxxx> Actually for me this should be a fix. Indeed if I try to use a vmmc regulator without this patch then the SD card does not work at all I only have the following messages: "mmc1: Timeout waiting for hardware cmd interrupt." Thanks, Gregory > >> --- >> Updated according to Jisheng Zhang's comment. >> drivers/mmc/host/sdhci-xenon.c | 19 +++++++++++++++++++ >> 1 file changed, 19 insertions(+) >> >> diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c >> index edd4d915..a4be2fd 100644 >> --- a/drivers/mmc/host/sdhci-xenon.c >> +++ b/drivers/mmc/host/sdhci-xenon.c >> @@ -210,8 +210,27 @@ static void xenon_set_uhs_signaling(struct sdhci_host *host, >> sdhci_writew(host, ctrl_2, SDHCI_HOST_CONTROL2); >> } >> >> +static void xenon_set_power(struct sdhci_host *host, unsigned char mode, >> + unsigned short vdd) >> +{ >> + struct mmc_host *mmc = host->mmc; >> + u8 pwr = host->pwr; >> + >> + sdhci_set_power_noreg(host, mode, vdd); >> + >> + if (host->pwr == pwr) >> + return; >> + >> + if (host->pwr == 0) >> + vdd = 0; >> + >> + if (!IS_ERR(mmc->supply.vmmc)) >> + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); >> +} >> + >> static const struct sdhci_ops sdhci_xenon_ops = { >> .set_clock = sdhci_set_clock, >> + .set_power = xenon_set_power, >> .set_bus_width = sdhci_set_bus_width, >> .reset = xenon_reset, >> .set_uhs_signaling = xenon_set_uhs_signaling, >> > -- Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html