From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Keeping Date: Thu, 18 Aug 2016 20:08:41 +0100 Subject: [U-Boot] [PATCH 2/3] rockchip: i2c: move register write out of inner loop In-Reply-To: <20160818190842.25094-1-john@metanate.com> References: <20160818190842.25094-1-john@metanate.com> Message-ID: <20160818190842.25094-3-john@metanate.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- drivers/i2c/rk_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/rk_i2c.c b/drivers/i2c/rk_i2c.c index 2597970..a4c0032 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, ®s->txdata[i]); } - debug("I2c Write TXDATA[%d] = 0x%x\n", i, txdata); + writel(txdata, ®s->txdata[i]); + debug("I2c Write TXDATA[%d] = 0x%08x\n", i, txdata); } writel(I2C_CON_EN | I2C_CON_MOD(I2C_MODE_TX), ®s->con); -- 2.9.3.728.g30b24b4.dirty