This source file includes following definitions.
- hcd_to_mtk
- xhci_mtk_add_ep_quirk
- xhci_mtk_drop_ep_quirk
1
2
3
4
5
6
7
8
9 #ifndef _XHCI_MTK_H_
10 #define _XHCI_MTK_H_
11
12 #include "xhci.h"
13
14
15
16
17
18
19
20 #define XHCI_MTK_MAX_ESIT 64
21
22
23
24
25
26
27
28 struct mu3h_sch_tt {
29 DECLARE_BITMAP(split_bit_map, XHCI_MTK_MAX_ESIT);
30 struct list_head ep_list;
31 struct usb_tt *usb_tt;
32 int tt_port;
33 };
34
35
36
37
38
39
40
41
42
43
44 struct mu3h_sch_bw_info {
45 u32 bus_bw[XHCI_MTK_MAX_ESIT];
46 struct list_head bw_ep_list;
47 };
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79 struct mu3h_sch_ep_info {
80 u32 esit;
81 u32 num_budget_microframes;
82 u32 bw_cost_per_microframe;
83 struct list_head endpoint;
84 struct list_head tt_endpoint;
85 struct mu3h_sch_tt *sch_tt;
86 u32 ep_type;
87 u32 maxpkt;
88 void *ep;
89
90
91
92
93 u32 offset;
94 u32 repeat;
95 u32 pkts;
96 u32 cs_count;
97 u32 burst_mode;
98 u32 bw_budget_table[0];
99 };
100
101 #define MU3C_U3_PORT_MAX 4
102 #define MU3C_U2_PORT_MAX 5
103
104
105
106
107
108
109
110
111
112
113 struct mu3c_ippc_regs {
114 __le32 ip_pw_ctr0;
115 __le32 ip_pw_ctr1;
116 __le32 ip_pw_ctr2;
117 __le32 ip_pw_ctr3;
118 __le32 ip_pw_sts1;
119 __le32 ip_pw_sts2;
120 __le32 reserved0[3];
121 __le32 ip_xhci_cap;
122 __le32 reserved1[2];
123 __le64 u3_ctrl_p[MU3C_U3_PORT_MAX];
124 __le64 u2_ctrl_p[MU3C_U2_PORT_MAX];
125 __le32 reserved2;
126 __le32 u2_phy_pll;
127 __le32 reserved3[33];
128 };
129
130 struct xhci_hcd_mtk {
131 struct device *dev;
132 struct usb_hcd *hcd;
133 struct mu3h_sch_bw_info *sch_array;
134 struct mu3c_ippc_regs __iomem *ippc_regs;
135 bool has_ippc;
136 int num_u2_ports;
137 int num_u3_ports;
138 int u3p_dis_msk;
139 struct regulator *vusb33;
140 struct regulator *vbus;
141 struct clk *sys_clk;
142 struct clk *xhci_clk;
143 struct clk *ref_clk;
144 struct clk *mcu_clk;
145 struct clk *dma_clk;
146 struct regmap *pericfg;
147 struct phy **phys;
148 int num_phys;
149 bool lpm_support;
150
151 bool uwk_en;
152 struct regmap *uwk;
153 u32 uwk_reg_base;
154 u32 uwk_vers;
155 };
156
157 static inline struct xhci_hcd_mtk *hcd_to_mtk(struct usb_hcd *hcd)
158 {
159 return dev_get_drvdata(hcd->self.controller);
160 }
161
162 #if IS_ENABLED(CONFIG_USB_XHCI_MTK)
163 int xhci_mtk_sch_init(struct xhci_hcd_mtk *mtk);
164 void xhci_mtk_sch_exit(struct xhci_hcd_mtk *mtk);
165 int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
166 struct usb_host_endpoint *ep);
167 void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev,
168 struct usb_host_endpoint *ep);
169
170 #else
171 static inline int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd,
172 struct usb_device *udev, struct usb_host_endpoint *ep)
173 {
174 return 0;
175 }
176
177 static inline void xhci_mtk_drop_ep_quirk(struct usb_hcd *hcd,
178 struct usb_device *udev, struct usb_host_endpoint *ep)
179 {
180 }
181
182 #endif
183
184 #endif