diff options
author | Andrew de Quincey <adq_dvb@lidskialf.net> | 2006-04-18 16:47:10 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 00:58:39 -0400 |
commit | 66292ebee9c30e05d5df0229b2fa966883082cd3 (patch) | |
tree | de6c1b150ebd177aab4d5435409b5b9def99989f /drivers/media/dvb | |
parent | 58b119e8a94e2f734cd3e43d1225281ed2d47c11 (diff) |
V4L/DVB (3854): Convert ves1x93 to refactored tuner code
Convert to tuner_ops calls.
Remove pll function pointers from structure.
Remove unneeded tuner calls.
Add i2c 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/dvb')
-rw-r--r-- | drivers/media/dvb/frontends/ves1x93.c | 25 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/ves1x93.h | 4 |
2 files changed, 16 insertions, 13 deletions
diff --git a/drivers/media/dvb/frontends/ves1x93.c b/drivers/media/dvb/frontends/ves1x93.c index 821df8e839d0..660aa7bb90d0 100644 --- a/drivers/media/dvb/frontends/ves1x93.c +++ b/drivers/media/dvb/frontends/ves1x93.c | |||
@@ -278,12 +278,6 @@ static int ves1x93_init (struct dvb_frontend* fe) | |||
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | if (state->config->pll_init) { | ||
282 | ves1x93_writereg(state, 0x00, 0x11); | ||
283 | state->config->pll_init(fe); | ||
284 | ves1x93_writereg(state, 0x00, 0x01); | ||
285 | } | ||
286 | |||
287 | return 0; | 281 | return 0; |
288 | } | 282 | } |
289 | 283 | ||
@@ -395,9 +389,10 @@ static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
395 | { | 389 | { |
396 | struct ves1x93_state* state = fe->demodulator_priv; | 390 | struct ves1x93_state* state = fe->demodulator_priv; |
397 | 391 | ||
398 | ves1x93_writereg(state, 0x00, 0x11); | 392 | if (fe->ops->tuner_ops.set_params) { |
399 | state->config->pll_set(fe, p); | 393 | fe->ops->tuner_ops.set_params(fe, p); |
400 | ves1x93_writereg(state, 0x00, 0x01); | 394 | if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0); |
395 | } | ||
401 | ves1x93_set_inversion (state, p->inversion); | 396 | ves1x93_set_inversion (state, p->inversion); |
402 | ves1x93_set_fec (state, p->u.qpsk.fec_inner); | 397 | ves1x93_set_fec (state, p->u.qpsk.fec_inner); |
403 | ves1x93_set_symbolrate (state, p->u.qpsk.symbol_rate); | 398 | ves1x93_set_symbolrate (state, p->u.qpsk.symbol_rate); |
@@ -442,6 +437,17 @@ static void ves1x93_release(struct dvb_frontend* fe) | |||
442 | kfree(state); | 437 | kfree(state); |
443 | } | 438 | } |
444 | 439 | ||
440 | static int ves1x93_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) | ||
441 | { | ||
442 | struct ves1x93_state* state = fe->demodulator_priv; | ||
443 | |||
444 | if (enable) { | ||
445 | return ves1x93_writereg(state, 0x00, 0x11); | ||
446 | } else { | ||
447 | return ves1x93_writereg(state, 0x00, 0x01); | ||
448 | } | ||
449 | } | ||
450 | |||
445 | static struct dvb_frontend_ops ves1x93_ops; | 451 | static struct dvb_frontend_ops ves1x93_ops; |
446 | 452 | ||
447 | struct dvb_frontend* ves1x93_attach(const struct ves1x93_config* config, | 453 | struct dvb_frontend* ves1x93_attach(const struct ves1x93_config* config, |
@@ -523,6 +529,7 @@ static struct dvb_frontend_ops ves1x93_ops = { | |||
523 | 529 | ||
524 | .init = ves1x93_init, | 530 | .init = ves1x93_init, |
525 | .sleep = ves1x93_sleep, | 531 | .sleep = ves1x93_sleep, |
532 | .i2c_gate_ctrl = ves1x93_i2c_gate_ctrl, | ||
526 | 533 | ||
527 | .set_frontend = ves1x93_set_frontend, | 534 | .set_frontend = ves1x93_set_frontend, |
528 | .get_frontend = ves1x93_get_frontend, | 535 | .get_frontend = ves1x93_get_frontend, |
diff --git a/drivers/media/dvb/frontends/ves1x93.h b/drivers/media/dvb/frontends/ves1x93.h index 1627e37c57a4..ba88ae0855c9 100644 --- a/drivers/media/dvb/frontends/ves1x93.h +++ b/drivers/media/dvb/frontends/ves1x93.h | |||
@@ -38,10 +38,6 @@ struct ves1x93_config | |||
38 | 38 | ||
39 | /* should PWM be inverted? */ | 39 | /* should PWM be inverted? */ |
40 | u8 invert_pwm:1; | 40 | u8 invert_pwm:1; |
41 | |||
42 | /* PLL maintenance */ | ||
43 | int (*pll_init)(struct dvb_frontend* fe); | ||
44 | int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); | ||
45 | }; | 41 | }; |
46 | 42 | ||
47 | extern struct dvb_frontend* ves1x93_attach(const struct ves1x93_config* config, | 43 | extern struct dvb_frontend* ves1x93_attach(const struct ves1x93_config* config, |