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/eve | |
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/eve')
-rw-r--r-- | board/eve/board.c | 42 | ||||
-rw-r--r-- | board/eve/board.h | 6 |
2 files changed, 24 insertions, 24 deletions
diff --git a/board/eve/board.c b/board/eve/board.c index 72877fd100..4d408915f7 100644 --- a/board/eve/board.c +++ b/board/eve/board.c @@ -207,7 +207,7 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { .bus_type = EC_BUS_TYPE_I2C, .i2c_info = { .port = I2C_PORT_TCPC0, - .addr__7bf = ANX74XX_I2C_ADDR1__7bf, + .addr_flags = ANX74XX_I2C_ADDR1_FLAGS, }, .drv = &anx74xx_tcpm_drv, }, @@ -215,7 +215,7 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = { .bus_type = EC_BUS_TYPE_I2C, .i2c_info = { .port = I2C_PORT_TCPC1, - .addr__7bf = ANX74XX_I2C_ADDR1__7bf, + .addr_flags = ANX74XX_I2C_ADDR1_FLAGS, }, .drv = &anx74xx_tcpm_drv, }, @@ -363,7 +363,7 @@ static void board_report_pmic_fault(const char *str) uint32_t info; /* RESETIRQ1 -- Bit 4: VRFAULT */ - if (i2c_read8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x8, &vrfault) + if (i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x8, &vrfault) != EC_SUCCESS) return; @@ -373,19 +373,19 @@ static void board_report_pmic_fault(const char *str) /* VRFAULT has occurred, print VRFAULT status bits. */ /* PWRSTAT1 */ - i2c_read8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x16, &pwrstat1); + i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x16, &pwrstat1); /* PWRSTAT2 */ - i2c_read8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x17, &pwrstat2); + i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x17, &pwrstat2); CPRINTS("PMIC VRFAULT: %s", str); CPRINTS("PMIC VRFAULT: PWRSTAT1=0x%02x PWRSTAT2=0x%02x", pwrstat1, pwrstat2); /* Clear all faults -- Write 1 to clear. */ - i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x8, BIT(4)); - i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x16, pwrstat1); - i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x17, pwrstat2); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x8, BIT(4)); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x16, pwrstat1); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x17, pwrstat2); /* * Status of the fault registers can be checked in the OS by looking at @@ -403,32 +403,32 @@ static void board_pmic_init(void) return; /* DISCHGCNT2 - enable 100 ohm discharge on V3.3A and V1.8A */ - i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x3d, 0x05); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x3d, 0x05); /* DISCHGCNT3 - enable 100 ohm discharge on V1.00A */ - i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x3e, 0x04); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x3e, 0x04); /* Set CSDECAYEN / VCCIO decays to 0V at assertion of SLP_S0# */ - i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x30, 0x7a); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x30, 0x7a); /* * Set V100ACNT / V1.00A Control Register: * Nominal output = 1.0V. */ - i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x37, 0x1a); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x37, 0x1a); /* * Set V085ACNT / V0.85A Control Register: * Lower power mode = 0.7V. * Nominal output = 1.0V. */ - i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x38, 0x7a); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x38, 0x7a); /* VRMODECTRL - disable low-power mode for all rails */ - i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x3b, 0x1f); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x3b, 0x1f); /* Clear power source events */ - i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x04, 0xff); + i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x04, 0xff); } DECLARE_HOOK(HOOK_INIT, board_pmic_init, HOOK_PRIO_DEFAULT); @@ -722,7 +722,7 @@ void board_hibernate(void) /* Shut down PMIC */ CPRINTS("Triggering PMIC shutdown"); uart_flush_output(); - if (i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x49, 0x01)) { + if (i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x49, 0x01)) { /* * If we can't tell the PMIC to shutdown, instead reset * and don't start the AP. Hopefully we'll be able to @@ -815,7 +815,7 @@ struct motion_sensor_t motion_sensors[] = { .mutex = &g_lid_mutex, .drv_data = &g_kxcj9_data, .port = I2C_PORT_LID_ACCEL, - .i2c_spi_addr__7bf = KXCJ9_ADDR0__7bf, + .i2c_spi_addr_flags = KXCJ9_ADDR0_FLAGS, .rot_standard_ref = &lid_standard_ref, .default_range = 2, /* g, enough for laptop. */ .min_frequency = KXCJ9_ACCEL_MIN_FREQ, @@ -842,7 +842,7 @@ struct motion_sensor_t motion_sensors[] = { .mutex = &g_base_mutex, .drv_data = &g_bmi160_data, .port = I2C_PORT_GYRO, - .i2c_spi_addr__7bf = BMI160_ADDR0__7bf, + .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .rot_standard_ref = NULL, .default_range = 2, /* g, enough for laptop. */ .min_frequency = BMI160_ACCEL_MIN_FREQ, @@ -876,7 +876,7 @@ struct motion_sensor_t motion_sensors[] = { .mutex = &g_base_mutex, .drv_data = &g_bmi160_data, .port = I2C_PORT_GYRO, - .i2c_spi_addr__7bf = BMI160_ADDR0__7bf, + .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = 1000, /* dps */ .rot_standard_ref = NULL, .min_frequency = BMI160_GYRO_MIN_FREQ, @@ -893,7 +893,7 @@ struct motion_sensor_t motion_sensors[] = { .mutex = &g_base_mutex, .drv_data = &g_bmi160_data, .port = I2C_PORT_GYRO, - .i2c_spi_addr__7bf = BMI160_ADDR0__7bf, + .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS, .default_range = BIT(11), /* 16LSB / uT, fixed */ .rot_standard_ref = &mag_standard_ref, .min_frequency = BMM150_MAG_MIN_FREQ, @@ -910,7 +910,7 @@ struct motion_sensor_t motion_sensors[] = { .mutex = &g_lid_mutex, .drv_data = &g_si114x_data, .port = I2C_PORT_ALS, - .i2c_spi_addr__7bf = SI114X_ADDR__7bf, + .i2c_spi_addr_flags = SI114X_ADDR_FLAGS, .rot_standard_ref = NULL, .default_range = 3088, /* 30.88%: int = 0 - frac = 3088/10000 */ .min_frequency = SI114X_LIGHT_MIN_FREQ, diff --git a/board/eve/board.h b/board/eve/board.h index 88938e9719..642db72eb3 100644 --- a/board/eve/board.h +++ b/board/eve/board.h @@ -128,7 +128,7 @@ #define CONFIG_ACCEL_INTERRUPTS #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(BASE_ACCEL) -#define CONFIG_ACCELGYRO_SEC_ADDR__7BF BMM150_ADDR0__7bf +#define CONFIG_ACCELGYRO_SEC_ADDR_FLAGS BMM150_ADDR0_FLAGS #define CONFIG_ACCELGYRO_BMI160_INT2_OUTPUT /* Unused */ #define CONFIG_MAG_CALIBRATE #define CONFIG_LID_ANGLE @@ -195,8 +195,8 @@ #define I2C_PORT_MP2949 NPCX_I2C_PORT3 /* I2C addresses */ -#define I2C_ADDR_BD99992__7bf 0x30 -#define I2C_ADDR_MP2949__7bf 0x20 +#define I2C_ADDR_BD99992_FLAGS 0x30 +#define I2C_ADDR_MP2949_FLAGS 0x20 #ifndef __ASSEMBLER__ |