summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorBalaji T K <balajitk@ti.com>2014-05-29 04:28:02 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-07-09 05:26:04 -0400
commit5a52b08b05b01732e338aab7283b3ce4987d71fb (patch)
tree94de7b8c724b0692f4381158557be0bff3b99c04 /drivers/mmc
parentbb0635f0b4d2bad44d315344527cfa2cd91f0f4f (diff)
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: Andreas Fenkart <afenkart@gmail.com> Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index ad3a2acd3664..b12a2882ec74 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -94,7 +94,10 @@
94#define BCE (1 << 1) 94#define BCE (1 << 1)
95#define FOUR_BIT (1 << 1) 95#define FOUR_BIT (1 << 1)
96#define HSPE (1 << 2) 96#define HSPE (1 << 2)
97#define IWE (1 << 24)
97#define DDR (1 << 19) 98#define DDR (1 << 19)
99#define CLKEXTFREE (1 << 16)
100#define CTPL (1 << 11)
98#define DW8 (1 << 5) 101#define DW8 (1 << 5)
99#define OD 0x1 102#define OD 0x1
100#define STAT_CLEAR 0xFFFFFFFF 103#define STAT_CLEAR 0xFFFFFFFF
@@ -687,6 +690,9 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host)
687 capa = VS18; 690 capa = VS18;
688 } 691 }
689 692
693 if (host->mmc->caps & MMC_CAP_SDIO_IRQ)
694 hctl |= IWE;
695
690 OMAP_HSMMC_WRITE(host->base, HCTL, 696 OMAP_HSMMC_WRITE(host->base, HCTL,
691 OMAP_HSMMC_READ(host->base, HCTL) | hctl); 697 OMAP_HSMMC_READ(host->base, HCTL) | hctl);
692 698
@@ -1684,19 +1690,23 @@ static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card)
1684static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable) 1690static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
1685{ 1691{
1686 struct omap_hsmmc_host *host = mmc_priv(mmc); 1692 struct omap_hsmmc_host *host = mmc_priv(mmc);
1687 u32 irq_mask; 1693 u32 irq_mask, con;
1688 unsigned long flags; 1694 unsigned long flags;
1689 1695
1690 spin_lock_irqsave(&host->irq_lock, flags); 1696 spin_lock_irqsave(&host->irq_lock, flags);
1691 1697
1698 con = OMAP_HSMMC_READ(host->base, CON);
1692 irq_mask = OMAP_HSMMC_READ(host->base, ISE); 1699 irq_mask = OMAP_HSMMC_READ(host->base, ISE);
1693 if (enable) { 1700 if (enable) {
1694 host->flags |= HSMMC_SDIO_IRQ_ENABLED; 1701 host->flags |= HSMMC_SDIO_IRQ_ENABLED;
1695 irq_mask |= CIRQ_EN; 1702 irq_mask |= CIRQ_EN;
1703 con |= CTPL | CLKEXTFREE;
1696 } else { 1704 } else {
1697 host->flags &= ~HSMMC_SDIO_IRQ_ENABLED; 1705 host->flags &= ~HSMMC_SDIO_IRQ_ENABLED;
1698 irq_mask &= ~CIRQ_EN; 1706 irq_mask &= ~CIRQ_EN;
1707 con &= ~(CTPL | CLKEXTFREE);
1699 } 1708 }
1709 OMAP_HSMMC_WRITE(host->base, CON, con);
1700 OMAP_HSMMC_WRITE(host->base, IE, irq_mask); 1710 OMAP_HSMMC_WRITE(host->base, IE, irq_mask);
1701 1711
1702 /* 1712 /*
@@ -1746,6 +1756,8 @@ static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host)
1746 goto err; 1756 goto err;
1747 } 1757 }
1748 1758
1759 OMAP_HSMMC_WRITE(host->base, HCTL,
1760 OMAP_HSMMC_READ(host->base, HCTL) | IWE);
1749 return 0; 1761 return 0;
1750 1762
1751err: 1763err: