USB: msm: 8x60: Configure PMIC ID interrupt as wakeup interrupt
Change-Id: I2f0d80b85ca97b2453ef8ef7ba93daa644cbe158
CRs-fixed: 309451
Signed-off-by: Anji jonnala <anjir@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index dee14e7..544f2af 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -974,6 +974,7 @@
#endif
#if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_MSM_72K)
+static struct msm_otg_platform_data msm_otg_pdata;
static struct regulator *ldo6_3p3;
static struct regulator *ldo7_1p8;
static struct regulator *vdd_cx;
@@ -1062,8 +1063,10 @@
}
/* Notify the initial Id status */
pmic_id_detect(&pmic_id_det.work);
+ msm_otg_pdata.pmic_id_irq = PMICID_INT;
} else {
free_irq(PMICID_INT, 0);
+ msm_otg_pdata.pmic_id_irq = 0;
cancel_delayed_work_sync(&pmic_id_det);
notify_vbus_state_func_ptr = NULL;
ret = pm8901_mpp_config_digital_out(1,
diff --git a/arch/arm/mach-msm/include/mach/msm72k_otg.h b/arch/arm/mach-msm/include/mach/msm72k_otg.h
index 9afac99..43f487a 100644
--- a/arch/arm/mach-msm/include/mach/msm72k_otg.h
+++ b/arch/arm/mach-msm/include/mach/msm72k_otg.h
@@ -126,6 +126,7 @@
int irq;
int vbus_on_irq;
+ int id_irq;
void __iomem *regs;
atomic_t in_lpm;
/* charger-type is modified by gadget for legacy chargers
diff --git a/arch/arm/mach-msm/include/mach/msm_hsusb.h b/arch/arm/mach-msm/include/mach/msm_hsusb.h
index b4880a2..26f1cdd 100644
--- a/arch/arm/mach-msm/include/mach/msm_hsusb.h
+++ b/arch/arm/mach-msm/include/mach/msm_hsusb.h
@@ -128,6 +128,7 @@
int (*phy_reset)(void __iomem *);
unsigned int core_clk;
int pmic_vbus_irq;
+ int pmic_id_irq;
/* if usb link is in sps there is no need for
* usb pclk as dayatona fabric clock will be
* used instead
diff --git a/drivers/usb/otg/msm72k_otg.c b/drivers/usb/otg/msm72k_otg.c
index 4e66cec..88d6b5b 100644
--- a/drivers/usb/otg/msm72k_otg.c
+++ b/drivers/usb/otg/msm72k_otg.c
@@ -742,6 +742,8 @@
enable_irq_wake(dev->irq);
if (dev->vbus_on_irq)
enable_irq_wake(dev->vbus_on_irq);
+ if (dev->id_irq)
+ enable_irq_wake(dev->id_irq);
}
msm_otg_vote_for_pclk_source(dev, 0);
@@ -810,6 +812,8 @@
disable_irq_wake(dev->irq);
if (dev->vbus_on_irq)
disable_irq_wake(dev->vbus_on_irq);
+ if (dev->id_irq)
+ disable_irq_wake(dev->id_irq);
}
atomic_set(&dev->in_lpm, 0);
@@ -2683,6 +2687,8 @@
if (dev->pdata->pmic_vbus_irq)
dev->vbus_on_irq = dev->pdata->pmic_vbus_irq;
+ if (dev->pdata->pmic_id_irq)
+ dev->id_irq = dev->pdata->pmic_id_irq;
/* vote for vddcx, as PHY cannot tolerate vddcx below 1.0V */
if (dev->pdata->init_vddcx) {