of.h 894 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * OF helpers for usb devices.
  3. *
  4. * This file is released under the GPLv2
  5. */
  6. #ifndef __LINUX_USB_OF_H
  7. #define __LINUX_USB_OF_H
  8. #include <linux/usb/ch9.h>
  9. #include <linux/usb/otg.h>
  10. #include <linux/usb/phy.h>
  11. #if IS_ENABLED(CONFIG_OF)
  12. bool of_usb_host_tpl_support(struct device_node *np);
  13. int of_usb_update_otg_caps(struct device_node *np,
  14. struct usb_otg_caps *otg_caps);
  15. #else
  16. static inline bool of_usb_host_tpl_support(struct device_node *np)
  17. {
  18. return false;
  19. }
  20. static inline int of_usb_update_otg_caps(struct device_node *np,
  21. struct usb_otg_caps *otg_caps)
  22. {
  23. return 0;
  24. }
  25. #endif
  26. #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT)
  27. enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np);
  28. #else
  29. static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
  30. {
  31. return USBPHY_INTERFACE_MODE_UNKNOWN;
  32. }
  33. #endif
  34. #endif /* __LINUX_USB_OF_H */