[PATCH] cmd: gpio: Add `gpio read` subcommand
Tom Rini
trini at konsulko.com
Sat Apr 9 01:43:59 CEST 2022
On Tue, Mar 22, 2022 at 06:14:35PM +0100, Diego Rondini wrote:
> 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.
>
> Signed-off-by: Diego Rondini <diego.rondini at kynetics.com>
> ---
> cmd/gpio.c | 24 ++++++++++++++++++++----
> test/py/tests/test_gpio.py | 15 +++++++++++++++
> 2 files changed, 35 insertions(+), 4 deletions(-)
Please rework this to add CONFIG_CMD_GPIO_READ, and enable it on sandbox
as it causes a good bit of growth on a large number of platforms,
thanks.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220408/dff6b585/attachment.sig>
More information about the U-Boot
mailing list