aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/composite.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-09-06 14:11:21 -0400
committerFelipe Balbi <balbi@ti.com>2012-09-10 09:13:00 -0400
commit276e2e4f1f3e07a0ad891bf757dbcfd655ff5f91 (patch)
tree5a3d0689815314e2fab55a8c9e0a99d6853c31bd /include/linux/usb/composite.h
parent7d16e8d3eb704f5f6eb5a271d5758b495634e8e6 (diff)
usb: gadget: make sure each gadget is using same index for Product, Serial,…
The index in usb_string array is defined by the gadget. The gadget can choose which index entry it assigns for the serial number and which the product name. The gadget has just to ensure that the descriptor contains the proper string id which is assigned by composite. If the composite layer knows the index of the "default" information which will be overwritten by module parameters, it can be used later to overwrite it. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb/composite.h')
-rw-r--r--include/linux/usb/composite.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 7651e5bf7487..f821a3ad475d 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -248,6 +248,14 @@ int usb_add_config(struct usb_composite_dev *,
248void usb_remove_config(struct usb_composite_dev *, 248void usb_remove_config(struct usb_composite_dev *,
249 struct usb_configuration *); 249 struct usb_configuration *);
250 250
251/* predefined index for usb_composite_driver */
252enum {
253 USB_GADGET_MANUFACTURER_IDX = 0,
254 USB_GADGET_PRODUCT_IDX,
255 USB_GADGET_SERIAL_IDX,
256 USB_GADGET_FIRST_AVAIL_IDX,
257};
258
251/** 259/**
252 * struct usb_composite_driver - groups configurations into a gadget 260 * struct usb_composite_driver - groups configurations into a gadget
253 * @name: For diagnostics, identifies the driver. 261 * @name: For diagnostics, identifies the driver.
@@ -261,7 +269,9 @@ void usb_remove_config(struct usb_composite_dev *,
261 * @dev: Template descriptor for the device, including default device 269 * @dev: Template descriptor for the device, including default device
262 * identifiers. 270 * identifiers.
263 * @strings: tables of strings, keyed by identifiers assigned during @bind 271 * @strings: tables of strings, keyed by identifiers assigned during @bind
264 * and language IDs provided in control requests 272 * and language IDs provided in control requests. Note: The first entries
273 * are predefined. The first entry that may be used is
274 * USB_GADGET_FIRST_AVAIL_IDX
265 * @max_speed: Highest speed the driver supports. 275 * @max_speed: Highest speed the driver supports.
266 * @needs_serial: set to 1 if the gadget needs userspace to provide 276 * @needs_serial: set to 1 if the gadget needs userspace to provide
267 * a serial number. If one is not provided, warning will be printed. 277 * a serial number. If one is not provided, warning will be printed.