summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
Diffstat (limited to 'board')
-rw-r--r--board/glados/battery.c4
-rw-r--r--board/mchpevb1/battery.c4
-rw-r--r--board/oak/battery.c4
-rw-r--r--board/samus/battery.c4
-rw-r--r--board/servo_micro/board.c7
-rw-r--r--board/sweetberry/board.c4
6 files changed, 13 insertions, 14 deletions
diff --git a/board/glados/battery.c b/board/glados/battery.c
index 2372affb64..016d225950 100644
--- a/board/glados/battery.c
+++ b/board/glados/battery.c
@@ -47,9 +47,9 @@ int board_cut_off_battery(void)
buf[2] = PARAM_CUT_OFF_HIGH;
i2c_lock(I2C_PORT_BATTERY, 1);
- rv = i2c_xfer(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
+ rv = i2c_xfer_unlocked(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
I2C_XFER_SINGLE);
- rv |= i2c_xfer(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
+ rv |= i2c_xfer_unlocked(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
I2C_XFER_SINGLE);
i2c_lock(I2C_PORT_BATTERY, 0);
diff --git a/board/mchpevb1/battery.c b/board/mchpevb1/battery.c
index 2372affb64..016d225950 100644
--- a/board/mchpevb1/battery.c
+++ b/board/mchpevb1/battery.c
@@ -47,9 +47,9 @@ int board_cut_off_battery(void)
buf[2] = PARAM_CUT_OFF_HIGH;
i2c_lock(I2C_PORT_BATTERY, 1);
- rv = i2c_xfer(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
+ rv = i2c_xfer_unlocked(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
I2C_XFER_SINGLE);
- rv |= i2c_xfer(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
+ rv |= i2c_xfer_unlocked(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
I2C_XFER_SINGLE);
i2c_lock(I2C_PORT_BATTERY, 0);
diff --git a/board/oak/battery.c b/board/oak/battery.c
index a3fe0cd452..a868e20bc0 100644
--- a/board/oak/battery.c
+++ b/board/oak/battery.c
@@ -57,9 +57,9 @@ static int cutoff(void)
buf[2] = PARAM_CUT_OFF_HIGH;
i2c_lock(I2C_PORT_BATTERY, 1);
- rv = i2c_xfer(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
+ rv = i2c_xfer_unlocked(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
I2C_XFER_SINGLE);
- rv |= i2c_xfer(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
+ rv |= i2c_xfer_unlocked(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
I2C_XFER_SINGLE);
i2c_lock(I2C_PORT_BATTERY, 0);
diff --git a/board/samus/battery.c b/board/samus/battery.c
index 64cf417ecc..f3c78e9d96 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(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
+ rv = i2c_xfer_unlocked(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
I2C_XFER_SINGLE);
- rv |= i2c_xfer(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
+ rv |= i2c_xfer_unlocked(I2C_PORT_BATTERY, BATTERY_ADDR, buf, 3, NULL, 0,
I2C_XFER_SINGLE);
i2c_lock(I2C_PORT_BATTERY, 0);
diff --git a/board/servo_micro/board.c b/board/servo_micro/board.c
index 5887d559ae..355c091a77 100644
--- a/board/servo_micro/board.c
+++ b/board/servo_micro/board.c
@@ -231,12 +231,13 @@ static int ite_i2c_read_register(uint8_t register_offset, uint8_t *output)
*/
int ret;
/* Tell the ITE EC which register we want to read. */
- ret = i2c_xfer(I2C_PORT_MASTER, ITE_DFU_I2C_CMD_ADDR, &register_offset,
- sizeof(register_offset), NULL, 0, I2C_XFER_SINGLE);
+ ret = i2c_xfer_unlocked(I2C_PORT_MASTER, ITE_DFU_I2C_CMD_ADDR,
+ &register_offset, sizeof(register_offset),
+ NULL, 0, I2C_XFER_SINGLE);
if (ret != EC_SUCCESS)
return ret;
/* Read in the 1 byte register value. */
- ret = i2c_xfer(I2C_PORT_MASTER, ITE_DFU_I2C_DATA_ADDR, NULL, 0,
+ ret = i2c_xfer_unlocked(I2C_PORT_MASTER, ITE_DFU_I2C_DATA_ADDR, NULL, 0,
output, sizeof(*output), I2C_XFER_SINGLE);
return ret;
}
diff --git a/board/sweetberry/board.c b/board/sweetberry/board.c
index 8640cfd87f..2d94f06f76 100644
--- a/board/sweetberry/board.c
+++ b/board/sweetberry/board.c
@@ -121,8 +121,6 @@ static void board_init(void)
uint8_t tmp;
/* i2c 0 has a tendancy to get wedged. TODO(nsanders): why? */
- i2c_lock(0, 1);
- i2c_xfer(0, 0, NULL, 0, &tmp, 1, I2C_XFER_SINGLE);
- i2c_lock(0, 0);
+ i2c_xfer(0, 0, NULL, 0, &tmp, 1);
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);