diff options
author | Peter Marheine <pmarheine@chromium.org> | 2020-08-20 15:10:06 +1000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-21 04:38:52 +0000 |
commit | ace8af086a9f8110ec0086cd6f81720e4bc6e7a1 (patch) | |
tree | cab8e8e5b8dc454c4608cd884488565a3618e603 /include | |
parent | c3419d7abab90ed7fd640b5758ebac757db8e8c7 (diff) | |
download | chrome-ec-ace8af086a9f8110ec0086cd6f81720e4bc6e7a1.tar.gz |
gpio: add a gpio_or_ioex_get_level function to match the setter
Code that wants to work with either regular or IO expander GPIOs may also
wish to read the current value; this function permits it.
BUG=b:159051013,b:165622386
TEST=buildall
BRANCH=None
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Change-Id: I677617621ae4964f568ad87512b372ce8a9830a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2366455
Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpio.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/gpio.h b/include/gpio.h index e1957813e0..92c851f91a 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -254,6 +254,16 @@ void gpio_set_level_verbose(enum console_channel channel, void gpio_or_ioex_set_level(int signal, int value); /** + * Get the value of a signal that could be either a local GPIO or an IO + * expander GPIO + * + * @param signal GPIO_* or IOEX_* signal to get + * @param value Pointer to storage for output value, 0 = low, 1 = high + * @return EC_SUCCESS or nonzero if error. + */ +int gpio_or_ioex_get_level(int signal, int *value); + +/** * Reset the GPIO flags and alternate function state * * This returns the GPIO to it's default state of being a GPIO (not |