Commit 5a52b08b authored by Balaji T K's avatar Balaji T K Committed by Ulf Hansson

mmc: omap_hsmmc: enable wakeup event for sdio OMAP4

To detect sdio irqs properly without spurious events,
OMAP4 needs IWE in CON and CTPL, CLKEXTFREE in HCTL to be set
Tested-by: default avatarAndreas Fenkart <afenkart@gmail.com>
Signed-off-by: default avatarBalaji T K <balajitk@ti.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent bb0635f0
...@@ -94,7 +94,10 @@ ...@@ -94,7 +94,10 @@
#define BCE (1 << 1) #define BCE (1 << 1)
#define FOUR_BIT (1 << 1) #define FOUR_BIT (1 << 1)
#define HSPE (1 << 2) #define HSPE (1 << 2)
#define IWE (1 << 24)
#define DDR (1 << 19) #define DDR (1 << 19)
#define CLKEXTFREE (1 << 16)
#define CTPL (1 << 11)
#define DW8 (1 << 5) #define DW8 (1 << 5)
#define OD 0x1 #define OD 0x1
#define STAT_CLEAR 0xFFFFFFFF #define STAT_CLEAR 0xFFFFFFFF
...@@ -687,6 +690,9 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host) ...@@ -687,6 +690,9 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
capa = VS18; capa = VS18;
} }
if (host->mmc->caps & MMC_CAP_SDIO_IRQ)
hctl |= IWE;
OMAP_HSMMC_WRITE(host->base, HCTL, OMAP_HSMMC_WRITE(host->base, HCTL,
OMAP_HSMMC_READ(host->base, HCTL) | hctl); OMAP_HSMMC_READ(host->base, HCTL) | hctl);
...@@ -1684,19 +1690,23 @@ static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card) ...@@ -1684,19 +1690,23 @@ static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card)
static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable) static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
{ {
struct omap_hsmmc_host *host = mmc_priv(mmc); struct omap_hsmmc_host *host = mmc_priv(mmc);
u32 irq_mask; u32 irq_mask, con;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&host->irq_lock, flags); spin_lock_irqsave(&host->irq_lock, flags);
con = OMAP_HSMMC_READ(host->base, CON);
irq_mask = OMAP_HSMMC_READ(host->base, ISE); irq_mask = OMAP_HSMMC_READ(host->base, ISE);
if (enable) { if (enable) {
host->flags |= HSMMC_SDIO_IRQ_ENABLED; host->flags |= HSMMC_SDIO_IRQ_ENABLED;
irq_mask |= CIRQ_EN; irq_mask |= CIRQ_EN;
con |= CTPL | CLKEXTFREE;
} else { } else {
host->flags &= ~HSMMC_SDIO_IRQ_ENABLED; host->flags &= ~HSMMC_SDIO_IRQ_ENABLED;
irq_mask &= ~CIRQ_EN; irq_mask &= ~CIRQ_EN;
con &= ~(CTPL | CLKEXTFREE);
} }
OMAP_HSMMC_WRITE(host->base, CON, con);
OMAP_HSMMC_WRITE(host->base, IE, irq_mask); OMAP_HSMMC_WRITE(host->base, IE, irq_mask);
/* /*
...@@ -1746,6 +1756,8 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host) ...@@ -1746,6 +1756,8 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host)
goto err; goto err;
} }
OMAP_HSMMC_WRITE(host->base, HCTL,
OMAP_HSMMC_READ(host->base, HCTL) | IWE);
return 0; return 0;
err: err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment