summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2007-07-18 10:26:38 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2007-07-18 10:26:38 -0300
commitdc6bcd9a295280818c9a86608ddf1a7e2e5c9d93 (patch)
tree55d59c7ed909675912f3de8d2ac37a42c1bf403b /linux/drivers
parent41bcd08d3f8d6e3b4ebabf945036a9334f4854a9 (diff)
downloadmediapointer-dvb-s2-dc6bcd9a295280818c9a86608ddf1a7e2e5c9d93.tar.gz
mediapointer-dvb-s2-dc6bcd9a295280818c9a86608ddf1a7e2e5c9d93.tar.bz2
tm6000: Improve handling of SMBus Write Byte commands followed by a read command.
From: Michel Ludwig <michel.ludwig@gmail.com> 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 <michel.ludwig@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/staging/tm6000/tm6000-i2c.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/linux/drivers/staging/tm6000/tm6000-i2c.c b/linux/drivers/staging/tm6000/tm6000-i2c.c
index ca1fdec40..dade4ab79 100644
--- a/linux/drivers/staging/tm6000/tm6000-i2c.c
+++ b/linux/drivers/staging/tm6000/tm6000-i2c.c
@@ -146,6 +146,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,