aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/tda10021.c
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-18 16:47:10 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 00:58:49 -0400
commitf1e809191c6b960aef721aa6aa8a8c103039d937 (patch)
tree779885302da1f24d2dd6d087dc4c3adc87c4836e /drivers/media/dvb/frontends/tda10021.c
parentd1544ecb3b0589089ddb928affa7bd4255f9442e (diff)
V4L/DVB (3862): Convert tda10021 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/frontends/tda10021.c')
-rw-r--r--drivers/media/dvb/frontends/tda10021.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c
index 21255cac9793..12e0ec27cb3c 100644
--- a/drivers/media/dvb/frontends/tda10021.c
+++ b/drivers/media/dvb/frontends/tda10021.c
@@ -225,13 +225,6 @@ static int tda10021_init (struct dvb_frontend *fe)
225 225
226 //Activate PLL 226 //Activate PLL
227 tda10021_writereg(state, 0x2a, tda10021_inittab[0x2a] & 0xef); 227 tda10021_writereg(state, 0x2a, tda10021_inittab[0x2a] & 0xef);
228
229 if (state->config->pll_init) {
230 lock_tuner(state);
231 state->config->pll_init(fe);
232 unlock_tuner(state);
233 }
234
235 return 0; 228 return 0;
236} 229}
237 230
@@ -259,9 +252,10 @@ static int tda10021_set_parameters (struct dvb_frontend *fe,
259 252
260 //printk("tda10021: set frequency to %d qam=%d symrate=%d\n", p->frequency,qam,p->u.qam.symbol_rate); 253 //printk("tda10021: set frequency to %d qam=%d symrate=%d\n", p->frequency,qam,p->u.qam.symbol_rate);
261 254
262 lock_tuner(state); 255 if (fe->ops->tuner_ops.set_params) {
263 state->config->pll_set(fe, p); 256 fe->ops->tuner_ops.set_params(fe, p);
264 unlock_tuner(state); 257 if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
258 }
265 259
266 tda10021_set_symbolrate (state, p->u.qam.symbol_rate); 260 tda10021_set_symbolrate (state, p->u.qam.symbol_rate);
267 tda10021_writereg (state, 0x34, state->pwm); 261 tda10021_writereg (state, 0x34, state->pwm);
@@ -376,6 +370,18 @@ static int tda10021_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
376 return 0; 370 return 0;
377} 371}
378 372
373static int tda10021_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
374{
375 struct tda10021_state* state = fe->demodulator_priv;
376
377 if (enable) {
378 lock_tuner(state);
379 } else {
380 unlock_tuner(state);
381 }
382 return 0;
383}
384
379static int tda10021_sleep(struct dvb_frontend* fe) 385static int tda10021_sleep(struct dvb_frontend* fe)
380{ 386{
381 struct tda10021_state* state = fe->demodulator_priv; 387 struct tda10021_state* state = fe->demodulator_priv;
@@ -448,6 +454,7 @@ static struct dvb_frontend_ops tda10021_ops = {
448 454
449 .init = tda10021_init, 455 .init = tda10021_init,
450 .sleep = tda10021_sleep, 456 .sleep = tda10021_sleep,
457 .i2c_gate_ctrl = tda10021_i2c_gate_ctrl,
451 458
452 .set_frontend = tda10021_set_parameters, 459 .set_frontend = tda10021_set_parameters,
453 .get_frontend = tda10021_get_frontend, 460 .get_frontend = tda10021_get_frontend,