]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00174128-1 Revert "Remove the discharge for VBUS and DP-1"
authorPeter Chen <peter.chen@freescale.com>
Thu, 9 Feb 2012 09:38:59 +0000 (17:38 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:33:58 +0000 (08:33 +0200)
As dp/dm is floating with no usb cable and switch host mode to
device mode situation, it do needs this discharge dp patch
But, discharge vbus doesn't be needed at suspend_irq, so
keep it removing.

This reverts commit 0924b71278650fa3891a8f6ea70f91242ca6e5fd.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/gadget/arcotg_udc.c

index 55fc066e636d6f7cc5238bf238090d1d9766b04e..fc49aaa15c441527be86d61629b10bb4cebf3252 100755 (executable)
@@ -2026,6 +2026,7 @@ static void suspend_irq(struct fsl_udc *udc)
 
        udc->resume_state = udc->usb_state;
        udc->usb_state = USB_STATE_SUSPENDED;
+
        /* report suspend to the driver, serial.c does not support this */
        if (udc->driver->suspend)
                udc->driver->suspend(&udc->gadget);
@@ -2147,6 +2148,10 @@ static void fsl_gadget_disconnect_event(struct work_struct *work)
        u32 tmp;
 
        pdata = udc->pdata;
+
+       /* enable pulldown dp */
+       if (pdata->gadget_discharge_dp)
+               pdata->gadget_discharge_dp(true);
        /*
         * Some boards are very slow change line state from J to SE0 for DP,
         * So, we need to discharge DP, otherwise there is a wakeup interrupt
@@ -2154,6 +2159,10 @@ static void fsl_gadget_disconnect_event(struct work_struct *work)
         */
        gadget_wait_line_to_se0();
 
+       /* Disable pulldown dp */
+       if (pdata->gadget_discharge_dp)
+               pdata->gadget_discharge_dp(false);
+
        /*
         * Wait class drivers finish, an well-behaviour class driver should
         * call ep_disable when it is notified to be disconnected.
@@ -2211,7 +2220,6 @@ bool try_wake_up_udc(struct fsl_udc *udc)
                        fsl_writel(tmp | USB_CMD_RUN_STOP, &dr_regs->usbcmd);
                        printk(KERN_DEBUG "%s: udc out low power mode\n", __func__);
                } else {
-                       printk(KERN_INFO "USB device disconnected\n");
                        fsl_writel(tmp & ~USB_CMD_RUN_STOP, &dr_regs->usbcmd);
                        /* here we need disable B_SESSION_IRQ, after
                         * schedule_work finished, it need to be enabled again.