Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1408693 > unrolled thread
| Started by | minyard@acm.org |
|---|---|
| First post | 2016-05-30 03:10 +0200 |
| Last post | 2016-05-30 03:10 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 10/10] i2c-i801: Only write the host control reg when necessary minyard@acm.org - 2016-05-30 03:10 +0200
| From | minyard@acm.org |
|---|---|
| Date | 2016-05-30 03:10 +0200 |
| Subject | [PATCH v2 10/10] i2c-i801: Only write the host control reg when necessary |
| Message-ID | <rEjSp-5Fx-7@gated-at.bofh.it> |
From: Corey Minyard <cminyard@mvista.com>
When doing byte-by-byte mode, the code was writing the host
control register on every byte. However, this is only necessary
on the first byte and for read transactions the last byte.
So only do it those times.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
drivers/i2c/busses/i2c-i801.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index bb15356..4a96a95 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -606,11 +606,11 @@ static int i801_block_transaction_byte_by_byte(struct i801_priv *priv,
for (i = 1; i <= len; i++) {
if (i == len && is_read)
smbcmd |= SMBHSTCNT_LAST_BYTE;
- outb_p(smbcmd, SMBHSTCNT(priv));
if (i == 1)
- outb_p(inb(SMBHSTCNT(priv)) | SMBHSTCNT_START,
- SMBHSTCNT(priv));
+ outb_p(smbcmd | SMBHSTCNT_START, SMBHSTCNT(priv));
+ else if (i == len && is_read)
+ outb_p(smbcmd, SMBHSTCNT(priv));
status = i801_wait_byte_done(priv);
if (status)
--
2.7.4
Back to top | Article view | linux.kernel
csiph-web