]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
USB: xhci-hcd: Add get_resuming_ports method
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 8 Jun 2018 20:59:57 +0000 (16:59 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jun 2018 13:44:43 +0000 (21:44 +0800)
This patch adds support for the new get_resuming_ports HCD method to
the xhci-hcd driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-hub.c
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h

index a4b95d019f843b69686e4e2834be5d0edaf6d341..7e2a531ba321d4d3d50b24fe1278332e128821c1 100644 (file)
@@ -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 8c8da2d657fa1008c1e612e6f30d3e9716d534b6..2f239cb3deaf0b679c692e86a3ba74e970fc9b16 100644 (file)
@@ -5081,6 +5081,7 @@ static const struct hc_driver xhci_hc_driver = {
        .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 939e2f86b595eecbf1f1ecac7dcd7f39965d238d..ece5891240f0e8af214d520c02125d672ae1cfc1 100644 (file)
@@ -2110,9 +2110,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);