diff options
Diffstat (limited to 'board/samus')
-rw-r--r-- | board/samus/battery.c | 4 | ||||
-rw-r--r-- | board/samus/board.c | 62 | ||||
-rw-r--r-- | board/samus/extpower.c | 6 | ||||
-rw-r--r-- | board/samus/panel.c | 10 |
4 files changed, 41 insertions, 41 deletions
diff --git a/board/samus/battery.c b/board/samus/battery.c index e21f51e3b5..bc73cbc1c3 100644 --- a/board/samus/battery.c +++ b/board/samus/battery.c @@ -290,9 +290,9 @@ int board_cut_off_battery(void) buf[2] = PARAM_CUT_OFF_HIGH; i2c_lock(I2C_PORT_BATTERY, 1); - rv = i2c_xfer_unlocked__7bf(I2C_PORT_BATTERY, BATTERY_ADDR__7bf, + rv = i2c_xfer_unlocked(I2C_PORT_BATTERY, BATTERY_ADDR_FLAGS, buf, 3, NULL, 0, I2C_XFER_SINGLE); - rv |= i2c_xfer_unlocked__7bf(I2C_PORT_BATTERY, BATTERY_ADDR__7bf, + rv |= i2c_xfer_unlocked(I2C_PORT_BATTERY, BATTERY_ADDR_FLAGS, buf, 3, NULL, 0, I2C_XFER_SINGLE); i2c_lock(I2C_PORT_BATTERY, 0); diff --git a/board/samus/board.c b/board/samus/board.c index 323789a7a3..02b80940f8 100644 --- a/board/samus/board.c +++ b/board/samus/board.c @@ -132,35 +132,35 @@ const struct i2c_port_t i2c_ports[] = { }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); -#define TEMP_U40_REG_ADDR__7bf (0x40 | I2C_FLAG_BIG_ENDIAN) -#define TEMP_U41_REG_ADDR__7bf (0x44 | I2C_FLAG_BIG_ENDIAN) -#define TEMP_U42_REG_ADDR__7bf (0x41 | I2C_FLAG_BIG_ENDIAN) -#define TEMP_U43_REG_ADDR__7bf (0x45 | I2C_FLAG_BIG_ENDIAN) -#define TEMP_U115_REG_ADDR__7bf (0x42 | I2C_FLAG_BIG_ENDIAN) -#define TEMP_U116_REG_ADDR__7bf (0x43 | I2C_FLAG_BIG_ENDIAN) - -#define TEMP_U40_ADDR__7bf TMP006_ADDR__7bf(I2C_PORT_THERMAL,\ - TEMP_U40_REG_ADDR__7bf) -#define TEMP_U41_ADDR__7bf TMP006_ADDR__7bf(I2C_PORT_THERMAL,\ - TEMP_U41_REG_ADDR__7bf) -#define TEMP_U42_ADDR__7bf TMP006_ADDR__7bf(I2C_PORT_THERMAL,\ - TEMP_U42_REG_ADDR__7bf) -#define TEMP_U43_ADDR__7bf TMP006_ADDR__7bf(I2C_PORT_THERMAL,\ - TEMP_U43_REG_ADDR__7bf) -#define TEMP_U115_ADDR__7bf TMP006_ADDR__7bf(I2C_PORT_THERMAL,\ - TEMP_U115_REG_ADDR__7bf) -#define TEMP_U116_ADDR__7bf TMP006_ADDR__7bf(I2C_PORT_THERMAL,\ - TEMP_U116_REG_ADDR__7bf) - -const struct tmp006_t tmp006_sensors__7bf[TMP006_COUNT] = { - {"Charger", TEMP_U40_ADDR__7bf}, - {"CPU", TEMP_U41_ADDR__7bf}, - {"Left C", TEMP_U42_ADDR__7bf}, - {"Right C", TEMP_U43_ADDR__7bf}, - {"Right D", TEMP_U115_ADDR__7bf}, - {"Left D", TEMP_U116_ADDR__7bf}, +#define TEMP_U40_REG_ADDR_FLAGS (0x40 | I2C_FLAG_BIG_ENDIAN) +#define TEMP_U41_REG_ADDR_FLAGS (0x44 | I2C_FLAG_BIG_ENDIAN) +#define TEMP_U42_REG_ADDR_FLAGS (0x41 | I2C_FLAG_BIG_ENDIAN) +#define TEMP_U43_REG_ADDR_FLAGS (0x45 | I2C_FLAG_BIG_ENDIAN) +#define TEMP_U115_REG_ADDR_FLAGS (0x42 | I2C_FLAG_BIG_ENDIAN) +#define TEMP_U116_REG_ADDR_FLAGS (0x43 | I2C_FLAG_BIG_ENDIAN) + +#define TEMP_U40_ADDR_FLAGS TMP006_ADDR(I2C_PORT_THERMAL,\ + TEMP_U40_REG_ADDR_FLAGS) +#define TEMP_U41_ADDR_FLAGS TMP006_ADDR(I2C_PORT_THERMAL,\ + TEMP_U41_REG_ADDR_FLAGS) +#define TEMP_U42_ADDR_FLAGS TMP006_ADDR(I2C_PORT_THERMAL,\ + TEMP_U42_REG_ADDR_FLAGS) +#define TEMP_U43_ADDR_FLAGS TMP006_ADDR(I2C_PORT_THERMAL,\ + TEMP_U43_REG_ADDR_FLAGS) +#define TEMP_U115_ADDR_FLAGS TMP006_ADDR(I2C_PORT_THERMAL,\ + TEMP_U115_REG_ADDR_FLAGS) +#define TEMP_U116_ADDR_FLAGS TMP006_ADDR(I2C_PORT_THERMAL,\ + TEMP_U116_REG_ADDR_FLAGS) + +const struct tmp006_t tmp006_sensors[TMP006_COUNT] = { + {"Charger", TEMP_U40_ADDR_FLAGS}, + {"CPU", TEMP_U41_ADDR_FLAGS}, + {"Left C", TEMP_U42_ADDR_FLAGS}, + {"Right C", TEMP_U43_ADDR_FLAGS}, + {"Right D", TEMP_U115_ADDR_FLAGS}, + {"Left D", TEMP_U116_ADDR_FLAGS}, }; -BUILD_ASSERT(ARRAY_SIZE(tmp006_sensors__7bf) == TMP006_COUNT); +BUILD_ASSERT(ARRAY_SIZE(tmp006_sensors) == TMP006_COUNT); /* Temperature sensors data; must be in same order as enum temp_sensor_id. */ const struct temp_sensor_t temp_sensors[] = { @@ -332,7 +332,7 @@ struct motion_sensor_t motion_sensors[] = { .mutex = &g_base_mutex, .drv_data = &g_saved_data[0], .port = I2C_PORT_ACCEL, - .i2c_spi_addr__7bf = LSM6DS0_ADDR1__7bf, + .i2c_spi_addr_flags = LSM6DS0_ADDR1_FLAGS, .rot_standard_ref = &base_standard_ref, .default_range = 2, /* g, enough for laptop. */ .min_frequency = LSM6DS0_ACCEL_MIN_FREQ, @@ -364,7 +364,7 @@ struct motion_sensor_t motion_sensors[] = { .mutex = &g_lid_mutex, .drv_data = &g_kxcj9_data, .port = I2C_PORT_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, @@ -387,7 +387,7 @@ struct motion_sensor_t motion_sensors[] = { .mutex = &g_base_mutex, .drv_data = &g_saved_data[1], .port = I2C_PORT_ACCEL, - .i2c_spi_addr__7bf = LSM6DS0_ADDR1__7bf, + .i2c_spi_addr_flags = LSM6DS0_ADDR1_FLAGS, .rot_standard_ref = NULL, .default_range = 2000, /* g, enough for laptop. */ .min_frequency = LSM6DS0_GYRO_MIN_FREQ, diff --git a/board/samus/extpower.c b/board/samus/extpower.c index cddb4a76e1..22cd13b44d 100644 --- a/board/samus/extpower.c +++ b/board/samus/extpower.c @@ -159,7 +159,7 @@ static void allow_max_request(void) int prochot_status; if (charge_circuit_state == CHARGE_CIRCUIT_WEDGED) { /* Read PROCHOT status register to clear it */ - i2c_read8__7bf(I2C_PORT_CHARGER, BQ24773_ADDR__7bf, + i2c_read8(I2C_PORT_CHARGER, BQ24773_ADDR_FLAGS, BQ24773_PROCHOT_STATUS, &prochot_status); charge_circuit_state = CHARGE_CIRCUIT_OK; } @@ -301,8 +301,8 @@ static void check_charge_wedged(void) if (charge_circuit_state == CHARGE_CIRCUIT_OK) { /* Check PROCHOT warning */ - rv = i2c_read8__7bf(I2C_PORT_CHARGER, BQ24773_ADDR__7bf, - BQ24773_PROCHOT_STATUS, &prochot_status); + rv = i2c_read8(I2C_PORT_CHARGER, BQ24773_ADDR_FLAGS, + BQ24773_PROCHOT_STATUS, &prochot_status); if (rv) prochot_status = 0; diff --git a/board/samus/panel.c b/board/samus/panel.c index 0c60b2a492..beb0d32e9d 100644 --- a/board/samus/panel.c +++ b/board/samus/panel.c @@ -15,7 +15,7 @@ #define CPRINTS(format, args...) cprints(CC_I2C, format, ## args) -#define I2C_ADDR_BACKLIGHT__7bf (0x2C | I2C_FLAG_BIG_ENDIAN) +#define I2C_ADDR_BACKLIGHT_FLAGS (0x2C | I2C_FLAG_BIG_ENDIAN) #define I2C_RETRIES 3 #define I2C_RETRY_DELAY (5*MSEC) @@ -61,8 +61,8 @@ static int lp8555_read_with_retry(int reg, int *data) int i, rv; for (i = 0; i < I2C_RETRIES; i++) { - rv = i2c_read8__7bf(I2C_PORT_BACKLIGHT, - I2C_ADDR_BACKLIGHT__7bf, + rv = i2c_read8(I2C_PORT_BACKLIGHT, + I2C_ADDR_BACKLIGHT_FLAGS, reg, data); if (rv == EC_SUCCESS) return EC_SUCCESS; @@ -79,8 +79,8 @@ static int lp8555_write_with_retry(int reg, int data) int i, rv; for (i = 0; i < I2C_RETRIES; i++) { - rv = i2c_write8__7bf(I2C_PORT_BACKLIGHT, - I2C_ADDR_BACKLIGHT__7bf, + rv = i2c_write8(I2C_PORT_BACKLIGHT, + I2C_ADDR_BACKLIGHT_FLAGS, reg, data); if (rv == EC_SUCCESS) return EC_SUCCESS; |