Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 371000
b: refs/heads/master
c: 8574731
h: refs/heads/master
v: v3
  • Loading branch information
Jaemin Yoo authored and Wolfram Sang committed Apr 9, 2013
1 parent 9af71a4 commit c18af6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 51d95709dddf7fdf6769a547de37a9c98edf8df9
refs/heads/master: 85747311ecb6167c989093c64a13807366fdd3a9
9 changes: 9 additions & 0 deletions trunk/drivers/i2c/busses/i2c-s3c2410.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ static inline int is_lastmsg(struct s3c24xx_i2c *i2c)

static inline int is_msglast(struct s3c24xx_i2c *i2c)
{
/* msg->len is always 1 for the first byte of smbus block read.
* Actual length will be read from slave. More bytes will be
* read according to the length then. */
if (i2c->msg->flags & I2C_M_RECV_LEN && i2c->msg->len == 1)
return 0;

return i2c->msg_ptr == i2c->msg->len-1;
}

Expand Down Expand Up @@ -485,6 +491,9 @@ static int i2c_s3c_irq_nextbyte(struct s3c24xx_i2c *i2c, unsigned long iicstat)
byte = readb(i2c->regs + S3C2410_IICDS);
i2c->msg->buf[i2c->msg_ptr++] = byte;

/* Add actual length to read for smbus block read */
if (i2c->msg->flags & I2C_M_RECV_LEN && i2c->msg->len == 1)
i2c->msg->len += byte;
prepare_read:
if (is_msglast(i2c)) {
/* last byte of buffer */
Expand Down

0 comments on commit c18af6c

Please sign in to comment.