ulpi.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. * This software is distributed under the terms of the GNU General
  8. * Public License ("GPL") as published by the Free Software Foundation,
  9. * version 2 of that License.
  10. */
  11. #ifndef __LINUX_USB_ULPI_H
  12. #define __LINUX_USB_ULPI_H
  13. #include <linux/usb/otg.h>
  14. #include <linux/ulpi/regs.h>
  15. /*-------------------------------------------------------------------------*/
  16. /*
  17. * ULPI Flags
  18. */
  19. #define ULPI_OTG_ID_PULLUP (1 << 0)
  20. #define ULPI_OTG_DP_PULLDOWN_DIS (1 << 1)
  21. #define ULPI_OTG_DM_PULLDOWN_DIS (1 << 2)
  22. #define ULPI_OTG_DISCHRGVBUS (1 << 3)
  23. #define ULPI_OTG_CHRGVBUS (1 << 4)
  24. #define ULPI_OTG_DRVVBUS (1 << 5)
  25. #define ULPI_OTG_DRVVBUS_EXT (1 << 6)
  26. #define ULPI_OTG_EXTVBUSIND (1 << 7)
  27. #define ULPI_IC_6PIN_SERIAL (1 << 8)
  28. #define ULPI_IC_3PIN_SERIAL (1 << 9)
  29. #define ULPI_IC_CARKIT (1 << 10)
  30. #define ULPI_IC_CLKSUSPM (1 << 11)
  31. #define ULPI_IC_AUTORESUME (1 << 12)
  32. #define ULPI_IC_EXTVBUS_INDINV (1 << 13)
  33. #define ULPI_IC_IND_PASSTHRU (1 << 14)
  34. #define ULPI_IC_PROTECT_DIS (1 << 15)
  35. #define ULPI_FC_HS (1 << 16)
  36. #define ULPI_FC_FS (1 << 17)
  37. #define ULPI_FC_LS (1 << 18)
  38. #define ULPI_FC_FS4LS (1 << 19)
  39. #define ULPI_FC_TERMSEL (1 << 20)
  40. #define ULPI_FC_OP_NORM (1 << 21)
  41. #define ULPI_FC_OP_NODRV (1 << 22)
  42. #define ULPI_FC_OP_DIS_NRZI (1 << 23)
  43. #define ULPI_FC_OP_NSYNC_NEOP (1 << 24)
  44. #define ULPI_FC_RST (1 << 25)
  45. #define ULPI_FC_SUSPM (1 << 26)
  46. /*-------------------------------------------------------------------------*/
  47. #if IS_ENABLED(CONFIG_USB_ULPI)
  48. struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
  49. unsigned int flags);
  50. #else
  51. static inline struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops,
  52. unsigned int flags)
  53. {
  54. return NULL;
  55. }
  56. #endif
  57. #ifdef CONFIG_USB_ULPI_VIEWPORT
  58. /* access ops for controllers with a viewport register */
  59. extern struct usb_phy_io_ops ulpi_viewport_access_ops;
  60. #endif
  61. #endif /* __LINUX_USB_ULPI_H */