msm: msm_sdcc: Add DT support for SDIO wakeup interrupt
Add device tree support for system wakeup on SDCC DAT1 line
assertion (LOW) by SDIO cards while system is suspended.
If SDC slot has dedicated MSM pins, board DT should specifiy MPM
interrupt line mapping (using new "qcom,dat1-mpm-int" property)
else a gpio to irq mapping of the corresponding DAT1 line should
be specified.
Change-Id: I7d1b02a4d35a1af12978be2aabd47ab99cb7956c
Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org>
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 7725715..4ef8fa5 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -5633,6 +5633,8 @@
pdata->nonremovable = true;
if (of_get_property(np, "qcom,sdcc-disable_cmd23", NULL))
pdata->disable_cmd23 = true;
+ of_property_read_u32(np, "qcom,dat1-mpm-int",
+ &pdata->mpm_sdiowakeup_int);
return pdata;
err:
@@ -5962,6 +5964,14 @@
disable_irq(core_irqres->start);
host->sdcc_irq_disabled = 1;
+ if (!plat->sdiowakeup_irq) {
+ /* Check if registered as IORESOURCE_IRQ */
+ plat->sdiowakeup_irq =
+ platform_get_irq_byname(pdev, "sdiowakeup_irq");
+ if (plat->sdiowakeup_irq < 0)
+ plat->sdiowakeup_irq = 0;
+ }
+
if (plat->sdiowakeup_irq) {
wake_lock_init(&host->sdio_wlock, WAKE_LOCK_SUSPEND,
mmc_hostname(mmc));