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

TOMOYO Linux Cross Reference
Linux/include/linux/usb/otg.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 ] ~

Diff markup

Differences between /include/linux/usb/otg.h (Version linux-6.11-rc3) and /include/linux/usb/otg.h (Version linux-3.10.108)


  1 /* SPDX-License-Identifier: GPL-2.0 */         << 
  2 /* USB OTG (On The Go) defines */                   1 /* USB OTG (On The Go) defines */
  3 /*                                                  2 /*
  4  *                                                  3  *
  5  * These APIs may be used between USB controll      4  * These APIs may be used between USB controllers.  USB device drivers
  6  * (for either host or peripheral roles) don't      5  * (for either host or peripheral roles) don't use these calls; they
  7  * continue to use just usb_device and usb_gad      6  * continue to use just usb_device and usb_gadget.
  8  */                                                 7  */
  9                                                     8 
 10 #ifndef __LINUX_USB_OTG_H                           9 #ifndef __LINUX_USB_OTG_H
 11 #define __LINUX_USB_OTG_H                          10 #define __LINUX_USB_OTG_H
 12                                                    11 
 13 #include <linux/phy/phy.h>                     << 
 14 #include <linux/usb/phy.h>                         12 #include <linux/usb/phy.h>
 15                                                    13 
 16 struct usb_otg {                                   14 struct usb_otg {
 17         u8                      default_a;         15         u8                      default_a;
 18                                                    16 
 19         struct phy              *phy;          !!  17         struct usb_phy          *phy;
 20         /* old usb_phy interface */            << 
 21         struct usb_phy          *usb_phy;      << 
 22         struct usb_bus          *host;             18         struct usb_bus          *host;
 23         struct usb_gadget       *gadget;           19         struct usb_gadget       *gadget;
 24                                                    20 
 25         enum usb_otg_state      state;         << 
 26                                                << 
 27         /* bind/unbind the host controller */      21         /* bind/unbind the host controller */
 28         int     (*set_host)(struct usb_otg *ot     22         int     (*set_host)(struct usb_otg *otg, struct usb_bus *host);
 29                                                    23 
 30         /* bind/unbind the peripheral controll     24         /* bind/unbind the peripheral controller */
 31         int     (*set_peripheral)(struct usb_o     25         int     (*set_peripheral)(struct usb_otg *otg,
 32                                         struct     26                                         struct usb_gadget *gadget);
 33                                                    27 
 34         /* effective for A-peripheral, ignored     28         /* effective for A-peripheral, ignored for B devices */
 35         int     (*set_vbus)(struct usb_otg *ot     29         int     (*set_vbus)(struct usb_otg *otg, bool enabled);
 36                                                    30 
 37         /* for B devices only:  start session      31         /* for B devices only:  start session with A-Host */
 38         int     (*start_srp)(struct usb_otg *o     32         int     (*start_srp)(struct usb_otg *otg);
 39                                                    33 
 40         /* start or continue HNP role switch *     34         /* start or continue HNP role switch */
 41         int     (*start_hnp)(struct usb_otg *o     35         int     (*start_hnp)(struct usb_otg *otg);
 42                                                    36 
 43 };                                                 37 };
 44                                                    38 
 45 /**                                            << 
 46  * struct usb_otg_caps - describes the otg cap << 
 47  * @otg_rev: The OTG revision number the devic << 
 48  *              in binary-coded decimal (i.e.  << 
 49  * @hnp_support: Indicates if the device suppo << 
 50  * @srp_support: Indicates if the device suppo << 
 51  * @adp_support: Indicates if the device suppo << 
 52  */                                            << 
 53 struct usb_otg_caps {                          << 
 54         u16 otg_rev;                           << 
 55         bool hnp_support;                      << 
 56         bool srp_support;                      << 
 57         bool adp_support;                      << 
 58 };                                             << 
 59                                                << 
 60 extern const char *usb_otg_state_string(enum u     39 extern const char *usb_otg_state_string(enum usb_otg_state state);
 61                                                    40 
 62 /* Context: can sleep */                           41 /* Context: can sleep */
 63 static inline int                                  42 static inline int
 64 otg_start_hnp(struct usb_otg *otg)                 43 otg_start_hnp(struct usb_otg *otg)
 65 {                                                  44 {
 66         if (otg && otg->start_hnp)                 45         if (otg && otg->start_hnp)
 67                 return otg->start_hnp(otg);        46                 return otg->start_hnp(otg);
 68                                                    47 
 69         return -ENOTSUPP;                          48         return -ENOTSUPP;
 70 }                                                  49 }
 71                                                    50 
 72 /* Context: can sleep */                           51 /* Context: can sleep */
 73 static inline int                                  52 static inline int
 74 otg_set_vbus(struct usb_otg *otg, bool enabled     53 otg_set_vbus(struct usb_otg *otg, bool enabled)
 75 {                                                  54 {
 76         if (otg && otg->set_vbus)                  55         if (otg && otg->set_vbus)
 77                 return otg->set_vbus(otg, enab     56                 return otg->set_vbus(otg, enabled);
 78                                                    57 
 79         return -ENOTSUPP;                          58         return -ENOTSUPP;
 80 }                                                  59 }
 81                                                    60 
 82 /* for HCDs */                                     61 /* for HCDs */
 83 static inline int                                  62 static inline int
 84 otg_set_host(struct usb_otg *otg, struct usb_b     63 otg_set_host(struct usb_otg *otg, struct usb_bus *host)
 85 {                                                  64 {
 86         if (otg && otg->set_host)                  65         if (otg && otg->set_host)
 87                 return otg->set_host(otg, host     66                 return otg->set_host(otg, host);
 88                                                    67 
 89         return -ENOTSUPP;                          68         return -ENOTSUPP;
 90 }                                                  69 }
 91                                                    70 
 92 /* for usb peripheral controller drivers */        71 /* for usb peripheral controller drivers */
 93                                                    72 
 94 /* Context: can sleep */                           73 /* Context: can sleep */
 95 static inline int                                  74 static inline int
 96 otg_set_peripheral(struct usb_otg *otg, struct     75 otg_set_peripheral(struct usb_otg *otg, struct usb_gadget *periph)
 97 {                                                  76 {
 98         if (otg && otg->set_peripheral)            77         if (otg && otg->set_peripheral)
 99                 return otg->set_peripheral(otg     78                 return otg->set_peripheral(otg, periph);
100                                                    79 
101         return -ENOTSUPP;                          80         return -ENOTSUPP;
102 }                                                  81 }
103                                                    82 
104 static inline int                                  83 static inline int
105 otg_start_srp(struct usb_otg *otg)                 84 otg_start_srp(struct usb_otg *otg)
106 {                                                  85 {
107         if (otg && otg->start_srp)                 86         if (otg && otg->start_srp)
108                 return otg->start_srp(otg);        87                 return otg->start_srp(otg);
109                                                    88 
110         return -ENOTSUPP;                          89         return -ENOTSUPP;
111 }                                                  90 }
112                                                    91 
113 /* for OTG controller drivers (and maybe other     92 /* for OTG controller drivers (and maybe other stuff) */
114 extern int usb_bus_start_enum(struct usb_bus *     93 extern int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num);
115                                                << 
116 enum usb_dr_mode {                             << 
117         USB_DR_MODE_UNKNOWN,                   << 
118         USB_DR_MODE_HOST,                      << 
119         USB_DR_MODE_PERIPHERAL,                << 
120         USB_DR_MODE_OTG,                       << 
121 };                                             << 
122                                                << 
123 /**                                            << 
124  * usb_get_dr_mode - Get dual role mode for gi << 
125  * @dev: Pointer to the given device           << 
126  *                                             << 
127  * The function gets phy interface string from << 
128  * and returns the corresponding enum usb_dr_m << 
129  */                                            << 
130 extern enum usb_dr_mode usb_get_dr_mode(struct << 
131 extern enum usb_dr_mode usb_get_role_switch_de << 
132                                                    94 
133 #endif /* __LINUX_USB_OTG_H */                     95 #endif /* __LINUX_USB_OTG_H */
134                                                    96 

~ [ 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