diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-09-10 15:01:54 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-09-10 16:13:00 +0300 |
commit | 1cf0d264088907038be560ba2dd472d5e432a3dc (patch) | |
tree | c62973c662c6c43763f672e65d8ae167e39686cc /drivers/usb/gadget/mass_storage.c | |
parent | 276e2e4f1f3e07a0ad891bf757dbcfd655ff5f91 (diff) | |
download | op-kernel-dev-1cf0d264088907038be560ba2dd472d5e432a3dc.zip op-kernel-dev-1cf0d264088907038be560ba2dd472d5e432a3dc.tar.gz |
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 8ffbade..6f5a3b2 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[] = { NULL, }; +static struct usb_string strings_dev[] = { + [USB_GADGET_MANUFACTURER_IDX].s = "", + [USB_GADGET_PRODUCT_IDX].s = "", + [USB_GADGET_SERIAL_IDX].s = "", + { } /* end of list */ +}; + +static struct usb_gadget_strings stringtab_dev = { + .language = 0x0409, /* en-us */ + .strings = strings_dev, +}; + +static struct usb_gadget_strings *dev_strings[] = { + &stringtab_dev, + NULL, +}; /****************************** Configurations ******************************/ @@ -141,6 +157,10 @@ static int __init msg_bind(struct usb_composite_dev *cdev) { int status; + status = usb_string_ids_tab(cdev, strings_dev); + if (status < 0) + return status; + status = usb_add_config(cdev, &msg_config_driver, msg_do_config); if (status < 0) return status; @@ -160,6 +180,7 @@ static __refdata struct usb_composite_driver msg_driver = { .iProduct = DRIVER_DESC, .max_speed = USB_SPEED_SUPER, .needs_serial = 1, + .strings = dev_strings, .bind = msg_bind, }; |