diff options
author | Michał Barnaś <mb@semihalf.com> | 2021-01-19 18:55:50 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-23 19:12:32 +0000 |
commit | 3a8d8b16790ea15bceec6e11d3ed091f5462ce44 (patch) | |
tree | 2ac4ce6dab7f884f1174533b8b953ca9551083d5 /common/ioexpander.c | |
parent | 4057eedf924fd5d3a9850b3d9ae8ed749474bc5e (diff) | |
download | chrome-ec-3a8d8b16790ea15bceec6e11d3ed091f5462ce44.tar.gz |
ioexpander: Add support to read levels on whole IOEX port
In some cases it's needed to read many pins on the same IOEX port.
To improve performance and remove redundant calls, it will be easier
to read levels on whole IOEX port. To enable this functionality,
CONFIG_IO_EXPANDER_SUPPORT_GET_PORT must be defined and driver
must support it.
BUG=b:168385201
BRANCH=main
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Change-Id: I472385a4ef4f5db23ce92d017194f8c737b7607e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2700295
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/ioexpander.c')
-rw-r--r-- | common/ioexpander.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/ioexpander.c b/common/ioexpander.c index 1e3f22764b..ccf3cc7c4a 100644 --- a/common/ioexpander.c +++ b/common/ioexpander.c @@ -152,6 +152,16 @@ int ioex_set_level(enum ioex_signal signal, int value) g->mask, value); } +#ifdef CONFIG_IO_EXPANDER_SUPPORT_GET_PORT +int ioex_get_port(int ioex, int port, int *val) +{ + if (ioex_config[ioex].drv->get_port == NULL) + return EC_ERROR_UNIMPLEMENTED; + + return ioex_config[ioex].drv->get_port(ioex, port, val); +} +#endif + int ioex_init(int ioex) { const struct ioex_info *g = ioex_list; |