summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2020-10-30 13:16:22 -0600
committerCommit Bot <commit-bot@chromium.org>2020-11-02 19:15:23 +0000
commit13323e77ff91a85154cfa5f504ed4609fb8cbfc7 (patch)
tree81709bca853db34a2eeb18a691514d0ba1ece1f8 /driver
parentf0e84c2df23995c61f7690a47f30f259bcde940e (diff)
downloadchrome-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 'driver')
-rw-r--r--driver/accel_kionix.c2
-rw-r--r--driver/accelgyro_bmi160.c2
-rw-r--r--driver/sensorhub_lsm6dsm.c2
-rw-r--r--driver/tcpm/anx7447.c8
4 files changed, 7 insertions, 7 deletions
diff --git a/driver/accel_kionix.c b/driver/accel_kionix.c
index ec7953551f..09416956dd 100644
--- a/driver/accel_kionix.c
+++ b/driver/accel_kionix.c
@@ -556,7 +556,7 @@ static int init(const struct motion_sensor_t *s)
*/
if (!SLAVE_IS_SPI(s->i2c_spi_addr_flags)) {
const uint16_t i2c_alt_addr_flags =
- I2C_GET_ADDR(
+ I2C_STRIP_FLAGS(
s->i2c_spi_addr_flags)
& ~2;
ret = raw_write8(s->port,
diff --git a/driver/accelgyro_bmi160.c b/driver/accelgyro_bmi160.c
index 803e705f42..2d7364889a 100644
--- a/driver/accelgyro_bmi160.c
+++ b/driver/accelgyro_bmi160.c
@@ -673,7 +673,7 @@ static int init(const struct motion_sensor_t *s)
/* Set the i2c address of the compass */
ret = bmi_write8(s->port, s->i2c_spi_addr_flags,
BMI160_MAG_IF_0,
- I2C_GET_ADDR(
+ I2C_STRIP_FLAGS(
CONFIG_ACCELGYRO_SEC_ADDR_FLAGS)
<< 1);
diff --git a/driver/sensorhub_lsm6dsm.c b/driver/sensorhub_lsm6dsm.c
index 37072d5970..371d8474f6 100644
--- a/driver/sensorhub_lsm6dsm.c
+++ b/driver/sensorhub_lsm6dsm.c
@@ -165,7 +165,7 @@ static int config_slv0_read(const struct motion_sensor_t *s,
uint16_t reg, uint8_t len)
{
int ret;
- uint16_t addr_8bit = I2C_GET_ADDR(slv_addr_flags) << 1;
+ uint16_t addr_8bit = I2C_STRIP_FLAGS(slv_addr_flags) << 1;
ret = st_raw_write8(s->port, s->i2c_spi_addr_flags,
LSM6DSM_SLV0_ADD_ADDR,
diff --git a/driver/tcpm/anx7447.c b/driver/tcpm/anx7447.c
index de9fb5dcfc..385cafb081 100644
--- a/driver/tcpm/anx7447.c
+++ b/driver/tcpm/anx7447.c
@@ -300,17 +300,17 @@ static int anx7447_init(int port)
* specified TCPC slave address
*/
for (i = 0; i < ARRAY_SIZE(anx7447_i2c_addrs_flags); i++) {
- if (I2C_GET_ADDR(tcpc_config[port].i2c_info.addr_flags) ==
- I2C_GET_ADDR(
+ 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;
break;
}
}
- if (!I2C_GET_ADDR(anx[port].i2c_slave_addr_flags)) {
+ if (!I2C_STRIP_FLAGS(anx[port].i2c_slave_addr_flags)) {
ccprintf("TCPC I2C slave addr 0x%x is invalid for ANX7447\n",
- I2C_GET_ADDR(tcpc_config[port]
+ I2C_STRIP_FLAGS(tcpc_config[port]
.i2c_info.addr_flags));
return EC_ERROR_UNKNOWN;
}