From: John Keeping <john@metanate.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] rockchip: i2c: move register write out of inner loop
Date: Thu, 18 Aug 2016 20:08:41 +0100 [thread overview]
Message-ID: <20160818190842.25094-3-john@metanate.com> (raw)
In-Reply-To: <20160818190842.25094-1-john@metanate.com>
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>
---
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
next prev parent reply other threads:[~2016-08-18 19:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-18 19:08 [U-Boot] [PATCH 0/3] rockchip: i2c: fix >32 byte writes John Keeping
2016-08-18 19:08 ` [U-Boot] [PATCH 1/3] rockchip: i2c: use named constant when appropriate John Keeping
2016-09-06 1:03 ` Simon Glass
2016-08-18 19:08 ` John Keeping [this message]
2016-09-06 1:03 ` [U-Boot] [PATCH 2/3] rockchip: i2c: move register write out of inner loop Simon Glass
2016-08-18 19:08 ` [U-Boot] [PATCH 3/3] rockchip: i2c: fix >32 byte writes John Keeping
2016-09-06 1:03 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160818190842.25094-3-john@metanate.com \
--to=john@metanate.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox