提交 c8461210 编写于 作者: I Igor M. Liplianin 提交者: Mauro Carvalho Chehab

V4L/DVB (12313): stv6110: Read registers through one time i2c_transfer calling

Signed-off-by: NIgor M. Liplianin <liplianin@netup.ru>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 fc7e4a3e
...@@ -101,35 +101,25 @@ static int stv6110_read_regs(struct dvb_frontend *fe, u8 regs[], ...@@ -101,35 +101,25 @@ static int stv6110_read_regs(struct dvb_frontend *fe, u8 regs[],
struct stv6110_priv *priv = fe->tuner_priv; struct stv6110_priv *priv = fe->tuner_priv;
int rc; int rc;
u8 reg[] = { start }; u8 reg[] = { start };
struct i2c_msg msg_wr = { struct i2c_msg msg[] = {
{
.addr = priv->i2c_address, .addr = priv->i2c_address,
.flags = 0, .flags = 0,
.buf = reg, .buf = reg,
.len = 1, .len = 1,
}; }, {
struct i2c_msg msg_rd = {
.addr = priv->i2c_address, .addr = priv->i2c_address,
.flags = I2C_M_RD, .flags = I2C_M_RD,
.buf = regs, .buf = regs,
.len = len, .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) if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1); fe->ops.i2c_gate_ctrl(fe, 1);
rc = i2c_transfer(priv->i2c, &msg_rd, 1); rc = i2c_transfer(priv->i2c, msg, 2);
if (rc != 1) if (rc != 2)
dprintk("%s: i2c error\n", __func__); dprintk("%s: i2c error\n", __func__);
if (fe->ops.i2c_gate_ctrl) if (fe->ops.i2c_gate_ctrl)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册