Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270262
b: refs/heads/master
c: e51cbc9
h: refs/heads/master
v: v3
  • Loading branch information
Xu lei authored and Chris Ball committed Oct 26, 2011
1 parent eb35cf3 commit 5765161
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c3805467aad7ce4e31c2b935046843de08cfc026
refs/heads/master: e51cbc9eab260ed50548925f6879c04e81123928
18 changes: 14 additions & 4 deletions trunk/drivers/mmc/host/sdhci-of-esdhc.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Freescale eSDHC controller driver.
*
* Copyright (c) 2007 Freescale Semiconductor, Inc.
* Copyright (c) 2007, 2010 Freescale Semiconductor, Inc.
* Copyright (c) 2009 MontaVista Software, Inc.
*
* Authors: Xiaobo Xie <X.Xie@freescale.com>
Expand All @@ -22,11 +22,21 @@
static u16 esdhc_readw(struct sdhci_host *host, int reg)
{
u16 ret;
int base = reg & ~0x3;
int shift = (reg & 0x2) * 8;

if (unlikely(reg == SDHCI_HOST_VERSION))
ret = in_be16(host->ioaddr + reg);
ret = in_be32(host->ioaddr + base) & 0xffff;
else
ret = sdhci_be32bs_readw(host, reg);
ret = (in_be32(host->ioaddr + base) >> shift) & 0xffff;
return ret;
}

static u8 esdhc_readb(struct sdhci_host *host, int reg)
{
int base = reg & ~0x3;
int shift = (reg & 0x3) * 8;
u8 ret = (in_be32(host->ioaddr + base) >> shift) & 0xff;
return ret;
}

Expand Down Expand Up @@ -74,7 +84,7 @@ static unsigned int esdhc_of_get_min_clock(struct sdhci_host *host)
static struct sdhci_ops sdhci_esdhc_ops = {
.read_l = sdhci_be32bs_readl,
.read_w = esdhc_readw,
.read_b = sdhci_be32bs_readb,
.read_b = esdhc_readb,
.write_l = sdhci_be32bs_writel,
.write_w = esdhc_writew,
.write_b = esdhc_writeb,
Expand Down

0 comments on commit 5765161

Please sign in to comment.