summaryrefslogtreecommitdiff
path: root/chip/g/i2cm.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/g/i2cm.c')
-rw-r--r--chip/g/i2cm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/chip/g/i2cm.c b/chip/g/i2cm.c
index e63c4a7014..b5f84e1598 100644
--- a/chip/g/i2cm.c
+++ b/chip/g/i2cm.c
@@ -272,8 +272,11 @@ static uint32_t i2cm_build_sequence(int port, int slave_addr,
if (flags & I2C_XFER_START)
inst |= INST_START;
- /* Setup slave device address */
- inst |= INST_DEVADDRVAL(slave_addr);
+ /*
+ * Setup slave device address. Calls to chip_i2c_xfer assume an 8 bit
+ * slave address. Need to shift right by 1 bit.
+ */
+ inst |= INST_DEVADDRVAL(slave_addr >> 1);
if (out_size) {
/* Send slave addr byte if this is start of I2C transaction */