aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_core.h
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2009-03-31 15:32:12 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-16 00:44:40 -0400
commitf7f9d63eac12b345d6243d1d608b7944a05be921 (patch)
tree4e4ca31d12739260656c2487babde560999c6eec /drivers/usb/musb/musb_core.h
parent84e250ffa76dddc1bad84e04248a27f442c25986 (diff)
musb: otg timer cleanup
Minor cleanup of OTG timer handling: * unify decls for OTG time constants, in the core header * set up and use that timer in a more normal way * move to the driver struct, so it's usable outside core And tighten use and setup of T(a_wait_bcon) so that if it's used, it's always valid. (If that timer expires, the A-device will stop powering VBUS. For non-OTG systems, that will be a surprise.) No behavioral changes, other than more consistency when applying that core HNP timeout. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb/musb_core.h')
-rw-r--r--drivers/usb/musb/musb_core.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index 2b49c989f043..78116fdb5781 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -40,6 +40,7 @@
40#include <linux/interrupt.h> 40#include <linux/interrupt.h>
41#include <linux/smp_lock.h> 41#include <linux/smp_lock.h>
42#include <linux/errno.h> 42#include <linux/errno.h>
43#include <linux/timer.h>
43#include <linux/clk.h> 44#include <linux/clk.h>
44#include <linux/device.h> 45#include <linux/device.h>
45#include <linux/usb/ch9.h> 46#include <linux/usb/ch9.h>
@@ -180,10 +181,15 @@ enum musb_g_ep0_state {
180 MUSB_EP0_STAGE_ACKWAIT, /* after zlp, before statusin */ 181 MUSB_EP0_STAGE_ACKWAIT, /* after zlp, before statusin */
181} __attribute__ ((packed)); 182} __attribute__ ((packed));
182 183
183/* OTG protocol constants */ 184/*
185 * OTG protocol constants. See USB OTG 1.3 spec,
186 * sections 5.5 "Device Timings" and 6.6.5 "Timers".
187 */
184#define OTG_TIME_A_WAIT_VRISE 100 /* msec (max) */ 188#define OTG_TIME_A_WAIT_VRISE 100 /* msec (max) */
185#define OTG_TIME_A_WAIT_BCON 0 /* 0=infinite; min 1000 msec */ 189#define OTG_TIME_A_WAIT_BCON 1100 /* min 1 second */
186#define OTG_TIME_A_IDLE_BDIS 200 /* msec (min) */ 190#define OTG_TIME_A_AIDL_BDIS 200 /* min 200 msec */
191#define OTG_TIME_B_ASE0_BRST 100 /* min 3.125 ms */
192
187 193
188/*************************** REGISTER ACCESS ********************************/ 194/*************************** REGISTER ACCESS ********************************/
189 195
@@ -332,6 +338,8 @@ struct musb {
332 struct list_head control; /* of musb_qh */ 338 struct list_head control; /* of musb_qh */
333 struct list_head in_bulk; /* of musb_qh */ 339 struct list_head in_bulk; /* of musb_qh */
334 struct list_head out_bulk; /* of musb_qh */ 340 struct list_head out_bulk; /* of musb_qh */
341
342 struct timer_list otg_timer;
335#endif 343#endif
336 344
337 /* called with IRQs blocked; ON/nonzero implies starting a session, 345 /* called with IRQs blocked; ON/nonzero implies starting a session,