From patchwork Wed May 23 08:53:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 10420755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4A2D260224 for ; Wed, 23 May 2018 09:09:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3842428DBB for ; Wed, 23 May 2018 09:09:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CAAE28DC1; Wed, 23 May 2018 09:09:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 708B428DBB for ; Wed, 23 May 2018 09:09:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zCVVHEpKiyG7hD2UjqE0tS/Kfp4blj+jQHjHkJyiGRs=; b=G5FY6unoIIc7MY D/x9I2Wy5QgZxYzhC4u3PmjWDuL3SpiwRGEraIpVEmjOzn0CR28+gk413obxDYx13ZQhthDb4z+z1 jXk83jTKkEiRG0SieXHlzPh+DE2Y5cw8V7U8/3IkLs4OZlfNbVdmpXC7GG9mVdoXYs2our7Mn2BWC h9sTlH/rwMZeIil+7O6e3gtmVzxRHTKS29AxzuQQMRlHEpNzmrc9Rr6U51x3gSYWFWKSDj1rUmI/h B5u0f6bHP3bjMVi/B7MBAqTdVryBiKWWGzj/j2WUiMfyFJ9cURmgIQOkKlYBfxbeYSQnAfoe1LE8I yrwZhjqEodQugpSh8kAA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLPm8-0000yh-OE for patchwork-linux-mediatek@patchwork.kernel.org; Wed, 23 May 2018 09:09:40 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLPcY-0002Kr-VO; Wed, 23 May 2018 08:59:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bRNmJCT+3SifDG2mi5mTjgHitPaKfiE8QBrwlqmimcw=; b=UlREB9xVyMwj60se6YKe8kmwY 2uBKMIQGCjWQ1d9DSxgRwOpw4+T3T3Ito+iO3PRnB9xDbg9T5zXRHLcMrgAoeYj0Z6dgXPjxQHo0P IDL08e7Z/NYurLxkfO++vXlgN08N6paaEblqU03eXEnI6VJs1JxVRD0onZ9X1eExqZ1wIsvT9Zn8x 3Nqc4nrkzbV6CaX5EY+5slP9BfQqu7FvsaRs/LZ2UYVTICDclcKzW7TsijsC4zea15rwykdw0uhhB Zf0QERpvbzPm021zwJjoSEQxWlWcKp41pk49lMvgs2R5Kus23NIunE5xqMnEjWxs2dor5AkcdSVCh cEX7POwkQ==; Received: from [1.203.163.81] (helo=mailgw02.mediatek.com) by casper.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLPXL-0000I0-PC; Wed, 23 May 2018 08:54:25 +0000 X-UUID: 113bf5d384d5430999316a89700230b9-20180523 Received: from mtkcas32.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 2135428019; Wed, 23 May 2018 16:53:28 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS31N1.mediatek.inc (172.27.4.69) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 23 May 2018 16:53:26 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Wed, 23 May 2018 16:53:26 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Felipe Balbi Subject: [next, PATCH 5/6] usb: mtu3: reset gadget when VBUS_FALL interrupt arises Date: Wed, 23 May 2018 16:53:19 +0800 Message-ID: <4def1d8ab49ab7733693c037c979ea89895856df.1527065109.git.chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1291b13a362eaa0cccd30cb8dd4f56d33e1d172d.1527065109.git.chunfeng.yun@mediatek.com> References: <1291b13a362eaa0cccd30cb8dd4f56d33e1d172d.1527065109.git.chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180523_095424_232991_096CAEC8 X-CRM114-Status: GOOD ( 13.26 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chunfeng Yun , linux-mediatek@lists.infradead.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When VBUS_FALL interrupt arises, it means U3 device is disconnected with host, so need reset status of gadget Signed-off-by: Chunfeng Yun --- drivers/usb/mtu3/mtu3_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c index 279f9cd..eecfd06 100644 --- a/drivers/usb/mtu3/mtu3_core.c +++ b/drivers/usb/mtu3/mtu3_core.c @@ -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);