Commit 28cb88ca authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

V4L/DVB (12813): tm6000: all read messages should use prev_reg

read messages with length>1 where using the wrong register.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b1ce40b1
...@@ -113,21 +113,11 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap, ...@@ -113,21 +113,11 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
out of message data. out of message data.
*/ */
/* SMBus Read Byte command */ /* SMBus Read Byte command */
if(msgs[i].len == 1) { rc = tm6000_read_write_usb (dev,
// we use the previously used register to read from USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
rc = tm6000_read_write_usb (dev, REQ_16_SET_GET_I2CSEQ,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, addr | (prev_reg << 8), 0,
REQ_16_SET_GET_I2CSEQ, msgs[i].buf, msgs[i].len);
addr | prev_reg<<8, 0,
msgs[i].buf, msgs[i].len);
}
else {
rc = tm6000_read_write_usb (dev,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
REQ_16_SET_GET_I2CSEQ,
addr|(*msgs[i].buf)<<8, 0,
msgs[i].buf, msgs[i].len);
}
if (i2c_debug>=2) { if (i2c_debug>=2) {
for (byte = 0; byte < msgs[i].len; byte++) { for (byte = 0; byte < msgs[i].len; byte++) {
printk(" %02x", msgs[i].buf[byte]); printk(" %02x", msgs[i].buf[byte]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment