mdm: Assert wakeup gpio to indicate mdm hsic to start connecting
hsic enumeration failure observed when mdm hsic initiates connect
signalling and apq hsic is not ready to act on it. Asserting wakeup
gpio after adding apq hsic device to indicate mdm hsic to start
initiating connect
CRs-Fixed: 349725
Change-Id: I608e8421172bbe70d3476f25334d9f3209700c45
Signed-off-by: Vamsi Krishna <vskrishn@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8064-gpiomux.c b/arch/arm/mach-msm/board-8064-gpiomux.c
index 4b9931a..8464752 100644
--- a/arch/arm/mach-msm/board-8064-gpiomux.c
+++ b/arch/arm/mach-msm/board-8064-gpiomux.c
@@ -518,6 +518,12 @@
.pull = GPIOMUX_PULL_DOWN,
};
+static struct gpiomux_setting ap2mdm_wakeup = {
+ .func = GPIOMUX_FUNC_GPIO,
+ .drv = GPIOMUX_DRV_8MA,
+ .pull = GPIOMUX_PULL_DOWN,
+};
+
static struct msm_gpiomux_config mdm_configs[] __initdata = {
/* AP2MDM_STATUS */
{
@@ -554,6 +560,13 @@
[GPIOMUX_SUSPENDED] = &ap2mdm_pon_reset_n_cfg,
}
},
+ /* AP2MDM_WAKEUP */
+ {
+ .gpio = 35,
+ .settings = {
+ [GPIOMUX_SUSPENDED] = &ap2mdm_wakeup,
+ }
+ },
};
static struct msm_gpiomux_config apq8064_mxt_configs[] __initdata = {
diff --git a/arch/arm/mach-msm/devices-8064.c b/arch/arm/mach-msm/devices-8064.c
index f6b753d..092a4f5 100644
--- a/arch/arm/mach-msm/devices-8064.c
+++ b/arch/arm/mach-msm/devices-8064.c
@@ -2157,6 +2157,7 @@
#define MDM2AP_STATUS 49
#define AP2MDM_STATUS 48
#define AP2MDM_PMIC_RESET_N 27
+#define AP2MDM_WAKEUP 35
static struct resource mdm_resources[] = {
{
@@ -2189,6 +2190,12 @@
.name = "AP2MDM_PMIC_RESET_N",
.flags = IORESOURCE_IO,
},
+ {
+ .start = AP2MDM_WAKEUP,
+ .end = AP2MDM_WAKEUP,
+ .name = "AP2MDM_WAKEUP",
+ .flags = IORESOURCE_IO,
+ },
};
struct platform_device mdm_8064_device = {
diff --git a/arch/arm/mach-msm/mdm2.c b/arch/arm/mach-msm/mdm2.c
index e0d2696..b4b7ea3 100644
--- a/arch/arm/mach-msm/mdm2.c
+++ b/arch/arm/mach-msm/mdm2.c
@@ -79,6 +79,11 @@
{
power_on_count++;
+ /* this gpio will be used to indicate apq readiness,
+ * de-assert it now so that it can asserted later
+ */
+ gpio_direction_output(mdm_drv->ap2mdm_wakeup_gpio, 0);
+
/* The second attempt to power-on the mdm is the first attempt
* from user space, but we're already powered on. Ignore this.
* Subsequent attempts are from SSR or if something failed, in
@@ -97,7 +102,7 @@
/* Deassert RESET first and wait for it to settle. */
pr_debug("%s: Pulling RESET gpio high\n", __func__);
gpio_direction_output(mdm_drv->ap2mdm_pmic_reset_n_gpio, 1);
- usleep(1000);
+ usleep(20000);
/* Pull PWR gpio high and wait for it to settle, but only
* the first time the mdm is powered up.
@@ -152,6 +157,7 @@
if (value) {
mdm_peripheral_disconnect(mdm_drv);
mdm_peripheral_connect(mdm_drv);
+ gpio_direction_output(mdm_drv->ap2mdm_wakeup_gpio, 1);
}
}
diff --git a/arch/arm/mach-msm/mdm_common.c b/arch/arm/mach-msm/mdm_common.c
index a7ba4a0..2fa25ce 100644
--- a/arch/arm/mach-msm/mdm_common.c
+++ b/arch/arm/mach-msm/mdm_common.c
@@ -204,9 +204,6 @@
mdm_disable_irqs();
gpio_set_value(mdm_drv->ap2mdm_errfatal_gpio, 1);
- if (mdm_drv->ap2mdm_wakeup_gpio > 0)
- gpio_set_value(mdm_drv->ap2mdm_wakeup_gpio, 1);
-
for (i = MDM_MODEM_TIMEOUT; i > 0; i -= MDM_MODEM_DELTA) {
pet_watchdog();
mdelay(MDM_MODEM_DELTA);
@@ -523,12 +520,6 @@
{
mdm_disable_irqs();
- if (mdm_drv->ap2mdm_wakeup_gpio > 0)
- gpio_set_value(mdm_drv->ap2mdm_wakeup_gpio, 1);
-
mdm_drv->ops->power_down_mdm_cb(mdm_drv);
-
- if (mdm_drv->ap2mdm_wakeup_gpio > 0)
- gpio_set_value(mdm_drv->ap2mdm_wakeup_gpio, 0);
}