Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260455
b: refs/heads/master
c: 7a9c42c
h: refs/heads/master
i:
  260453: d6df50f
  260451: a094d1c
  260447: 42d212a
v: v3
  • Loading branch information
Tomoya MORINAGA authored and Ben Dooks committed Jul 26, 2011
1 parent fb6ad5a commit f6244c1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c470f39eea66ff00b31136f8bce9359d6b95375
refs/heads/master: 7a9c42ccc9fd4317383e55209f825f974e64aa99
39 changes: 20 additions & 19 deletions trunk/drivers/i2c/busses/i2c-eg20t.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,25 +673,26 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap,
/* transfer not completed */
adap->pch_i2c_xfer_in_progress = true;

pmsg = &msgs[0];
pmsg->flags |= adap->pch_buff_mode_en;
status = pmsg->flags;
pch_dbg(adap,
"After invoking I2C_MODE_SEL :flag= 0x%x\n", status);
/* calculate sub address length and message length */
/* these are applicable only for buffer mode */
subaddrlen = pmsg->buf[0];
/* calculate actual message length excluding
* the sub address fields */
msglen = (pmsg->len) - (subaddrlen + 1);
if (status & (I2C_M_RD)) {
pch_dbg(adap, "invoking pch_i2c_readbytes\n");
ret = pch_i2c_readbytes(i2c_adap, pmsg, (i + 1 == num),
(i == 0));
} else {
pch_dbg(adap, "invoking pch_i2c_writebytes\n");
ret = pch_i2c_writebytes(i2c_adap, pmsg, (i + 1 == num),
(i == 0));
for (i = 0; i < num; i++) {
pmsg = &msgs[i];
pmsg->flags |= adap->pch_buff_mode_en;
status = pmsg->flags;
pch_dbg(adap,
"After invoking I2C_MODE_SEL :flag= 0x%x\n", status);
/* calculate sub address length and message length */
/* these are applicable only for buffer mode */
subaddrlen = pmsg->buf[0];
/* calculate actual message length excluding
* the sub address fields */
msglen = (pmsg->len) - (subaddrlen + 1);

if ((status & (I2C_M_RD)) != false) {
ret = pch_i2c_readbytes(i2c_adap, pmsg, (i + 1 == num),
(i == 0));
} else {
ret = pch_i2c_writebytes(i2c_adap, pmsg, (i + 1 == num),
(i == 0));
}
}

adap->pch_i2c_xfer_in_progress = false; /* transfer completed */
Expand Down

0 comments on commit f6244c1

Please sign in to comment.