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