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: 38802 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0436E20973 for ; Thu, 16 Oct 2014 12:58:36 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf1881278lbg.9 for ; Thu, 16 Oct 2014 05:58:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=IpJzkUZF7eZRYZ9Y2luAqZNQU9Su4QZNv0sDSAfnytc=; b=IxuMLcuJroeFQh8gJpIBTydLp/fSr8GgHHyDDnSyIZwG2tYnTQhDAl3XmAcbVFBu2s XpS6yum8cD4S4UdiFA2AgT/luMZeHlDbYVNU9o7/Hs2v2si2iIe0w/uJfDjAH0CNG/nm ct7ARLkfyPz5OAK651HiFpF7VhGLKYBMDvSCcGA9wJsEfx10e9kbhDuNKxALD4bjgguc 9mKPbyt0YpUxTqRsT0bN7ht1QmuOE86/T6sKJi9AnTUJrGiSbYySryjm9WRqAzHgftEu dsZ2xN+3gSRpFE79tWeoREh4qmfux/S3A5VbfvRjUlsxgu7kF4La1dJBOi41FchPR84b n5TQ== X-Gm-Message-State: ALoCoQmHHO+6Csy7LE3Yv1E952/iPb3ezR8umnpaon9lecS3T8Sx4teCgjFmQf//GORXeMuIbcQY X-Received: by 10.180.76.42 with SMTP id h10mr913502wiw.6.1413464315787; Thu, 16 Oct 2014 05:58:35 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.200 with SMTP id y8ls154096lal.93.gmail; Thu, 16 Oct 2014 05:58:35 -0700 (PDT) X-Received: by 10.152.7.7 with SMTP id f7mr1377226laa.57.1413464315616; Thu, 16 Oct 2014 05:58:35 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com [209.85.215.44]) by mx.google.com with ESMTPS id bg6si34729129lbc.42.2014.10.16.05.58.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Oct 2014 05:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by mail-la0-f44.google.com with SMTP id hs14so2821414lab.17 for ; Thu, 16 Oct 2014 05:58:35 -0700 (PDT) X-Received: by 10.112.167.38 with SMTP id zl6mr1538930lbb.34.1413464315301; Thu, 16 Oct 2014 05:58:35 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.84.229 with SMTP id c5csp33446lbz; Thu, 16 Oct 2014 05:58:34 -0700 (PDT) X-Received: by 10.69.18.235 with SMTP id gp11mr1223932pbd.160.1413464313828; Thu, 16 Oct 2014 05:58:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yk7si11920691pab.135.2014.10.16.05.58.33 for ; Thu, 16 Oct 2014 05:58:33 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752440AbaJPM6a (ORCPT + 3 others); 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-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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) {