ulpi.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * ulpi.h -- ULPI defines and function prorotypes
  4. *
  5. * Copyright (C) 2010 Nokia Corporation
  6. */
  7. #ifndef __LINUX_USB_ULPI_H
  8. #define __LINUX_USB_ULPI_H
  9. #include <linux/usb/otg.h>
  10. #include <linux/ulpi/regs.h>
  11. /*-------------------------------------------------------------------------*/
  12. /*
  13. * ULPI Flags
  14. */
  15. #define ULPI_OTG_ID_PULLUP (1 << 0)
  16. #define ULPI_OTG_DP_PULLDOWN_DIS (1 << 1)
  17. #define ULPI_OTG_DM_PULLDOWN_DIS (1 << 2)
  18. #define ULPI_OTG_DISCHRGVBUS (1 << 3)
  19. #define ULPI_OTG_CHRGVBUS (1 << 4)
  20. #define ULPI_OTG_DRVVBUS (1 << 5)
  21. #define ULPI_OTG_DRVVBUS_EXT (1 << 6)
  22. #define ULPI_OTG_EXTVBUSIND (1 << 7)
  23. #define ULPI_IC_6PIN_SERIAL (1 << 8)
  24. #define ULPI_IC_3PIN_SERIAL (1 << 9)
  25. #define ULPI_IC_CARKIT (1 << 10)
  26. #define ULPI_IC_CLKSUSPM (1 << 11)
  27. #define ULPI_IC_AUTORESUME (1 << 12)
  28. #define ULPI_IC_EXTVBUS_INDINV (1 << 13)
  29. #define ULPI_IC_IND_PASSTHRU (1 << 14)
  30. #define ULPI_IC_PROTECT_DIS (1 << 15)
  31. #define ULPI_FC_HS (1 << 16)
  32. #define ULPI_FC_FS (1 << 17)
  33. #define ULPI_FC_LS (1 << 18)
  34. #define ULPI_FC_FS4LS (1 << 19)
  35. #define ULPI_FC_TERMSEL (1 << 20)
  36. #define ULPI_FC_OP_NORM (1 << 21)
  37. #define ULPI_FC_OP_NODRV (1 << 22)
  38. #define ULPI_FC_OP_DIS_NRZI (1 << 23)
  39. #define ULPI_FC_OP_NSYNC_NEOP (1 << 24)
  40. #define ULPI_FC_RST (1 << 25)
  41. #define ULPI_FC_SUSPM (1 << 26)
  42. /*-------------------------------------------------------------------------*/
  43. #if IS_ENABLED(CONFIG_USB_ULPI)
  44. struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
  45. unsigned int flags);
  46. struct usb_phy *devm_otg_ulpi_create(struct device *dev,
  47. struct usb_phy_io_ops *ops,
  48. unsigned int flags);
  49. #else
  50. static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
  51. unsigned int flags)
  52. {
  53. return NULL;
  54. }
  55. static inline struct usb_phy *devm_otg_ulpi_create(struct device *dev,
  56. struct usb_phy_io_ops *ops,
  57. unsigned int flags)
  58. {
  59. return NULL;
  60. }
  61. #endif
  62. #ifdef CONFIG_USB_ULPI_VIEWPORT
  63. /* access ops for controllers with a viewport register */
  64. extern struct usb_phy_io_ops ulpi_viewport_access_ops;
  65. #endif
  66. #endif /* __LINUX_USB_ULPI_H */