of.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0);
  13. bool of_usb_host_tpl_support(struct device_node *np);
  14. int of_usb_update_otg_caps(struct device_node *np,
  15. struct usb_otg_caps *otg_caps);
  16. struct device_node *usb_of_get_child_node(struct device_node *parent,
  17. int portnum);
  18. #else
  19. static inline enum usb_dr_mode
  20. of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0)
  21. {
  22. return USB_DR_MODE_UNKNOWN;
  23. }
  24. static inline bool of_usb_host_tpl_support(struct device_node *np)
  25. {
  26. return false;
  27. }
  28. static inline int of_usb_update_otg_caps(struct device_node *np,
  29. struct usb_otg_caps *otg_caps)
  30. {
  31. return 0;
  32. }
  33. static inline struct device_node *usb_of_get_child_node
  34. (struct device_node *parent, int portnum)
  35. {
  36. return NULL;
  37. }
  38. #endif
  39. #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT)
  40. enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np);
  41. #else
  42. static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
  43. {
  44. return USBPHY_INTERFACE_MODE_UNKNOWN;
  45. }
  46. #endif
  47. #endif /* __LINUX_USB_OF_H */