diff options
author | Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> | 2011-06-08 22:29:29 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2011-07-26 19:02:28 -0400 |
commit | 7a9c42ccc9fd4317383e55209f825f974e64aa99 (patch) | |
tree | b5af15e25456fa0a591232367edf25aa7268bafe /drivers/i2c/busses/i2c-eg20t.c | |
parent | 5c470f39eea66ff00b31136f8bce9359d6b95375 (diff) |
i2c-eg20t : Support Combined R/W transfer mode
Currently, Combined R/W transfer mode is not supported.
This patch enables Combined R/W transfer mode.
Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-eg20t.c')
-rw-r--r-- | drivers/i2c/busses/i2c-eg20t.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index 8abfa4a03ce1..9b072fd42108 100644 --- a/drivers/i2c/busses/i2c-eg20t.c +++ b/drivers/i2c/busses/i2c-eg20t.c | |||
@@ -673,25 +673,26 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap, | |||
673 | /* transfer not completed */ | 673 | /* transfer not completed */ |
674 | adap->pch_i2c_xfer_in_progress = true; | 674 | adap->pch_i2c_xfer_in_progress = true; |
675 | 675 | ||
676 | pmsg = &msgs[0]; | 676 | for (i = 0; i < num; i++) { |
677 | pmsg->flags |= adap->pch_buff_mode_en; | 677 | pmsg = &msgs[i]; |
678 | status = pmsg->flags; | 678 | pmsg->flags |= adap->pch_buff_mode_en; |
679 | pch_dbg(adap, | 679 | status = pmsg->flags; |
680 | "After invoking I2C_MODE_SEL :flag= 0x%x\n", status); | 680 | pch_dbg(adap, |
681 | /* calculate sub address length and message length */ | 681 | "After invoking I2C_MODE_SEL :flag= 0x%x\n", status); |
682 | /* these are applicable only for buffer mode */ | 682 | /* calculate sub address length and message length */ |
683 | subaddrlen = pmsg->buf[0]; | 683 | /* these are applicable only for buffer mode */ |
684 | /* calculate actual message length excluding | 684 | subaddrlen = pmsg->buf[0]; |
685 | * the sub address fields */ | 685 | /* calculate actual message length excluding |
686 | msglen = (pmsg->len) - (subaddrlen + 1); | 686 | * the sub address fields */ |
687 | if (status & (I2C_M_RD)) { | 687 | msglen = (pmsg->len) - (subaddrlen + 1); |
688 | pch_dbg(adap, "invoking pch_i2c_readbytes\n"); | 688 | |
689 | ret = pch_i2c_readbytes(i2c_adap, pmsg, (i + 1 == num), | 689 | if ((status & (I2C_M_RD)) != false) { |
690 | (i == 0)); | 690 | ret = pch_i2c_readbytes(i2c_adap, pmsg, (i + 1 == num), |
691 | } else { | 691 | (i == 0)); |
692 | pch_dbg(adap, "invoking pch_i2c_writebytes\n"); | 692 | } else { |
693 | ret = pch_i2c_writebytes(i2c_adap, pmsg, (i + 1 == num), | 693 | ret = pch_i2c_writebytes(i2c_adap, pmsg, (i + 1 == num), |
694 | (i == 0)); | 694 | (i == 0)); |
695 | } | ||
695 | } | 696 | } |
696 | 697 | ||
697 | adap->pch_i2c_xfer_in_progress = false; /* transfer completed */ | 698 | adap->pch_i2c_xfer_in_progress = false; /* transfer completed */ |