From patchwork Fri Jun 8 20:59:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Stern X-Patchwork-Id: 10455235 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D0601601D4 for ; Fri, 8 Jun 2018 21:00:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDCEB29572 for ; Fri, 8 Jun 2018 21:00:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B212429292; Fri, 8 Jun 2018 21:00:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F56829292 for ; Fri, 8 Jun 2018 21:00:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753100AbeFHU77 (ORCPT ); Fri, 8 Jun 2018 16:59:59 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:45246 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753096AbeFHU76 (ORCPT ); Fri, 8 Jun 2018 16:59:58 -0400 Received: (qmail 2281 invoked by uid 2102); 8 Jun 2018 16:59:57 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 8 Jun 2018 16:59:57 -0400 Date: Fri, 8 Jun 2018 16:59:57 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Greg KH cc: Anshuman Gupta , USB list Subject: [PATCH 3/3] USB: xhci-hcd: Add get_resuming_ports method Message-ID: MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds support for the new get_resuming_ports HCD method to the xhci-hcd driver. Signed-off-by: Alan Stern CC: Mathias Nyman Acked-by: Mathias Nyman --- [as1869] -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: usb-4.x/drivers/usb/host/xhci-hub.c =================================================================== --- usb-4.x.orig/drivers/usb/host/xhci-hub.c +++ usb-4.x/drivers/usb/host/xhci-hub.c @@ -1684,4 +1684,15 @@ int xhci_bus_resume(struct usb_hcd *hcd) return 0; } +unsigned long xhci_get_resuming_ports(struct usb_hcd *hcd) +{ + struct xhci_hcd *xhci = hcd_to_xhci(hcd); + struct xhci_bus_state *bus_state; + + bus_state = &xhci->bus_state[hcd_index(hcd)]; + + /* USB3 port wakeups are reported via usb_wakeup_notification() */ + return bus_state->resuming_ports; /* USB2 ports only */ +} + #endif /* CONFIG_PM */ Index: usb-4.x/drivers/usb/host/xhci.c =================================================================== --- usb-4.x.orig/drivers/usb/host/xhci.c +++ usb-4.x/drivers/usb/host/xhci.c @@ -5019,6 +5019,7 @@ static const struct hc_driver xhci_hc_dr .hub_status_data = xhci_hub_status_data, .bus_suspend = xhci_bus_suspend, .bus_resume = xhci_bus_resume, + .get_resuming_ports = xhci_get_resuming_ports, /* * call back when device connected and addressed Index: usb-4.x/drivers/usb/host/xhci.h =================================================================== --- usb-4.x.orig/drivers/usb/host/xhci.h +++ usb-4.x/drivers/usb/host/xhci.h @@ -2104,9 +2104,11 @@ void xhci_hc_died(struct xhci_hcd *xhci) #ifdef CONFIG_PM int xhci_bus_suspend(struct usb_hcd *hcd); int xhci_bus_resume(struct usb_hcd *hcd); +unsigned long xhci_get_resuming_ports(struct usb_hcd *hcd); #else #define xhci_bus_suspend NULL #define xhci_bus_resume NULL +#define xhci_get_resuming_ports NULL #endif /* CONFIG_PM */ u32 xhci_port_state_to_neutral(u32 state);