usb: mtu3: reset gadget when VBUS_FALL interrupt arises
authorChunfeng Yun <chunfeng.yun@mediatek.com>
Wed, 23 May 2018 08:53:19 +0000 (16:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 May 2018 16:09:37 +0000 (18:09 +0200)
When VBUS_FALL interrupt arises, it means U3 device is disconnected
with host, so need reset status of gadget

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/mtu3/mtu3_core.c

index 279f9cd7bd6c544da0e53f5393f8804a3c2adb1f..eecfd067136287a65c89bb58409bf054f9ea6e1c 100644 (file)
@@ -668,8 +668,10 @@ static irqreturn_t mtu3_u3_ltssm_isr(struct mtu3 *mtu)
        if (ltssm & (HOT_RST_INTR | WARM_RST_INTR))
                mtu3_gadget_reset(mtu);
 
-       if (ltssm & VBUS_FALL_INTR)
+       if (ltssm & VBUS_FALL_INTR) {
                mtu3_ss_func_set(mtu, false);
+               mtu3_gadget_reset(mtu);
+       }
 
        if (ltssm & VBUS_RISE_INTR)
                mtu3_ss_func_set(mtu, true);