[PATCH] USB OTG: usbcore enumeration (3/5)
commit1ae4eefeb5fac0383fede8b23c6b8126651bdf4d
authorDavid Brownell <david-b@pacbell.net>
Tue, 24 Aug 2004 04:55:57 +0000 (23 21:55 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 24 Aug 2004 04:55:57 +0000 (23 21:55 -0700)
tree6fc8551424618408035291bb50cfcc1976f36c83
parent6c932443172df7788662bd2ebe158a866a97f701
[PATCH] USB OTG: usbcore enumeration (3/5)

Teach usbcore how to enumerate OTG devices and perform HNP:

 - CONFIG_USB_OTG is a boolean; it selects CONFIG_USB_SUSPEND.
   Boards with a Mini-AB connector should offer it as a config
   option; no other hardware could support OTG.

 - Before resetting a port, make sure it's not still suspended.
   (For example, after an HNP role switch.)

 - When an OTG A-Host enumerates a dual-role device, set the
   appropriate device feature:  B_HNP_ENABLE if it's connected
   to the OTG port, otherwise A_ALT_HNP_SUPPORT.

 - When an OTG B-Host enumerates a dual-role device, don't
   bother debouncing ... the power session is stable already,
   the A-Host already debounced.

 - The OTG "Targeted Peripheral List" lives in a product-customized
   "otg_whitelist.h" header.

 - CONFIG_USB_OTG_WHITELIST lets developers choose to ignore whitelist
   failures, so unsupported devices can be configured anyway.

 - If the whitelist check fails, immediately suspend the device.

    * For dual-role devices, that triggers HNP so the other device
      can try to act as host.

    * For peripheral-only devices, that conserves power ... but not
      quite as much as turning off power on that port, which should
      eventually be done with OTG ports (and all other ports that
      support SRP).

The whitelist logic tries to make use of the existing usb_device_id
logic, but since the interface info isn't available that early it's
a bit awkward use information anywhere outside the device descriptor.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/usb/core/Kconfig
drivers/usb/core/hub.c
drivers/usb/core/otg_whitelist.h [new file with mode: 0644]