diff options
author | Diana Z <dzigterman@chromium.org> | 2021-01-25 21:42:41 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-27 21:30:42 +0000 |
commit | e2f756a76e4f867949489c3e39d5c80a25432394 (patch) | |
tree | a9b1573dc4ed6ccadc97c1d0d460f9d333454735 | |
parent | 0a142f8365840439ef08518004122209183bdb14 (diff) | |
download | chrome-ec-e2f756a76e4f867949489c3e39d5c80a25432394.tar.gz |
COIL: Rename variables and comments for ANX7447
Rename variables and comments for the ANX7447 driver to match current
i2c naming conventions.
BRANCH=None
BUG=None
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I42ea7b190bf82c900a4ce9bc5ac49f155d9ecf14
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2649355
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | driver/tcpm/anx7447.c | 32 | ||||
-rw-r--r-- | driver/tcpm/anx7447.h | 8 |
2 files changed, 20 insertions, 20 deletions
diff --git a/driver/tcpm/anx7447.c b/driver/tcpm/anx7447.c index e7203947ee..2f679193ec 100644 --- a/driver/tcpm/anx7447.c +++ b/driver/tcpm/anx7447.c @@ -31,7 +31,7 @@ (((anx7447_get_vbus_voltage(port))) > vsafe0v_max) struct anx_state { - uint16_t i2c_slave_addr_flags; + uint16_t i2c_addr_flags; }; struct anx_usb_mux { @@ -44,15 +44,15 @@ static struct anx_state anx[CONFIG_USB_PD_PORT_MAX_COUNT]; static struct anx_usb_mux mux[CONFIG_USB_PD_PORT_MAX_COUNT]; /* - * ANX7447 has two co-existence I2C slave addresses, TCPC slave address and - * SPI slave address. The registers of TCPC slave address are partly compliant - * with standard USB TCPC specification, and the registers in SPI slave + * ANX7447 has two co-existence I2C addresses, TCPC address and + * SPI address. The registers of TCPC address are partly compliant + * with standard USB TCPC specification, and the registers in SPI * address controls the other functions (ex, hpd_level, mux_switch, and - * so on). It can't use tcpc_read() and tcpc_write() to access SPI slave - * address because its slave address has been set as TCPC in the structure + * so on). It can't use tcpc_read() and tcpc_write() to access SPI + * address because its address has been set as TCPC in the structure * tcpc_config_t. * anx7447_reg_write() and anx7447_reg_read() are implemented here to access - * ANX7447 SPI slave address. + * ANX7447 SPI address. */ const struct anx7447_i2c_addr anx7447_i2c_addrs_flags[] = { {AN7447_TCPC0_I2C_ADDR_FLAGS, AN7447_SPI0_I2C_ADDR_FLAGS}, @@ -64,7 +64,7 @@ const struct anx7447_i2c_addr anx7447_i2c_addrs_flags[] = { static inline int anx7447_reg_write(int port, int reg, int val) { int rv = i2c_write8(tcpc_config[port].i2c_info.port, - anx[port].i2c_slave_addr_flags, + anx[port].i2c_addr_flags, reg, val); #ifdef CONFIG_USB_PD_TCPC_LOW_POWER pd_device_accessed(port); @@ -75,7 +75,7 @@ static inline int anx7447_reg_write(int port, int reg, int val) static inline int anx7447_reg_read(int port, int reg, int *val) { int rv = i2c_read8(tcpc_config[port].i2c_info.port, - anx[port].i2c_slave_addr_flags, + anx[port].i2c_addr_flags, reg, val); #ifdef CONFIG_USB_PD_TCPC_LOW_POWER pd_device_accessed(port); @@ -296,20 +296,20 @@ static int anx7447_init(int port) memset(&anx[port], 0, sizeof(struct anx_state)); /* - * find corresponding anx7447 SPI slave address according to - * specified TCPC slave address + * find corresponding anx7447 SPI address according to + * specified TCPC address */ for (i = 0; i < ARRAY_SIZE(anx7447_i2c_addrs_flags); i++) { if (I2C_STRIP_FLAGS(tcpc_config[port].i2c_info.addr_flags) == I2C_STRIP_FLAGS( - anx7447_i2c_addrs_flags[i].tcpc_slave_addr_flags)) { - anx[port].i2c_slave_addr_flags = - anx7447_i2c_addrs_flags[i].spi_slave_addr_flags; + anx7447_i2c_addrs_flags[i].tcpc_addr_flags)) { + anx[port].i2c_addr_flags = + anx7447_i2c_addrs_flags[i].spi_addr_flags; break; } } - if (!I2C_STRIP_FLAGS(anx[port].i2c_slave_addr_flags)) { - ccprintf("TCPC I2C slave addr 0x%x is invalid for ANX7447\n", + if (!I2C_STRIP_FLAGS(anx[port].i2c_addr_flags)) { + ccprintf("TCPC I2C addr 0x%x is invalid for ANX7447\n", I2C_STRIP_FLAGS(tcpc_config[port] .i2c_info.addr_flags)); return EC_ERROR_UNKNOWN; diff --git a/driver/tcpm/anx7447.h b/driver/tcpm/anx7447.h index 94b8bd994b..8323282040 100644 --- a/driver/tcpm/anx7447.h +++ b/driver/tcpm/anx7447.h @@ -10,7 +10,7 @@ #ifndef __CROS_EC_USB_PD_TCPM_ANX7447_H #define __CROS_EC_USB_PD_TCPM_ANX7447_H -/* Registers: TCPC slave address used */ +/* Registers: TCPC address used */ #define ANX7447_REG_TCPC_SWITCH_0 0xB4 #define ANX7447_REG_TCPC_SWITCH_1 0xB5 #define ANX7447_REG_TCPC_AUX_SWITCH 0xB6 @@ -23,7 +23,7 @@ #define ANX7447_REG_ADC_CTRL_1 0xBF #define ANX7447_REG_ADCFSM_EN 0x20 -/* Registers: SPI slave address used */ +/* Registers: SPI address used */ #define ANX7447_REG_INTP_SOURCE_0 0x67 #define ANX7447_REG_HPD_CTRL_0 0x7E @@ -109,8 +109,8 @@ /* End of defines used for CONFIG_USB_PD_TCPM_ANX7447_OCM_ERASE_COMMAND */ struct anx7447_i2c_addr { - uint16_t tcpc_slave_addr_flags; - uint16_t spi_slave_addr_flags; + uint16_t tcpc_addr_flags; + uint16_t spi_addr_flags; }; #define AN7447_TCPC0_I2C_ADDR_FLAGS 0x2C |