aboutsummaryrefslogtreecommitdiff
path: root/drivers/i2c/rk_i2c.c
diff options
context:
space:
mode:
authorJohn Keeping2016-08-18 20:08:41 +0100
committerHeiko Schocher2016-09-13 06:57:16 +0200
commit551288bd8ba5db8f7553a9b7e4420fd005767b88 (patch)
tree1f94bc9bd0042e39ace3114ac5438c30060e4340 /drivers/i2c/rk_i2c.c
parent80333fd85c23daa235500ecf675f36efad34851b (diff)
rockchip: i2c: move register write out of inner loop
There is no point in writing intermediate values to the txdata registers. Also add padding to the debug logging to make it easier to read when there are leading zeroes. Signed-off-by: John Keeping <john@metanate.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/i2c/rk_i2c.c')
-rw-r--r--drivers/i2c/rk_i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/rk_i2c.c b/drivers/i2c/rk_i2c.c
index 2597970bb00..a4c0032fd8d 100644
--- a/drivers/i2c/rk_i2c.c
+++ b/drivers/i2c/rk_i2c.c
@@ -277,9 +277,9 @@ static int rk_i2c_write(struct rk_i2c *i2c, uchar chip, uint reg, uint r_len,
} else {
txdata |= (*pbuf++)<<(j * 8);
}
- writel(txdata, &regs->txdata[i]);
}
- debug("I2c Write TXDATA[%d] = 0x%x\n", i, txdata);
+ writel(txdata, &regs->txdata[i]);
+ debug("I2c Write TXDATA[%d] = 0x%08x\n", i, txdata);
}
writel(I2C_CON_EN | I2C_CON_MOD(I2C_MODE_TX), &regs->con);