From: Philippe Reynes Date: Fri, 17 Jul 2020 14:22:22 +0200 Subject: [PATCH v2 3/8] cmd: button: add a new 'button' command In-Reply-To: <1594988547-24010-1-git-send-email-philippe.reynes@softathome.com> References: <1594988547-24010-1-git-send-email-philippe.reynes@softathome.com> Message-ID: <1594988547-24010-3-git-send-email-philippe.reynes@softathome.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- Changelog: v2 - no change 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 192b3b2..750d26a 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1664,6 +1664,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