musb.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * This is used to for host and peripheral modes of the driver for
  3. * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC.
  4. *
  5. * Board initialization should put one of these into dev->platform_data,
  6. * probably on some platform_device named "musb_hdrc". It encapsulates
  7. * key configuration differences between boards.
  8. */
  9. #ifndef __LINUX_USB_MUSB_H
  10. #define __LINUX_USB_MUSB_H
  11. /* The USB role is defined by the connector used on the board, so long as
  12. * standards are being followed. (Developer boards sometimes won't.)
  13. */
  14. enum musb_mode {
  15. MUSB_UNDEFINED = 0,
  16. MUSB_HOST, /* A or Mini-A connector */
  17. MUSB_PERIPHERAL, /* B or Mini-B connector */
  18. MUSB_OTG /* Mini-AB connector */
  19. };
  20. struct clk;
  21. struct musb_hdrc_eps_bits {
  22. const char name[16];
  23. u8 bits;
  24. };
  25. struct musb_hdrc_config {
  26. /* MUSB configuration-specific details */
  27. unsigned multipoint:1; /* multipoint device */
  28. unsigned dyn_fifo:1 __deprecated; /* supports dynamic fifo sizing */
  29. unsigned soft_con:1 __deprecated; /* soft connect required */
  30. unsigned utm_16:1 __deprecated; /* utm data witdh is 16 bits */
  31. unsigned big_endian:1; /* true if CPU uses big-endian */
  32. unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */
  33. unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */
  34. unsigned high_iso_tx:1; /* Tx ep required for HB iso */
  35. unsigned high_iso_rx:1; /* Rx ep required for HD iso */
  36. unsigned dma:1 __deprecated; /* supports DMA */
  37. unsigned vendor_req:1 __deprecated; /* vendor registers required */
  38. u8 num_eps; /* number of endpoints _with_ ep0 */
  39. u8 dma_channels __deprecated; /* number of dma channels */
  40. u8 dyn_fifo_size; /* dynamic size in bytes */
  41. u8 vendor_ctrl __deprecated; /* vendor control reg width */
  42. u8 vendor_stat __deprecated; /* vendor status reg witdh */
  43. u8 dma_req_chan __deprecated; /* bitmask for required dma channels */
  44. u8 ram_bits; /* ram address size */
  45. struct musb_hdrc_eps_bits *eps_bits __deprecated;
  46. #ifdef CONFIG_BLACKFIN
  47. /* A GPIO controlling VRSEL in Blackfin */
  48. unsigned int gpio_vrsel;
  49. #endif
  50. };
  51. struct musb_hdrc_platform_data {
  52. /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */
  53. u8 mode;
  54. /* for clk_get() */
  55. const char *clock;
  56. /* (HOST or OTG) switch VBUS on/off */
  57. int (*set_vbus)(struct device *dev, int is_on);
  58. /* (HOST or OTG) mA/2 power supplied on (default = 8mA) */
  59. u8 power;
  60. /* (PERIPHERAL) mA/2 max power consumed (default = 100mA) */
  61. u8 min_power;
  62. /* (HOST or OTG) msec/2 after VBUS on till power good */
  63. u8 potpgt;
  64. /* (HOST or OTG) program PHY for external Vbus */
  65. unsigned extvbus:1;
  66. /* Power the device on or off */
  67. int (*set_power)(int state);
  68. /* Turn device clock on or off */
  69. int (*set_clock)(struct clk *clock, int is_on);
  70. /* MUSB configuration-specific details */
  71. struct musb_hdrc_config *config;
  72. /* Architecture specific board data */
  73. void *board_data;
  74. };
  75. /* TUSB 6010 support */
  76. #define TUSB6010_OSCCLK_60 16667 /* psec/clk @ 60.0 MHz */
  77. #define TUSB6010_REFCLK_24 41667 /* psec/clk @ 24.0 MHz XI */
  78. #define TUSB6010_REFCLK_19 52083 /* psec/clk @ 19.2 MHz CLKIN */
  79. #ifdef CONFIG_ARCH_OMAP2
  80. extern int __init tusb6010_setup_interface(
  81. struct musb_hdrc_platform_data *data,
  82. unsigned ps_refclk, unsigned waitpin,
  83. unsigned async_cs, unsigned sync_cs,
  84. unsigned irq, unsigned dmachan);
  85. extern int tusb6010_platform_retime(unsigned is_refclk);
  86. #endif /* OMAP2 */
  87. #endif /* __LINUX_USB_MUSB_H */