Skip to content

Commit 6ae0336

Browse files
ahunter6storulf
authored andcommitted
mmc: sdhci-pci: Fix voltage switch for some Intel host controllers
Some Intel host controllers (e.g. CNP) use an ACPI device-specific method to ensure correct voltage switching. Fix voltage switch for those, by adding a call to the DSM. Signed-off-by: Adrian Hunter <[email protected]> Cc: [email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent e87be9b commit 6ae0336

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/mmc/host/sdhci-pci-core.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ static const struct sdhci_pci_fixes sdhci_intel_pch_sdio = {
392392

393393
enum {
394394
INTEL_DSM_FNS = 0,
395+
INTEL_DSM_V18_SWITCH = 3,
395396
INTEL_DSM_DRV_STRENGTH = 9,
396397
INTEL_DSM_D3_RETUNE = 10,
397398
};
@@ -557,6 +558,19 @@ static void intel_hs400_enhanced_strobe(struct mmc_host *mmc,
557558
sdhci_writel(host, val, INTEL_HS400_ES_REG);
558559
}
559560

561+
static void sdhci_intel_voltage_switch(struct sdhci_host *host)
562+
{
563+
struct sdhci_pci_slot *slot = sdhci_priv(host);
564+
struct intel_host *intel_host = sdhci_pci_priv(slot);
565+
struct device *dev = &slot->chip->pdev->dev;
566+
u32 result = 0;
567+
int err;
568+
569+
err = intel_dsm(intel_host, dev, INTEL_DSM_V18_SWITCH, &result);
570+
pr_debug("%s: %s DSM error %d result %u\n",
571+
mmc_hostname(host->mmc), __func__, err, result);
572+
}
573+
560574
static const struct sdhci_ops sdhci_intel_byt_ops = {
561575
.set_clock = sdhci_set_clock,
562576
.set_power = sdhci_intel_set_power,
@@ -565,6 +579,7 @@ static const struct sdhci_ops sdhci_intel_byt_ops = {
565579
.reset = sdhci_reset,
566580
.set_uhs_signaling = sdhci_set_uhs_signaling,
567581
.hw_reset = sdhci_pci_hw_reset,
582+
.voltage_switch = sdhci_intel_voltage_switch,
568583
};
569584

570585
static void byt_read_dsm(struct sdhci_pci_slot *slot)

0 commit comments

Comments
 (0)