diff options
author | Diana Z <dzigterman@chromium.org> | 2021-06-07 16:10:42 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-09 17:44:19 +0000 |
commit | 7837e2011cf7c4d8690a17f9b7d89768a5a01d4c (patch) | |
tree | 48758199beccadd5b67e5a6f7b749e62c8a4e881 /driver/accel_kionix.c | |
parent | 5927d4ccc51a131e075c1aad44532caa2faa7ef0 (diff) | |
download | chrome-ec-7837e2011cf7c4d8690a17f9b7d89768a5a01d4c.tar.gz |
COIL: Rename motion sense address macros
Update the motion_sense.h address macros to reflect our current i2c
terms, and also to specify that these are used exclusively in the
accelerometer code.
BRANCH=None
BUG=None
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ibad287df2ba1ecd0b6f3061599476636ac7a5354
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2946316
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'driver/accel_kionix.c')
-rw-r--r-- | driver/accel_kionix.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/driver/accel_kionix.c b/driver/accel_kionix.c index d92aa71c01..69f0ca9073 100644 --- a/driver/accel_kionix.c +++ b/driver/accel_kionix.c @@ -147,13 +147,13 @@ static int raw_read8(const int port, { int rv = EC_ERROR_INVAL; - if (SLAVE_IS_SPI(i2c_spi_addr_flags)) { + if (ACCEL_ADDR_IS_SPI(i2c_spi_addr_flags)) { #ifdef CONFIG_SPI_ACCEL_PORT uint8_t val; uint8_t cmd = 0x80 | reg; rv = spi_transaction( - &spi_devices[SLAVE_GET_SPI_ADDR(i2c_spi_addr_flags)], + &spi_devices[ACCEL_GET_SPI_ADDR(i2c_spi_addr_flags)], &cmd, 1, &val, 1); if (rv == EC_SUCCESS) *data_ptr = val; @@ -175,12 +175,12 @@ static int raw_write8(const int port, { int rv = EC_ERROR_INVAL; - if (SLAVE_IS_SPI(i2c_spi_addr_flags)) { + if (ACCEL_ADDR_IS_SPI(i2c_spi_addr_flags)) { #ifdef CONFIG_SPI_ACCEL_PORT uint8_t cmd[2] = { reg, data }; rv = spi_transaction( - &spi_devices[SLAVE_GET_SPI_ADDR(i2c_spi_addr_flags)], + &spi_devices[ACCEL_GET_SPI_ADDR(i2c_spi_addr_flags)], cmd, 2, NULL, 0); #endif } else { @@ -196,11 +196,11 @@ static int raw_read_multi(const int port, { int rv = EC_ERROR_INVAL; - if (SLAVE_IS_SPI(i2c_spi_addr_flags)) { + if (ACCEL_ADDR_IS_SPI(i2c_spi_addr_flags)) { #ifdef CONFIG_SPI_ACCEL_PORT reg |= 0x80; rv = spi_transaction( - &spi_devices[SLAVE_GET_SPI_ADDR(i2c_spi_addr_flags)], + &spi_devices[ACCEL_GET_SPI_ADDR(i2c_spi_addr_flags)], ®, 1, rxdata, rxlen); #endif } else { @@ -572,7 +572,7 @@ static int init(struct motion_sensor_t *s) * from the first address, resend the command using * the second address. */ - if (!SLAVE_IS_SPI(s->i2c_spi_addr_flags)) { + if (!ACCEL_ADDR_IS_SPI(s->i2c_spi_addr_flags)) { const uint16_t i2c_alt_addr_flags = I2C_STRIP_FLAGS( s->i2c_spi_addr_flags) |