From 325141a6eab0d21c928a4c36aa9b6873bb672dab Mon Sep 17 00:00:00 2001 From: Philippe Reynes Date: Fri, 24 Jul 2020 18:19:47 +0200 Subject: [PATCH] cmd: button: add a new 'button' command Adds a command 'button' that provides the list of buttons supported by the board, and the state of a button. Reviewed-by: Simon Glass Signed-off-by: Philippe Reynes --- cmd/Kconfig | 11 ++++++++ cmd/Makefile | 1 + cmd/button.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 cmd/button.c diff --git a/cmd/Kconfig b/cmd/Kconfig index e2b0a4f..bea2ddf 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1680,6 +1680,17 @@ config CMD_BLOCK_CACHE during development, but also allows the cache to be disabled when it might hurt performance (e.g. when using the ums command). +config CMD_BUTTON + bool "button" + depends on BUTTON + default y if BUTTON + help + Enable the 'button' command which allows to get the status of + buttons supported by the board. The buttonss can be listed with + 'button list' and state can be known with 'button