diff options
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc.h | 1 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-of-esdhc.c | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h index 34b64f4..0f49164 100644 --- a/drivers/mmc/host/sdhci-esdhc.h +++ b/drivers/mmc/host/sdhci-esdhc.h @@ -42,6 +42,7 @@ #define ESDHC_DMA_SNOOP 0x00000040 #define ESDHC_HOST_CONTROL_RES 0x01 +#define ESDHC_VOL_SEL 0x04 static inline void esdhc_set_clock(struct sdhci_host *host, unsigned int clock) { diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index 60331ce..eb3301b 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -140,6 +140,23 @@ static void esdhc_writeb(struct sdhci_host *host, u8 val, int reg) (val & SDHCI_RESET_ALL)) val = SDHCI_RESET_CMD | SDHCI_RESET_DATA; + if (reg == SDHCI_POWER_CONTROL) { + /* eSDHC don't support gate off power */ + if (!host->pwr || !val) + return; + + if (fsl_svr_is(SVR_T4240)) { + u8 vol; + + vol = sdhci_be32bs_readb(host, reg); + if (host->pwr == SDHCI_POWER_180) + vol &= ~ESDHC_VOL_SEL; + else + vol |= ESDHC_VOL_SEL; + } else + return; + } + sdhci_be32bs_writeb(host, val, reg); } |