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:32 -0400
commit5becb3b045c21001eeeec37bae0738d8ede3a882 (patch)
tree3d41b04cbbc210342a75d9ffa950f21ecb3600bc /drivers/media
parent7eef5dd6daecf3ee305116c9cf41ae7166270c4c (diff)
V4L/DVB (3847): Convert cx22700 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')
-rw-r--r--drivers/media/dvb/frontends/cx22700.c26
-rw-r--r--drivers/media/dvb/frontends/cx22700.h4
2 files changed, 17 insertions, 13 deletions
diff --git a/drivers/media/dvb/frontends/cx22700.c b/drivers/media/dvb/frontends/cx22700.c
index 755f774f6b7d..02fee904752e 100644
--- a/drivers/media/dvb/frontends/cx22700.c
+++ b/drivers/media/dvb/frontends/cx22700.c
@@ -247,12 +247,6 @@ static int cx22700_init (struct dvb_frontend* fe)
247 247
248 cx22700_writereg (state, 0x00, 0x01); 248 cx22700_writereg (state, 0x00, 0x01);
249 249
250 if (state->config->pll_init) {
251 cx22700_writereg (state, 0x0a, 0x00); /* open i2c bus switch */
252 state->config->pll_init(fe);
253 cx22700_writereg (state, 0x0a, 0x01); /* close i2c bus switch */
254 }
255
256 return 0; 250 return 0;
257} 251}
258 252
@@ -333,9 +327,11 @@ static int cx22700_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
333 cx22700_writereg (state, 0x00, 0x02); /* XXX CHECKME: soft reset*/ 327 cx22700_writereg (state, 0x00, 0x02); /* XXX CHECKME: soft reset*/
334 cx22700_writereg (state, 0x00, 0x00); 328 cx22700_writereg (state, 0x00, 0x00);
335 329
336 cx22700_writereg (state, 0x0a, 0x00); /* open i2c bus switch */ 330 if (fe->ops->tuner_ops.set_params) {
337 state->config->pll_set(fe, p); 331 fe->ops->tuner_ops.set_params(fe, p);
338 cx22700_writereg (state, 0x0a, 0x01); /* close i2c bus switch */ 332 if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
333 }
334
339 cx22700_set_inversion (state, p->inversion); 335 cx22700_set_inversion (state, p->inversion);
340 cx22700_set_tps (state, &p->u.ofdm); 336 cx22700_set_tps (state, &p->u.ofdm);
341 cx22700_writereg (state, 0x37, 0x01); /* PAL loop filter off */ 337 cx22700_writereg (state, 0x37, 0x01); /* PAL loop filter off */
@@ -353,6 +349,17 @@ static int cx22700_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
353 return cx22700_get_tps (state, &p->u.ofdm); 349 return cx22700_get_tps (state, &p->u.ofdm);
354} 350}
355 351
352static int cx22700_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
353{
354 struct cx22700_state* state = fe->demodulator_priv;
355
356 if (enable) {
357 return cx22700_writereg(state, 0x0a, 0x00);
358 } else {
359 return cx22700_writereg(state, 0x0a, 0x01);
360 }
361}
362
356static int cx22700_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) 363static int cx22700_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings)
357{ 364{
358 fesettings->min_delay_ms = 150; 365 fesettings->min_delay_ms = 150;
@@ -413,6 +420,7 @@ static struct dvb_frontend_ops cx22700_ops = {
413 .release = cx22700_release, 420 .release = cx22700_release,
414 421
415 .init = cx22700_init, 422 .init = cx22700_init,
423 .i2c_gate_ctrl = cx22700_i2c_gate_ctrl,
416 424
417 .set_frontend = cx22700_set_frontend, 425 .set_frontend = cx22700_set_frontend,
418 .get_frontend = cx22700_get_frontend, 426 .get_frontend = cx22700_get_frontend,
diff --git a/drivers/media/dvb/frontends/cx22700.h b/drivers/media/dvb/frontends/cx22700.h
index c9145b45874b..dcd8979c1a15 100644
--- a/drivers/media/dvb/frontends/cx22700.h
+++ b/drivers/media/dvb/frontends/cx22700.h
@@ -29,10 +29,6 @@ struct cx22700_config
29{ 29{
30 /* the demodulator's i2c address */ 30 /* the demodulator's i2c address */
31 u8 demod_address; 31 u8 demod_address;
32
33 /* PLL maintenance */
34 int (*pll_init)(struct dvb_frontend* fe);
35 int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
36}; 32};
37 33
38extern struct dvb_frontend* cx22700_attach(const struct cx22700_config* config, 34extern struct dvb_frontend* cx22700_attach(const struct cx22700_config* config,