misc: tegra-baseband: short autosuspend for native remote wake
Neil Patel [Fri, 25 Oct 2013 14:29:39 +0000 (10:29 -0400)]
Add support for short autosuspend when native remote wakeup is used.

Bug 1362837
Bug 1430974

Change-Id: I13cab913645d00a1d37caabf0d274bb2e557e0c3
Signed-off-by: Neil Patel <neilp@nvidia.com>
Reviewed-on: http://git-master/r/324075
(cherry picked from commit c3d9eaafe053f5d8f8859811e01e3a0dac314ba3)
Reviewed-on: http://git-master/r/328441
GVS: Gerrit_Virtual_Submit
Reviewed-by: Steve Lin <stlin@nvidia.com>
Reviewed-on: http://git-master/r/349730
Reviewed-by: Martin Chi <mchi@nvidia.com>
Tested-by: Martin Chi <mchi@nvidia.com>
Reviewed-on: http://git-master/r/351587

drivers/misc/tegra-baseband/tegra_usb_modem_power.c

index 28f5202..277cc56 100644 (file)
@@ -391,7 +391,6 @@ static int mdm_pm_notifier(struct notifier_block *notifier,
                modem->system_suspend = 1;
 #ifdef CONFIG_PM
                if (modem->capability & TEGRA_MODEM_AUTOSUSPEND &&
-                   modem->wake_irq &&
                    modem->udev &&
                    modem->udev->state != USB_STATE_NOTATTACHED) {
                        pm_runtime_set_autosuspend_delay(&modem->udev->dev,
@@ -456,6 +455,16 @@ static void tegra_usb_modem_post_remote_wakeup(void)
        modem = dev_get_drvdata(dev);
 
        mutex_lock(&modem->lock);
+#ifdef CONFIG_PM
+       if (modem->capability & TEGRA_MODEM_AUTOSUSPEND &&
+           modem->udev &&
+           modem->udev->state != USB_STATE_NOTATTACHED &&
+           modem->short_autosuspend_enabled) {
+               pm_runtime_set_autosuspend_delay(&modem->udev->dev,
+                               modem->pdata->autosuspend_delay);
+               modem->short_autosuspend_enabled = 0;
+       }
+#endif
        wake_lock_timeout(&modem->wake_lock, WAKELOCK_TIMEOUT_FOR_REMOTE_WAKE);
        mutex_unlock(&modem->lock);