aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-18 16:47:09 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 00:58:35 -0400
commit58ac7d36179e27d82e067752b792b1cc573fc590 (patch)
treefbd23af32dc21f395e77740baba757379db27154 /drivers/media
parenta81870e00bf502db2c579dcb9721adab3775ba58 (diff)
V4L/DVB (3850): Convert stv0297 to refactored tuner code
Convert to tuner_ops calls. Remove pll function pointers from structure. Remove unneeded tuner calls. Add i2c gate control function. Remove extra exported pll gate control function. Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/stv0297.c18
-rw-r--r--drivers/media/dvb/frontends/stv0297.h5
2 files changed, 10 insertions, 13 deletions
diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c
index eb15676d374f..c8c3b74f9958 100644
--- a/drivers/media/dvb/frontends/stv0297.c
+++ b/drivers/media/dvb/frontends/stv0297.c
@@ -276,12 +276,14 @@ static int stv0297_set_inversion(struct stv0297_state *state, fe_spectral_invers
276 return 0; 276 return 0;
277} 277}
278 278
279int stv0297_enable_plli2c(struct dvb_frontend *fe) 279static int stv0297_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
280{ 280{
281 struct stv0297_state *state = fe->demodulator_priv; 281 struct stv0297_state *state = fe->demodulator_priv;
282 282
283 stv0297_writereg(state, 0x87, 0x78); 283 if (enable) {
284 stv0297_writereg(state, 0x86, 0xc8); 284 stv0297_writereg(state, 0x87, 0x78);
285 stv0297_writereg(state, 0x86, 0xc8);
286 }
285 287
286 return 0; 288 return 0;
287} 289}
@@ -296,9 +298,6 @@ static int stv0297_init(struct dvb_frontend *fe)
296 stv0297_writereg(state, state->config->inittab[i], state->config->inittab[i+1]); 298 stv0297_writereg(state, state->config->inittab[i], state->config->inittab[i+1]);
297 msleep(200); 299 msleep(200);
298 300
299 if (state->config->pll_init)
300 state->config->pll_init(fe);
301
302 return 0; 301 return 0;
303} 302}
304 303
@@ -421,7 +420,10 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par
421 } 420 }
422 421
423 stv0297_init(fe); 422 stv0297_init(fe);
424 state->config->pll_set(fe, p); 423 if (fe->ops->tuner_ops.set_params) {
424 fe->ops->tuner_ops.set_params(fe, p);
425 if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
426 }
425 427
426 /* clear software interrupts */ 428 /* clear software interrupts */
427 stv0297_writereg(state, 0x82, 0x0); 429 stv0297_writereg(state, 0x82, 0x0);
@@ -668,6 +670,7 @@ static struct dvb_frontend_ops stv0297_ops = {
668 670
669 .init = stv0297_init, 671 .init = stv0297_init,
670 .sleep = stv0297_sleep, 672 .sleep = stv0297_sleep,
673 .i2c_gate_ctrl = stv0297_i2c_gate_ctrl,
671 674
672 .set_frontend = stv0297_set_frontend, 675 .set_frontend = stv0297_set_frontend,
673 .get_frontend = stv0297_get_frontend, 676 .get_frontend = stv0297_get_frontend,
@@ -684,4 +687,3 @@ MODULE_AUTHOR("Dennis Noermann and Andrew de Quincey");
684MODULE_LICENSE("GPL"); 687MODULE_LICENSE("GPL");
685 688
686EXPORT_SYMBOL(stv0297_attach); 689EXPORT_SYMBOL(stv0297_attach);
687EXPORT_SYMBOL(stv0297_enable_plli2c);
diff --git a/drivers/media/dvb/frontends/stv0297.h b/drivers/media/dvb/frontends/stv0297.h
index 9e53f019db71..8ff793c90038 100644
--- a/drivers/media/dvb/frontends/stv0297.h
+++ b/drivers/media/dvb/frontends/stv0297.h
@@ -37,14 +37,9 @@ struct stv0297_config
37 37
38 /* does the "inversion" need inverted? */ 38 /* does the "inversion" need inverted? */
39 u8 invert:1; 39 u8 invert:1;
40
41 /* PLL maintenance */
42 int (*pll_init)(struct dvb_frontend* fe);
43 int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
44}; 40};
45 41
46extern struct dvb_frontend* stv0297_attach(const struct stv0297_config* config, 42extern struct dvb_frontend* stv0297_attach(const struct stv0297_config* config,
47 struct i2c_adapter* i2c); 43 struct i2c_adapter* i2c);
48extern int stv0297_enable_plli2c(struct dvb_frontend* fe);
49 44
50#endif // STV0297_H 45#endif // STV0297_H