aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/multi.c
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 /drivers/usb/gadget/multi.c
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 'drivers/usb/gadget/multi.c')
-rw-r--r--drivers/usb/gadget/multi.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
index 60168877330a..94b35e5539d7 100644
--- a/drivers/usb/gadget/multi.c
+++ b/drivers/usb/gadget/multi.c
@@ -109,21 +109,16 @@ static const struct usb_descriptor_header *otg_desc[] = {
109 109
110 110
111enum { 111enum {
112#ifdef CONFIG_USB_G_MULTI_RNDIS 112 MULTI_STRING_RNDIS_CONFIG_IDX = USB_GADGET_FIRST_AVAIL_IDX,
113 MULTI_STRING_RNDIS_CONFIG_IDX,
114#endif
115#ifdef CONFIG_USB_G_MULTI_CDC
116 MULTI_STRING_CDC_CONFIG_IDX, 113 MULTI_STRING_CDC_CONFIG_IDX,
117#endif
118}; 114};
119 115
120static struct usb_string strings_dev[] = { 116static struct usb_string strings_dev[] = {
121#ifdef CONFIG_USB_G_MULTI_RNDIS 117 [USB_GADGET_MANUFACTURER_IDX].s = "",
118 [USB_GADGET_PRODUCT_IDX].s = "",
119 [USB_GADGET_SERIAL_IDX].s = "",
122 [MULTI_STRING_RNDIS_CONFIG_IDX].s = "Multifunction with RNDIS", 120 [MULTI_STRING_RNDIS_CONFIG_IDX].s = "Multifunction with RNDIS",
123#endif
124#ifdef CONFIG_USB_G_MULTI_CDC
125 [MULTI_STRING_CDC_CONFIG_IDX].s = "Multifunction with CDC ECM", 121 [MULTI_STRING_CDC_CONFIG_IDX].s = "Multifunction with CDC ECM",
126#endif
127 { } /* end of list */ 122 { } /* end of list */
128}; 123};
129 124