aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/composite.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb/composite.h')
-rw-r--r--include/linux/usb/composite.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 617068134ae..a78e813d27e 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -237,10 +237,17 @@ int usb_add_config(struct usb_composite_dev *,
237/** 237/**
238 * struct usb_composite_driver - groups configurations into a gadget 238 * struct usb_composite_driver - groups configurations into a gadget
239 * @name: For diagnostics, identifies the driver. 239 * @name: For diagnostics, identifies the driver.
240 * @iProduct: Used as iProduct override if @dev->iProduct is not set.
241 * If NULL value of @name is taken.
242 * @iManufacturer: Used as iManufacturer override if @dev->iManufacturer is
243 * not set. If NULL a default "<system> <release> with <udc>" value
244 * will be used.
240 * @dev: Template descriptor for the device, including default device 245 * @dev: Template descriptor for the device, including default device
241 * identifiers. 246 * identifiers.
242 * @strings: tables of strings, keyed by identifiers assigned during bind() 247 * @strings: tables of strings, keyed by identifiers assigned during bind()
243 * and language IDs provided in control requests 248 * and language IDs provided in control requests
249 * @needs_serial: set to 1 if the gadget needs userspace to provide
250 * a serial number. If one is not provided, warning will be printed.
244 * @bind: (REQUIRED) Used to allocate resources that are shared across the 251 * @bind: (REQUIRED) Used to allocate resources that are shared across the
245 * whole device, such as string IDs, and add its configurations using 252 * whole device, such as string IDs, and add its configurations using
246 * @usb_add_config(). This may fail by returning a negative errno 253 * @usb_add_config(). This may fail by returning a negative errno
@@ -266,8 +273,11 @@ int usb_add_config(struct usb_composite_dev *,
266 */ 273 */
267struct usb_composite_driver { 274struct usb_composite_driver {
268 const char *name; 275 const char *name;
276 const char *iProduct;
277 const char *iManufacturer;
269 const struct usb_device_descriptor *dev; 278 const struct usb_device_descriptor *dev;
270 struct usb_gadget_strings **strings; 279 struct usb_gadget_strings **strings;
280 unsigned needs_serial:1;
271 281
272 /* REVISIT: bind() functions can be marked __init, which 282 /* REVISIT: bind() functions can be marked __init, which
273 * makes trouble for section mismatch analysis. See if 283 * makes trouble for section mismatch analysis. See if
@@ -334,6 +344,9 @@ struct usb_composite_dev {
334 struct list_head configs; 344 struct list_head configs;
335 struct usb_composite_driver *driver; 345 struct usb_composite_driver *driver;
336 u8 next_string_id; 346 u8 next_string_id;
347 u8 manufacturer_override;
348 u8 product_override;
349 u8 serial_override;
337 350
338 /* the gadget driver won't enable the data pullup 351 /* the gadget driver won't enable the data pullup
339 * while the deactivation count is nonzero. 352 * while the deactivation count is nonzero.