Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: sdhci-esdhc-imx: Correct two register accesses

- The DMA error interrupt bit is in a different position as
compared to the sdhci standard. This is accounted for in
many cases, but not handled in the case of clearing the
INT_STATUS register by writing a 1 to that location.
- The HOST_CONTROL register is very different as compared to
the sdhci standard. This is accounted for in the write
case, but not when read back out (which it is in the sdhci
code).

Signed-off-by: Dave Russell <david.russell@datasoft.com>
Signed-off-by: Aaron Brice <aaron.brice@datasoft.com>
Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Aaron Brice and committed by
Ulf Hansson
77da3da0 fee686b7

+22 -1
+22 -1
drivers/mmc/host/sdhci-esdhc-imx.c
··· 346 346 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); 347 347 u32 data; 348 348 349 - if (unlikely(reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE)) { 349 + if (unlikely(reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE || 350 + reg == SDHCI_INT_STATUS)) { 350 351 if ((val & SDHCI_INT_CARD_INT) && !esdhc_is_usdhc(imx_data)) { 351 352 /* 352 353 * Clear and then set D3CD bit to avoid missing the ··· 554 553 break; 555 554 } 556 555 esdhc_clrset_le(host, 0xffff, val, reg); 556 + } 557 + 558 + static u8 esdhc_readb_le(struct sdhci_host *host, int reg) 559 + { 560 + u8 ret; 561 + u32 val; 562 + 563 + switch (reg) { 564 + case SDHCI_HOST_CONTROL: 565 + val = readl(host->ioaddr + reg); 566 + 567 + ret = val & SDHCI_CTRL_LED; 568 + ret |= (val >> 5) & SDHCI_CTRL_DMA_MASK; 569 + ret |= (val & ESDHC_CTRL_4BITBUS); 570 + ret |= (val & ESDHC_CTRL_8BITBUS) << 3; 571 + return ret; 572 + } 573 + 574 + return readb(host->ioaddr + reg); 557 575 } 558 576 559 577 static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg) ··· 967 947 static struct sdhci_ops sdhci_esdhc_ops = { 968 948 .read_l = esdhc_readl_le, 969 949 .read_w = esdhc_readw_le, 950 + .read_b = esdhc_readb_le, 970 951 .write_l = esdhc_writel_le, 971 952 .write_w = esdhc_writew_le, 972 953 .write_b = esdhc_writeb_le,