diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2020-03-18 09:24:46 +0100 |
---|---|---|
committer | Patrick Delaunay <patrick.delaunay@st.com> | 2020-05-14 09:02:12 +0200 |
commit | bcd677f246e872c2c945d667ac1044cb735c8e14 (patch) | |
tree | ed4e0fe8f8c567883ff47915ce97ce4aac05330f /drivers/usb/gadget | |
parent | 1a803f6e14c2d0065da2142108e3849e79d8d7dd (diff) | |
download | u-boot-bcd677f246e872c2c945d667ac1044cb735c8e14.zip u-boot-bcd677f246e872c2c945d667ac1044cb735c8e14.tar.gz u-boot-bcd677f246e872c2c945d667ac1044cb735c8e14.tar.bz2 |
usb: gadget: g_dnl: add function g_dnl_set_product
Add a function g_dnl_set_product to change the Product string used in USB
enumeration in any command based on download gadget.
If the function is called with NULL pointer, the product string is set to
the default value (product[] = "USB download gadget").
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/g_dnl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c index e9e1600..7a51b53 100644 --- a/drivers/usb/gadget/g_dnl.c +++ b/drivers/usb/gadget/g_dnl.c @@ -89,6 +89,14 @@ static struct usb_gadget_strings *g_dnl_composite_strings[] = { NULL, }; +void g_dnl_set_product(const char *s) +{ + if (s) + g_dnl_string_defs[1].s = s; + else + g_dnl_string_defs[1].s = product; +} + static int g_dnl_unbind(struct usb_composite_dev *cdev) { struct usb_gadget *gadget = cdev->gadget; |