]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/usb/musb/musb_core.h
musb: otg timer cleanup
[net-next-2.6.git] / drivers / usb / musb / musb_core.h
index 2b49c989f04343c1f89efab1f0fee5caab61efa6..78116fdb578101f51fe745b52b922271d5936df1 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/interrupt.h>
 #include <linux/smp_lock.h>
 #include <linux/errno.h>
+#include <linux/timer.h>
 #include <linux/clk.h>
 #include <linux/device.h>
 #include <linux/usb/ch9.h>
@@ -180,10 +181,15 @@ enum musb_g_ep0_state {
        MUSB_EP0_STAGE_ACKWAIT,         /* after zlp, before statusin */
 } __attribute__ ((packed));
 
-/* OTG protocol constants */
+/*
+ * OTG protocol constants.  See USB OTG 1.3 spec,
+ * sections 5.5 "Device Timings" and 6.6.5 "Timers".
+ */
 #define OTG_TIME_A_WAIT_VRISE  100             /* msec (max) */
-#define OTG_TIME_A_WAIT_BCON   0               /* 0=infinite; min 1000 msec */
-#define OTG_TIME_A_IDLE_BDIS   200             /* msec (min) */
+#define OTG_TIME_A_WAIT_BCON   1100            /* min 1 second */
+#define OTG_TIME_A_AIDL_BDIS   200             /* min 200 msec */
+#define OTG_TIME_B_ASE0_BRST   100             /* min 3.125 ms */
+
 
 /*************************** REGISTER ACCESS ********************************/
 
@@ -332,6 +338,8 @@ struct musb {
        struct list_head        control;        /* of musb_qh */
        struct list_head        in_bulk;        /* of musb_qh */
        struct list_head        out_bulk;       /* of musb_qh */
+
+       struct timer_list       otg_timer;
 #endif
 
        /* called with IRQs blocked; ON/nonzero implies starting a session,