aboutsummaryrefslogtreecommitdiff
path: root/cmd/gpio.c
AgeCommit message (Collapse)Author
2019-08-26cmd: gpio: remove redundant assignmentHeinrich Schuchardt
The assigned value NULL is overwritten before being used. Remove the assignment. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-02-20gpio: Use case-insentive matching on the GPIO nameSimon Glass
Allow the 'gpio' command to match GPIO bank names regardless of the case of each. While these are generally in upper case, it is useful to be able to provide lower case with the command. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2019-02-20gpio: Show inactive GPIOs when explicitly requestedSimon Glass
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>
2019-02-01gpio: Use more command-specific enums valuesSimon Glass
At present this file uses GPIO_OUTPUT and GPIO_INPUT as its sub-command values. These are pretty generic names. Add a 'C' suffix to avoid possible conflicts. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2019-01-15cmd: gpio: use correct printf codeHeinrich Schuchardt
gpio is defined as unsigned int. So we should use %u when calling printf(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-03-17gpio: Report errors when GPIOs cannot be readSimon Glass
Some controllers do not allow the output value to be read. Detect this and report the error in that case. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-02-15gpio: Correct handling of 'gpio status'Simon Glass
This is broken - we need to look at the first two characters to distinguish 'gpio status' from 'gpio set'. Fixes: 0ffe6ab5 (gpio: Allow 's' as an abbreviation for 'status') Reported-by: Soeren Moch <smoch@web.de> Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Soeren Moch <smoch@web.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Hannes Schmelzer <oe5hpm@oevsv.at>
2016-01-25Remove the cmd_ prefix from command filesSimon Glass
Now that they are in their own directory, we can remove this prefix. This makes it easier to find a file since the prefix does not get in the way. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>