From: Dave Liu Date: Wed, 6 May 2009 10:40:07 +0000 (+0800) Subject: sdhci-of: Fix the wrong accessor to HOSTVER register X-Git-Tag: v2.6.30~15^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=fbf6a5fcbcc2248f1e676f7a0a7d49cd4b535d2a;p=karo-tx-linux.git sdhci-of: Fix the wrong accessor to HOSTVER register Freescale eSDHC controller has the special order for the HOST version register. that is not same as the other's registers. The address of HOSTVER in spec is 0xFE, and we need use the in_be16(0xFE) to access it, not in_be16(0xFC). Signed-off-by: Dave Liu Acked-by: Anton Vorontsov Signed-off-by: Pierre Ossman --- diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c index 09cc597c6316..128c614d11aa 100644 --- a/drivers/mmc/host/sdhci-of.c +++ b/drivers/mmc/host/sdhci-of.c @@ -55,7 +55,13 @@ static u32 esdhc_readl(struct sdhci_host *host, int reg) static u16 esdhc_readw(struct sdhci_host *host, int reg) { - return in_be16(host->ioaddr + (reg ^ 0x2)); + u16 ret; + + if (unlikely(reg == SDHCI_HOST_VERSION)) + ret = in_be16(host->ioaddr + reg); + else + ret = in_be16(host->ioaddr + (reg ^ 0x2)); + return ret; } static u8 esdhc_readb(struct sdhci_host *host, int reg)