of.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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(struct device_node *np);
  13. enum usb_device_speed of_usb_get_maximum_speed(struct device_node *np);
  14. bool of_usb_host_tpl_support(struct device_node *np);
  15. #else
  16. static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np)
  17. {
  18. return USB_DR_MODE_UNKNOWN;
  19. }
  20. static inline enum usb_device_speed
  21. of_usb_get_maximum_speed(struct device_node *np)
  22. {
  23. return USB_SPEED_UNKNOWN;
  24. }
  25. static inline bool of_usb_host_tpl_support(struct device_node *np)
  26. {
  27. return false;
  28. }
  29. #endif
  30. #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT)
  31. enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np);
  32. #else
  33. static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
  34. {
  35. return USBPHY_INTERFACE_MODE_UNKNOWN;
  36. }
  37. #endif
  38. #endif /* __LINUX_USB_OF_H */