All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Greg KH <greg@kroah.com>
Cc: Anshuman Gupta <anshuman.gupta@intel.com>,
	USB list <linux-usb@vger.kernel.org>
Subject: [3/3] USB: xhci-hcd: Add get_resuming_ports method
Date: Fri, 8 Jun 2018 16:59:57 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44L0.1806081656350.1285-100000@iolanthe.rowland.org> (raw)

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>
CC: Mathias Nyman <mathias.nyman@intel.com>
---


[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);

             reply	other threads:[~2018-06-08 20:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08 20:59 Alan Stern [this message]
2018-06-11 11:09 [3/3] USB: xhci-hcd: Add get_resuming_ports method Mathias Nyman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.44L0.1806081656350.1285-100000@iolanthe.rowland.org \
    --to=stern@rowland.harvard.edu \
    --cc=anshuman.gupta@intel.com \
    --cc=greg@kroah.com \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.