Received: by 10.223.176.46 with SMTP id f43csp2880430wra; Mon, 22 Jan 2018 05:05:12 -0800 (PST) X-Google-Smtp-Source: AH8x224DruGxdIMtz6BEgrlw1S+7mTG1rpudzxNmMeHfmP531QmTG3II8oI7yB8/d3B+ZW/WWyFW X-Received: by 10.98.36.132 with SMTP id k4mr6306876pfk.161.1516626312253; Mon, 22 Jan 2018 05:05:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516626312; cv=none; d=google.com; s=arc-20160816; b=vQBzHF5B8WmoqOFMXto9QrE+pPqbqE4X/KIKhjazDydAw43Mutg4hPHQvheBFsuxNy RBoO4eX+QjzVH3E5WuuQFQzdiz5JmI4iCrAwKgOuOpkRFHmQvDslWgLM7kf+2wR9MYXQ +Srm2wpIFOE4usALzWf/XXheZjwiBZiwVZzK5jJ+qf5BRnFgWXzAv0SRLSDDX1lb+Rsd E13SV5xyeMmHfP1M3dt9PPbfDjH9GioZtZPMghMluwN5d3O82CJJWJuEtk8irNKlH2Vs 8Q8I4/NY8qBC5tjZ/Dc+28FeC1rsbNjQ3Gev9reF3eVbTNgNk8a/AA5hw0fLfNiCr5um yFYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=0nymR4iMXTUWXAiRxbPES1ndlSGDjQEuO6TA81p3r/U=; b=Ug2lJUpLRMLC3J1jvO0EmfDsxXVRMiOa9XBCHl29tNG/hLtOURlUzE/8E72oDx8AkL ptvZH6ykM2QEl1ez83j4PhSShLCiTVSlvqJShzw8lxtshpNA2n9WkSFEjYFaKX8FhHpk rPTPK4sj1bOhPTcaP6L/xr2fgJbBgEUvpMcDlF+icOk2MNTTcH1NKP3IpOou49rfhwMY YN3ddhWsknUsj2BxxQaDJ/qjUYrn5uNFL9Ba6KlfsW+HQrphMVnkq6Ua2Jj+aia3JDMv jM4hNtM6EUftwWR55xwS+NzbU15gKB3S5zJjkBwXAWxHKeKLb6bLoDZAhGydTnwRsKvA F6KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=t7Q5Nr9T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7-v6si3448379plk.625.2018.01.22.05.04.58; Mon, 22 Jan 2018 05:05:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=t7Q5Nr9T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751263AbeAVNC2 (ORCPT + 99 others); Mon, 22 Jan 2018 08:02:28 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:24539 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751099AbeAVNBz (ORCPT ); Mon, 22 Jan 2018 08:01:55 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w0MD1rBS006714; Mon, 22 Jan 2018 07:01:53 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1516626113; bh=AIpv58iUotZBxK5oxMuljqfglkqI8nayxCrcf4Noft0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=t7Q5Nr9TZq06au/7aMWTPfnZKa/00WQbaPxqR0Dq0kRwjItWkq3VkSdkwCDhRpoq+ BL1r6JrmFkgVM5Ak67rAyjjXVx2tW2qqRS/ipNRz81al3nRjW6lUNiTJKoZbF4vfOD RqN+cpLRa8GEuozVS0MqaPgA7BzFv0iQpriFfKBU= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0MD1rVN005179; Mon, 22 Jan 2018 07:01:53 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 22 Jan 2018 07:01:53 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 22 Jan 2018 07:01:53 -0600 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0MD1rjp010737; Mon, 22 Jan 2018 07:01:53 -0600 Received: from lta0400828d.ti.com (vboxa0400828d.emea.dhcp.ti.com [172.22.235.94]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id w0MD1oWZ029287; Mon, 22 Jan 2018 07:01:52 -0600 From: Roger Quadros To: CC: , , Roger Quadros Subject: [PATCH 1/2] usb: dwc3: omap: don't miss events during suspend/resume Date: Mon, 22 Jan 2018 15:01:42 +0200 Message-ID: <1516626103-1969-2-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516626103-1969-1-git-send-email-rogerq@ti.com> References: <1516626103-1969-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The USB cable state can change during suspend/resume so be sure to check and update the extcon state. Signed-off-by: Roger Quadros --- drivers/usb/dwc3/dwc3-omap.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index a4719e8..ed8b865 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -582,9 +582,25 @@ static int dwc3_omap_resume(struct device *dev) return 0; } +static void dwc3_omap_complete(struct device *dev) +{ + struct dwc3_omap *omap = dev_get_drvdata(dev); + + if (extcon_get_state(omap->edev, EXTCON_USB)) + dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID); + else + dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_OFF); + + if (extcon_get_state(omap->edev, EXTCON_USB_HOST)) + dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND); + else + dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_FLOAT); +} + static const struct dev_pm_ops dwc3_omap_dev_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume) + .complete = dwc3_omap_complete, }; #define DEV_PM_OPS (&dwc3_omap_dev_pm_ops) -- cheers, -roger Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki