Revert "LOCAL / dwc3: gadget: add VBUS session handling" 48/88848/1
authorDongwoo Lee <dwoo08.lee@@samsung.com>
Wed, 21 Sep 2016 02:20:17 +0000 (11:20 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 21 Sep 2016 02:21:41 +0000 (11:21 +0900)
This reverts commit 835ba793e91ddfc2ec8dc25183fac0efdf346f4a.

After commit 628ef0d ("usb: udc: add usb_udc_vbus_handler"), the
patch is not necessary, and it causes failure of host switch after
peripheral role.

Change-Id: I6e1786ee7f2ab46019f3fb50efc92735f0c99cab
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/gadget.c

index 46a429d..08eb46c 100644 (file)
@@ -845,7 +845,6 @@ struct dwc3 {
 
        unsigned                tx_de_emphasis_quirk:1;
        unsigned                tx_de_emphasis:2;
-       unsigned                vbus_session:1;
 
        unsigned                needs_reinit:1;
 };
index 01a44ba..8ee0132 100644 (file)
@@ -1593,53 +1593,12 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend)
        return 0;
 }
 
-static int dwc3_gadget_vbus_session(struct usb_gadget *g, int is_active)
-{
-       struct dwc3 *dwc = gadget_to_dwc(g);
-       unsigned long flags;
-
-       if (!dwc->dotg)
-               return -EPERM;
-
-       is_active = !!is_active;
-
-       spin_lock_irqsave(&dwc->lock, flags);
-
-       /* Mark that the vbus was powered */
-       dwc->vbus_session = is_active;
-
-       /*
-        * Check if upper level usb_gadget_driver was already registerd with
-        * this udc controller driver (if dwc3_gadget_start was called)
-        */
-       if (dwc->gadget_driver) {
-               if (dwc->vbus_session) {
-                       /*
-                        * Both vbus was activated by otg and pullup was
-                        * signaled by the gadget driver.
-                        */
-                       dwc3_gadget_run_stop(dwc, 1, false);
-               } else {
-                       dwc3_gadget_run_stop(dwc, 0, false);
-               }
-       }
-
-       spin_unlock_irqrestore(&dwc->lock, flags);
-
-       return 0;
-}
-
-
 static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
 {
        struct dwc3             *dwc = gadget_to_dwc(g);
        unsigned long           flags;
        int                     ret;
 
-       /* Need to wait for vbus_session(on) from otg driver */
-       if (dwc->dotg && !dwc->vbus_session)
-               return 0;
-
        is_on = !!is_on;
 
        spin_lock_irqsave(&dwc->lock, flags);
@@ -1744,7 +1703,6 @@ static const struct usb_gadget_ops dwc3_gadget_ops = {
        .get_frame              = dwc3_gadget_get_frame,
        .wakeup                 = dwc3_gadget_wakeup,
        .set_selfpowered        = dwc3_gadget_set_selfpowered,
-       .vbus_session           = dwc3_gadget_vbus_session,
        .pullup                 = dwc3_gadget_pullup,
        .udc_start              = dwc3_gadget_start,
        .udc_stop               = dwc3_gadget_stop,