phy.h 1018 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * USB PHY defines
  4. *
  5. * These APIs may be used between USB controllers. USB device drivers
  6. * (for either host or peripheral roles) don't use these calls; they
  7. * continue to use just usb_device and usb_gadget.
  8. */
  9. #ifndef __LINUX_USB_PHY_H
  10. #define __LINUX_USB_PHY_H
  11. #include <dm/ofnode.h>
  12. enum usb_phy_interface {
  13. USBPHY_INTERFACE_MODE_UNKNOWN,
  14. USBPHY_INTERFACE_MODE_UTMI,
  15. USBPHY_INTERFACE_MODE_UTMIW,
  16. USBPHY_INTERFACE_MODE_ULPI,
  17. USBPHY_INTERFACE_MODE_SERIAL,
  18. USBPHY_INTERFACE_MODE_HSIC,
  19. };
  20. #if CONFIG_IS_ENABLED(DM_USB)
  21. /**
  22. * usb_get_phy_mode - Get phy mode for given device_node
  23. * @np: Pointer to the given device_node
  24. *
  25. * The function gets phy interface string from property 'phy_type',
  26. * and returns the corresponding enum usb_phy_interface
  27. */
  28. enum usb_phy_interface usb_get_phy_mode(ofnode node);
  29. #else
  30. static inline enum usb_phy_interface usb_get_phy_mode(ofnode node)
  31. {
  32. return USBPHY_INTERFACE_MODE_UNKNOWN;
  33. }
  34. #endif
  35. #endif /* __LINUX_USB_PHY_H */