aboutsummaryrefslogtreecommitdiff
path: root/include/button.h
AgeCommit message (Collapse)AuthorFilesLines
2024-02-13boot: add support for button commandsCaleb Connolly1-0/+9
With the relatively new button API in U-Boot, it's now much easier to model the common usecase of mapping arbitrary actions to different buttons during boot - for example entering fastboot mode, setting some additional kernel cmdline arguments, or booting with a custom recovery ramdisk, to name a few. Historically, this functionality has been implemented in board code, making it fixed for a given U-Boot binary and requiring the code be duplicated and modified for every board. Implement a generic abstraction to run an arbitrary command during boot when a specific button is pressed. The button -> command mapping is configured via environment variables with the following format: button_cmd_N_name=<button label> button_cmd_N=<command to run> Where N is the mapping number starting from 0. For example: button_cmd_0_name=vol_down button_cmd_0=fastboot usb 0 This will cause the device to enter fastboot mode if volume down is held during boot. After we enter the cli loop the button commands are no longer valid, this allows the buttons to additionally be used for navigating a boot menu. Tested-by: Svyatoslav Ryhel <clamor95@gmail.com> # Tegra30 Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2023-02-10dm: button: add support for linux_code in button-gpio.c driverDzmitry Sankouski1-0/+16
Linux event code must be used in input devices, using buttons. Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-01-19doc: replace @return by Return:Heinrich Schuchardt1-2/+2
Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-02-22button: add udevice forward declarationNeil Armstrong1-0/+2
After 401d1c4f5d2d ("common: Drop asm/global_data.h from common header") build fails with : drivers/button/button-uclass.c:13:5: error: conflicting types for 'button_get_by_label' int button_get_by_label(const char *label, struct udevice **devp) ^~~~~~~~~~~~~~~~~~~ Adding struct udevice forward declaration in button.h solves the build error. Fixes: 401d1c4f5d2d ("common: Drop asm/global_data.h from common header") Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2020-07-28dm: button: add an uclass for buttonPhilippe Reynes1-0/+59
Add a new uclass for button that implements two functions: - button_get_by_label - button_get_status Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>