diff options
author | Yuval Peress <peress@chromium.org> | 2020-10-30 10:47:02 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-30 21:56:10 +0000 |
commit | 0e612dca764e2c482f720c3ca328f79f8ba7a2d8 (patch) | |
tree | 661b25dcc00097abdd46cda4f7b2e45f13e4b24a /include | |
parent | 916603a537b7aa4d59f9deac23056d2dc89933ea (diff) | |
download | chrome-ec-0e612dca764e2c482f720c3ca328f79f8ba7a2d8.tar.gz |
Zephyr: refactor i2c components to avoid name collisions with zephyr
This change prepares the i2c module for shimming (in the next CL) by
avoiding name conflicts with zephyr's. It also does some minor
formatting changes using clang-format.
BRANCH=none
BUG=b:171302975
TEST=build platform/ec boards volteer and eve
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I5f53384eb5819d39acc68669c0c40ff211815f63
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2509976
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/i2c.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/i2c.h b/include/i2c.h index 1ba56e51bf..44e5290e47 100644 --- a/include/i2c.h +++ b/include/i2c.h @@ -40,7 +40,10 @@ /* BIT(15) SPI_FLAG - used in motion_sense to overload address */ #define I2C_FLAG_ADDR_IS_SPI BIT(15) -#define I2C_GET_ADDR(addr_flags) ((addr_flags) & I2C_ADDR_MASK) +#define I2C_STRIP_FLAGS(addr_flags) ((addr_flags) & I2C_ADDR_MASK) +#ifndef CONFIG_ZEPHYR +#define I2C_GET_ADDR(addr_flags) I2C_STRIP_FLAGS(addr_flags) +#endif /* !CONFIG_ZEPHYR */ #define I2C_USE_PEC(addr_flags) ((addr_flags) & I2C_FLAG_PEC) #define I2C_IS_BIG_ENDIAN(addr_flags) ((addr_flags) & I2C_FLAG_BIG_ENDIAN) |