Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mmc: sdhci: Disable SD card clock before changing parameters

Per the SD Host Controller Simplified Specification v4.20 §3.2.3, change
the SD card clock parameters only after first disabling the external card
clock. Doing this fixes a spurious clock pulse on Baytrail and Apollo Lake
SD controllers which otherwise breaks voltage switching with a specific
Swissbit SD card.

Signed-off-by: Kyle Roeschley <kyle.roeschley@ni.com>
Signed-off-by: Brad Mouring <brad.mouring@ni.com>
Signed-off-by: Erick Shepherd <erick.shepherd@ni.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20250211214645.469279-1-erick.shepherd@ni.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Erick Shepherd and committed by
Ulf Hansson
fb3bbc46 4e35c611

+7 -2
+7 -2
drivers/mmc/host/sdhci.c
··· 2065 2065 2066 2066 host->mmc->actual_clock = 0; 2067 2067 2068 - sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); 2068 + clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); 2069 + if (clk & SDHCI_CLOCK_CARD_EN) 2070 + sdhci_writew(host, clk & ~SDHCI_CLOCK_CARD_EN, 2071 + SDHCI_CLOCK_CONTROL); 2069 2072 2070 - if (clock == 0) 2073 + if (clock == 0) { 2074 + sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); 2071 2075 return; 2076 + } 2072 2077 2073 2078 clk = sdhci_calc_clk(host, clock, &host->mmc->actual_clock); 2074 2079 sdhci_enable_clk(host, clk);