summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci.h
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2022-11-28 14:32:56 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2022-11-29 13:42:42 +0100
commitc981cdfb9925f64a364f13c2b4f98f877308a408 (patch)
tree6a40d833d1581fca8725b5e840ecd5f72b3dba7c /drivers/mmc/host/sdhci.h
parentmmc: mtk-sd: Fix missing clk_disable_unprepare in msdc_of_clock_parse() (diff)
downloadlinux-c981cdfb9925f64a364f13c2b4f98f877308a408.tar.xz
linux-c981cdfb9925f64a364f13c2b4f98f877308a408.zip
mmc: sdhci: Fix voltage switch delay
Commit 20b92a30b561 ("mmc: sdhci: update signal voltage switch code") removed voltage switch delays from sdhci because mmc core had been enhanced to support them. However that assumed that sdhci_set_ios() did a single clock change, which it did not, and so the delays in mmc core, which should have come after the first clock change, were not effective. Fix by avoiding re-configuring UHS and preset settings when the clock is turning on and the settings have not changed. That then also avoids the associated clock changes, so that then sdhci_set_ios() does a single clock change when voltage switching, and the mmc core delays become effective. To do that has meant keeping track of driver strength (host->drv_type), and cases of reinitialization (host->reinit_uhs). Note also, the 'turning_on_clk' restriction should not be necessary but is done to minimize the impact of the change on stable kernels. Fixes: 20b92a30b561 ("mmc: sdhci: update signal voltage switch code") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20221128133259.38305-2-adrian.hunter@intel.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci.h')
-rw-r--r--drivers/mmc/host/sdhci.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index d750c464bd1e..87a3aaa07438 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -524,6 +524,8 @@ struct sdhci_host {
unsigned int clock; /* Current clock (MHz) */
u8 pwr; /* Current voltage */
+ u8 drv_type; /* Current UHS-I driver type */
+ bool reinit_uhs; /* Force UHS-related re-initialization */
bool runtime_suspended; /* Host is runtime suspended */
bool bus_on; /* Bus power prevents runtime suspend */