diff options
author | Diana Z <dzigterman@chromium.org> | 2020-10-30 14:47:16 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-31 01:06:05 +0000 |
commit | 63e4dcbe22f2b987e3040a1a8a39720fb4cd55bf (patch) | |
tree | 2be0489c11d85a9cddbe5c183448ea8fbc847db2 /chip | |
parent | f77cdd2feaa04cf55af76994079e42de808fb096 (diff) | |
download | chrome-ec-63e4dcbe22f2b987e3040a1a8a39720fb4cd55bf.tar.gz |
COIL: Rename CONFIG_HOSTCMD_I2C_ADDR_FLAGS
Rename for CONFIG_HOSTCMD_I2C_ADDR_FLAGS and surrounding comments.
BRANCH=None
BUG=None
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I49dc12753957da7baa1bb387e212d75c75e81d86
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2511093
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/max32660/i2c_chip.c | 20 | ||||
-rw-r--r-- | chip/stm32/i2c-stm32f0.c | 12 | ||||
-rw-r--r-- | chip/stm32/i2c-stm32f4.c | 12 | ||||
-rw-r--r-- | chip/stm32/i2c-stm32l4.c | 8 |
4 files changed, 26 insertions, 26 deletions
diff --git a/chip/max32660/i2c_chip.c b/chip/max32660/i2c_chip.c index 1279e9e50c..201b42a8a8 100644 --- a/chip/max32660/i2c_chip.c +++ b/chip/max32660/i2c_chip.c @@ -173,16 +173,16 @@ static int i2c_master_write(mxc_i2c_regs_t *i2c, uint8_t addr, int start, static int i2c_master_read(mxc_i2c_regs_t *i2c, uint8_t addr, int start, int stop, uint8_t *data, int len, int restart); -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS static void init_i2cs(int port); static int i2c_slave_async(mxc_i2c_regs_t *i2c, i2c_req_t *req); static void i2c_slave_handler(mxc_i2c_regs_t *i2c); -#endif /* CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS */ +#endif /* CONFIG_HOSTCMD_I2C_ADDR_FLAGS */ /* Port address for each I2C */ static mxc_i2c_regs_t *i2c_bus_ports[] = {MXC_I2C0, MXC_I2C1}; -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS #ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS static void i2c_send_board_response(int len); @@ -190,7 +190,7 @@ static void i2c_process_board_command(int read, int addr, int len); void board_i2c_process(int read, uint8_t addr, int len, char *buffer, void (*send_response)(int len)); #endif /* CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS */ -#endif /* CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS */ +#endif /* CONFIG_HOSTCMD_I2C_ADDR_FLAGS */ /** * chip_i2c_xfer() - Low Level function for I2C Master Reads and Writes. @@ -280,7 +280,7 @@ void i2c_init(void) i2c_set_timeout(i, 0); } -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS /* Initialize the I2C Slave */ init_i2cs(I2C_PORT_EC); #ifdef CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS @@ -298,14 +298,14 @@ void i2c_init(void) (1 << MXC_F_I2C_SLAVE_ADDR_SLAVE_ADDR_IDX_POS) | CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS; #endif /* CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS */ -#endif /* CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS */ +#endif /* CONFIG_HOSTCMD_I2C_ADDR_FLAGS */ } /** - * I2C Slave Implentation + * I2C Peripheral Implementation */ -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS /* IRQ for each I2C */ static uint32_t i2c_bus_irqs[] = {EC_I2C0_IRQn, EC_I2C1_IRQn}; @@ -657,7 +657,7 @@ void init_i2cs(int port) ; } /* Prepare for interrupt driven slave requests. */ - req_slave.addr = CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS; + req_slave.addr = CONFIG_HOSTCMD_I2C_ADDR_FLAGS; req_slave.tx_data = host_buffer; /* Transmitted to host. */ req_slave.tx_remain = -1; req_slave.rx_data = host_buffer; /* Received from host. */ @@ -727,7 +727,7 @@ static void i2c_process_board_command(int read, int addr, int len) i2c_send_board_response); } #endif /* CONFIG_BOARD_I2C_SLAVE_ADDR_FLAGS */ -#endif /* CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS */ +#endif /* CONFIG_HOSTCMD_I2C_ADDR_FLAGS */ /** * i2c_set_speed() - Set the transfer speed of the selected I2C. diff --git a/chip/stm32/i2c-stm32f0.c b/chip/stm32/i2c-stm32f0.c index 6a09483036..d56281f175 100644 --- a/chip/stm32/i2c-stm32f0.c +++ b/chip/stm32/i2c-stm32f0.c @@ -28,7 +28,7 @@ /* Transmit timeout in microseconds */ #define I2C_TX_TIMEOUT_CONTROLLER (10 * MSEC) -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS #if (I2C_PORT_EC == STM32_I2C1_PORT) #define IRQ_PERIPHERAL STM32_IRQ_I2C1 #else @@ -117,7 +117,7 @@ int chip_i2c_set_freq(int port, enum i2c_freq freq) { enum stm32_i2c_clk_src src = I2C_CLK_SRC_48MHZ; -#if defined(CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS) && \ +#if defined(CONFIG_HOSTCMD_I2C_ADDR_FLAGS) && \ defined(CONFIG_LOW_POWER_IDLE) && \ (I2C_PORT_EC == STM32_I2C1_PORT) if (port == STM32_I2C1_PORT) { @@ -164,7 +164,7 @@ static int 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_FLAGS) && \ +#if defined(CONFIG_HOSTCMD_I2C_ADDR_FLAGS) && \ defined(CONFIG_LOW_POWER_IDLE) && \ (I2C_PORT_EC == STM32_I2C1_PORT) /* @@ -209,7 +209,7 @@ static int i2c_init_port(const struct i2c_port_t *p) } /*****************************************************************************/ -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS /* Host command peripheral */ /* * Buffer for received host command packets (including prefix byte on request, @@ -625,7 +625,7 @@ void i2c_init(void) for (i = 0; i < i2c_ports_used; i++, p++) i2c_init_port(p); -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_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; @@ -638,7 +638,7 @@ 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(CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS) << 1); + | (I2C_GET_ADDR(CONFIG_HOSTCMD_I2C_ADDR_FLAGS) << 1); #ifdef TCPCI_I2C_PERIPHERAL /* * Configure TCPC address with OA2[1] masked so that we respond diff --git a/chip/stm32/i2c-stm32f4.c b/chip/stm32/i2c-stm32f4.c index 515aed20eb..4a609fe127 100644 --- a/chip/stm32/i2c-stm32f4.c +++ b/chip/stm32/i2c-stm32f4.c @@ -25,7 +25,7 @@ /* Transmit timeout in microseconds */ #define I2C_TX_TIMEOUT_MASTER (10 * MSEC) -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS #if (I2C_PORT_EC == STM32_I2C1_PORT) #define IRQ_SLAVE_EV STM32_IRQ_I2C1_EV #define IRQ_SLAVE_ER STM32_IRQ_I2C1_ER @@ -754,9 +754,9 @@ DECLARE_HOOK(HOOK_FREQ_CHANGE, i2c_freq_change_hook, HOOK_PRIO_DEFAULT); #endif /*****************************************************************************/ -/* Slave */ -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS -/* Host command slave */ +/* Peripheral */ +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS +/* Host command peripheral */ /* * Buffer for received host command packets (including prefix byte on request, * and result/size on response). After any protocol-specific headers, the @@ -991,7 +991,7 @@ void i2c_init(void) i2c_init_port(p); -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS /* Enable ACK */ STM32_I2C_CR1(I2C_PORT_EC) |= STM32_I2C_CR1_ACK; /* Enable interrupts */ @@ -999,7 +999,7 @@ 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_SLAVE_ADDR_FLAGS) << 1); + | (I2C_GET_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); diff --git a/chip/stm32/i2c-stm32l4.c b/chip/stm32/i2c-stm32l4.c index 66bd063499..b0304f375c 100644 --- a/chip/stm32/i2c-stm32l4.c +++ b/chip/stm32/i2c-stm32l4.c @@ -26,7 +26,7 @@ /* Transmit timeout in microseconds */ #define I2C_TX_TIMEOUT_MASTER (10 * MSEC) -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS #define I2C_SLAVE_ERROR_CODE 0xec #if (I2C_PORT_EC == STM32_I2C1_PORT) #define IRQ_SLAVE STM32_IRQ_I2C1 @@ -177,7 +177,7 @@ static void i2c_init_port(const struct i2c_port_t *p) /*****************************************************************************/ -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_ADDR_FLAGS static void i2c_event_handler(int port) { @@ -453,12 +453,12 @@ void i2c_init(void) for (i = 0; i < i2c_ports_used; i++, p++) i2c_init_port(p); -#ifdef CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS +#ifdef CONFIG_HOSTCMD_I2C_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; STM32_I2C_OAR1(I2C_PORT_EC) = 0x8000 - | (I2C_GET_ADDR(CONFIG_HOSTCMD_I2C_SLAVE_ADDR_FLAGS) << 1); + | (I2C_GET_ADDR(CONFIG_HOSTCMD_I2C_ADDR_FLAGS) << 1); task_enable_irq(IRQ_SLAVE); #endif } |