1
2
3
4
5
6
7
8
9
10#ifndef __LINUX_USB_MUSB_H
11#define __LINUX_USB_MUSB_H
12
13#ifndef __deprecated
14#define __deprecated
15#endif
16
17#include <linux/compat.h>
18
19
20
21
22enum musb_mode {
23 MUSB_UNDEFINED = 0,
24 MUSB_HOST,
25 MUSB_PERIPHERAL,
26 MUSB_OTG
27};
28
29struct clk;
30
31enum musb_fifo_style {
32 FIFO_RXTX,
33 FIFO_TX,
34 FIFO_RX
35} __attribute__ ((packed));
36
37enum musb_buf_mode {
38 BUF_SINGLE,
39 BUF_DOUBLE
40} __attribute__ ((packed));
41
42struct musb_fifo_cfg {
43 u8 hw_ep_num;
44 enum musb_fifo_style style;
45 enum musb_buf_mode mode;
46 u16 maxpacket;
47};
48
49#define MUSB_EP_FIFO(ep, st, m, pkt) \
50{ \
51 .hw_ep_num = ep, \
52 .style = st, \
53 .mode = m, \
54 .maxpacket = pkt, \
55}
56
57#define MUSB_EP_FIFO_SINGLE(ep, st, pkt) \
58 MUSB_EP_FIFO(ep, st, BUF_SINGLE, pkt)
59
60#define MUSB_EP_FIFO_DOUBLE(ep, st, pkt) \
61 MUSB_EP_FIFO(ep, st, BUF_DOUBLE, pkt)
62
63struct musb_hdrc_eps_bits {
64 const char name[16];
65 u8 bits;
66};
67
68struct musb_hdrc_config {
69 struct musb_fifo_cfg *fifo_cfg;
70 unsigned fifo_cfg_size;
71
72
73 unsigned multipoint:1;
74 unsigned dyn_fifo:1 __deprecated;
75 unsigned soft_con:1 __deprecated;
76 unsigned utm_16:1 __deprecated;
77 unsigned big_endian:1;
78 unsigned mult_bulk_tx:1;
79 unsigned mult_bulk_rx:1;
80 unsigned high_iso_tx:1;
81 unsigned high_iso_rx:1;
82 unsigned dma:1 __deprecated;
83 unsigned vendor_req:1 __deprecated;
84
85 u8 num_eps;
86 u8 dma_channels __deprecated;
87 u8 dyn_fifo_size;
88 u8 vendor_ctrl __deprecated;
89 u8 vendor_stat __deprecated;
90 u8 dma_req_chan __deprecated;
91 u8 ram_bits;
92
93 struct musb_hdrc_eps_bits *eps_bits __deprecated;
94#ifdef CONFIG_BLACKFIN
95
96 unsigned int gpio_vrsel;
97 unsigned int gpio_vrsel_active;
98
99 unsigned char clkin;
100#endif
101
102};
103
104struct musb_hdrc_platform_data {
105
106 u8 mode;
107
108
109 const char *clock;
110
111
112 int (*set_vbus)(struct device *dev, int is_on);
113
114
115 u8 power;
116
117
118 u8 min_power;
119
120
121 u8 potpgt;
122
123
124 unsigned extvbus:1;
125
126
127 int (*set_power)(int state);
128
129
130 struct musb_hdrc_config *config;
131
132
133 void *board_data;
134
135
136 const void *platform_ops;
137};
138
139
140
141
142#define TUSB6010_OSCCLK_60 16667
143#define TUSB6010_REFCLK_24 41667
144#define TUSB6010_REFCLK_19 52083
145
146#ifdef CONFIG_ARCH_OMAP2
147
148extern int __init tusb6010_setup_interface(
149 struct musb_hdrc_platform_data *data,
150 unsigned ps_refclk, unsigned waitpin,
151 unsigned async_cs, unsigned sync_cs,
152 unsigned irq, unsigned dmachan);
153
154extern int tusb6010_platform_retime(unsigned is_refclk);
155
156#endif
157
158
159
160
161int musb_register(struct musb_hdrc_platform_data *plat, void *bdata,
162 void *ctl_regs);
163
164#endif
165