From patchwork Mon Jul 13 12:56:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe REYNES X-Patchwork-Id: 241412 List-Id: U-Boot discussion From: philippe.reynes at softathome.com (Philippe Reynes) Date: Mon, 13 Jul 2020 14:56:08 +0200 Subject: [PATCH 3/7] cmd: button: add a new 'button' command In-Reply-To: <1594644972-2588-1-git-send-email-philippe.reynes@softathome.com> References: <1594644972-2588-1-git-send-email-philippe.reynes@softathome.com> Message-ID: <1594644972-2588-3-git-send-email-philippe.reynes@softathome.com> Adds a command 'button' that provides the list of buttons supported by the board, and the state of a button. Signed-off-by: Philippe Reynes Reviewed-by: Simon Glass --- 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