summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorIgor M. Liplianin <liplianin@netup.ru>2009-07-20 01:21:38 +0400
committerIgor M. Liplianin <liplianin@netup.ru>2009-07-20 01:21:38 +0400
commit1f04aaf2cbc9e510002eaabb94b8a85d21b12640 (patch)
tree89b1eee3baa889855b9bed7268deac2827add87f /linux
parentab5fd1dec1bf106e22d4bc18f3119830270f20aa (diff)
downloadmediapointer-dvb-s2-1f04aaf2cbc9e510002eaabb94b8a85d21b12640.tar.gz
mediapointer-dvb-s2-1f04aaf2cbc9e510002eaabb94b8a85d21b12640.tar.bz2
stv6110 tuner: Read registers through one time i2c_transfer calling.
From: Igor M. Liplianin <liplianin@netup.ru> Signed-off-by: Igor M. Liplianin <liplianin@netup.ru>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/frontends/stv6110.c38
1 files changed, 14 insertions, 24 deletions
diff --git a/linux/drivers/media/dvb/frontends/stv6110.c b/linux/drivers/media/dvb/frontends/stv6110.c
index 5aabb782e..dcf1b21ea 100644
--- a/linux/drivers/media/dvb/frontends/stv6110.c
+++ b/linux/drivers/media/dvb/frontends/stv6110.c
@@ -101,35 +101,25 @@ static int stv6110_read_regs(struct dvb_frontend *fe, u8 regs[],
struct stv6110_priv *priv = fe->tuner_priv;
int rc;
u8 reg[] = { start };
- struct i2c_msg msg_wr = {
- .addr = priv->i2c_address,
- .flags = 0,
- .buf = reg,
- .len = 1,
+ struct i2c_msg msg[] = {
+ {
+ .addr = priv->i2c_address,
+ .flags = 0,
+ .buf = reg,
+ .len = 1,
+ }, {
+ .addr = priv->i2c_address,
+ .flags = I2C_M_RD,
+ .buf = regs,
+ .len = len,
+ },
};
- struct i2c_msg msg_rd = {
- .addr = priv->i2c_address,
- .flags = I2C_M_RD,
- .buf = regs,
- .len = len,
- };
- /* write subaddr */
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
- rc = i2c_transfer(priv->i2c, &msg_wr, 1);
- if (rc != 1)
- dprintk("%s: i2c error\n", __func__);
-
- if (fe->ops.i2c_gate_ctrl)
- fe->ops.i2c_gate_ctrl(fe, 0);
- /* read registers */
- if (fe->ops.i2c_gate_ctrl)
- fe->ops.i2c_gate_ctrl(fe, 1);
-
- rc = i2c_transfer(priv->i2c, &msg_rd, 1);
- if (rc != 1)
+ rc = i2c_transfer(priv->i2c, msg, 2);
+ if (rc != 2)
dprintk("%s: i2c error\n", __func__);
if (fe->ops.i2c_gate_ctrl)