ssusb.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /*
  2. * This is used to for host and peripheral modes of the driver for
  3. * super speed Dual-Role Controllers (MediaTek).
  4. */
  5. #ifndef _LINUX_USB_SSUSB_H_
  6. #define _LINUX_USB_SSUSB_H_
  7. /*
  8. * copy from musb/musb.h temp. modify later
  9. */
  10. /* The USB role is defined by the connector used on the board, so long as
  11. * standards are being followed. (Developer boards sometimes won't.)
  12. */
  13. enum musb_mode {
  14. MUSB_UNDEFINED = 0,
  15. MUSB_HOST, /* A or Mini-A connector */
  16. MUSB_PERIPHERAL, /* B or Mini-B connector */
  17. MUSB_OTG /* Mini-AB connector */
  18. };
  19. /* struct clk; */
  20. enum musb_fifo_style {
  21. FIFO_RXTX, /* add MUSB_ prefix to avoid confilicts with musbfsh.h, gang */
  22. FIFO_TX,
  23. FIFO_RX
  24. };
  25. enum musb_ep_mode {
  26. EP_CONT,
  27. EP_INT,
  28. EP_BULK,
  29. EP_ISO
  30. };
  31. struct musb_fifo_cfg {
  32. u8 hw_ep_num;
  33. enum musb_fifo_style style;
  34. u16 maxpacket;
  35. enum musb_ep_mode ep_mode;
  36. };
  37. #define MUSB_EP_FIFO(ep, st, m, pkt) \
  38. { \
  39. .hw_ep_num = ep, \
  40. .style = st, \
  41. .mode = m, \
  42. .maxpacket = pkt, \
  43. }
  44. struct musb_hdrc_config {
  45. struct musb_fifo_cfg *fifo_cfg; /* board fifo configuration */
  46. u32 fifo_cfg_size; /* size of the fifo configuration */
  47. u32 num_eps; /* number of endpoints _with_ ep0 */
  48. u32 dyn_fifo_size; /* dynamic size in bytes */
  49. u32 ram_bits; /* ram address size */
  50. };
  51. struct musb_hdrc_platform_data {
  52. int port_num;
  53. /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */
  54. int drv_mode;
  55. int otg_mode;
  56. int str_mode;
  57. int otg_init_as_host; /* init as device or host? */
  58. int is_u3_otg; /* is usb3 or usb2? */
  59. int eint_num;
  60. int p0_vbus_mode;
  61. int p0_gpio_num;
  62. int p0_gpio_active_low;
  63. int p1_vbus_mode;
  64. int p1_gpio_num;
  65. int p1_gpio_active_low;
  66. int wakeup_src;
  67. /* MUSB configuration-specific details */
  68. struct musb_hdrc_config *config;
  69. /* Architecture specific board data */
  70. void *board_data;
  71. /* Platform specific struct musb_ops pointer */
  72. const void *platform_ops;
  73. };
  74. struct ssusb_xhci_pdata {
  75. int need_str;
  76. };
  77. extern void mtk_xhci_set(void *xhci);
  78. #endif /* __LINUX_USB_MUSB_H */