Skip to content

Commit

Permalink
mmc: sdhci-sprd: Fix no reset data and command after voltage switch
Browse files Browse the repository at this point in the history
commit dd30dcf upstream.

After switching the voltage, no reset data and command will cause
CMD2 timeout.

Fixes: 29ca763 ("mmc: sdhci-sprd: Add pin control support for voltage switch")
Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221130121328.25553-1-wenchao.chen@unisoc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Wenchao Chen authored and gregkh committed Dec 8, 2022
1 parent e915679 commit ab5cdcc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/mmc/host/sdhci-sprd.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
}

if (IS_ERR(sprd_host->pinctrl))
return 0;
goto reset;

switch (ios->signal_voltage) {
case MMC_SIGNAL_VOLTAGE_180:
Expand Down Expand Up @@ -498,6 +498,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)

/* Wait for 300 ~ 500 us for pin state stable */
usleep_range(300, 500);

reset:
sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);

return 0;
Expand Down

0 comments on commit ab5cdcc

Please sign in to comment.