diff options
author | Diego Rondini <diego.rondini@kynetics.com> | 2022-04-11 12:02:09 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-04-20 11:14:39 -0400 |
commit | dd2b8c1155d016800cbbaa1bd70efdd81f9da493 (patch) | |
tree | 127dc4d0079353e6f5cb7df708bfc5bc5f348bb5 /configs | |
parent | 270f7fd25b3d1e825d3364eee652c3ccc9d5aae4 (diff) | |
download | u-boot-dd2b8c1155d016800cbbaa1bd70efdd81f9da493.tar.gz u-boot-dd2b8c1155d016800cbbaa1bd70efdd81f9da493.tar.bz2 u-boot-dd2b8c1155d016800cbbaa1bd70efdd81f9da493.zip |
cmd: gpio: Add `gpio read` subcommand
As explained in commit 4af2a33ee5b9 ("cmd: gpio: Make `gpio input`
return pin value again") the `gpio input` is used in scripts to obtain
the value of a pin, despite the fact that CMD_RET_FAILURE is
indistinguishable from a valid pin value.
To be able to detect failures and properly use the value of a GPIO in
scripts we introduce the `gpio read` command that sets the variable
`name` to the value of the pin. Return code of the `gpio read` command
can be used to check for CMD_RET_SUCCESS or CMD_RET_FAILURE.
CONFIG_CMD_GPIO_READ is used to enable the `gpio read` command.
Signed-off-by: Diego Rondini <diego.rondini@kynetics.com>
Diffstat (limited to 'configs')
-rw-r--r-- | configs/sandbox_defconfig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 06dbf38dcc..14d7af4db2 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -60,6 +60,7 @@ CONFIG_CMD_UNZIP=y CONFIG_CMD_BIND=y CONFIG_CMD_DEMO=y CONFIG_CMD_GPIO=y +CONFIG_CMD_GPIO_READ=y CONFIG_CMD_PWM=y CONFIG_CMD_GPT=y CONFIG_CMD_GPT_RENAME=y |