diff options
author | Denis Brockus <dbrockus@chromium.org> | 2019-07-16 15:10:11 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-07-20 23:09:18 +0000 |
commit | 473bd883b60fd5b00377766dae2bacad246de0d2 (patch) | |
tree | 992d9f03104277934c22c869eceb634e2cf5f7ec /board/elm | |
parent | 053491b560d2c4e374bb739373d8ae25c41f6315 (diff) | |
download | chrome-ec-473bd883b60fd5b00377766dae2bacad246de0d2.tar.gz |
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 <dbrockus@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704792
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'board/elm')
-rw-r--r-- | board/elm/board.c | 18 | ||||
-rw-r--r-- | board/elm/board.h | 4 |
2 files changed, 12 insertions, 10 deletions
diff --git a/board/elm/board.c b/board/elm/board.c index 3568564621..7dfc0a503d 100644 --- a/board/elm/board.c +++ b/board/elm/board.c @@ -92,14 +92,16 @@ const struct adc_t adc_channels[] = { }; BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT); -int anx7688_passthru_allowed__7bf(const struct i2c_port_t *port, - const uint16_t addr__7bf) +int anx7688_passthru_allowed(const struct i2c_port_t *port, + const uint16_t addr_flags) { + uint16_t addr = I2C_GET_ADDR(addr_flags); + /* Allow access to 0x2c (TCPC) */ - if (I2C_GET_ADDR__7b(addr__7bf) == 0x2c) + if (addr == 0x2c) return 1; - CPRINTF("Passthru rejected on %x", I2C_GET_ADDR__7b(addr__7bf)); + CPRINTF("Passthru rejected on %x", addr); return 0; } @@ -108,7 +110,7 @@ int anx7688_passthru_allowed__7bf(const struct i2c_port_t *port, const struct i2c_port_t i2c_ports[] = { {"battery", I2C_PORT_BATTERY, 100, GPIO_I2C0_SCL, GPIO_I2C0_SDA}, {"pd", I2C_PORT_PD_MCU, 1000, GPIO_I2C1_SCL, GPIO_I2C1_SDA, - anx7688_passthru_allowed__7bf} + anx7688_passthru_allowed} }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); @@ -126,7 +128,7 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { .bus_type = EC_BUS_TYPE_I2C, .i2c_info = { .port = I2C_PORT_TCPC, - .addr__7bf = CONFIG_TCPC_I2C_BASE_ADDR__7BF, + .addr_flags = CONFIG_TCPC_I2C_BASE_ADDR_FLAGS, }, .drv = &anx7688_tcpm_drv, }, @@ -467,7 +469,7 @@ struct motion_sensor_t motion_sensors[] = { .drv = &kionix_accel_drv, .mutex = &g_kx022_mutex[0], .drv_data = &g_kx022_data[0], - .i2c_spi_addr__7bf = SLAVE_MK_SPI_ADDR__7bf(0), + .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(0), .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, enough for laptop. */ .min_frequency = KX022_ACCEL_MIN_FREQ, @@ -490,7 +492,7 @@ struct motion_sensor_t motion_sensors[] = { .drv = &kionix_accel_drv, .mutex = &g_kx022_mutex[1], .drv_data = &g_kx022_data[1], - .i2c_spi_addr__7bf = SLAVE_MK_SPI_ADDR__7bf(1), + .i2c_spi_addr_flags = SLAVE_MK_SPI_ADDR_FLAGS(1), .rot_standard_ref = &lid_standard_ref, .default_range = 2, /* g, enough for laptop. */ .min_frequency = KX022_ACCEL_MIN_FREQ, diff --git a/board/elm/board.h b/board/elm/board.h index d9e336f720..9312782599 100644 --- a/board/elm/board.h +++ b/board/elm/board.h @@ -99,8 +99,8 @@ #define CONFIG_USB_PD_TCPM_TCPCI #define CONFIG_USB_PD_TRY_SRC #define CONFIG_USB_PD_VBUS_DETECT_TCPC -#undef CONFIG_TCPC_I2C_BASE_ADDR__7BF -#define CONFIG_TCPC_I2C_BASE_ADDR__7BF 0x2C +#undef CONFIG_TCPC_I2C_BASE_ADDR_FLAGS +#define CONFIG_TCPC_I2C_BASE_ADDR_FLAGS 0x2C #define CONFIG_USB_PD_ANX7688 /* UART DMA */ |