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