Lines Matching full:struct
20 int tegra_xusb_padctl_legacy_probe(struct platform_device *pdev);
21 int tegra_xusb_padctl_legacy_remove(struct platform_device *pdev);
23 struct phy;
24 struct phy_provider;
25 struct platform_device;
26 struct regulator;
31 struct tegra_xusb_lane_soc {
41 struct {
46 struct tegra_xusb_lane {
47 const struct tegra_xusb_lane_soc *soc;
48 struct tegra_xusb_pad *pad;
49 struct device_node *np;
50 struct list_head list;
55 int tegra_xusb_lane_parse_dt(struct tegra_xusb_lane *lane,
56 struct device_node *np);
58 struct tegra_xusb_usb3_lane {
59 struct tegra_xusb_lane base;
62 static inline struct tegra_xusb_usb3_lane *
63 to_usb3_lane(struct tegra_xusb_lane *lane) in to_usb3_lane()
65 return container_of(lane, struct tegra_xusb_usb3_lane, base); in to_usb3_lane()
68 struct tegra_xusb_usb2_lane {
69 struct tegra_xusb_lane base;
75 static inline struct tegra_xusb_usb2_lane *
76 to_usb2_lane(struct tegra_xusb_lane *lane) in to_usb2_lane()
78 return container_of(lane, struct tegra_xusb_usb2_lane, base); in to_usb2_lane()
81 struct tegra_xusb_ulpi_lane {
82 struct tegra_xusb_lane base;
85 static inline struct tegra_xusb_ulpi_lane *
86 to_ulpi_lane(struct tegra_xusb_lane *lane) in to_ulpi_lane()
88 return container_of(lane, struct tegra_xusb_ulpi_lane, base); in to_ulpi_lane()
91 struct tegra_xusb_hsic_lane {
92 struct tegra_xusb_lane base;
104 static inline struct tegra_xusb_hsic_lane *
105 to_hsic_lane(struct tegra_xusb_lane *lane) in to_hsic_lane()
107 return container_of(lane, struct tegra_xusb_hsic_lane, base); in to_hsic_lane()
110 struct tegra_xusb_pcie_lane {
111 struct tegra_xusb_lane base;
114 static inline struct tegra_xusb_pcie_lane *
115 to_pcie_lane(struct tegra_xusb_lane *lane) in to_pcie_lane()
117 return container_of(lane, struct tegra_xusb_pcie_lane, base); in to_pcie_lane()
120 struct tegra_xusb_sata_lane {
121 struct tegra_xusb_lane base;
124 static inline struct tegra_xusb_sata_lane *
125 to_sata_lane(struct tegra_xusb_lane *lane) in to_sata_lane()
127 return container_of(lane, struct tegra_xusb_sata_lane, base); in to_sata_lane()
130 struct tegra_xusb_lane_ops {
131 struct tegra_xusb_lane *(*probe)(struct tegra_xusb_pad *pad,
132 struct device_node *np,
134 void (*remove)(struct tegra_xusb_lane *lane);
135 void (*iddq_enable)(struct tegra_xusb_lane *lane);
136 void (*iddq_disable)(struct tegra_xusb_lane *lane);
137 int (*enable_phy_sleepwalk)(struct tegra_xusb_lane *lane, enum usb_device_speed speed);
138 int (*disable_phy_sleepwalk)(struct tegra_xusb_lane *lane);
139 int (*enable_phy_wake)(struct tegra_xusb_lane *lane);
140 int (*disable_phy_wake)(struct tegra_xusb_lane *lane);
141 bool (*remote_wake_detected)(struct tegra_xusb_lane *lane);
144 bool tegra_xusb_lane_check(struct tegra_xusb_lane *lane, const char *function);
149 struct tegra_xusb_pad_soc;
150 struct tegra_xusb_padctl;
152 struct tegra_xusb_pad_ops {
153 struct tegra_xusb_pad *(*probe)(struct tegra_xusb_padctl *padctl,
154 const struct tegra_xusb_pad_soc *soc,
155 struct device_node *np);
156 void (*remove)(struct tegra_xusb_pad *pad);
159 struct tegra_xusb_pad_soc {
162 const struct tegra_xusb_lane_soc *lanes;
165 const struct tegra_xusb_pad_ops *ops;
168 struct tegra_xusb_pad {
169 const struct tegra_xusb_pad_soc *soc;
170 struct tegra_xusb_padctl *padctl;
171 struct phy_provider *provider;
172 struct phy **lanes;
173 struct device dev;
175 const struct tegra_xusb_lane_ops *ops;
177 struct list_head list;
180 static inline struct tegra_xusb_pad *to_tegra_xusb_pad(struct device *dev) in to_tegra_xusb_pad()
182 return container_of(dev, struct tegra_xusb_pad, dev); in to_tegra_xusb_pad()
185 int tegra_xusb_pad_init(struct tegra_xusb_pad *pad,
186 struct tegra_xusb_padctl *padctl,
187 struct device_node *np);
188 int tegra_xusb_pad_register(struct tegra_xusb_pad *pad,
189 const struct phy_ops *ops);
190 void tegra_xusb_pad_unregister(struct tegra_xusb_pad *pad);
192 struct tegra_xusb_usb3_pad {
193 struct tegra_xusb_pad base;
196 struct mutex lock;
199 static inline struct tegra_xusb_usb3_pad *
200 to_usb3_pad(struct tegra_xusb_pad *pad) in to_usb3_pad()
202 return container_of(pad, struct tegra_xusb_usb3_pad, base); in to_usb3_pad()
205 struct tegra_xusb_usb2_pad {
206 struct tegra_xusb_pad base;
208 struct clk *clk;
210 struct mutex lock;
213 static inline struct tegra_xusb_usb2_pad *
214 to_usb2_pad(struct tegra_xusb_pad *pad) in to_usb2_pad()
216 return container_of(pad, struct tegra_xusb_usb2_pad, base); in to_usb2_pad()
219 struct tegra_xusb_ulpi_pad {
220 struct tegra_xusb_pad base;
223 static inline struct tegra_xusb_ulpi_pad *
224 to_ulpi_pad(struct tegra_xusb_pad *pad) in to_ulpi_pad()
226 return container_of(pad, struct tegra_xusb_ulpi_pad, base); in to_ulpi_pad()
229 struct tegra_xusb_hsic_pad {
230 struct tegra_xusb_pad base;
232 struct regulator *supply;
233 struct clk *clk;
236 static inline struct tegra_xusb_hsic_pad *
237 to_hsic_pad(struct tegra_xusb_pad *pad) in to_hsic_pad()
239 return container_of(pad, struct tegra_xusb_hsic_pad, base); in to_hsic_pad()
242 struct tegra_xusb_pcie_pad {
243 struct tegra_xusb_pad base;
245 struct reset_control *rst;
246 struct clk *pll;
251 static inline struct tegra_xusb_pcie_pad *
252 to_pcie_pad(struct tegra_xusb_pad *pad) in to_pcie_pad()
254 return container_of(pad, struct tegra_xusb_pcie_pad, base); in to_pcie_pad()
257 struct tegra_xusb_sata_pad {
258 struct tegra_xusb_pad base;
260 struct reset_control *rst;
261 struct clk *pll;
266 static inline struct tegra_xusb_sata_pad *
267 to_sata_pad(struct tegra_xusb_pad *pad) in to_sata_pad()
269 return container_of(pad, struct tegra_xusb_sata_pad, base); in to_sata_pad()
275 struct tegra_xusb_port_ops;
277 struct tegra_xusb_port {
278 struct tegra_xusb_padctl *padctl;
279 struct tegra_xusb_lane *lane;
282 struct list_head list;
283 struct device dev;
285 struct usb_role_switch *usb_role_sw;
286 struct work_struct usb_phy_work;
287 struct usb_phy usb_phy;
289 const struct tegra_xusb_port_ops *ops;
292 static inline struct tegra_xusb_port *to_tegra_xusb_port(struct device *dev) in to_tegra_xusb_port()
294 return container_of(dev, struct tegra_xusb_port, dev); in to_tegra_xusb_port()
297 struct tegra_xusb_lane_map {
304 struct tegra_xusb_lane *
305 tegra_xusb_port_find_lane(struct tegra_xusb_port *port,
306 const struct tegra_xusb_lane_map *map,
309 struct tegra_xusb_port *
310 tegra_xusb_find_port(struct tegra_xusb_padctl *padctl, const char *type,
313 struct tegra_xusb_usb2_port {
314 struct tegra_xusb_port base;
316 struct regulator *supply;
322 static inline struct tegra_xusb_usb2_port *
323 to_usb2_port(struct tegra_xusb_port *port) in to_usb2_port()
325 return container_of(port, struct tegra_xusb_usb2_port, base); in to_usb2_port()
328 struct tegra_xusb_usb2_port *
329 tegra_xusb_find_usb2_port(struct tegra_xusb_padctl *padctl,
331 void tegra_xusb_usb2_port_release(struct tegra_xusb_port *port);
332 void tegra_xusb_usb2_port_remove(struct tegra_xusb_port *port);
334 struct tegra_xusb_ulpi_port {
335 struct tegra_xusb_port base;
337 struct regulator *supply;
341 static inline struct tegra_xusb_ulpi_port *
342 to_ulpi_port(struct tegra_xusb_port *port) in to_ulpi_port()
344 return container_of(port, struct tegra_xusb_ulpi_port, base); in to_ulpi_port()
347 void tegra_xusb_ulpi_port_release(struct tegra_xusb_port *port);
349 struct tegra_xusb_hsic_port {
350 struct tegra_xusb_port base;
353 static inline struct tegra_xusb_hsic_port *
354 to_hsic_port(struct tegra_xusb_port *port) in to_hsic_port()
356 return container_of(port, struct tegra_xusb_hsic_port, base); in to_hsic_port()
359 void tegra_xusb_hsic_port_release(struct tegra_xusb_port *port);
361 struct tegra_xusb_usb3_port {
362 struct tegra_xusb_port base;
374 static inline struct tegra_xusb_usb3_port *
375 to_usb3_port(struct tegra_xusb_port *port) in to_usb3_port()
377 return container_of(port, struct tegra_xusb_usb3_port, base); in to_usb3_port()
380 struct tegra_xusb_usb3_port *
381 tegra_xusb_find_usb3_port(struct tegra_xusb_padctl *padctl,
383 void tegra_xusb_usb3_port_release(struct tegra_xusb_port *port);
385 struct tegra_xusb_port_ops {
386 void (*release)(struct tegra_xusb_port *port);
387 void (*remove)(struct tegra_xusb_port *port);
388 int (*enable)(struct tegra_xusb_port *port);
389 void (*disable)(struct tegra_xusb_port *port);
390 struct tegra_xusb_lane *(*map)(struct tegra_xusb_port *port);
396 struct tegra_xusb_padctl_soc;
398 struct tegra_xusb_padctl_ops {
399 struct tegra_xusb_padctl *
400 (*probe)(struct device *dev,
401 const struct tegra_xusb_padctl_soc *soc);
402 void (*remove)(struct tegra_xusb_padctl *padctl);
404 int (*suspend_noirq)(struct tegra_xusb_padctl *padctl);
405 int (*resume_noirq)(struct tegra_xusb_padctl *padctl);
406 int (*usb3_save_context)(struct tegra_xusb_padctl *padctl,
408 int (*hsic_set_idle)(struct tegra_xusb_padctl *padctl,
410 int (*usb3_set_lfps_detect)(struct tegra_xusb_padctl *padctl,
412 int (*vbus_override)(struct tegra_xusb_padctl *padctl, bool set);
413 int (*utmi_port_reset)(struct phy *phy);
414 void (*utmi_pad_power_on)(struct phy *phy);
415 void (*utmi_pad_power_down)(struct phy *phy);
418 struct tegra_xusb_padctl_soc {
419 const struct tegra_xusb_pad_soc * const *pads;
422 struct {
423 struct {
424 const struct tegra_xusb_port_ops *ops;
429 const struct tegra_xusb_padctl_ops *ops;
440 struct tegra_xusb_padctl {
441 struct device *dev;
443 struct mutex lock;
444 struct reset_control *rst;
446 const struct tegra_xusb_padctl_soc *soc;
448 struct tegra_xusb_pad *pcie;
449 struct tegra_xusb_pad *sata;
450 struct tegra_xusb_pad *ulpi;
451 struct tegra_xusb_pad *usb2;
452 struct tegra_xusb_pad *hsic;
454 struct list_head ports;
455 struct list_head lanes;
456 struct list_head pads;
460 struct clk *clk;
462 struct regulator_bulk_data *supplies;
465 static inline void padctl_writel(struct tegra_xusb_padctl *padctl, u32 value, in padctl_writel()
472 static inline u32 padctl_readl(struct tegra_xusb_padctl *padctl, in padctl_readl()
480 static inline u32 padctl_readl_poll(struct tegra_xusb_padctl *padctl, in padctl_readl_poll()
497 struct tegra_xusb_lane *tegra_xusb_find_lane(struct tegra_xusb_padctl *padctl,
502 extern const struct tegra_xusb_padctl_soc tegra124_xusb_padctl_soc;
505 extern const struct tegra_xusb_padctl_soc tegra210_xusb_padctl_soc;
508 extern const struct tegra_xusb_padctl_soc tegra186_xusb_padctl_soc;
511 extern const struct tegra_xusb_padctl_soc tegra194_xusb_padctl_soc;
514 extern const struct tegra_xusb_padctl_soc tegra234_xusb_padctl_soc;