summaryrefslogtreecommitdiff
path: root/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
diff options
context:
space:
mode:
authorOlli Salonen <olli.salonen@iki.fi>2015-05-05 13:54:18 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-05-12 13:21:29 -0300
commitd744a0cb8a819e93ad3852705a8df7bbe4599ad4 (patch)
tree4c82f33fba145aaeca6c110217960bf40f90d3cd /drivers/media/usb/dvb-usb-v2/rtl28xxu.c
parentee3c3e46885946cc041f08ec68e7c5b91b087cbe (diff)
downloadlinux-d744a0cb8a819e93ad3852705a8df7bbe4599ad4.tar.gz
linux-d744a0cb8a819e93ad3852705a8df7bbe4599ad4.tar.xz
[media] rtl28xxu: add I2C read without write
Add support for I2C read operation without a preceeding write. While here, change the error code to EOPNOTSUPP in case an unsupported I2C operation is attempted. Signed-off-by: Olli Salonen <olli.salonen@iki.fi> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/dvb-usb-v2/rtl28xxu.c')
-rw-r--r--drivers/media/usb/dvb-usb-v2/rtl28xxu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
index 895441fe90f7..54cb10979d99 100644
--- a/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
+++ b/drivers/media/usb/dvb-usb-v2/rtl28xxu.c
@@ -232,8 +232,14 @@ static int rtl28xxu_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
req.data = msg[0].buf;
ret = rtl28xxu_ctrl_msg(d, &req);
}
+ } else if (num == 1 && (msg[0].flags & I2C_M_RD)) {
+ req.value = (msg[0].addr << 1);
+ req.index = CMD_I2C_DA_RD;
+ req.size = msg[0].len;
+ req.data = msg[0].buf;
+ ret = rtl28xxu_ctrl_msg(d, &req);
} else {
- ret = -EINVAL;
+ ret = -EOPNOTSUPP;
}
err_mutex_unlock: