From 473bd883b60fd5b00377766dae2bacad246de0d2 Mon Sep 17 00:00:00 2001 From: Denis Brockus Date: Tue, 16 Jul 2019 15:10:11 -0600 Subject: Remove __7b, __8b and __7bf The extentions were added to make the compiler perform most of the verification that the conversion was being done correctly to remove 8bit addressing as the standard I2C/SPI address type. Now that the compiler has verified the code, the extra extentions are being removed BUG=chromium:971296 BRANCH=none TEST=make buildall -j TEST=verify sensor functionality on arcada_ish Change-Id: I36894f8bb9daefb5b31b5e91577708f6f9af2a4f Signed-off-by: Denis Brockus Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704792 Reviewed-by: Jack Rosenthal --- chip/stm32/i2c-stm32f0.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'chip/stm32/i2c-stm32f0.c') diff --git a/chip/stm32/i2c-stm32f0.c b/chip/stm32/i2c-stm32f0.c index e2aa3f8af9..c612e922c5 100644 --- a/chip/stm32/i2c-stm32f0.c +++ b/chip/stm32/i2c-stm32f0.c @@ -27,7 +27,7 @@ /* Transmit timeout in microseconds */ #define I2C_TX_TIMEOUT_MASTER (10 * MSEC) -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR__7BF +#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS #if (I2C_PORT_EC == STM32_I2C1_PORT) #define IRQ_SLAVE STM32_IRQ_I2C1 #else @@ -146,7 +146,7 @@ static void i2c_init_port(const struct i2c_port_t *p) STM32_RCC_APB1ENR |= 1 << (21 + port); if (port == STM32_I2C1_PORT) { -#if defined(CONFIG_HOSTCMD_I2C_SLAVE_ADDR__7BF) && \ +#if defined(CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS) && \ defined(CONFIG_LOW_POWER_IDLE) && \ (I2C_PORT_EC == STM32_I2C1_PORT) /* @@ -189,7 +189,7 @@ defined(CONFIG_LOW_POWER_IDLE) && \ } /*****************************************************************************/ -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR__7BF +#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS /* Host command slave */ /* * Buffer for received host command packets (including prefix byte on request, @@ -426,11 +426,11 @@ DECLARE_IRQ(IRQ_SLAVE, i2c2_event_interrupt, 2); /*****************************************************************************/ /* Interface */ -int chip_i2c_xfer__7bf(const int port, const uint16_t slave_addr__7bf, +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__8b = I2C_GET_ADDR__7b(slave_addr__7bf) << 1; + int addr_8bit = I2C_GET_ADDR(slave_addr_flags) << 1; int rv = EC_SUCCESS; int i; int xfer_start = flags & I2C_XFER_START; @@ -438,7 +438,7 @@ int chip_i2c_xfer__7bf(const int port, const uint16_t slave_addr__7bf, #if defined(CONFIG_I2C_SCL_GATE_ADDR) && defined(CONFIG_I2C_SCL_GATE_PORT) if (port == CONFIG_I2C_SCL_GATE_PORT && - slave_addr__7bf == CONFIG_I2C_SCL_GATE_ADDR__7BF) + slave_addr_flags == CONFIG_I2C_SCL_GATE_ADDR_FLAGS) gpio_set_level(CONFIG_I2C_SCL_GATE_GPIO, 1); #endif @@ -459,7 +459,7 @@ int chip_i2c_xfer__7bf(const int port, const uint16_t slave_addr__7bf, * NBYTES again. if we are starting, then set START bit. */ STM32_I2C_CR2(port) = ((out_bytes & 0xFF) << 16) - | addr__8b + | addr_8bit | ((in_bytes == 0 && xfer_stop) ? STM32_I2C_CR2_AUTOEND : 0) | ((in_bytes == 0 && !xfer_stop) ? @@ -488,7 +488,7 @@ int chip_i2c_xfer__7bf(const int port, const uint16_t slave_addr__7bf, * set START bit to send (re)start and begin read transaction. */ STM32_I2C_CR2(port) = ((in_bytes & 0xFF) << 16) - | STM32_I2C_CR2_RD_WRN | addr__8b + | STM32_I2C_CR2_RD_WRN | addr_8bit | (xfer_stop ? STM32_I2C_CR2_AUTOEND : 0) | (!xfer_stop ? STM32_I2C_CR2_RELOAD : 0) | (out_bytes || xfer_start ? STM32_I2C_CR2_START : 0); @@ -545,7 +545,7 @@ xfer_exit: #ifdef CONFIG_I2C_SCL_GATE_ADDR if (port == CONFIG_I2C_SCL_GATE_PORT && - slave_addr__7bf == CONFIG_I2C_SCL_GATE_ADDR__7BF) + slave_addr_flags == CONFIG_I2C_SCL_GATE_ADDR_FLAGS) gpio_set_level(CONFIG_I2C_SCL_GATE_GPIO, 0); #endif @@ -588,7 +588,7 @@ static void i2c_init(void) for (i = 0; i < i2c_ports_used; i++, p++) i2c_init_port(p); -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR__7BF +#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS STM32_I2C_CR1(I2C_PORT_EC) |= STM32_I2C_CR1_RXIE | STM32_I2C_CR1_ERRIE | STM32_I2C_CR1_ADDRIE | STM32_I2C_CR1_STOPIE | STM32_I2C_CR1_NACKIE; @@ -601,14 +601,14 @@ static void i2c_init(void) STM32_I2C_CR1(I2C_PORT_EC) |= STM32_I2C_CR1_WUPEN; #endif STM32_I2C_OAR1(I2C_PORT_EC) = 0x8000 - | (I2C_GET_ADDR__7b(CONFIG_HOSTCMD_I2C_SLAVE_ADDR__7BF) << 1); + | (I2C_GET_ADDR(CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS) << 1); #ifdef TCPCI_I2C_SLAVE /* * Configure TCPC address with OA2[1] masked so that we respond * to CONFIG_TCPC_I2C_BASE_ADDR and CONFIG_TCPC_I2C_BASE_ADDR + 2. */ STM32_I2C_OAR2(I2C_PORT_EC) = 0x8100 - | (I2C_GET_ADDR__7b(CONFIG_TCPC_I2C_BASE_ADDR__7BF) << 1); + | (I2C_GET_ADDR(CONFIG_TCPC_I2C_BASE_ADDR_FLAGS) << 1); #endif task_enable_irq(IRQ_SLAVE); #endif -- cgit v1.2.1