diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-09-10 09:01:54 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-09-10 09:13:00 -0400 |
commit | 1cf0d264088907038be560ba2dd472d5e432a3dc (patch) | |
tree | c62973c662c6c43763f672e65d8ae167e39686cc /drivers/usb/gadget/mass_storage.c | |
parent | 276e2e4f1f3e07a0ad891bf757dbcfd655ff5f91 (diff) |
usb: gadget: push iSerialNumber into gadgets
This patch pushes the iSerialNumber module argument from composite into
each gadget. Once the user uses the module paramter, the string is
overwritten with the final value.
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/mass_storage.c')
-rw-r--r-- | drivers/usb/gadget/mass_storage.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c index 8ffbade383f2..6f5a3b232d81 100644 --- a/drivers/usb/gadget/mass_storage.c +++ b/drivers/usb/gadget/mass_storage.c | |||
@@ -83,6 +83,22 @@ static const struct usb_descriptor_header *otg_desc[] = { | |||
83 | NULL, | 83 | NULL, |
84 | }; | 84 | }; |
85 | 85 | ||
86 | static struct usb_string strings_dev[] = { | ||
87 | [USB_GADGET_MANUFACTURER_IDX].s = "", | ||
88 | [USB_GADGET_PRODUCT_IDX].s = "", | ||
89 | [USB_GADGET_SERIAL_IDX].s = "", | ||
90 | { } /* end of list */ | ||
91 | }; | ||
92 | |||
93 | static struct usb_gadget_strings stringtab_dev = { | ||
94 | .language = 0x0409, /* en-us */ | ||
95 | .strings = strings_dev, | ||
96 | }; | ||
97 | |||
98 | static struct usb_gadget_strings *dev_strings[] = { | ||
99 | &stringtab_dev, | ||
100 | NULL, | ||
101 | }; | ||
86 | 102 | ||
87 | /****************************** Configurations ******************************/ | 103 | /****************************** Configurations ******************************/ |
88 | 104 | ||
@@ -141,6 +157,10 @@ static int __init msg_bind(struct usb_composite_dev *cdev) | |||
141 | { | 157 | { |
142 | int status; | 158 | int status; |
143 | 159 | ||
160 | status = usb_string_ids_tab(cdev, strings_dev); | ||
161 | if (status < 0) | ||
162 | return status; | ||
163 | |||
144 | status = usb_add_config(cdev, &msg_config_driver, msg_do_config); | 164 | status = usb_add_config(cdev, &msg_config_driver, msg_do_config); |
145 | if (status < 0) | 165 | if (status < 0) |
146 | return status; | 166 | return status; |
@@ -160,6 +180,7 @@ static __refdata struct usb_composite_driver msg_driver = { | |||
160 | .iProduct = DRIVER_DESC, | 180 | .iProduct = DRIVER_DESC, |
161 | .max_speed = USB_SPEED_SUPER, | 181 | .max_speed = USB_SPEED_SUPER, |
162 | .needs_serial = 1, | 182 | .needs_serial = 1, |
183 | .strings = dev_strings, | ||
163 | .bind = msg_bind, | 184 | .bind = msg_bind, |
164 | }; | 185 | }; |
165 | 186 | ||