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