/*
- * Copyright 2004-2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2004-2012 Freescale Semiconductor, Inc. All Rights Reserved.
*/
/*
goto out;
}
- udc->stopped = 1;
if (!(fsl_readl(&dr_regs->otgsc) & OTGSC_A_BUS_VALID)) {
/* stop the controller */
usbcmd = fsl_readl(&dr_regs->usbcmd) & ~USB_CMD_RUN_STOP;
fsl_writel(usbcmd, &dr_regs->usbcmd);
+ udc->stopped = 1;
}
dr_phy_low_power_mode(udc, true);
{
int ret;
printk(KERN_DEBUG "udc suspend begins\n");
-#ifdef CONFIG_USB_OTG
- if (udc_controller->transceiver->gadget == NULL)
+ if (get_gadget_data(&udc_controller->gadget) == NULL) {
+ /* if no gadget is binded, quit */
return 0;
-#endif
+ }
+
if (udc_controller->stopped)
dr_clk_gate(true);
if (((!(udc_controller->gadget.is_otg)) ||
wait_event_interruptible(wake_up_pdata->wq, !wake_up_pdata->usb_wakeup_is_pending);
-#ifdef CONFIG_USB_OTG
- if (udc_controller->transceiver->gadget == NULL) {
+ if (get_gadget_data(&udc_controller->gadget) == NULL) {
+ /* if no gadget is binded, quit */
return 0;
}
-#endif
mutex_lock(&udc_resume_mutex);
pr_debug("%s(): stopped %d suspended %d\n", __func__,