tpm: add a helper to iterate on all tpm devices
[oweals/u-boot.git] / include / dwc3-uboot.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* include/dwc3-uboot.h
3  *
4  * Copyright (c) 2015 Texas Instruments Incorporated - http://www.ti.com
5  *
6  * Designware SuperSpeed USB uboot init
7  */
8
9 #ifndef __DWC3_UBOOT_H_
10 #define __DWC3_UBOOT_H_
11
12 #include <linux/usb/otg.h>
13 #include <linux/usb/phy.h>
14
15 struct dwc3_device {
16         unsigned long base;
17         enum usb_dr_mode dr_mode;
18         enum usb_phy_interface hsphy_mode;
19         u32 maximum_speed;
20         unsigned tx_fifo_resize:1;
21         unsigned has_lpm_erratum;
22         u8 lpm_nyet_threshold;
23         unsigned is_utmi_l1_suspend;
24         u8 hird_threshold;
25         unsigned disable_scramble_quirk;
26         unsigned u2exit_lfps_quirk;
27         unsigned u2ss_inp3_quirk;
28         unsigned req_p1p2p3_quirk;
29         unsigned del_p1p2p3_quirk;
30         unsigned del_phy_power_chg_quirk;
31         unsigned lfps_filter_quirk;
32         unsigned rx_detect_poll_quirk;
33         unsigned dis_u3_susphy_quirk;
34         unsigned dis_u2_susphy_quirk;
35         unsigned tx_de_emphasis_quirk;
36         unsigned tx_de_emphasis;
37         int index;
38 };
39
40 int dwc3_uboot_init(struct dwc3_device *dev);
41 void dwc3_uboot_exit(int index);
42 void dwc3_uboot_handle_interrupt(int index);
43
44 struct phy;
45 #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)
46 int dwc3_setup_phy(struct udevice *dev, struct phy **array, int *num_phys);
47 int dwc3_shutdown_phy(struct udevice *dev, struct phy *usb_phys, int num_phys);
48 #else
49 static inline int dwc3_setup_phy(struct udevice *dev, struct phy **array,
50                                  int *num_phys)
51 {
52         return -ENOTSUPP;
53 }
54
55 static inline int dwc3_shutdown_phy(struct udevice *dev, struct phy *usb_phys,
56                                     int num_phys)
57 {
58         return -ENOTSUPP;
59 }
60 #endif
61
62 #endif /* __DWC3_UBOOT_H_ */