rk3288: sync i2c driver with depthcharge

this change syncs the i2c driver with the one in depthcharge.

BUG=None
TEST=Booted Veyron Pinky
BRANCH=None

Change-Id: Ic9c7006770bba50fd412e0bcefc52f879b7195ec
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Original-Commit-Id: 95ca6c88061062c0de95a8dd3567a71a372771b0
Original-Change-Id: I0d0fdefa58c5b4cc5c991be40796a800ccf074a5
Original-Reviewed-on: https://chromium-review.googlesource.com/218873
Original-Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Original-Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: http://review.coreboot.org/8872
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
This commit is contained in:
Daisuke Nojiri 2014-09-18 12:35:09 -07:00 committed by Patrick Georgi
parent 7a757c942e
commit 51de5a8eda
1 changed files with 7 additions and 7 deletions

View File

@ -148,7 +148,7 @@ static int i2c_read(struct rk3288_i2c_regs *reg_addr, struct i2c_seg segment)
writel(I2C_8BIT | segment.chip << 1 | 1, &reg_addr->i2c_mrxaddr); writel(I2C_8BIT | segment.chip << 1 | 1, &reg_addr->i2c_mrxaddr);
writel(0, &reg_addr->i2c_mrxraddr); writel(0, &reg_addr->i2c_mrxraddr);
con = I2C_MODE_TRX | I2C_EN; con = I2C_MODE_TRX | I2C_EN | I2C_ACT2NAK;
while (bytes_remaining) { while (bytes_remaining) {
bytes_transfered = MIN(bytes_remaining, 32); bytes_transfered = MIN(bytes_remaining, 32);
bytes_remaining -= bytes_transfered; bytes_remaining -= bytes_transfered;
@ -187,7 +187,7 @@ static int i2c_read(struct rk3288_i2c_regs *reg_addr, struct i2c_seg segment)
*data++ = (rxdata >> (j * 8)) & 0xff; *data++ = (rxdata >> (j * 8)) & 0xff;
} }
} }
con = I2C_MODE_RX | I2C_EN; con = I2C_MODE_RX | I2C_EN | I2C_ACT2NAK;
} }
return res; return res;
} }
@ -221,7 +221,7 @@ static int i2c_write(struct rk3288_i2c_regs *reg_addr, struct i2c_seg segment)
} }
writel(I2C_CLEANI, &reg_addr->i2c_ipd); writel(I2C_CLEANI, &reg_addr->i2c_ipd);
writel(I2C_EN | I2C_MODE_TX, &reg_addr->i2c_con); writel(I2C_EN | I2C_MODE_TX | I2C_ACT2NAK, &reg_addr->i2c_con);
writel(bytes_transfered, &reg_addr->i2c_mtxcnt); writel(bytes_transfered, &reg_addr->i2c_mtxcnt);
timeout = I2C_TIMEOUT_US; timeout = I2C_TIMEOUT_US;