diff options
author | Andrew de Quincey <adq_dvb@lidskialf.net> | 2006-04-18 16:47:11 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 00:58:54 -0400 |
commit | 605ee41c432e550a4e6a4f6fd82013b2989e36a3 (patch) | |
tree | c7979943fb4649618ccceebd3b343fd5cd4b8743 | |
parent | 638a3fba39748b63bdfa391bd65144e487a02e3c (diff) |
V4L/DVB (3867): Convert nxt6000 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>
-rw-r--r-- | drivers/media/dvb/frontends/nxt6000.c | 25 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/nxt6000.h | 4 |
2 files changed, 16 insertions, 13 deletions
diff --git a/drivers/media/dvb/frontends/nxt6000.c b/drivers/media/dvb/frontends/nxt6000.c index a16eeba0020d..bca83266ae8b 100644 --- a/drivers/media/dvb/frontends/nxt6000.c +++ b/drivers/media/dvb/frontends/nxt6000.c | |||
@@ -207,12 +207,6 @@ static void nxt6000_setup(struct dvb_frontend* fe) | |||
207 | nxt6000_writereg(state, SUB_DIAG_MODE_SEL, 0); | 207 | nxt6000_writereg(state, SUB_DIAG_MODE_SEL, 0); |
208 | 208 | ||
209 | nxt6000_writereg(state, TS_FORMAT, 0); | 209 | nxt6000_writereg(state, TS_FORMAT, 0); |
210 | |||
211 | if (state->config->pll_init) { | ||
212 | nxt6000_writereg(state, ENABLE_TUNER_IIC, 0x01); /* open i2c bus switch */ | ||
213 | state->config->pll_init(fe); | ||
214 | nxt6000_writereg(state, ENABLE_TUNER_IIC, 0x00); /* close i2c bus switch */ | ||
215 | } | ||
216 | } | 210 | } |
217 | 211 | ||
218 | static void nxt6000_dump_status(struct nxt6000_state *state) | 212 | static void nxt6000_dump_status(struct nxt6000_state *state) |
@@ -469,9 +463,10 @@ static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
469 | struct nxt6000_state* state = fe->demodulator_priv; | 463 | struct nxt6000_state* state = fe->demodulator_priv; |
470 | int result; | 464 | int result; |
471 | 465 | ||
472 | nxt6000_writereg(state, ENABLE_TUNER_IIC, 0x01); /* open i2c bus switch */ | 466 | if (fe->ops->tuner_ops.set_params) { |
473 | state->config->pll_set(fe, param); | 467 | fe->ops->tuner_ops.set_params(fe, param); |
474 | nxt6000_writereg(state, ENABLE_TUNER_IIC, 0x00); /* close i2c bus switch */ | 468 | if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0); |
469 | } | ||
475 | 470 | ||
476 | if ((result = nxt6000_set_bandwidth(state, param->u.ofdm.bandwidth)) < 0) | 471 | if ((result = nxt6000_set_bandwidth(state, param->u.ofdm.bandwidth)) < 0) |
477 | return result; | 472 | return result; |
@@ -532,6 +527,17 @@ static int nxt6000_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_fron | |||
532 | return 0; | 527 | return 0; |
533 | } | 528 | } |
534 | 529 | ||
530 | static int nxt6000_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) | ||
531 | { | ||
532 | struct nxt6000_state* state = fe->demodulator_priv; | ||
533 | |||
534 | if (enable) { | ||
535 | return nxt6000_writereg(state, ENABLE_TUNER_IIC, 0x01); | ||
536 | } else { | ||
537 | return nxt6000_writereg(state, ENABLE_TUNER_IIC, 0x00); | ||
538 | } | ||
539 | } | ||
540 | |||
535 | static struct dvb_frontend_ops nxt6000_ops; | 541 | static struct dvb_frontend_ops nxt6000_ops; |
536 | 542 | ||
537 | struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config, | 543 | struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config, |
@@ -584,6 +590,7 @@ static struct dvb_frontend_ops nxt6000_ops = { | |||
584 | .release = nxt6000_release, | 590 | .release = nxt6000_release, |
585 | 591 | ||
586 | .init = nxt6000_init, | 592 | .init = nxt6000_init, |
593 | .i2c_gate_ctrl = nxt6000_i2c_gate_ctrl, | ||
587 | 594 | ||
588 | .get_tune_settings = nxt6000_fe_get_tune_settings, | 595 | .get_tune_settings = nxt6000_fe_get_tune_settings, |
589 | 596 | ||
diff --git a/drivers/media/dvb/frontends/nxt6000.h b/drivers/media/dvb/frontends/nxt6000.h index b7d9bead3002..117031d11708 100644 --- a/drivers/media/dvb/frontends/nxt6000.h +++ b/drivers/media/dvb/frontends/nxt6000.h | |||
@@ -31,10 +31,6 @@ struct nxt6000_config | |||
31 | 31 | ||
32 | /* should clock inversion be used? */ | 32 | /* should clock inversion be used? */ |
33 | u8 clock_inversion:1; | 33 | u8 clock_inversion:1; |
34 | |||
35 | /* PLL maintenance */ | ||
36 | int (*pll_init)(struct dvb_frontend* fe); | ||
37 | int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); | ||
38 | }; | 34 | }; |
39 | 35 | ||
40 | extern struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config, | 36 | extern struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config, |