]> git.ipfire.org Git - thirdparty/u-boot.git/commit
gpio: Show inactive GPIOs when explicitly requested
authorSimon Glass <sjg@chromium.org>
Sun, 17 Feb 2019 03:24:42 +0000 (20:24 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Wed, 20 Feb 2019 07:24:29 +0000 (15:24 +0800)
commitb8989b537eb1f3387d08a1c34633e78e6a56acc2
tree185e26669cb45ac9f9736600d34a5e395459db6d
parent7d38db55f70a30eaa64f91b35720abc5f595783f
gpio: Show inactive GPIOs when explicitly requested

At present the gpio command only shows GPIOs which are marked as in use.
This makes sense with 'gpio status' since we already have the '-a' flag
to indicate that all GPIOs should be shown. But when a particular GPIO is
requested, it seems better to always display it. At present the request is
simply ignored.

For example if GPIO a10 is not in use, then:

   > gpio status a10

shows nothing, not even the function being used for that GPIO. With this
change, it shows the pin status:

   > gpio status a10
   a10: input: 0 [ ]

Add an extra parameter for this to avoid changing the existing flag
parameter.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: correct the 'gpio' command in the commit message]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
cmd/gpio.c