--- zzzz-none-000/linux-2.6.28.10/drivers/usb/musb/musb_core.h 2009-05-02 18:54:43.000000000 +0000 +++ puma5-6360-529/linux-2.6.28.10/drivers/usb/musb/musb_core.h 2011-02-07 17:11:53.000000000 +0000 @@ -42,8 +42,11 @@ #include #include #include +//#include +//#include #include #include + #include #include #include @@ -52,10 +55,25 @@ struct musb_hw_ep; struct musb_ep; +#ifdef CONFIG_AVM_POWER +#include +#endif /*--- #ifdef CONFIG_AVM_POWER ---*/ #include "musb_debug.h" #include "musb_dma.h" +#ifdef CONFIG_USB_MUSB_SOC +/* + * * Get core configuration from a header converted (by cfg_conv) + * * from the Verilog config file generated by the core config utility + * * + * * For now we assume that header is provided along with other + * * arch-specific files. Discrete chips will need a build tweak. + * * So will using AHB IDs from silicon that provides them. + * */ +#include +#endif + #include "musb_io.h" #include "musb_regs.h" @@ -153,9 +171,17 @@ /****************************** CONSTANTS ********************************/ #ifndef MUSB_C_NUM_EPS -#define MUSB_C_NUM_EPS ((u8)16) +#define MUSB_C_NUM_EPS ((u8)10) #endif +/* ** Number of Tx endpoints ** */ +/* Legal values are 1 - 16 (this value includes EP0) */ +#define MUSB_C_NUM_EPT 5 + +/* ** Number of Rx endpoints ** */ +/* Legal values are 1 - 16 (this value includes EP0) */ +#define MUSB_C_NUM_EPR 5 + #ifndef MUSB_MAX_END0_PACKET #define MUSB_MAX_END0_PACKET ((u16)MUSB_EP0_FIFOSIZE) #endif @@ -246,6 +272,7 @@ /* index in musb->endpoints[] */ u8 epnum; + u8 dma_mode; /* hardware configuration, possibly dynamic */ bool is_shared_fifo; @@ -270,6 +297,9 @@ /* currently scheduled peripheral endpoint */ struct musb_qh *in_qh; struct musb_qh *out_qh; + /* list of rx and tx qh's */ + struct list_head in_list; + struct list_head out_list; u8 rx_reinit; u8 tx_reinit; @@ -280,6 +310,10 @@ struct musb_ep ep_in; /* TX */ struct musb_ep ep_out; /* RX */ #endif + struct usb_iso_packet_descriptor *iso_frame_desc; + int num_iso_packets; + u8 iso_idx; + u8 fifo_flush_check; }; static inline struct usb_request *next_in_request(struct musb_hw_ep *hw_ep) @@ -304,9 +338,9 @@ * struct musb - Driver instance data. */ struct musb { - /* device lock */ spinlock_t lock; struct clk *clock; +// irqreturn_t (*isr)(int, void *, struct pt_regs *); irqreturn_t (*isr)(int, void *); struct work_struct irq_work; @@ -320,18 +354,13 @@ enum musb_h_ep0_state ep0_stage; - /* bulk traffic normally dedicates endpoint hardware, and each - * direction has its own ring of host side endpoints. - * we try to progress the transfer at the head of each endpoint's - * queue until it completes or NAKs too much; then we try the next - * endpoint. - */ - struct musb_hw_ep *bulk_ep; + struct musb_hw_ep *iso_ep; + struct musb_hw_ep *intr_ep; + u8 hold; + int hold_count; - struct list_head control; /* of musb_qh */ - struct list_head in_bulk; /* of musb_qh */ - struct list_head out_bulk; /* of musb_qh */ - struct musb_qh *periodic[32]; /* tree of interrupt+iso */ + struct musb_qh *in[5]; + struct musb_qh *out[5]; #endif /* called with IRQs blocked; ON/nonzero implies starting a session, @@ -355,13 +384,14 @@ u8 int_usb; u16 int_rx; u16 int_tx; + //struct pt_regs *int_regs; struct otg_transceiver xceiv; int nIrq; + unsigned irq_wake:1; struct musb_hw_ep endpoints[MUSB_C_NUM_EPS]; -#define control_ep endpoints #define VBUSERR_RETRY_COUNT 3 u16 vbuserr_retry; @@ -428,11 +458,18 @@ struct usb_gadget_driver *gadget_driver; /* its driver */ #endif - struct musb_hdrc_config *config; + struct musb_hdrc_config *config; #ifdef MUSB_CONFIG_PROC_FS struct proc_dir_entry *proc_entry; #endif + + struct tasklet_struct fifo_check; + void (*fifo_check_complete) (struct musb_hw_ep *ep); + +#ifdef CONFIG_AVM_POWER + struct list_head urb_giveback_list; +#endif /*--- #ifdef CONFIG_AVM_POWER ---*/ }; static inline void musb_set_vbus(struct musb *musb, int is_on) @@ -484,5 +521,29 @@ extern int __init musb_platform_init(struct musb *musb); extern int musb_platform_exit(struct musb *musb); +#ifndef CONFIG_MUSB_SCHEDULE_INTR_EP +#define use_intr_sched (0) +#else +extern int use_intr_sched; +#endif + +/*-------------------------- ProcFS definitions ---------------------*/ + +struct proc_dir_entry; + +#if (MUSB_DEBUG > 0) && defined(MUSB_CONFIG_PROC_FS) +extern struct proc_dir_entry *musb_debug_create(char *name, struct musb *data); +extern void musb_debug_delete(char *name, struct musb *data); + +#else +static inline struct proc_dir_entry * +musb_debug_create(char *name, struct musb *data) +{ + return NULL; +} +static inline void musb_debug_delete(char *name, struct musb *data) +{ +} +#endif #endif /* __MUSB_CORE_H__ */