Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1999254imm; Thu, 24 May 2018 04:16:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpXZGLJiA9+rRfecFi2Tf+PK2Xz5kN9o1YXXCz4Kc1UgziR6Cp4BXXp3HE0OqbHTg1jeYrX X-Received: by 2002:a17:902:6bc7:: with SMTP id m7-v6mr6762997plt.162.1527160605906; Thu, 24 May 2018 04:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160605; cv=none; d=google.com; s=arc-20160816; b=RUyx8oiLtVChIXnUoM+LKuC6wC6aCTKs3ulMQ3G5EBjflK2CIvUY4+NZjDJzUVeCnt YmOvetFvD1Viy5JY0Psx4sYiovtWDw9u+ALJv4XWeNuzjhXnsZD073tUZ62lmkOVkHV5 H3sh/xCOnobRH+Pzu3Q6X+ql6ia9No2c6SkWgQmBcptbmeW1y6DE65L9eFeQJi6dsMoJ QAYZ0QTzWtkLHDjsHXiDm+r31YU/dyP8g+nr4fDZ7kaMjsFQjcvzxQhVh3A/JiQmnIC2 AZR6fvzdnxAmKqj0RxbQGGUMvvz0XChsmzI+WC8lffOrGjTfPBYL4oUeOm6Nnma+7Z1V 1koA== 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=oYgJPiQio/S9do9Zw3pt/JXdkSsLm4diy/E9Q0otyEk=; b=Wm/C708NJqepai3Evt3yNZsL+da5Y0Uvmj2SK8epvH8CkioNsshYSUY1VKXcir6/As 1lYwQFljSW1G2U+bOIFhGrDjiYO4neTCpnhbNfhRqxkBOLvM7po64QdLYTEtVusU0igT 38p21finfXrnObIq+U6nDinLhPxaQ2J15ElyCI1gC40V2Pf9BudKOfLEi7j7ct1sUd1G YAmJoafZuMOO8aEjqlMmTeGNI8y1ADpRckn1dEM57+MdwvSnaIM3oD0+mpEhEqY55TBe eylQ+Su1UT+U4L9/QQfAsNF/ewTs7uLpJ+/LAZ3H1HvEFubcla8+mnE6tHQiadLZ0zpo cvhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jcYeOZnR; 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 z19-v6si20553667plo.174.2018.05.24.04.16.31; Thu, 24 May 2018 04:16:45 -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=jcYeOZnR; 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 S968659AbeEXLP5 (ORCPT + 99 others); Thu, 24 May 2018 07:15:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:60360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968068AbeEXJxk (ORCPT ); Thu, 24 May 2018 05:53:40 -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 56F22208A0; Thu, 24 May 2018 09:53:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155619; bh=gbSxlT8SwB31V3cqsB+hq+NtvSKvxrwrKizNtb4HEjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jcYeOZnRhelq4wPL7BHbf3+3ngEk1wZau7vr0OBFu2wlE+19yXMGIg1d2v/++W3wD R4I/XnXm2A7VAP+EtHgXgzGddiQfK86GuSVCoqUi0EawsizyVkzYoDCf3EC67LGOR2 eVEbFbToIQloYXdpzzmFVGzXv8mW+B2hV7xSaBI4= 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.14 056/165] usb: dwc3: omap: dont miss events during suspend/resume Date: Thu, 24 May 2018 11:37:42 +0200 Message-Id: <20180524093624.287933701@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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.14-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 @@ -590,9 +590,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)