Commit b3226f96 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] ts2020: do not use i2c_transfer() on sleep()

There is no need to use bulk i2c_transfer() to write single register.
Use write register function instead.
Tested-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent ce0b065a
...@@ -123,29 +123,14 @@ static int ts2020_readreg(struct dvb_frontend *fe, u8 reg) ...@@ -123,29 +123,14 @@ static int ts2020_readreg(struct dvb_frontend *fe, u8 reg)
static int ts2020_sleep(struct dvb_frontend *fe) static int ts2020_sleep(struct dvb_frontend *fe)
{ {
struct ts2020_priv *priv = fe->tuner_priv; struct ts2020_priv *priv = fe->tuner_priv;
int ret; u8 u8tmp;
u8 buf[] = { 10, 0 };
struct i2c_msg msg = {
.addr = priv->i2c_address,
.flags = 0,
.buf = buf,
.len = 2
};
if (priv->tuner == TS2020_M88TS2022)
buf[0] = 0x00;
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
ret = i2c_transfer(priv->i2c, &msg, 1);
if (ret != 1)
printk(KERN_ERR "%s: i2c error\n", __func__);
if (fe->ops.i2c_gate_ctrl) if (priv->tuner == TS2020_M88TS2020)
fe->ops.i2c_gate_ctrl(fe, 0); u8tmp = 0x0a; /* XXX: probably wrong */
else
u8tmp = 0x00;
return (ret == 1) ? 0 : ret; return ts2020_writereg(fe, u8tmp, 0x00);
} }
static int ts2020_init(struct dvb_frontend *fe) static int ts2020_init(struct dvb_frontend *fe)
......
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