summaryrefslogtreecommitdiff
path: root/board/atlas
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/atlas
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/atlas')
-rw-r--r--board/atlas/board.c48
-rw-r--r--board/atlas/board.h8
2 files changed, 28 insertions, 28 deletions
diff --git a/board/atlas/board.c b/board/atlas/board.c
index 3d6e52ed89..1c86e589d8 100644
--- a/board/atlas/board.c
+++ b/board/atlas/board.c
@@ -159,7 +159,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 = I2C_ADDR_TCPC__7bf,
+ .addr_flags = I2C_ADDR_TCPC_FLAGS,
},
.drv = &ps8xxx_tcpm_drv,
/* Alert is active-low, push-pull */
@@ -170,7 +170,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 = I2C_ADDR_TCPC__7bf,
+ .addr_flags = I2C_ADDR_TCPC_FLAGS,
},
.drv = &ps8xxx_tcpm_drv,
/* Alert is active-low, push-pull */
@@ -262,7 +262,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,
+ if (i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_RESETIRQ1, &vrfault) != EC_SUCCESS)
return;
@@ -272,11 +272,11 @@ 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,
+ i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_PWRSTAT1, &pwrstat1);
/* PWRSTAT2 */
- i2c_read8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_read8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_PWRSTAT2, &pwrstat2);
CPRINTS("PMIC VRFAULT: %s", str);
@@ -284,11 +284,11 @@ static void board_report_pmic_fault(const char *str)
pwrstat2);
/* Clear all faults -- Write 1 to clear. */
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_RESETIRQ1, BIT(4));
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_PWRSTAT1, pwrstat1);
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_PWRSTAT2, pwrstat2);
/*
@@ -308,7 +308,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,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_VCCIOCNT, 0x3a);
/*
@@ -318,7 +318,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,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_V18ACNT, 0x2a);
/*
@@ -328,7 +328,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,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_V085ACNT, 0x2a);
}
@@ -341,7 +341,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,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_VCCIOCNT, 0x7a);
/*
@@ -351,7 +351,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,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_V18ACNT, 0x6a);
/*
@@ -361,7 +361,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,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_V085ACNT, 0x6a);
}
@@ -378,25 +378,25 @@ static void board_pmic_init(void)
board_report_pmic_fault("SYSJUMP");
/* Clear power source events */
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_PWRSRCINT, 0xff);
/* Disable power button shutdown timer */
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_PBCONFIG, 0x00);
if (system_jumped_to_this_image())
return;
/* DISCHGCNT1 - enable 100 ohm discharge on VCCIO */
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_DISCHGCNT1, 0x01);
/*
* DISCHGCNT2 - enable 100 ohm discharge on
* V5.0A, V3.3DSW, V3.3A and V1.8A
*/
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_DISCHGCNT2, 0x55);
/*
@@ -405,19 +405,19 @@ static void board_pmic_init(void)
* DISCHGCNT3 - enable 100 ohm discharge on
* V12U, V1.00A, V0.85A
*/
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_DISCHGCNT3, 0xd5);
/* DISCHGCNT4 - enable 100 ohm discharge on V33S, V18S, V100S */
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_DISCHGCNT4, 0x15);
/* VRMODECTRL - disable low-power mode for all rails */
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_VRMODECTRL, 0x1f);
/* V5ADS3CNT - boost V5A_DS3 by 2% */
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_V5ADS3CNT, 0x1a);
board_pmic_disable_slp_s0_vr_decay();
@@ -440,7 +440,7 @@ void board_hibernate(void)
system_enter_psl_mode();
/* Cut off DSW power via the ROP PMIC. */
- i2c_write8__7bf(I2C_PORT_PMIC, I2C_ADDR_BD99992__7bf,
+ i2c_write8(I2C_PORT_PMIC, I2C_ADDR_BD99992_FLAGS,
BD99992GW_REG_SDWNCTRL, BD99992GW_SDWNCTRL_SWDN);
/* Wait for power to be cut. */
@@ -593,7 +593,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv = &opt3001_drv,
.drv_data = &g_opt3001_data,
.port = I2C_PORT_SENSOR,
- .i2c_spi_addr__7bf = OPT3001_I2C_ADDR__7bf,
+ .i2c_spi_addr_flags = OPT3001_I2C_ADDR_FLAGS,
.rot_standard_ref = NULL,
.default_range = 0x2b11a1, /* from nocturne */
.min_frequency = OPT3001_LIGHT_MIN_FREQ,
diff --git a/board/atlas/board.h b/board/atlas/board.h
index 2d27e89314..37d8c5afd1 100644
--- a/board/atlas/board.h
+++ b/board/atlas/board.h
@@ -113,7 +113,7 @@
#define CONFIG_ALS
#define CONFIG_ALS_OPT3001
#define ALS_COUNT 1
-#define OPT3001_I2C_ADDR__7bf OPT3001_I2C_ADDR1__7bf
+#define OPT3001_I2C_ADDR_FLAGS OPT3001_I2C_ADDR1_FLAGS
#define CONFIG_ACCEL_FIFO 1024
#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3)
#define CONFIG_ACCEL_INTERRUPTS
@@ -166,9 +166,9 @@
#define I2C_PORT_THERMAL I2C_PORT_POWER
/* I2C addresses */
-#define I2C_ADDR_TCPC__7bf 0x0B
-#define I2C_ADDR_MP2949__7bf 0x20
-#define I2C_ADDR_BD99992__7bf 0x30
+#define I2C_ADDR_TCPC_FLAGS 0x0B
+#define I2C_ADDR_MP2949_FLAGS 0x20
+#define I2C_ADDR_BD99992_FLAGS 0x30
#ifndef __ASSEMBLER__