From patchwork Thu Oct 16 12:57:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 5091751 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5BEDBC11AC for ; Thu, 16 Oct 2014 12:58:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E642201EF for ; Thu, 16 Oct 2014 12:58:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EF52220154 for ; Thu, 16 Oct 2014 12:58:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752009AbaJPM6a (ORCPT ); Thu, 16 Oct 2014 08:58:30 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:21232 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752429AbaJPM63 (ORCPT ); Thu, 16 Oct 2014 08:58:29 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NDJ008N3G634PB0@mailout2.w1.samsung.com>; Thu, 16 Oct 2014 14:01:15 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-b5-543fc0f1cfb2 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id F8.65.25543.1F0CF345; Thu, 16 Oct 2014 13:58:25 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NDJ00F34G17BB00@eusync2.samsung.com>; Thu, 16 Oct 2014 13:58:25 +0100 (BST) From: Marek Szyprowski To: linux-usb@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Kyungmin Park , Robert Baldyga , Paul Zimmerman , Krzysztof Kozlowski Subject: [PATCH 1/9] usb: dwc2/gadget: report disconnect event from 'end session' irq Date: Thu, 16 Oct 2014 14:57:57 +0200 Message-id: <1413464285-24172-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1413464285-24172-1-git-send-email-m.szyprowski@samsung.com> References: <1413464285-24172-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNJMWRmVeSWpSXmKPExsVy+t/xK7ofD9iHGPSdULF4/cLQ4mzTG3aL Gef3MVksWtbKbLH2yF12i+1TpjNZPDi8k92B3aNvyypGjy37PzN6fN4kF8AcxWWTkpqTWZZa pG+XwJXxZA53wVG2ivnHnzE1MG5l7WLk5JAQMJFofdjNCGGLSVy4t56ti5GLQ0hgKaPE660X oJw+Jone3s9MIFVsAoYSXW+72EBsEQEHiSVL74AVMQvcYZRYv/8TWJGwQLjElI+7WUBsFgFV ibed/WAreAU8JG5fmMUMsU5O4v/LFWD1nAKeErs2rwSLCwHVnL86nXECI+8CRoZVjKKppckF xUnpuYZ6xYm5xaV56XrJ+bmbGCEB9GUH4+JjVocYBTgYlXh4NYLtQ4RYE8uKK3MPMUpwMCuJ 8C6aBBTiTUmsrEotyo8vKs1JLT7EyMTBKdXA6LhE9f39Y532BT9cCt72/r6meNX48UsDmcid fq/bmHs39vgwnsqwesGizx7GNbeg9v3Gxog/Zzp9BH/dO3eZ90hc/P0TpbYrNi7urY5Q+pic yp+8eX+S3wH/W0nfNDrU22XlPe4ceXclYcr8ogPxnw61R7QHHVYp7jUyWa7gqPRk+qPU5Pvv lFiKMxINtZiLihMBeTJQ6P4BAAA= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a call to s3c_hsotg_disconnect() from 'end session' interrupt to correctly notify gadget subsystem about unplugged usb cable. Signed-off-by: Marek Szyprowski --- drivers/usb/dwc2/gadget.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 7b5856fadd93..119c8a3effc2 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2279,6 +2279,12 @@ irq_retry: dev_info(hsotg->dev, "OTGInt: %08x\n", otgint); writel(otgint, hsotg->regs + GOTGINT); + + if (otgint & GOTGINT_SES_END_DET) { + if (hsotg->gadget.speed != USB_SPEED_UNKNOWN) + s3c_hsotg_disconnect(hsotg); + hsotg->gadget.speed = USB_SPEED_UNKNOWN; + } } if (gintsts & GINTSTS_SESSREQINT) {