Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2022001imm; Thu, 24 May 2018 04:40:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq1ns02aDkIkp7Gzyb5cAUvCNDp8ZOKLstmRTZxoID4wS8pBJbwVoaqB7+bTT31wRGMGxSq X-Received: by 2002:a62:2218:: with SMTP id i24-v6mr6876917pfi.53.1527162018270; Thu, 24 May 2018 04:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527162018; cv=none; d=google.com; s=arc-20160816; b=wf2S1WyoD0X5Tjvx1d0NekJ1ZLjKk1g0Vk84LtZr1JuXUB4OW3/FnVcCbrLVBE7YbJ D7U9WsZGUe2flUuXIXu3bbliZ1TZpxMlbxQ/RZ8Ohyj65Z+xsx9tw/URH8i1UhfBfS5d 8RUGYfvW4CRpI7ivafaP1EpvERPU6aIwTDEROY5geVILHRRsArZi9AVDwbol86qswbsB Ofl0GYFSIA/Y7sQ4Iaz0+hvpfDkBcXmoR1BIanyb3n2cjlP3KjpM8jVFXzWUw8dEdlPo MF3BqKrsqBPv+QBRveKSImCosBlcJflXXUXL7w/T+hzzdL82LB5lKlLMQ1XqsrLi8Ccq W/VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=9RGM30gUeihNB/BzIbcuz+VaLzziBZRllangRzAHBvc=; b=ww5nIpV71DP1nKK3BS3At+qP3J/koJMBQyU4L7a91RNdvzG5m/MrkQ4Y8eNCt5W1yz rXdOQTSoI4J9yahv44RNe7wc3n7ZBWPAGjV43+jkAAV73wT/syJvacP2gJ0zCQs+hrMr Q4sY/tzojoIHRJzIjCqjZ4chYxO3vz9Uq+kXW2FHauKXth9ht5M3ENHh6qiRdvUSNpA2 Svyswq373L0ke4FLNvurh3r2Cet7fQSGKNW2opla8oL9Z4kzMMO2Mc1nxFL6oRMVoh5m zL4ErIkgatFq/9mS5Hb14p5ZawAMsVkVYiM4VDkVICb4BYYTWqHtA1BgNvrLWtb3SXLH 7Exg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gRK3/lZV; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7-v6si247280pgu.362.2018.05.24.04.40.03; Thu, 24 May 2018 04:40:18 -0700 (PDT) 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=@kernel.org header.s=default header.b=gRK3/lZV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969133AbeEXLjZ (ORCPT + 99 others); Thu, 24 May 2018 07:39:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:36624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967319AbeEXJtI (ORCPT ); Thu, 24 May 2018 05:49:08 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD3A2208A3; Thu, 24 May 2018 09:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155348; bh=/DA9yjyw8KE/kgNu8H+LU+Qn2EkukU8nYfG8WHRuWu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gRK3/lZVsCLBzF17nfEXIJkkbAV2ExbACKgcsFjNUO+1zIpX9k5NAHg8nDZD4SmRe j5rypRoEecwL4yiBy3b007VJ33FBMC8uOWqwFatGt14USmfOa7QgWBV/1NIeYaISLc Gh+pU3EJdTnT8SxgKEeLojUHb/rjatTLuTZjrCOU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roger Quadros , Felipe Balbi , Sasha Levin Subject: [PATCH 4.9 26/96] usb: dwc3: omap: dont miss events during suspend/resume Date: Thu, 24 May 2018 11:38:09 +0200 Message-Id: <20180524093607.076046076@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093605.602125311@linuxfoundation.org> References: <20180524093605.602125311@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Roger Quadros [ Upstream commit c49f63055e252810e5d6c83a4943b18db16b3cd8 ] The USB cable state can change during suspend/resume so be sure to check and update the extcon state. Signed-off-by: Roger Quadros Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/dwc3-omap.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -598,9 +598,25 @@ static int dwc3_omap_resume(struct devic 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)