tegra: otg: State update during suspend
Suresh Mangipudi [Thu, 4 Aug 2011 12:28:00 +0000 (17:28 +0530)]
Update the state of OTG when the device is entering suspend mode with
the device cable connected.

Bug 858490

Original-Change-Id: I7c8fb029f6e47418295d4f665cedf1774dd05e51
Reviewed-on: http://git-master/r/45006
Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com>
Tested-by: Suresh Mangipudi <smangipudi@nvidia.com>
Tested-by: Bala Murali Krishna <balam@nvidia.com>
Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com>

Rebase-Id: R1bad22e4207e558065f307f942907659c1d110d4

drivers/usb/otg/tegra-otg.c

index e24d577..f895c4a 100644 (file)
@@ -389,9 +389,10 @@ static int tegra_otg_suspend(struct device *dev)
        tegra_otg->intr_reg_data = readl(tegra_otg->regs + USB_PHY_WAKEUP);
        clk_disable(tegra_otg->clk);
 
-       if (from == OTG_STATE_B_PERIPHERAL && otg->gadget)
+       if (from == OTG_STATE_B_PERIPHERAL && otg->gadget) {
                usb_gadget_vbus_disconnect(otg->gadget);
-
+               otg->state = OTG_STATE_A_SUSPEND;
+       }
        tegra_otg_disable_clk();
        return 0;
 }