summaryrefslogtreecommitdiff
path: root/board/rammus
diff options
context:
space:
mode:
authorDenis Brockus <dbrockus@chromium.org>2019-07-16 15:10:11 -0600
committerCommit Bot <commit-bot@chromium.org>2019-07-20 23:09:18 +0000
commit473bd883b60fd5b00377766dae2bacad246de0d2 (patch)
tree992d9f03104277934c22c869eceb634e2cf5f7ec /board/rammus
parent053491b560d2c4e374bb739373d8ae25c41f6315 (diff)
downloadchrome-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/rammus')
-rw-r--r--board/rammus/board.c44
-rw-r--r--board/rammus/board.h6
2 files changed, 25 insertions, 25 deletions
diff --git a/board/rammus/board.c b/board/rammus/board.c
index 82af7a2667..6ba7907346 100644
--- a/board/rammus/board.c
+++ b/board/rammus/board.c
@@ -151,7 +151,7 @@ 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 = PS8751_I2C_ADDR1__7bf,
+ .addr_flags = PS8751_I2C_ADDR1_FLAGS,
},
.drv = &ps8xxx_tcpm_drv,
},
@@ -160,7 +160,7 @@ struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_COUNT] = {
.i2c_info = {
.port = I2C_PORT_TCPC0,
/* Verified on v1.1 */
- .addr__7bf = AN7447_TCPC3_I2C_ADDR__7bf,
+ .addr_flags = AN7447_TCPC3_I2C_ADDR_FLAGS,
},
.drv = &anx7447_tcpm_drv,
},
@@ -298,7 +298,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;
@@ -308,19 +308,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
@@ -339,7 +339,7 @@ static void board_pmic_disable_slp_s0_vr_decay(void)
* Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
* Bits 1:0 (10) - VR set to AUTO operating mode
*/
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x30, 0x3a);
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x30, 0x3a);
/*
* V18ACNT:
@@ -348,7 +348,7 @@ static void board_pmic_disable_slp_s0_vr_decay(void)
* Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
* Bits 1:0 (10) - VR set to AUTO operating mode
*/
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x34, 0x2a);
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x34, 0x2a);
/*
* V085ACNT:
@@ -357,7 +357,7 @@ static void board_pmic_disable_slp_s0_vr_decay(void)
* Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
* Bits 1:0 (10) - VR set to AUTO operating mode
*/
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x38, 0x3a);
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x38, 0x3a);
}
static void board_pmic_enable_slp_s0_vr_decay(void)
@@ -369,7 +369,7 @@ static void board_pmic_enable_slp_s0_vr_decay(void)
* Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
* Bits 1:0 (10) - VR set to AUTO operating mode
*/
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x30, 0x7a);
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x30, 0x7a);
/*
* V18ACNT:
@@ -378,7 +378,7 @@ static void board_pmic_enable_slp_s0_vr_decay(void)
* Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
* Bits 1:0 (10) - VR set to AUTO operating mode
*/
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x34, 0x6a);
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x34, 0x6a);
/*
* V085ACNT:
@@ -387,7 +387,7 @@ static void board_pmic_enable_slp_s0_vr_decay(void)
* Bits 3:2 (10) - VR set to AUTO on SLP_S0# de-assertion
* Bits 1:0 (10) - VR set to AUTO operating mode
*/
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x38, 0x7a);
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x38, 0x7a);
}
void power_board_handle_host_sleep_event(enum host_sleep_event state)
@@ -409,16 +409,16 @@ static void board_pmic_init(void)
* DISCHGCNT2 - enable 100 ohm discharge on
* V5A_DS3/V33A_DSW/V33A_PCH/V1.8A
*/
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x3d, 0x55);
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x3d, 0x55);
/* DISCHGCNT3 - enable 100 ohm discharge on V1.8U_25U/V1.00A */
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x3e, 0x44);
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x3e, 0x44);
/* DISCHGCNT4 - enable 100 ohm discharge on v1.8S */
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf, 0x3f, 0x04);
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS, 0x3f, 0x04);
board_pmic_disable_slp_s0_vr_decay();
/* 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);
}
DECLARE_DEFERRED(board_pmic_init);
@@ -544,7 +544,7 @@ void board_hibernate(void)
uart_flush_output();
/* Trigger PMIC shutdown. */
- 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
@@ -602,7 +602,7 @@ struct motion_sensor_t motion_sensors[] = {
.mutex = &g_lid_mutex,
.drv_data = &g_bma255_data,
.port = I2C_PORT_ACCEL,
- .i2c_spi_addr__7bf = BMA2x2_I2C_ADDR1__7bf,
+ .i2c_spi_addr_flags = BMA2x2_I2C_ADDR1_FLAGS,
.rot_standard_ref = &lid_standard_ref,
.min_frequency = BMA255_ACCEL_MIN_FREQ,
.max_frequency = BMA255_ACCEL_MAX_FREQ,
@@ -630,7 +630,7 @@ struct motion_sensor_t motion_sensors[] = {
.mutex = &g_base_mutex,
.drv_data = &g_bmi160_data,
.port = I2C_PORT_ACCEL,
- .i2c_spi_addr__7bf = BMI160_ADDR0__7bf,
+ .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS,
.rot_standard_ref = &base_standard_ref,
.min_frequency = BMI160_ACCEL_MIN_FREQ,
.max_frequency = BMI160_ACCEL_MAX_FREQ,
@@ -658,7 +658,7 @@ struct motion_sensor_t motion_sensors[] = {
.mutex = &g_base_mutex,
.drv_data = &g_bmi160_data,
.port = I2C_PORT_ACCEL,
- .i2c_spi_addr__7bf = BMI160_ADDR0__7bf,
+ .i2c_spi_addr_flags = BMI160_ADDR0_FLAGS,
.default_range = 1000, /* dps */
.rot_standard_ref = &base_standard_ref,
.min_frequency = BMI160_GYRO_MIN_FREQ,
diff --git a/board/rammus/board.h b/board/rammus/board.h
index 5d577be79d..da73f7acd4 100644
--- a/board/rammus/board.h
+++ b/board/rammus/board.h
@@ -187,9 +187,9 @@
#define I2C_PORT_THERMAL I2C_PORT_PMIC
/* I2C addresses */
-#define I2C_ADDR_BD99992__7bf 0x30
-#define I2C_ADDR_MP2949__7bf 0x20
-#define I2C_ADDR_EEPROM__7bf 0x50
+#define I2C_ADDR_BD99992_FLAGS 0x30
+#define I2C_ADDR_MP2949_FLAGS 0x20
+#define I2C_ADDR_EEPROM_FLAGS 0x50
/* Rename GPIOs */
#define GPIO_PCH_SLP_S0_L GPIO_SLP_S0_L