diff options
-rw-r--r-- | drivers/mmc/host/sdhci.c | 7 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci.h | 7 | ||||
-rw-r--r-- | include/linux/mmc/sdhci.h | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 760d54b53a20..24713706295c 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1528,6 +1528,12 @@ static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, if (host->version < SDHCI_SPEC_300) return 0; + if (host->quirks & SDHCI_QUIRK_NON_STD_VOLTAGE_SWITCHING) { + if (host->ops->switch_signal_voltage) + return host->ops->switch_signal_voltage( + host, ios->signal_voltage); + } + /* * We first check whether the request is to set signalling voltage * to 3.3V. If so, we change the voltage to 3.3V and return quickly. @@ -1570,7 +1576,6 @@ static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, /* Wait for 5ms */ usleep_range(5000, 5500); - ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); if (ctrl & SDHCI_CTRL_VDD_180) { /* Provide SDCLK again and wait for 1ms*/ diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 40619b777901..1c12419f9d64 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -273,9 +273,10 @@ struct sdhci_ops { void (*platform_reset_enter)(struct sdhci_host *host, u8 mask); void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); - - int (*suspend)(struct sdhci_host *host, pm_message_t state); - int (*resume)(struct sdhci_host *host); + int (*suspend)(struct sdhci_host *host, pm_message_t state); + int (*resume)(struct sdhci_host *host); + int (*switch_signal_voltage)(struct sdhci_host *host, + unsigned int signal_voltage); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 9d499a078bbc..0c7b5869813b 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -87,6 +87,8 @@ struct sdhci_host { #define SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC (1<<30) /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ #define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) +/* Controller cannot report the line status in present state register */ +#define SDHCI_QUIRK_NON_STD_VOLTAGE_SWITCHING (1UL<<32) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */ |