0001
0002
0003
0004
0005
0006 #ifndef __LINUX_USB_OF_H
0007 #define __LINUX_USB_OF_H
0008
0009 #include <linux/usb/ch9.h>
0010 #include <linux/usb/otg.h>
0011 #include <linux/usb/phy.h>
0012
0013 struct usb_device;
0014
0015 #if IS_ENABLED(CONFIG_OF)
0016 enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0);
0017 bool of_usb_host_tpl_support(struct device_node *np);
0018 int of_usb_update_otg_caps(struct device_node *np,
0019 struct usb_otg_caps *otg_caps);
0020 struct device_node *usb_of_get_device_node(struct usb_device *hub, int port1);
0021 bool usb_of_has_combined_node(struct usb_device *udev);
0022 struct device_node *usb_of_get_interface_node(struct usb_device *udev,
0023 u8 config, u8 ifnum);
0024 struct device *usb_of_get_companion_dev(struct device *dev);
0025 #else
0026 static inline enum usb_dr_mode
0027 of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0)
0028 {
0029 return USB_DR_MODE_UNKNOWN;
0030 }
0031 static inline bool of_usb_host_tpl_support(struct device_node *np)
0032 {
0033 return false;
0034 }
0035 static inline int of_usb_update_otg_caps(struct device_node *np,
0036 struct usb_otg_caps *otg_caps)
0037 {
0038 return 0;
0039 }
0040 static inline struct device_node *
0041 usb_of_get_device_node(struct usb_device *hub, int port1)
0042 {
0043 return NULL;
0044 }
0045 static inline bool usb_of_has_combined_node(struct usb_device *udev)
0046 {
0047 return false;
0048 }
0049 static inline struct device_node *
0050 usb_of_get_interface_node(struct usb_device *udev, u8 config, u8 ifnum)
0051 {
0052 return NULL;
0053 }
0054 static inline struct device *usb_of_get_companion_dev(struct device *dev)
0055 {
0056 return NULL;
0057 }
0058 #endif
0059
0060 #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT)
0061 enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np);
0062 #else
0063 static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
0064 {
0065 return USBPHY_INTERFACE_MODE_UNKNOWN;
0066 }
0067
0068 #endif
0069
0070 #endif