USB: core: Add support for OTG automated compliance tests
1. Add OTG PET device to TPL. OTG device shall support this
device for allowing compliance automated testing.
2. Add otg_srp_reqd filed to gadget. OTG B-device shall enable
this flag when OTG PET (Protocol and Electrical Tester) that
acts as A-device sends Set Feature TEST_MODE with wIndex high
byte value = 0x06. OTG PET expects B-device to initiate SRP
after the end of current session.
3. Add otg_vbus_off to usb_bus. USB core enables this flag
when OTG PET enumerates with bcdDevice[0] field in its Device
Descriptor is equal to 1. OTG PET expects A-device to turn off
the VBUS with in 5 sec of its disconnection which allows it to
initiate SRP.
3. Add support to identify OTG PET and start HNP quickly.
Change-Id: Ib1f4d835d00ca29ff8f980c94d75a3890507dedc
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index e4ee15c..ea49aa1 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -133,6 +133,12 @@
#define TEST_PACKET 4
#define TEST_FORCE_EN 5
+/* OTG test mode feature bits
+ * See ECN OTG2.0 spec Table 6-8
+ */
+#define TEST_OTG_SRP_REQD 6
+#define TEST_OTG_HNP_REQD 7
+
/*
* New Feature Selectors as added by USB 3.0
* See USB 3.0 spec Table 9-6
@@ -146,9 +152,12 @@
#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
-#define OTG_STATUS_SELECTOR 0xF000
+#define OTG_STATUS_SELECTOR 0xF000
+#define HOST_REQUEST_FLAG 0
#define THOST_REQ_POLL 1500 /* msec (1000 - 2000) */
-#define HOST_REQUEST_FLAG 0
+#define OTG_TTST_SUSP 70 /* msec (0 - 100) */
+
+#define OTG_TTST_VBUS_OFF 1
/* Bit array elements as returned by the USB_REQ_GET_STATUS request. */
#define USB_DEV_STAT_U1_ENABLED 2 /* transition into U1 state */