]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/musb/musbdefs.h
musb_hdrc: Update peripheral side suspend support
[linux-2.6-omap-h63xx.git] / drivers / usb / musb / musbdefs.h
index cea81fdaf6630c84fd6ccc535d9fa82adb3b4109..d059be34ff0a6d5bca9ea8f5add3414f18e3c5a4 100644 (file)
@@ -176,10 +176,13 @@ static inline void musb_host_rx(struct musb *m, u8 e) {}
 #endif
 
 /* host side ep0 states */
-#define MGC_END0_START  0x0
-#define MGC_END0_OUT    0x2
-#define MGC_END0_IN     0x4
-#define MGC_END0_STATUS 0x8
+enum musb_h_ep0_state {
+       MGC_END0_IDLE,
+       MGC_END0_START,                 /* expect ack of setup */
+       MGC_END0_IN,                    /* expect IN DATA */
+       MGC_END0_OUT,                   /* expect ack of OUT DATA */
+       MGC_END0_STATUS,                /* expect ack of STATUS */
+} __attribute__ ((packed));
 
 /* peripheral side ep0 states */
 enum musb_g_ep0_state {
@@ -347,7 +350,7 @@ struct musb {
        u32                     port1_status;
        unsigned long           rh_timer;
 
-       u8 bEnd0Stage;          /* end0 stage while in host */
+       enum musb_h_ep0_state   bEnd0Stage;
 
        /* bulk traffic normally dedicates endpoint hardware, and each
         * direction has its own ring of host side endpoints.
@@ -402,7 +405,7 @@ struct musb {
        u8                      min_power;      /* vbus for periph, in mA/2 */
 
        /* active means connected and not suspended */
-       unsigned is_active:1;
+       unsigned                is_active:1;
 
        unsigned bIsMultipoint:1;
        unsigned bIsHost:1;
@@ -430,8 +433,19 @@ struct musb {
 #endif
 
 #ifdef CONFIG_USB_GADGET_MUSB_HDRC
-       unsigned bIsSelfPowered:1;
-       unsigned bMayWakeup:1;
+       /* is_suspended means USB B_PERIPHERAL suspend */
+       unsigned                is_suspended:1;
+
+       /* may_wakeup means remote wakeup is enabled */
+       unsigned                may_wakeup:1;
+
+       /* is_self_powered is reported in device status and the
+        * config descriptor.  is_bus_powered means B_PERIPHERAL
+        * draws some VBUS current; both can be true.
+        */
+       unsigned                is_self_powered:1;
+       unsigned                is_bus_powered:1;
+
        unsigned bSetAddress:1;
        unsigned bTestMode:1;
        unsigned softconnect:1;