
On Thu, 10 Jun 2021 at 07:57, Nandor Han nandor.han@vaisala.com wrote:
A use case for controlling the boot mode is when the user wants to control the device boot by pushing a button without needing to go in user-space.
Add a new backed for reboot mode where GPIOs are used to control the reboot-mode. The driver is able to scan a predefined list of GPIOs and return the magic value. Having the modes associated with the magic value generated based on the GPIO values, allows the reboot mode uclass to select the proper mode.
Signed-off-by: Nandor Han nandor.han@vaisala.com
arch/sandbox/dts/test.dts | 8 ++ configs/sandbox_defconfig | 2 + .../reboot-mode/reboot-mode-gpio.txt | 20 +++ drivers/reboot-mode/Kconfig | 9 ++ drivers/reboot-mode/Makefile | 1 + drivers/reboot-mode/reboot-mode-gpio.c | 128 ++++++++++++++++++ include/reboot-mode/reboot-mode-gpio.h | 32 +++++ test/dm/Makefile | 1 + test/dm/reboot-mode.c | 42 ++++++ 9 files changed, 243 insertions(+) create mode 100644 doc/device-tree-bindings/reboot-mode/reboot-mode-gpio.txt create mode 100644 drivers/reboot-mode/reboot-mode-gpio.c create mode 100644 include/reboot-mode/reboot-mode-gpio.h create mode 100644 test/dm/reboot-mode.c
Reviewed-by: Simon Glass sjg@chromium.org