summaryrefslogtreecommitdiffstats
path: root/common/usbgadget.c
Commit message (Collapse)AuthorAgeFilesLines
* common: replace license statements with SPDX-License-IdentifiersAhmad Fatoum2020-11-271-10/+1
| | | | | | | | | | | | | For all files in common/ that already have a license text: - Replace with appropriate SPDX-License-Identifier - Remove empty comment lines around replacement - remove comment completely if only thing remaining is name of file without description Reviewed-by: Roland Hieber <rhi@pengutronix.de> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usbgadget: autostart: don't print error on repeated nv.usbgadget.autostart=1Ahmad Fatoum2020-11-241-2/+8
| | | | | | | | | | | | | | | | | | | | | | nvvar_add results in two calls to dev_set_param: - once when the existing global variable is found and set - once more when setting the nv variable This results in an annoying but ultimately harmless message on startup: ERROR: USB multi gadget already registered ERROR: failed to create nv variable usbgadget.autostart: Device or resource busy Avoid this by ignoring usbgadget.autostart=1 after it succeeded once. This issue should only affect $global.usbgadget.autostart, because all other global variables are "simple" meaning that they have no setters triggered. Fixes: 5a5c5178e7dc ("usbgadget: autostart: support delayed usbgadget.autostart=1") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/reboot-mode' into masterSascha Hauer2020-10-141-3/+3
|\
| * Merge branch 'for-next/magicvar-unique-id' into for-next/reboot-modeSascha Hauer2020-10-071-9/+6
| |\
| * | usbgadget: autostart: support delayed usbgadget.autostart=1Ahmad Fatoum2020-09-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, global.usbgadget.autostart=1 from the shell was without effect, because the variable is only evaluated once at postenvironment_initcall. Use the new globalvar_add_bool() to allow acting on the variable being true at any time. This is necessary for scripts that want to enable the usbgadget autostart functionality selectively without themselves hardcoding the particularities of what is exported. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/percent_pe' into masterSascha Hauer2020-10-141-2/+1
|\ \ \ | |_|/ |/| |
| * | vsprintf: retire strerrorp in favor of %peAhmad Fatoum2020-09-291-2/+1
| |/ | | | | | | | | | | | | | | | | strerrorp() is only used along with printf. We now have a format specifier for printing error pointers directly, so use that and remove strerrorp. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / magicvar: Replace BAREBOX_MAGICVAR_NAMED with BAREBOX_MAGICVARSascha Hauer2020-10-021-9/+6
|/ | | | | | | | BAREBOX_MAGICVAR now generates a unique identifier automatically, so we can convert users of BAREBOX_MAGICVAR_NAMED to the simpler BAREBOX_MAGICVAR macro. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fastboot: rename usbgadget.fastboot_* variables to fastboot.*Daniel Glöckner2020-08-191-15/+6
| | | | | | | | | | | | | There is nothing USB-specific in the defined usbgadget.fastboot_* variables. Rename them to be usable also for the UDP fastboot transport. The usbgadget.fastboot_function variable is used to define the files and devices accessible with the erase and flash commands. Since "function" is a term from the USB specification and the Fastboot specification uses the term "partition", we rename that variable to "fastboot.partitions". Signed-off-by: Daniel Glöckner <dg@emlix.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usbgadget: autostart: add DFU supportLadislav Michl2018-10-291-0/+144
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>