From: make shi Date: Thu, 10 Jan 2013 05:16:24 +0000 (+0800) Subject: ENGR00232755 USB: disable clock and abnormal wakeup when remove gadget driver X-Git-Tag: v3.0.35-fsl~157 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a97d8b7c254ae0d70837869159043523146285e6;p=karo-tx-linux.git 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 --- 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;