aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda826x.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2006-08-08 08:10:11 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 10:53:31 -0400
commitef09c071a2867279a49374c35b2a169f69fced73 (patch)
treee25248b7a8b82adede8a60b15c985a904e3a5863 /drivers/media/dvb/frontends/tda826x.c
parente2ac28fa15696d3d9dc38923438ad39fe1235ecd (diff)
V4L/DVB (4400): Tda826x: Remove 0-byte I2C write; put tuner_ops info in static struct
Remove the 0-byte write that precedes 2-byte read. Move initialize the info field in the static tuner_ops definition, so that it doesn't need to be done manually. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/tda826x.c')
-rw-r--r--drivers/media/dvb/frontends/tda826x.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/dvb/frontends/tda826x.c b/drivers/media/dvb/frontends/tda826x.c
index 2921eb82fb6f..f594eab4432e 100644
--- a/drivers/media/dvb/frontends/tda826x.c
+++ b/drivers/media/dvb/frontends/tda826x.c
@@ -110,6 +110,11 @@ static int tda826x_get_frequency(struct dvb_frontend *fe, u32 *frequency)
110} 110}
111 111
112static struct dvb_tuner_ops tda826x_tuner_ops = { 112static struct dvb_tuner_ops tda826x_tuner_ops = {
113 .info = {
114 .name = "Philips TDA826X",
115 .frequency_min = 950000,
116 .frequency_min = 2175000
117 },
113 .release = tda826x_release, 118 .release = tda826x_release,
114 .sleep = tda826x_sleep, 119 .sleep = tda826x_sleep,
115 .set_params = tda826x_set_params, 120 .set_params = tda826x_set_params,
@@ -120,13 +125,12 @@ struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2
120{ 125{
121 struct tda826x_priv *priv = NULL; 126 struct tda826x_priv *priv = NULL;
122 u8 b1 [] = { 0, 0 }; 127 u8 b1 [] = { 0, 0 };
123 struct i2c_msg msg [] = { { .addr = addr, .flags = 0, .buf = NULL, .len = 0 }, 128 struct i2c_msg msg [] = { { .addr = addr, .flags = I2C_M_RD, .buf = b1, .len = 2 } };
124 { .addr = addr, .flags = I2C_M_RD, .buf = b1, .len = 2 } };
125 int ret; 129 int ret;
126 130
127 if (fe->ops.i2c_gate_ctrl) 131 if (fe->ops.i2c_gate_ctrl)
128 fe->ops.i2c_gate_ctrl(fe, 1); 132 fe->ops.i2c_gate_ctrl(fe, 1);
129 ret = i2c_transfer (i2c, msg, 2); 133 ret = i2c_transfer (i2c, msg, 1);
130 if (fe->ops.i2c_gate_ctrl) 134 if (fe->ops.i2c_gate_ctrl)
131 fe->ops.i2c_gate_ctrl(fe, 0); 135 fe->ops.i2c_gate_ctrl(fe, 0);
132 136
@@ -144,9 +148,6 @@ struct dvb_frontend *tda826x_attach(struct dvb_frontend *fe, int addr, struct i2
144 priv->has_loopthrough = has_loopthrough; 148 priv->has_loopthrough = has_loopthrough;
145 149
146 memcpy(&fe->ops.tuner_ops, &tda826x_tuner_ops, sizeof(struct dvb_tuner_ops)); 150 memcpy(&fe->ops.tuner_ops, &tda826x_tuner_ops, sizeof(struct dvb_tuner_ops));
147 strncpy(fe->ops.tuner_ops.info.name, "Philips TDA826X", 128);
148 fe->ops.tuner_ops.info.frequency_min = 950000;
149 fe->ops.tuner_ops.info.frequency_min = 2175000;
150 151
151 fe->tuner_priv = priv; 152 fe->tuner_priv = priv;
152 printk("%s:\n", __FUNCTION__); 153 printk("%s:\n", __FUNCTION__);