diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-10-30 03:20:56 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-10-30 03:20:56 -0400 |
| commit | 53279f36dccffc26ff536003fd6bb97cc21c3b82 (patch) | |
| tree | 9d16e497c0e4158c7c054c479bd0e9ff0388d7bb /include/linux/usb.h | |
| parent | a6e8c0a25377e27958b11b20e1927885ae7c9857 (diff) | |
| parent | 8f0d8163b50e01f398b14bcd4dc039ac5ab18d64 (diff) | |
Merge tag 'v3.7-rc3' into next to sync up with recent USB and MFD changes
Diffstat (limited to 'include/linux/usb.h')
| -rw-r--r-- | include/linux/usb.h | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 30d1ae38eab1..10278d18709c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -384,6 +384,13 @@ enum usb_device_removable { | |||
| 384 | USB_DEVICE_FIXED, | 384 | USB_DEVICE_FIXED, |
| 385 | }; | 385 | }; |
| 386 | 386 | ||
| 387 | enum usb_port_connect_type { | ||
| 388 | USB_PORT_CONNECT_TYPE_UNKNOWN = 0, | ||
| 389 | USB_PORT_CONNECT_TYPE_HOT_PLUG, | ||
| 390 | USB_PORT_CONNECT_TYPE_HARD_WIRED, | ||
| 391 | USB_PORT_NOT_USED, | ||
| 392 | }; | ||
| 393 | |||
| 387 | /* | 394 | /* |
| 388 | * USB 3.0 Link Power Management (LPM) parameters. | 395 | * USB 3.0 Link Power Management (LPM) parameters. |
| 389 | * | 396 | * |
| @@ -469,7 +476,6 @@ struct usb3_lpm_parameters { | |||
| 469 | * access from userspace | 476 | * access from userspace |
| 470 | * @usbfs_dentry: usbfs dentry entry for the device | 477 | * @usbfs_dentry: usbfs dentry entry for the device |
| 471 | * @maxchild: number of ports if hub | 478 | * @maxchild: number of ports if hub |
| 472 | * @children: child devices - USB devices that are attached to this hub | ||
| 473 | * @quirks: quirks of the whole device | 479 | * @quirks: quirks of the whole device |
| 474 | * @urbnum: number of URBs submitted for the whole device | 480 | * @urbnum: number of URBs submitted for the whole device |
| 475 | * @active_duration: total time device is not suspended | 481 | * @active_duration: total time device is not suspended |
| @@ -543,7 +549,6 @@ struct usb_device { | |||
| 543 | struct list_head filelist; | 549 | struct list_head filelist; |
| 544 | 550 | ||
| 545 | int maxchild; | 551 | int maxchild; |
| 546 | struct usb_device **children; | ||
| 547 | 552 | ||
| 548 | u32 quirks; | 553 | u32 quirks; |
| 549 | atomic_t urbnum; | 554 | atomic_t urbnum; |
| @@ -572,6 +577,19 @@ static inline struct usb_device *interface_to_usbdev(struct usb_interface *intf) | |||
| 572 | 577 | ||
| 573 | extern struct usb_device *usb_get_dev(struct usb_device *dev); | 578 | extern struct usb_device *usb_get_dev(struct usb_device *dev); |
| 574 | extern void usb_put_dev(struct usb_device *dev); | 579 | extern void usb_put_dev(struct usb_device *dev); |
| 580 | extern struct usb_device *usb_hub_find_child(struct usb_device *hdev, | ||
| 581 | int port1); | ||
| 582 | |||
| 583 | /** | ||
| 584 | * usb_hub_for_each_child - iterate over all child devices on the hub | ||
| 585 | * @hdev: USB device belonging to the usb hub | ||
| 586 | * @port1: portnum associated with child device | ||
| 587 | * @child: child device pointer | ||
| 588 | */ | ||
| 589 | #define usb_hub_for_each_child(hdev, port1, child) \ | ||
| 590 | for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ | ||
| 591 | port1 <= hdev->maxchild; \ | ||
| 592 | child = usb_hub_find_child(hdev, ++port1)) | ||
| 575 | 593 | ||
| 576 | /* USB device locking */ | 594 | /* USB device locking */ |
| 577 | #define usb_lock_device(udev) device_lock(&(udev)->dev) | 595 | #define usb_lock_device(udev) device_lock(&(udev)->dev) |
| @@ -584,6 +602,16 @@ extern int usb_lock_device_for_reset(struct usb_device *udev, | |||
| 584 | extern int usb_reset_device(struct usb_device *dev); | 602 | extern int usb_reset_device(struct usb_device *dev); |
| 585 | extern void usb_queue_reset_device(struct usb_interface *dev); | 603 | extern void usb_queue_reset_device(struct usb_interface *dev); |
| 586 | 604 | ||
| 605 | #ifdef CONFIG_ACPI | ||
| 606 | extern int usb_acpi_set_power_state(struct usb_device *hdev, int index, | ||
| 607 | bool enable); | ||
| 608 | extern bool usb_acpi_power_manageable(struct usb_device *hdev, int index); | ||
| 609 | #else | ||
| 610 | static inline int usb_acpi_set_power_state(struct usb_device *hdev, int index, | ||
| 611 | bool enable) { return 0; } | ||
| 612 | static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index) | ||
| 613 | { return true; } | ||
| 614 | #endif | ||
| 587 | 615 | ||
| 588 | /* USB autosuspend and autoresume */ | 616 | /* USB autosuspend and autoresume */ |
| 589 | #ifdef CONFIG_USB_SUSPEND | 617 | #ifdef CONFIG_USB_SUSPEND |
| @@ -1750,17 +1778,6 @@ static inline int usb_translate_errors(int error_code) | |||
| 1750 | extern void usb_register_notify(struct notifier_block *nb); | 1778 | extern void usb_register_notify(struct notifier_block *nb); |
| 1751 | extern void usb_unregister_notify(struct notifier_block *nb); | 1779 | extern void usb_unregister_notify(struct notifier_block *nb); |
| 1752 | 1780 | ||
| 1753 | #ifdef DEBUG | ||
| 1754 | #define dbg(format, arg...) \ | ||
| 1755 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg) | ||
| 1756 | #else | ||
| 1757 | #define dbg(format, arg...) \ | ||
| 1758 | do { \ | ||
| 1759 | if (0) \ | ||
| 1760 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \ | ||
| 1761 | } while (0) | ||
| 1762 | #endif | ||
| 1763 | |||
| 1764 | /* debugfs stuff */ | 1781 | /* debugfs stuff */ |
| 1765 | extern struct dentry *usb_debug_root; | 1782 | extern struct dentry *usb_debug_root; |
| 1766 | 1783 | ||
