summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/ts2020.c
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2015-03-24 09:40:58 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-02 22:27:32 -0300
commitb3226f961aa91eb94971939400c7506e7dcc86c0 (patch)
tree8bd26abad27fb392efa76224d1e29d27dc2ea52d /drivers/media/dvb-frontends/ts2020.c
parentce0b065a7cc3cad8e974f1e8a5bead61563a3885 (diff)
downloadtalos-obmc-linux-b3226f961aa91eb94971939400c7506e7dcc86c0.tar.gz
talos-obmc-linux-b3226f961aa91eb94971939400c7506e7dcc86c0.zip
[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: David Howells <dhowells@redhat.com> Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/dvb-frontends/ts2020.c')
-rw-r--r--drivers/media/dvb-frontends/ts2020.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/drivers/media/dvb-frontends/ts2020.c b/drivers/media/dvb-frontends/ts2020.c
index b1d91dc46a47..90164a38cd36 100644
--- a/drivers/media/dvb-frontends/ts2020.c
+++ b/drivers/media/dvb-frontends/ts2020.c
@@ -123,29 +123,14 @@ static int ts2020_readreg(struct dvb_frontend *fe, u8 reg)
static int ts2020_sleep(struct dvb_frontend *fe)
{
struct ts2020_priv *priv = fe->tuner_priv;
- int ret;
- 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__);
+ u8 u8tmp;
- if (fe->ops.i2c_gate_ctrl)
- fe->ops.i2c_gate_ctrl(fe, 0);
+ if (priv->tuner == TS2020_M88TS2020)
+ 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)
OpenPOWER on IntegriCloud