From: Colin Cross Date: Fri, 23 Jul 2010 19:54:37 +0000 (-0700) Subject: usb: gadget: fsl_udc: Prevent udc timeout on suspend X-Git-Tag: firefly_0821_release~9833^2~153^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cafc989dd8a92797785ad6d313935e136a16b33c;p=firefly-linux-kernel-4.4.55.git usb: gadget: fsl_udc: Prevent udc timeout on suspend Change-Id: Ic4780063d432860df835c54c17b2b9249132c8c5 Signed-off-by: Colin Cross --- diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 68715f5183be..fe66989232b9 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -2604,6 +2604,10 @@ static int __exit fsl_udc_remove(struct platform_device *pdev) -----------------------------------------------------------------*/ static int fsl_udc_suspend(struct platform_device *pdev, pm_message_t state) { + if (udc_controller->transceiver && + udc_controller->transceiver->state != OTG_STATE_B_PERIPHERAL) + return 0; + dr_controller_stop(udc_controller); return 0; } @@ -2614,6 +2618,10 @@ 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 && + udc_controller->transceiver->state != OTG_STATE_B_PERIPHERAL) + return 0; + /* Enable DR irq reg and set controller Run */ if (udc_controller->stopped) { dr_controller_setup(udc_controller);