diff options
author | Yuval Peress <peress@chromium.org> | 2020-10-30 13:16:22 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-02 19:15:23 +0000 |
commit | 13323e77ff91a85154cfa5f504ed4609fb8cbfc7 (patch) | |
tree | 81709bca853db34a2eeb18a691514d0ba1ece1f8 /chip/stm32/i2c-stm32f4.c | |
parent | f0e84c2df23995c61f7690a47f30f259bcde940e (diff) | |
download | chrome-ec-13323e77ff91a85154cfa5f504ed4609fb8cbfc7.tar.gz |
Replace I2C_GET_ADDR with I2C_STRIP_FLAGS
The new I2C_STRIP_FLAGS macro was added to avoid conflict with
Zephyr's macro. This CL performs the migration to that new API.
BRANCH=none
BUG=b:172067439
TEST=make runtests -j and built for various boards: eve, volteer,
arcada_ish, atlas, hatch, kohaku, nocturne, samus, and scarlet
Change-Id: I0583b647435db96ec268f186252b367bdc4118a6
Signed-off-by: Yuval Peress <peress@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2511097
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'chip/stm32/i2c-stm32f4.c')
-rw-r--r-- | chip/stm32/i2c-stm32f4.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chip/stm32/i2c-stm32f4.c b/chip/stm32/i2c-stm32f4.c index 84cd667d2d..6d504da412 100644 --- a/chip/stm32/i2c-stm32f4.c +++ b/chip/stm32/i2c-stm32f4.c @@ -552,7 +552,7 @@ int chip_i2c_xfer(const int port, const uint16_t slave_addr_flags, const uint8_t *out, int out_bytes, uint8_t *in, int in_bytes, int flags) { - int addr_8bit = I2C_GET_ADDR(slave_addr_flags) << 1; + int addr_8bit = I2C_STRIP_FLAGS(slave_addr_flags) << 1; int started = (flags & I2C_XFER_START) ? 0 : 1; int rv = EC_SUCCESS; int i; @@ -928,7 +928,7 @@ static void i2c_event_handler(int port) STM32_I2C_CR2(port) &= ~STM32_I2C_CR2_ITBUFEN; #ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS if ((addr_8bit >> 1) == - I2C_GET_ADDR( + I2C_STRIP_FLAGS( CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS)) i2c_process_board_command(1, addr_8bit, buf_idx); @@ -955,7 +955,7 @@ static void i2c_event_handler(int port) #ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS if (rx_pending && (addr_8b >> 1) == - I2C_GET_ADDR(CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS)) + I2C_STRIP_FLAGS(CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS)) i2c_process_board_command(0, addr_8bit, buf_idx); #endif rx_pending = 0; @@ -999,10 +999,10 @@ void i2c_init(void) | STM32_I2C_CR2_ITERREN; /* Setup host command slave */ STM32_I2C_OAR1(I2C_PORT_EC) = STM32_I2C_OAR1_B14 - | (I2C_GET_ADDR(CONFIG_HOSTCMD_I2C_ADDR_FLAGS) << 1); + | (I2C_STRIP_ADDR(CONFIG_HOSTCMD_I2C_ADDR_FLAGS) << 1); #ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS STM32_I2C_OAR2(I2C_PORT_EC) = STM32_I2C_OAR2_ENDUAL - | (I2C_GET_ADDR(CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS) << 1); + | (I2C_STRIP_FLAGS(CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS) << 1); #endif task_enable_irq(IRQ_SLAVE_EV); task_enable_irq(IRQ_SLAVE_ER); |