@@ -1206,10 +1206,13 @@ static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
} else {
if (host->version >= SDHCI_SPEC_300)
ctrl &= ~SDHCI_CTRL_8BITBUS;
- if (ios->bus_width == MMC_BUS_WIDTH_4)
+ if (ios->bus_width == MMC_BUS_WIDTH_4) {
ctrl |= SDHCI_CTRL_4BITBUS;
- else
+ host->flags |= SDHCI_IN_4BIT_MODE;
+ } else {
ctrl &= ~SDHCI_CTRL_4BITBUS;
+ host->flags &= ~SDHCI_IN_4BIT_MODE;
+ }
}
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
}
@@ -109,6 +109,7 @@ struct sdhci_host {
#define SDHCI_USE_ADMA (1<<1) /* Host is ADMA capable */
#define SDHCI_REQ_USE_DMA (1<<2) /* Use DMA for this req. */
#define SDHCI_DEVICE_DEAD (1<<3) /* Device unresponsive */
+#define SDHCI_IN_4BIT_MODE (1<<4) /* bus is in 4-bit mode */
unsigned int version; /* SDHCI spec. version */