Skip to contentSkip to conversation

mmc: sdhci: Fix setting wrong buswidth

PATCH New Sascha Hauer 1 participant 1 message Jan 26, 2022 Arm/Microchip (AT91) SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci: Fix setting wrong buswidth

a0e22fc7bc accidently replaced SDHCI_DATA_WIDTH_4BIT with SDHCI_CTRL_8BITBUS. Replace with SDHCI_CTRL_4BITBUS.

Fixes a0e22fc7bc ("mci: sdhci: Use Linux defines for SDHCI_HOST_CONTROL register")
---
 drivers/mci/atmel-sdhci-common.c | 4 ++--
 drivers/mci/dove-sdhci.c         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/mci/atmel-sdhci-common.c +2 -2
index eff2a993db..129480aa55 100644
@@ -302,11 +302,11 @@ static int at91_sdhci_set_bus_width(struct at91_sdhci *host, unsigned bus_width)
 		break;
 	case MMC_BUS_WIDTH_4:
 		reg &= ~SDHCI_CTRL_8BITBUS;
-		reg |= SDHCI_CTRL_8BITBUS;
+		reg |= SDHCI_CTRL_4BITBUS;
 		break;
 	default:
 		reg &= ~SDHCI_CTRL_8BITBUS;
-		reg &= ~SDHCI_CTRL_8BITBUS;
+		reg &= ~SDHCI_CTRL_4BITBUS;
 	}
 
 	sdhci_write8(sdhci, SDHCI_HOST_CONTROL, reg);
drivers/mci/dove-sdhci.c +2 -2
index e6ac769bde..7581511285 100644
@@ -181,13 +181,13 @@ static void dove_sdhci_mci_set_ios(struct mci_host *mci, struct mci_ios *ios)
 
 	/* set bus width */
 	val = sdhci_read8(&host->sdhci, SDHCI_HOST_CONTROL) &
-		~(SDHCI_CTRL_8BITBUS | SDHCI_CTRL_8BITBUS);
+		~(SDHCI_CTRL_4BITBUS | SDHCI_CTRL_8BITBUS);
 	switch (ios->bus_width) {
 	case MMC_BUS_WIDTH_8:
 		val |= SDHCI_CTRL_8BITBUS;
 		break;
 	case MMC_BUS_WIDTH_4:
-		val |= SDHCI_CTRL_8BITBUS;
+		val |= SDHCI_CTRL_4BITBUS;
 		break;
 	}
 
Signature · 7 lines
2.30.2


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox