diff options
author | Dileep Katta <dileep.katta@linaro.org> | 2015-02-13 14:33:43 +0800 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-02-25 17:47:02 +0100 |
commit | 537cd072da9c350d6709785c85f83cae2ad53493 (patch) | |
tree | 142694102e02b9987e02efbdadb91223015eb101 /drivers/usb | |
parent | e874207134e9d2d5958636f7f32b60e5441ab320 (diff) | |
download | u-boot-imx-537cd072da9c350d6709785c85f83cae2ad53493.zip u-boot-imx-537cd072da9c350d6709785c85f83cae2ad53493.tar.gz u-boot-imx-537cd072da9c350d6709785c85f83cae2ad53493.tar.bz2 |
usb: gadget: fastboot: Set the Serial Number for Fastboot Gadget
Configure the serial number using the serial# environment variable
during the fastboot bind.
This enables "fastboot devices" to return the serial number for
the attached devices.
Signed-off-by: Dileep Katta <dileep.katta@linaro.org>
Acked-by: Steve Rae <srae@broadcom.com>
Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/f_fastboot.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index fd9fc8a..751ec9e 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -137,6 +137,7 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f) int id; struct usb_gadget *gadget = c->cdev->gadget; struct f_fastboot *f_fb = func_to_fastboot(f); + const char *s; /* DYNAMIC interface numbers assignments */ id = usb_interface_id(c, f); @@ -162,6 +163,10 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f) hs_ep_out.bEndpointAddress = fs_ep_out.bEndpointAddress; + s = getenv("serial#"); + if (s) + g_dnl_set_serialnumber((char *)s); + return 0; } |