diff options
author | Anton Staaf <robotboy@chromium.org> | 2016-03-02 08:53:12 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-03-02 18:03:43 -0800 |
commit | 325fe5ac6079e28d21d78de75c3151db10614ebd (patch) | |
tree | 88d8d5356ee5843670b7fd682781cb7f2a58e4cc /include/gpio.h | |
parent | 6877eee247250cb0e962ef8ddf1544aba4b75e6b (diff) | |
download | chrome-ec-325fe5ac6079e28d21d78de75c3151db10614ebd.tar.gz |
GPIO: Move host and console commands to new file
These commands, like other users of GPIOs should be able to use the
public GPIO API, and thus do not need to be coupled directly to the
GPIO common code.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Manually verified console commands on discovery board
Change-Id: I6e38b9d103590d4f7c72813a33437067716a858c
Reviewed-on: https://chromium-review.googlesource.com/329992
Commit-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/gpio.h')
-rw-r--r-- | include/gpio.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h index d7dcd9d3ca..7c0a4cad22 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -128,6 +128,17 @@ int gpio_get_level(enum gpio_signal signal); const char *gpio_get_name(enum gpio_signal signal); /** + * Determine if a GPIO is implemented. + * + * Some well known GPIO signal names may not be implemented on a particular + * board. This function can be used to determine if a GPIO is implemented. + * + * @param signal Signal to query + * @returns 0 if the GPIO is not implemented, 1 if it is. + */ +int gpio_is_implemented(enum gpio_signal signal); + +/** * Set the flags for a signal. * * @param signal Signal to set flags for @@ -136,6 +147,14 @@ const char *gpio_get_name(enum gpio_signal signal); void gpio_set_flags(enum gpio_signal signal, int flags); /** + * Get the default flags for a signal. + * + * @param signal Signal to set flags for + * @returns The flags that were originally defined for this signal + */ +int gpio_get_default_flags(enum gpio_signal signal); + +/** * Set the value of a signal. * * @param signal Signal to set |