[PATCH 5/5] mmc:esdhc: Avoid writting to power register

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



eSDHC host don't have a standand power control register.
Also eSDHC host which support spec 1.0 and spec 2.0 don't
support voltage switch. So add this change avoid writing other
bit of this register by mistake.

Signed-off-by: Haijun Zhang <haijun.zhang@xxxxxxxxxxxxx>
---
 drivers/mmc/host/sdhci-of-esdhc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index f5de1e5..bc7de5e 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -141,6 +141,11 @@ static void esdhc_writeb(struct sdhci_host *host, u8 val, int reg)
 	/* Prevent SDHCI core from writing reserved bits (e.g. HISPD). */
 	if (reg == SDHCI_HOST_CONTROL)
 		val &= ~ESDHC_HOST_CONTROL_RES;
+
+	/* ESDHC host spec version 1.0 and 2.0 don't support voltage switch */
+	if ((reg == SDHCI_POWER_CONTROL) && (host->version < SDHCI_SPEC_300))
+		return;
+
 	sdhci_be32bs_writeb(host, val, reg);
 }
 
-- 
1.8.0


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux