diff options
author | Suresh Mangipudi <smangipudi@nvidia.com> | 2011-05-05 18:18:52 +0530 |
---|---|---|
committer | Niket Sirsi <nsirsi@nvidia.com> | 2011-05-09 17:59:12 -0700 |
commit | cae416e076b8c31c422b71b6df82a7921132ee11 (patch) | |
tree | 74d38d6904cf056724f1c7b9fe113442c7f3083f | |
parent | aefcb5131be5fc4d252e0f6489cf9d6d90b9cea8 (diff) |
usb: fsl_udc: Resume of device mode optimized.
Having the device resume and suspend when the cable is not present is
an overhead for the system. Hence removed resume and device function
calls when the cable is not present.
Bug 803280
Change-Id: I238474fb1f3629f78833d58a89ffcabff7754fbb
Reviewed-on: http://git-master/r/30500
Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com>
Tested-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | drivers/usb/gadget/fsl_udc_core.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 5c1ceb4e6ebc..74ebe55a1ca0 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -2858,19 +2858,17 @@ static int fsl_udc_suspend(struct platform_device *pdev, pm_message_t state) static int fsl_udc_resume(struct platform_device *pdev) { if (udc_controller->transceiver) { - /* enable clock */ - fsl_udc_clk_resume(); + if (!(fsl_readl(&usb_sys_regs->vbus_wakeup) & USB_SYS_ID_PIN_STATUS)) { /* If ID status is low means host is connected, return */ - fsl_udc_clk_suspend(); return 0; } /* check for VBUS */ if (!(fsl_readl(&usb_sys_regs->vbus_wakeup) & USB_SYS_VBUS_STATUS)) { /* if there is no VBUS then power down the clocks and return */ - fsl_udc_clk_suspend(); return 0; } else { + fsl_udc_clk_resume(); /* Detected VBUS set the transceiver state to device mode */ udc_controller->transceiver->state = OTG_STATE_B_PERIPHERAL; } |