Initial Contribution
msm-2.6.38: tag AU_LINUX_ANDROID_GINGERBREAD.02.03.04.00.142
Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index d87f44f..61814a7 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -35,6 +35,34 @@
OTG_STATE_A_VBUS_ERR,
};
+enum usb_otg_event {
+ /* Device is not connected within
+ * TA_WAIT_BCON or not responding.
+ */
+ OTG_EVENT_DEV_CONN_TMOUT,
+ /* B-device returned STALL for
+ * B_HNP_ENABLE feature request.
+ */
+ OTG_EVENT_NO_RESP_FOR_HNP_ENABLE,
+ /* HUB class devices are not
+ * supported.
+ */
+ OTG_EVENT_HUB_NOT_SUPPORTED,
+ /* Device is not supported i.e
+ * not listed in TPL.
+ */
+ OTG_EVENT_DEV_NOT_SUPPORTED,
+ /* HNP failed due to
+ * TA_AIDL_BDIS timeout or
+ * TB_ASE0_BRST timeout
+ */
+ OTG_EVENT_HNP_FAILED,
+ /* B-device did not detect VBUS
+ * within TB_SRP_FAIL time.
+ */
+ OTG_EVENT_NO_RESP_FOR_SRP,
+};
+
enum usb_xceiv_events {
USB_EVENT_NONE, /* no events or cable disconnected */
USB_EVENT_VBUS, /* vbus valid event */
@@ -111,6 +139,10 @@
/* start or continue HNP role switch */
int (*start_hnp)(struct otg_transceiver *otg);
+ /* send events to user space */
+ int (*send_event)(struct otg_transceiver *otg,
+ enum usb_otg_event event);
+
};
@@ -164,6 +196,10 @@
otg->shutdown(otg);
}
+/* for USB core, host and peripheral controller drivers */
+/* Context: can sleep */
+extern int otg_send_event(enum usb_otg_event event);
+
/* for usb host and peripheral controller drivers */
#ifdef CONFIG_USB_OTG_UTILS
extern struct otg_transceiver *otg_get_transceiver(void);