aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda8261.c
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2008-02-03 17:37:02 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:23 -0500
commit40e8ce3dba8e9437ed48c88c268615dc0a4bebb2 (patch)
treeb5588068dfd4ff2e7a16c420f98110a5be6ce711 /drivers/media/dvb/frontends/tda8261.c
parented3d150eacfa87087f705a908a2586bdec5bf9b7 (diff)
V4L/DVB (9457): Optimization, Fix a Bug
* cut down some I/O operations by disabling "disable gate" * budget_av was left with the gate open, thereby more susceptible to RF interference due to I/O operations Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/tda8261.c')
-rw-r--r--drivers/media/dvb/frontends/tda8261.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/media/dvb/frontends/tda8261.c b/drivers/media/dvb/frontends/tda8261.c
index 16e833fdc77e..b6d177799104 100644
--- a/drivers/media/dvb/frontends/tda8261.c
+++ b/drivers/media/dvb/frontends/tda8261.c
@@ -37,14 +37,10 @@ struct tda8261_state {
37 37
38static int tda8261_read(struct tda8261_state *state, u8 *buf) 38static int tda8261_read(struct tda8261_state *state, u8 *buf)
39{ 39{
40 struct dvb_frontend *fe = state->fe;
41 const struct tda8261_config *config = state->config; 40 const struct tda8261_config *config = state->config;
42 int err = 0; 41 int err = 0;
43 struct i2c_msg msg = { .addr = config->addr, .flags = I2C_M_RD,.buf = buf, .len = 2 }; 42 struct i2c_msg msg = { .addr = config->addr, .flags = I2C_M_RD,.buf = buf, .len = 2 };
44 43
45 if (fe->ops.i2c_gate_ctrl)
46 fe->ops.i2c_gate_ctrl(fe, 1);
47
48 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) 44 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1)
49 printk("%s: read error, err=%d\n", __func__, err); 45 printk("%s: read error, err=%d\n", __func__, err);
50 46
@@ -53,14 +49,10 @@ static int tda8261_read(struct tda8261_state *state, u8 *buf)
53 49
54static int tda8261_write(struct tda8261_state *state, u8 *buf) 50static int tda8261_write(struct tda8261_state *state, u8 *buf)
55{ 51{
56 struct dvb_frontend *fe = state->fe;
57 const struct tda8261_config *config = state->config; 52 const struct tda8261_config *config = state->config;
58 int err = 0; 53 int err = 0;
59 struct i2c_msg msg = { .addr = config->addr, .flags = 0, .buf = buf, .len = 4 }; 54 struct i2c_msg msg = { .addr = config->addr, .flags = 0, .buf = buf, .len = 4 };
60 55
61 if (fe->ops.i2c_gate_ctrl)
62 fe->ops.i2c_gate_ctrl(fe, 1);
63
64 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) 56 if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1)
65 printk("%s: write error, err=%d\n", __func__, err); 57 printk("%s: write error, err=%d\n", __func__, err);
66 58