summaryrefslogtreecommitdiffstats
path: root/commands/usbgadget.c
Commit message (Collapse)AuthorAgeFilesLines
* usbgadget: autostart: add DFU supportLadislav Michl2018-10-291-61/+11
| | | | | | | | | | | Use global variable dfu_function to autostart DFU. As similar code is used to start multifunction gadget using command, move common code to common/usbgadget.c and consolidate it. It turned out that '-s' option of usbgadget command does nothing, so remove its help text and make it function as '-a'. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usbgadget: Update command help textSascha Hauer2018-01-111-7/+7
| | | | | | | | | - Do not use BAREBOX_CMD_HELP_OPT with an empty option to extend the previous option text. It confuses the rst converter - Add a '\t' to the options to align the option help texts in the barebox command help Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fastboot command: Add -b option to export bbu handlersSascha Hauer2017-09-271-2/+7
| | | | | | | When -b is given the usbgadget command will automatically export the registered bbu handlers via fastboot. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usbgadget command: catch errors when parsing the file listSascha Hauer2017-09-271-0/+11
| | | | | | | file_list_parse() can fail. Print an error message in this case instead of crashing. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: usbgadget: update fastboot help textOleksij Rempel2017-05-081-1/+2
| | | | | | | | | cmd_usbgadget can use now the fallback to global.usbgadget.fastboot_function. Update help text to reflect this behavior. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: usbgadget: provide fallback to global variablesOleksij Rempel2017-03-311-3/+8
| | | | | | | | usbgadget autostarter is providing now a global variable to configure fastboot. We can use is as fallback for the cmd_usbgadget as well. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: gadget: properly release f_multi_optsSascha Hauer2017-03-091-6/+13
| | | | | | | | | | | | | | | | The usbgadget commands uses statically allocated f_multi_opts and passes this to usb_multi_register(). These f_multi_opts are of course no longer valid when we leave the usbgadget command. Luckily we do not use the data after we left the usbgadget command, so this never has been a problem. However, f_multi_opts has some allocated members which we can not free anymore on gadget unregistration because we no longer have the pointer to them. Fix this by adding a release function to struct f_multi_opts. This way we can allocate all memory dynamically and properly free it when not used anymore. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: usbgadget: Fix -d option help textSascha Hauer2016-08-291-1/+1
| | | | | | | The -d option disables any currently active gadget, it does not necessarily have to be a serial gadget. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* USB: gadget: Add a multi function gadgetSascha Hauer2014-07-241-0/+108
Similar to the Kernel multi function this gadget driver is used for creating a USB device with multiple functions. This is created and removed with the newly created 'usbgadget' command. Based on the options it creates combinations of DFU, fastboot and serial USB functions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>