From a97d8b7c254ae0d70837869159043523146285e6 Mon Sep 17 00:00:00 2001 From: make shi Date: Thu, 10 Jan 2013 13:16:24 +0800 Subject: [PATCH] ENGR00232755 USB: disable clock and abnormal wakeup when remove gadget driver - In current bsp, the usb clock mismatch when rmmod gadget class driver. The clock should be turn off when gadget class driver unregister. - There is an abnormal usb wakeup interrupt happen if phy is no power without VBUS. If we unplug the usb cable after unregister usb gadget driver, it is difficult to handle the unexpected usb wakeup interrupt. SO we must call dr_discharge_line() to make sure no abnormal usb wakeup interrupt happen in usb unregister gadget class driver. Signed-off-by: make shi --- drivers/usb/gadget/arcotg_udc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/arcotg_udc.c b/drivers/usb/gadget/arcotg_udc.c index 04824da1c07f..d1a2e27bcd56 100755 --- a/drivers/usb/gadget/arcotg_udc.c +++ b/drivers/usb/gadget/arcotg_udc.c @@ -1,5 +1,5 @@ /* - * Copyright 2004-2012 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -562,6 +562,8 @@ static void dr_controller_stop(struct fsl_udc *udc) tmp &= ~USB_CMD_RUN_STOP; fsl_writel(tmp, &dr_regs->usbcmd); + /* disable pulldown dp and dm */ + dr_discharge_line(udc->pdata, true); return; } @@ -2519,6 +2521,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) dr_phy_low_power_mode(udc_controller, true); + dr_clk_gate(false); printk(KERN_INFO "unregistered gadget driver '%s'\r\n", driver->driver.name); return 0; -- 2.39.5