diff options
author | Avinash Kumar <avinash.kumar@stericsson.com> | 2012-02-13 18:48:47 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 11:03:18 +0200 |
commit | bdb74d8442ca934d2a06a35379cd5315d76c7888 (patch) | |
tree | 46d21a83fc54ea76283759984d0c3083e937c770 /include/linux | |
parent | 8bf2cb67f4a2b543294a3cdef05bb8e84ad0bc79 (diff) |
USB: core: OTG Supplement Revision 2.0 updates
OTG supplement revision 2.0 spec introduces Attach Detection Protocol
(ADP) for detecting peripheral connection without applying power on
VBUS. ADP is optional and is included in the OTG descriptor along with
SRP and HNP.
HNP polling is introduced for peripheral to notify its wish to become
host. Host polls (GET_STATUS on DEVICE) peripheral for host_request
and suspend the bus when peripheral returns host_request TRUE. The
spec insists the polling frequency to be in 1-2 sec range and bus
should be suspended with in 2 sec from host_request is set.
a_alt_hnp_support feature is obsolete and a_hnp_support feature is
limited to only legacy OTG B-device. The newly introduced bcdOTG
field in the OTG descriptor is used for identifying the 2.0 compliant
B-device.
ST-Ericsson ID: 401192
ST-Ericsson Linux next: NA
ST-Ericsson FOSS-OUT ID: NA
Change-Id: I01ea82656e3ea0302613562354521ed4fae5ac5e
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Avinash Kumar <avinash.kumar@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/48747
Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
Reviewed-by: QATOOLS
Reviewed-by: QABUILD
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/usb.h | 4 | ||||
-rw-r--r-- | include/linux/usb/ch9.h | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h index 33488200c17..3645e63e029 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -331,6 +331,10 @@ struct usb_bus { u8 otg_port; /* 0, or number of OTG/HNP port */ unsigned is_b_host:1; /* true during some HNP roleswitches */ unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ +#ifdef CONFIG_USB_OTG + unsigned hnp_support:1; /* OTG: HNP is supported on OTG port */ + struct delayed_work hnp_polling;/* OTG: HNP polling work */ +#endif unsigned sg_tablesize; /* 0 or largest number of sg list entries */ int devnum_next; /* Next open device number in diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index af21f311591..1ed2af81975 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h @@ -152,6 +152,12 @@ #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ +#ifdef CONFIG_USB_OTG +/* OTG 2.0 spec 6.2 and 6.3 sections */ +#define OTG_STATUS_SELECTOR 0xF000 +#define THOST_REQ_POLL 1500 /* 1000 - 2000 msec */ +#define HOST_REQUEST_FLAG 0 +#endif /* Bit array elements as returned by the USB_REQ_GET_STATUS request. */ #define USB_DEV_STAT_U1_ENABLED 2 /* transition into U1 state */ #define USB_DEV_STAT_U2_ENABLED 3 /* transition into U2 state */ @@ -651,8 +657,10 @@ struct usb_qualifier_descriptor { struct usb_otg_descriptor { __u8 bLength; __u8 bDescriptorType; - - __u8 bmAttributes; /* support for HNP, SRP, etc */ +#ifdef CONFIG_USB_OTG + __u8 bmAttributes; /* support for HNP, SRP, ADP etc */ + __le16 bcdOTG; +#endif } __attribute__ ((packed)); /* from usb_otg_descriptor.bmAttributes */ |