diff options
Diffstat (limited to 'include/linux/usb')
| -rw-r--r-- | include/linux/usb/ch11.h | 4 | ||||
| -rw-r--r-- | include/linux/usb/composite.h | 97 | ||||
| -rw-r--r-- | include/linux/usb/ehci_def.h | 35 | ||||
| -rw-r--r-- | include/linux/usb/ehci_pdriver.h | 8 | ||||
| -rw-r--r-- | include/linux/usb/ezusb.h | 16 | ||||
| -rw-r--r-- | include/linux/usb/gadget.h | 33 | ||||
| -rw-r--r-- | include/linux/usb/hcd.h | 4 | ||||
| -rw-r--r-- | include/linux/usb/nop-usb-xceiv.h | 24 | ||||
| -rw-r--r-- | include/linux/usb/ohci_pdriver.h | 8 | ||||
| -rw-r--r-- | include/linux/usb/omap_usb.h | 46 | ||||
| -rw-r--r-- | include/linux/usb/otg.h | 236 | ||||
| -rw-r--r-- | include/linux/usb/phy.h | 233 | ||||
| -rw-r--r-- | include/linux/usb/phy_companion.h | 34 | ||||
| -rw-r--r-- | include/linux/usb/quirks.h | 4 | ||||
| -rw-r--r-- | include/linux/usb/serial.h | 32 | ||||
| -rw-r--r-- | include/linux/usb/tegra_usb_phy.h | 80 |
16 files changed, 575 insertions, 319 deletions
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h index b6c2863b2c94..7692dc69ccf7 100644 --- a/include/linux/usb/ch11.h +++ b/include/linux/usb/ch11.h | |||
| @@ -236,8 +236,8 @@ struct usb_hub_descriptor { | |||
| 236 | 236 | ||
| 237 | struct { | 237 | struct { |
| 238 | __u8 bHubHdrDecLat; | 238 | __u8 bHubHdrDecLat; |
| 239 | __u16 wHubDelay; | 239 | __le16 wHubDelay; |
| 240 | __u16 DeviceRemovable; | 240 | __le16 DeviceRemovable; |
| 241 | } __attribute__ ((packed)) ss; | 241 | } __attribute__ ((packed)) ss; |
| 242 | } u; | 242 | } u; |
| 243 | } __attribute__ ((packed)); | 243 | } __attribute__ ((packed)); |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 9d8c3b634493..f8dda0621800 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
| @@ -34,6 +34,8 @@ | |||
| 34 | * the composite model the host can use both functions at the same time. | 34 | * the composite model the host can use both functions at the same time. |
| 35 | */ | 35 | */ |
| 36 | 36 | ||
| 37 | #include <linux/bcd.h> | ||
| 38 | #include <linux/version.h> | ||
| 37 | #include <linux/usb/ch9.h> | 39 | #include <linux/usb/ch9.h> |
| 38 | #include <linux/usb/gadget.h> | 40 | #include <linux/usb/gadget.h> |
| 39 | 41 | ||
| @@ -46,6 +48,9 @@ | |||
| 46 | */ | 48 | */ |
| 47 | #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ | 49 | #define USB_GADGET_DELAYED_STATUS 0x7fff /* Impossibly large value */ |
| 48 | 50 | ||
| 51 | /* big enough to hold our biggest descriptor */ | ||
| 52 | #define USB_COMP_EP0_BUFSIZ 1024 | ||
| 53 | |||
| 49 | struct usb_configuration; | 54 | struct usb_configuration; |
| 50 | 55 | ||
| 51 | /** | 56 | /** |
| @@ -245,24 +250,31 @@ int usb_add_config(struct usb_composite_dev *, | |||
| 245 | void usb_remove_config(struct usb_composite_dev *, | 250 | void usb_remove_config(struct usb_composite_dev *, |
| 246 | struct usb_configuration *); | 251 | struct usb_configuration *); |
| 247 | 252 | ||
| 253 | /* predefined index for usb_composite_driver */ | ||
| 254 | enum { | ||
| 255 | USB_GADGET_MANUFACTURER_IDX = 0, | ||
| 256 | USB_GADGET_PRODUCT_IDX, | ||
| 257 | USB_GADGET_SERIAL_IDX, | ||
| 258 | USB_GADGET_FIRST_AVAIL_IDX, | ||
| 259 | }; | ||
| 260 | |||
| 248 | /** | 261 | /** |
| 249 | * struct usb_composite_driver - groups configurations into a gadget | 262 | * struct usb_composite_driver - groups configurations into a gadget |
| 250 | * @name: For diagnostics, identifies the driver. | 263 | * @name: For diagnostics, identifies the driver. |
| 251 | * @iProduct: Used as iProduct override if @dev->iProduct is not set. | ||
| 252 | * If NULL value of @name is taken. | ||
| 253 | * @iManufacturer: Used as iManufacturer override if @dev->iManufacturer is | ||
| 254 | * not set. If NULL a default "<system> <release> with <udc>" value | ||
| 255 | * will be used. | ||
| 256 | * @iSerialNumber: Used as iSerialNumber override if @dev->iSerialNumber is | ||
| 257 | * not set. | ||
| 258 | * @dev: Template descriptor for the device, including default device | 264 | * @dev: Template descriptor for the device, including default device |
| 259 | * identifiers. | 265 | * identifiers. |
| 260 | * @strings: tables of strings, keyed by identifiers assigned during bind() | 266 | * @strings: tables of strings, keyed by identifiers assigned during @bind |
| 261 | * and language IDs provided in control requests | 267 | * and language IDs provided in control requests. Note: The first entries |
| 268 | * are predefined. The first entry that may be used is | ||
| 269 | * USB_GADGET_FIRST_AVAIL_IDX | ||
| 262 | * @max_speed: Highest speed the driver supports. | 270 | * @max_speed: Highest speed the driver supports. |
| 263 | * @needs_serial: set to 1 if the gadget needs userspace to provide | 271 | * @needs_serial: set to 1 if the gadget needs userspace to provide |
| 264 | * a serial number. If one is not provided, warning will be printed. | 272 | * a serial number. If one is not provided, warning will be printed. |
| 265 | * @unbind: Reverses bind; called as a side effect of unregistering | 273 | * @bind: (REQUIRED) Used to allocate resources that are shared across the |
| 274 | * whole device, such as string IDs, and add its configurations using | ||
| 275 | * @usb_add_config(). This may fail by returning a negative errno | ||
| 276 | * value; it should return zero on successful initialization. | ||
| 277 | * @unbind: Reverses @bind; called as a side effect of unregistering | ||
| 266 | * this driver. | 278 | * this driver. |
| 267 | * @disconnect: optional driver disconnect method | 279 | * @disconnect: optional driver disconnect method |
| 268 | * @suspend: Notifies when the host stops sending USB traffic, | 280 | * @suspend: Notifies when the host stops sending USB traffic, |
| @@ -271,9 +283,9 @@ void usb_remove_config(struct usb_composite_dev *, | |||
| 271 | * before function notifications | 283 | * before function notifications |
| 272 | * | 284 | * |
| 273 | * Devices default to reporting self powered operation. Devices which rely | 285 | * Devices default to reporting self powered operation. Devices which rely |
| 274 | * on bus powered operation should report this in their @bind() method. | 286 | * on bus powered operation should report this in their @bind method. |
| 275 | * | 287 | * |
| 276 | * Before returning from bind, various fields in the template descriptor | 288 | * Before returning from @bind, various fields in the template descriptor |
| 277 | * may be overridden. These include the idVendor/idProduct/bcdDevice values | 289 | * may be overridden. These include the idVendor/idProduct/bcdDevice values |
| 278 | * normally to bind the appropriate host side driver, and the three strings | 290 | * normally to bind the appropriate host side driver, and the three strings |
| 279 | * (iManufacturer, iProduct, iSerialNumber) normally used to provide user | 291 | * (iManufacturer, iProduct, iSerialNumber) normally used to provide user |
| @@ -283,14 +295,12 @@ void usb_remove_config(struct usb_composite_dev *, | |||
| 283 | */ | 295 | */ |
| 284 | struct usb_composite_driver { | 296 | struct usb_composite_driver { |
| 285 | const char *name; | 297 | const char *name; |
| 286 | const char *iProduct; | ||
| 287 | const char *iManufacturer; | ||
| 288 | const char *iSerialNumber; | ||
| 289 | const struct usb_device_descriptor *dev; | 298 | const struct usb_device_descriptor *dev; |
| 290 | struct usb_gadget_strings **strings; | 299 | struct usb_gadget_strings **strings; |
| 291 | enum usb_device_speed max_speed; | 300 | enum usb_device_speed max_speed; |
| 292 | unsigned needs_serial:1; | 301 | unsigned needs_serial:1; |
| 293 | 302 | ||
| 303 | int (*bind)(struct usb_composite_dev *cdev); | ||
| 294 | int (*unbind)(struct usb_composite_dev *); | 304 | int (*unbind)(struct usb_composite_dev *); |
| 295 | 305 | ||
| 296 | void (*disconnect)(struct usb_composite_dev *); | 306 | void (*disconnect)(struct usb_composite_dev *); |
| @@ -298,10 +308,10 @@ struct usb_composite_driver { | |||
| 298 | /* global suspend hooks */ | 308 | /* global suspend hooks */ |
| 299 | void (*suspend)(struct usb_composite_dev *); | 309 | void (*suspend)(struct usb_composite_dev *); |
| 300 | void (*resume)(struct usb_composite_dev *); | 310 | void (*resume)(struct usb_composite_dev *); |
| 311 | struct usb_gadget_driver gadget_driver; | ||
| 301 | }; | 312 | }; |
| 302 | 313 | ||
| 303 | extern int usb_composite_probe(struct usb_composite_driver *driver, | 314 | extern int usb_composite_probe(struct usb_composite_driver *driver); |
| 304 | int (*bind)(struct usb_composite_dev *cdev)); | ||
| 305 | extern void usb_composite_unregister(struct usb_composite_driver *driver); | 315 | extern void usb_composite_unregister(struct usb_composite_driver *driver); |
| 306 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | 316 | extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); |
| 307 | 317 | ||
| @@ -310,7 +320,6 @@ extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | |||
| 310 | * struct usb_composite_device - represents one composite usb gadget | 320 | * struct usb_composite_device - represents one composite usb gadget |
| 311 | * @gadget: read-only, abstracts the gadget's usb peripheral controller | 321 | * @gadget: read-only, abstracts the gadget's usb peripheral controller |
| 312 | * @req: used for control responses; buffer is pre-allocated | 322 | * @req: used for control responses; buffer is pre-allocated |
| 313 | * @bufsiz: size of buffer pre-allocated in @req | ||
| 314 | * @config: the currently active configuration | 323 | * @config: the currently active configuration |
| 315 | * | 324 | * |
| 316 | * One of these devices is allocated and initialized before the | 325 | * One of these devices is allocated and initialized before the |
| @@ -341,7 +350,6 @@ extern void usb_composite_setup_continue(struct usb_composite_dev *cdev); | |||
| 341 | struct usb_composite_dev { | 350 | struct usb_composite_dev { |
| 342 | struct usb_gadget *gadget; | 351 | struct usb_gadget *gadget; |
| 343 | struct usb_request *req; | 352 | struct usb_request *req; |
| 344 | unsigned bufsiz; | ||
| 345 | 353 | ||
| 346 | struct usb_configuration *config; | 354 | struct usb_configuration *config; |
| 347 | 355 | ||
| @@ -352,9 +360,7 @@ struct usb_composite_dev { | |||
| 352 | struct list_head configs; | 360 | struct list_head configs; |
| 353 | struct usb_composite_driver *driver; | 361 | struct usb_composite_driver *driver; |
| 354 | u8 | ||
