diff options
author | Edward Hill <ecgh@chromium.org> | 2020-03-17 20:37:39 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-03-20 18:14:18 +0000 |
commit | 1deb79863d965a2410515f633ff66646badd9a65 (patch) | |
tree | 7f0fe721561d920ec2a22509382643cd4db3e5b9 /include | |
parent | 9f17f26d0ac487ea4092809f23fe7c38cfb7e866 (diff) | |
download | chrome-ec-1deb79863d965a2410515f633ff66646badd9a65.tar.gz |
ioexpander: add IOEX_FLAGS_DISABLED
BUG=b:150349225
BRANCH=none
TEST=none
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: Id264d633576ca79b288a435f95de7fda9ca201ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108334
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com>
Tested-by: Paul Ma <magf@bitland.corp-partner.google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/ioexpander.h | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/include/ioexpander.h b/include/ioexpander.h index 206b0a390c..ebdb4ac652 100644 --- a/include/ioexpander.h +++ b/include/ioexpander.h @@ -45,6 +45,9 @@ struct ioexpander_drv { int (*enable_interrupt)(int ioex, int port, int mask, int enable); }; +/* IO expander chip disabled. No I2C communication will be attempted. */ +#define IOEX_FLAGS_DISABLED BIT(0) + struct ioexpander_config_t { /* Physical I2C port connects to the IO expander chip. */ int i2c_host_port; @@ -55,6 +58,8 @@ struct ioexpander_config_t { * the struct ioexpander_drv. */ const struct ioexpander_drv *drv; + /* Config flags for this IO expander chip. See IOEX_FLAGS_* */ + uint32_t flags; }; extern struct ioexpander_config_t ioex_config[]; @@ -76,28 +81,6 @@ int ioex_enable_interrupt(enum ioex_signal signal); int ioex_disable_interrupt(enum ioex_signal signal); /* - * Get flags for the IOEX pin by mask - * - * @param ioex IO expander chip's port number - * @param port IO port in the IO expander chip - * @param mask Bitmask of the pin on the port above - * @param flags Pointer to the keep the flags read - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_get_flags_by_mask(int ioex, int port, int mask, int *flags); - -/* - * Set flags for the IOEX pin by mask - * - * @param ioex IO expander chip's port number - * @param port IO port in the IO expander chip - * @param mask Bitmask of the pin on the port above - * @param flags flags to set - * @return EC_SUCCESS if successful, non-zero if error. - */ -int ioex_set_flags_by_mask(int ioex, int port, int mask, int flags); - -/* * Get flags for the IOEX signal * * @param signal IOEX signal to get flags for |