summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSuresh Mangipudi <smangipudi@nvidia.com>2011-05-30 15:14:29 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-06-01 12:03:03 -0700
commit3c069e975a267d7a37a0171b9cd03b420e1a0849 (patch)
tree54fbbd979c265cdf88dac400c857d879307e8f2a /drivers
parent1514d457b5672b10c14fd28139ba624f46c72ff0 (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 (cherry picked from commit cae416e076b8c31c422b71b6df82a7921132ee11) Change-Id: I8595bfbb5b5cb1cfa3d20e68ae1b6ef7755f1e3e Reviewed-on: http://git-master/r/34452 Reviewed-by: Niket Sirsi <nsirsi@nvidia.com> Tested-by: Niket Sirsi <nsirsi@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/fsl_udc_core.c6
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 c96322f3544c..08079b0dffa6 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2915,18 +2915,16 @@ 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(true);
if (!(fsl_readl(&usb_sys_regs->vbus_wakeup) & USB_SYS_ID_PIN_STATUS)) {
/* If ID status is low means host is connected, return */
- return 0;
+ 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(false);
return 0;
} else {
+ fsl_udc_clk_resume(true);
/* Detected VBUS set the transceiver state to device mode */
udc_controller->transceiver->state = OTG_STATE_B_PERIPHERAL;
}