summaryrefslogtreecommitdiff
path: root/src/drivers/i2c/designware
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/i2c/designware')
-rw-r--r--src/drivers/i2c/designware/dw_i2c.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/drivers/i2c/designware/dw_i2c.c b/src/drivers/i2c/designware/dw_i2c.c
index 384cca5783..af769ca02e 100644
--- a/src/drivers/i2c/designware/dw_i2c.c
+++ b/src/drivers/i2c/designware/dw_i2c.c
@@ -379,7 +379,11 @@ int dw_i2c_transfer(unsigned int bus,
}
/* Set target slave address */
- write32(&regs->target_addr, segments->slave);
+ if (read32(&regs->target_addr) != segments->slave) {
+ dw_i2c_disable(regs);
+ write32(&regs->target_addr, segments->slave);
+ dw_i2c_enable(regs);
+ }
/* Read or write each byte in segment */
for (byte = 0; byte < segments->len; byte++) {