Skip to content

Commit 429d939

Browse files
yangbolu1991storulf
authored andcommitted
mmc: sdhci-of-esdhc: fix transfer mode register reading
The standard SD controller uses two 16-bit registers for command sending. 0xC: Transfer Mode Register 0xE: Command Register But the eSDHC controller uses one 32-bit register instead. 0xC: XFERTYPE For Transfer Mode Register and Command Register writing, the eSDHC driver will store Transfer Mode Register value in a variable first. When Command Register writing happens, driver will directly write a 32-bit value into XFERTYPE register. But for Transfer Mode Register reading, driver just returns a actual value. This may cause issue for some read-modify-write operations. We should make both reading and write on that variable for Transfer Mode Register. Signed-off-by: Yangbo Lu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]>
1 parent 2fefc7c commit 429d939

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/mmc/host/sdhci-of-esdhc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ static u16 esdhc_readw_fixup(struct sdhci_host *host,
173173
u16 ret;
174174
int shift = (spec_reg & 0x2) * 8;
175175

176+
if (spec_reg == SDHCI_TRANSFER_MODE)
177+
return pltfm_host->xfer_mode_shadow;
178+
176179
if (spec_reg == SDHCI_HOST_VERSION)
177180
ret = value & 0xffff;
178181
else

0 commit comments

Comments
 (0)