~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/usb/musb.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * This is used to for host and peripheral modes of the driver for
  4  * Inventra (Multidrop) Highspeed Dual-Role Controllers:  (M)HDRC.
  5  *
  6  * Board initialization should put one of these into dev->platform_data,
  7  * probably on some platform_device named "musb-hdrc".  It encapsulates
  8  * key configuration differences between boards.
  9  */
 10 
 11 #ifndef __LINUX_USB_MUSB_H
 12 #define __LINUX_USB_MUSB_H
 13 
 14 /* The USB role is defined by the connector used on the board, so long as
 15  * standards are being followed.  (Developer boards sometimes won't.)
 16  */
 17 enum musb_mode {
 18         MUSB_UNDEFINED = 0,
 19         MUSB_HOST,              /* A or Mini-A connector */
 20         MUSB_PERIPHERAL,        /* B or Mini-B connector */
 21         MUSB_OTG                /* Mini-AB connector */
 22 };
 23 
 24 struct clk;
 25 
 26 enum musb_fifo_style {
 27         FIFO_RXTX,
 28         FIFO_TX,
 29         FIFO_RX
 30 } __attribute__ ((packed));
 31 
 32 enum musb_buf_mode {
 33         BUF_SINGLE,
 34         BUF_DOUBLE
 35 } __attribute__ ((packed));
 36 
 37 struct musb_fifo_cfg {
 38         u8                      hw_ep_num;
 39         enum musb_fifo_style    style;
 40         enum musb_buf_mode      mode;
 41         u16                     maxpacket;
 42 };
 43 
 44 #define MUSB_EP_FIFO(ep, st, m, pkt)            \
 45 {                                               \
 46         .hw_ep_num      = ep,                   \
 47         .style          = st,                   \
 48         .mode           = m,                    \
 49         .maxpacket      = pkt,                  \
 50 }
 51 
 52 #define MUSB_EP_FIFO_SINGLE(ep, st, pkt)        \
 53         MUSB_EP_FIFO(ep, st, BUF_SINGLE, pkt)
 54 
 55 #define MUSB_EP_FIFO_DOUBLE(ep, st, pkt)        \
 56         MUSB_EP_FIFO(ep, st, BUF_DOUBLE, pkt)
 57 
 58 struct musb_hdrc_eps_bits {
 59         const char      name[16];
 60         u8              bits;
 61 };
 62 
 63 struct musb_hdrc_config {
 64         struct musb_fifo_cfg    *fifo_cfg;      /* board fifo configuration */
 65         unsigned                fifo_cfg_size;  /* size of the fifo configuration */
 66 
 67         /* MUSB configuration-specific details */
 68         unsigned        multipoint:1;   /* multipoint device */
 69         unsigned        dyn_fifo:1 __deprecated; /* supports dynamic fifo sizing */
 70 
 71         /* need to explicitly de-assert the port reset after resume? */
 72         unsigned        host_port_deassert_reset_at_resume:1;
 73 
 74         u8              num_eps;        /* number of endpoints _with_ ep0 */
 75         u8              ram_bits;       /* ram address size */
 76 
 77         u32             maximum_speed;
 78 };
 79 
 80 struct musb_hdrc_platform_data {
 81         /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */
 82         u8              mode;
 83 
 84         /* for clk_get() */
 85         const char      *clock;
 86 
 87         /* (HOST or OTG) switch VBUS on/off */
 88         int             (*set_vbus)(struct device *dev, int is_on);
 89 
 90         /* (HOST or OTG) mA/2 power supplied on (default = 8mA) */
 91         u8              power;
 92 
 93         /* (PERIPHERAL) mA/2 max power consumed (default = 100mA) */
 94         u8              min_power;
 95 
 96         /* (HOST or OTG) msec/2 after VBUS on till power good */
 97         u8              potpgt;
 98 
 99         /* (HOST or OTG) program PHY for external Vbus */
100         unsigned        extvbus:1;
101 
102         /* MUSB configuration-specific details */
103         const struct musb_hdrc_config *config;
104 
105         /* Architecture specific board data     */
106         void            *board_data;
107 
108         /* Platform specific struct musb_ops pointer */
109         const void      *platform_ops;
110 };
111 
112 enum musb_vbus_id_status {
113         MUSB_UNKNOWN = 0,
114         MUSB_ID_GROUND,
115         MUSB_ID_FLOAT,
116         MUSB_VBUS_VALID,
117         MUSB_VBUS_OFF,
118 };
119 
120 #if IS_ENABLED(CONFIG_USB_MUSB_HDRC)
121 int musb_mailbox(enum musb_vbus_id_status status);
122 #else
123 static inline int musb_mailbox(enum musb_vbus_id_status status)
124 {
125         return 0;
126 }
127 #endif
128 
129 /* TUSB 6010 support */
130 
131 #define TUSB6010_OSCCLK_60      16667   /* psec/clk @ 60.0 MHz */
132 #define TUSB6010_REFCLK_24      41667   /* psec/clk @ 24.0 MHz XI */
133 #define TUSB6010_REFCLK_19      52083   /* psec/clk @ 19.2 MHz CLKIN */
134 
135 #endif /* __LINUX_USB_MUSB_H */
136 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php