2 * This is used to for host and peripheral modes of the driver for
3 * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC.
5 * Board initialization should put one of these into dev->platform_data,
6 * probably on some platform_device named "musb-hdrc". It encapsulates
7 * key configuration differences between boards.
10 #ifndef __LINUX_USB_MUSB_H
11 #define __LINUX_USB_MUSB_H
13 /* The USB role is defined by the connector used on the board, so long as
14 * standards are being followed. (Developer boards sometimes won't.)
18 MUSB_HOST
, /* A or Mini-A connector */
19 MUSB_PERIPHERAL
, /* B or Mini-B connector */
20 MUSB_OTG
/* Mini-AB connector */
25 enum musb_fifo_style
{
29 } __attribute__ ((packed
));
34 } __attribute__ ((packed
));
36 struct musb_fifo_cfg
{
38 enum musb_fifo_style style
;
39 enum musb_buf_mode mode
;
43 #define MUSB_EP_FIFO(ep, st, m, pkt) \
51 #define MUSB_EP_FIFO_SINGLE(ep, st, pkt) \
52 MUSB_EP_FIFO(ep, st, BUF_SINGLE, pkt)
54 #define MUSB_EP_FIFO_DOUBLE(ep, st, pkt) \
55 MUSB_EP_FIFO(ep, st, BUF_DOUBLE, pkt)
57 struct musb_hdrc_eps_bits
{
62 struct musb_hdrc_config
{
63 struct musb_fifo_cfg
*fifo_cfg
; /* board fifo configuration */
64 unsigned fifo_cfg_size
; /* size of the fifo configuration */
66 /* MUSB configuration-specific details */
67 unsigned multipoint
:1; /* multipoint device */
68 unsigned dyn_fifo
:1 __deprecated
; /* supports dynamic fifo sizing */
69 unsigned soft_con
:1 __deprecated
; /* soft connect required */
70 unsigned utm_16
:1 __deprecated
; /* utm data witdh is 16 bits */
71 unsigned big_endian
:1; /* true if CPU uses big-endian */
72 unsigned mult_bulk_tx
:1; /* Tx ep required for multbulk pkts */
73 unsigned mult_bulk_rx
:1; /* Rx ep required for multbulk pkts */
74 unsigned high_iso_tx
:1; /* Tx ep required for HB iso */
75 unsigned high_iso_rx
:1; /* Rx ep required for HD iso */
76 unsigned dma
:1 __deprecated
; /* supports DMA */
77 unsigned vendor_req
:1 __deprecated
; /* vendor registers required */
79 u8 num_eps
; /* number of endpoints _with_ ep0 */
80 u8 dma_channels __deprecated
; /* number of dma channels */
81 u8 dyn_fifo_size
; /* dynamic size in bytes */
82 u8 vendor_ctrl __deprecated
; /* vendor control reg width */
83 u8 vendor_stat __deprecated
; /* vendor status reg witdh */
84 u8 dma_req_chan __deprecated
; /* bitmask for required dma channels */
85 u8 ram_bits
; /* ram address size */
87 struct musb_hdrc_eps_bits
*eps_bits __deprecated
;
88 #ifdef CONFIG_BLACKFIN
89 /* A GPIO controlling VRSEL in Blackfin */
90 unsigned int gpio_vrsel
;
91 unsigned int gpio_vrsel_active
;
92 /* musb CLKIN in Blackfin in MHZ */
98 struct musb_hdrc_platform_data
{
99 /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */
107 /* (HOST or OTG) switch VBUS on/off */
108 int (*set_vbus
)(struct device
*dev
, int is_on
);
110 /* (HOST or OTG) mA/2 power supplied on (default = 8mA) */
113 /* (PERIPHERAL) mA/2 max power consumed (default = 100mA) */
116 /* (HOST or OTG) msec/2 after VBUS on till power good */
119 /* (HOST or OTG) program PHY for external Vbus */
122 /* Power the device on or off */
123 int (*set_power
)(int state
);
125 /* MUSB configuration-specific details */
126 struct musb_hdrc_config
*config
;
128 /* Architecture specific board data */
131 /* Platform specific struct musb_ops pointer */
132 const void *platform_ops
;
136 /* TUSB 6010 support */
138 #define TUSB6010_OSCCLK_60 16667 /* psec/clk @ 60.0 MHz */
139 #define TUSB6010_REFCLK_24 41667 /* psec/clk @ 24.0 MHz XI */
140 #define TUSB6010_REFCLK_19 52083 /* psec/clk @ 19.2 MHz CLKIN */
142 #ifdef CONFIG_ARCH_OMAP2
144 extern int __init
tusb6010_setup_interface(
145 struct musb_hdrc_platform_data
*data
,
146 unsigned ps_refclk
, unsigned waitpin
,
147 unsigned async_cs
, unsigned sync_cs
,
148 unsigned irq
, unsigned dmachan
);
150 extern int tusb6010_platform_retime(unsigned is_refclk
);
154 #endif /* __LINUX_USB_MUSB_H */