aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Ludwig <[email protected]>2007-07-18 10:26:38 -0300
committerMauro Carvalho Chehab <[email protected]>2010-05-18 00:39:32 -0300
commit4f44dcec7141244ae4baba66c0334cc33c9bbd78 (patch)
tree28eb6611bcce36d83474c8b938505adefb0b5759
parenta5adfbed09ffedb4ffa8e9a93dbd757096020470 (diff)
V4L/DVB (12780): tm6000: Improve handling of SMBus Write Byte commands followed by a read command.
SMBus Write Byte commands followed by a read command on the same I2C address are not sent out to the chip as they wouldn't have any effect. Signed-off-by: Michel Ludwig <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/staging/tm6000/tm6000-i2c.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/tm6000/tm6000-i2c.c b/drivers/staging/tm6000/tm6000-i2c.c
index 80252b746699..2a8c169cf07f 100644
--- a/drivers/staging/tm6000/tm6000-i2c.c
+++ b/drivers/staging/tm6000/tm6000-i2c.c
@@ -141,6 +141,13 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
printk(" %02x", msgs[i].buf[byte]);
}
+ /* SMBus Write Byte command followed by a read command */
+ if(msgs[i].len == 1 && i+1 < num && msgs[i+1].flags & I2C_M_RD
+ && msgs[i+1].addr == msgs[i].addr) {
+ prev_reg = msgs[i].buf[0];
+ continue;
+ }
+
rc = tm6000_read_write_usb (dev,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
REQ_16_SET_GET_I2CSEQ,