summaryrefslogtreecommitdiff
path: root/drivers/usb/core/hub.h
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2013-01-23 04:26:29 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-25 10:12:19 -0800
commit971fcd492cebf544714f12d94549d2f0d2002645 (patch)
tree553a48486114b3b3b1507cf5dc391f24a464912f /drivers/usb/core/hub.h
parent6802771bba0455a751d8f4ece7587585be3eaa2f (diff)
usb: add runtime pm support for usb port device
This patch is to add runtime pm callback for usb port device. Set/clear PORT_POWER feature in the resume/suspend callback. Add portnum for struct usb_port to record port number. Do pm_rumtime_get_sync/put(portdev) when a device is plugged/unplugged to prevent it from being powered off when it is active. Acked-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/hub.h')
-rw-r--r--drivers/usb/core/hub.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
index c472058f8f27..452e5cd7b249 100644
--- a/drivers/usb/core/hub.h
+++ b/drivers/usb/core/hub.h
@@ -79,12 +79,14 @@ struct usb_hub {
* @dev: generic device interface
* @port_owner: port's owner
* @connect_type: port's connect type
+ * @portnum: port index num based one
*/
struct usb_port {
struct usb_device *child;
struct device dev;
struct dev_state *port_owner;
enum usb_port_connect_type connect_type;
+ u8 portnum;
};
#define to_usb_port(_dev) \
@@ -94,4 +96,6 @@ extern int usb_hub_create_port_device(struct usb_hub *hub,
int port1);
extern void usb_hub_remove_port_device(struct usb_hub *hub,
int port1);
+extern int usb_hub_set_port_power(struct usb_device *hdev,
+ int port1, bool set);