From 6833fbee23582faeb1432052b0fd12483834f639 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 23 Jul 2010 12:54:37 -0700 Subject: [PATCH] usb: fsl_udc_core: Prevent udc timeout on suspend Change-Id: Ic4780063d432860df835c54c17b2b9249132c8c5 Signed-off-by: Colin Cross --- drivers/usb/gadget/fsl_udc_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 2.34.1