Commit 812fe6d9 authored by Hans-Frieder Vogt's avatar Hans-Frieder Vogt Committed by Mauro Carvalho Chehab

[media] af9035: i2c read fix

Enable i2c read requests.

I2C read fix (necessary e.g. for mxl5007t tuner, because it
sends a 2 bytes for a read request, thus msg[0].len != msg[1].len).
Signed-off-by: default avatarHans-Frieder Vogt <hfvogt@gmx.net>
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 8e8a5ac7
...@@ -209,24 +209,15 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap, ...@@ -209,24 +209,15 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
msg[1].len); msg[1].len);
} else { } else {
/* I2C */ /* I2C */
#if 0
/*
* FIXME: Keep that code. It should work but as it is
* not tested I left it disabled and return -EOPNOTSUPP
* for the sure.
*/
u8 buf[4 + msg[0].len]; u8 buf[4 + msg[0].len];
struct usb_req req = { CMD_I2C_RD, 0, sizeof(buf), struct usb_req req = { CMD_I2C_RD, 0, sizeof(buf),
buf, msg[1].len, msg[1].buf }; buf, msg[1].len, msg[1].buf };
buf[0] = msg[0].len; buf[0] = msg[1].len;
buf[1] = msg[0].addr << 1; buf[1] = msg[0].addr << 1;
buf[2] = 0x01; buf[2] = 0x01;
buf[3] = 0x00; buf[3] = 0x00;
memcpy(&buf[4], msg[0].buf, msg[0].len); memcpy(&buf[4], msg[0].buf, msg[0].len);
ret = af9035_ctrl_msg(d->udev, &req); ret = af9035_ctrl_msg(d->udev, &req);
#endif
pr_debug("%s: I2C operation not supported\n", __func__);
ret = -EOPNOTSUPP;
} }
} else if (num == 1 && !(msg[0].flags & I2C_M_RD)) { } else if (num == 1 && !(msg[0].flags & I2C_M_RD)) {
if (msg[0].len > 40) { if (msg[0].len > 40) {
......
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