aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSakethram Bommisetti <sakethram.bommisetti@stericsson.com>2011-01-25 14:53:59 +0530
committerHenrik Öhman <henrik.ohman@stericsson.com>2011-03-07 10:16:27 +0100
commit2bc9de64f8c94fe8fcf5aa4d3fe61a99efa533b6 (patch)
tree943e166f17902d9c840f50c486829b194d4e3d60 /include
parent80f99186577e9bcdcf74493379e0411396fbcdd7 (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. Signed-off-by: Pavankumar Kondeti <pkondeti@...> Change-Id: Ic94fae902b5eadbbb5eb39959d79adaeb33fa1fb Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/13420 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Tested-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb.h2
-rw-r--r--include/linux/usb/ch9.h9
2 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index d5922a87799..f4f6ef34998 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -314,6 +314,8 @@ 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? */
+ unsigned hnp_support:1; /* OTG: HNP is supported on OTG port */
+ struct delayed_work hnp_polling;/* OTG: HNP polling work */
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 b0f7e9f5717..14e75cb857f 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -126,6 +126,11 @@
#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
+/* 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
+
/**
* struct usb_ctrlrequest - SETUP data for a USB device control request
* @bRequestType: matches the USB bmRequestType field
@@ -585,12 +590,14 @@ struct usb_otg_descriptor {
__u8 bLength;
__u8 bDescriptorType;
- __u8 bmAttributes; /* support for HNP, SRP, etc */
+ __u8 bmAttributes; /* support for HNP, SRP, ADP etc */
+ __le16 bcdOTG;
} __attribute__ ((packed));
/* from usb_otg_descriptor.bmAttributes */
#define USB_OTG_SRP (1 << 0)
#define USB_OTG_HNP (1 << 1) /* swap host/device roles */
+#define USB_OTG_ADP (1 << 2) /* Attach detection protocol*/
/*-------------------------------------------------------------------------*/