V4L/DVB (3848): Convert cx22702 to refactored tuner code
authorAndrew de Quincey <adq_dvb@lidskialf.net>
Tue, 18 Apr 2006 20:47:09 +0000 (17:47 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 25 Jun 2006 04:58:34 +0000 (01:58 -0300)
Convert to tuner_ops calls.
Remove pll function pointers from structure.
Remove unneeded tuner calls.
Add i2c gate control function.
Remove dvb-pll support - done elsewhere now.

Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/dvb/frontends/cx22702.c
drivers/media/dvb/frontends/cx22702.h

index 0fc899f81c5e9be0a16b1f263a09465fc3adeb96..a129fc9cba30f12f4f708645d9340476da3a1408 100644 (file)
@@ -211,22 +211,10 @@ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_paramet
        u8 val;
        struct cx22702_state* state = fe->demodulator_priv;
 
-       /* set PLL */
-       cx22702_i2c_gate_ctrl(fe, 1);
-       if (state->config->pll_set) {
-               state->config->pll_set(fe, p);
-       } else if (state->config->pll_desc) {
-               u8 pllbuf[4];
-               struct i2c_msg msg = { .addr = state->config->pll_address,
-                                      .buf = pllbuf, .len = 4 };
-               dvb_pll_configure(state->config->pll_desc, pllbuf,
-                                 p->frequency,
-                                 p->u.ofdm.bandwidth);
-               i2c_transfer(state->i2c, &msg, 1);
-       } else {
-               BUG();
+       if (fe->ops->tuner_ops.set_params) {
+               fe->ops->tuner_ops.set_params(fe, p);
+               if (fe->ops->i2c_gate_ctrl) fe->ops->i2c_gate_ctrl(fe, 0);
        }
-       cx22702_i2c_gate_ctrl(fe, 0);
 
        /* set inversion */
        cx22702_set_inversion (state, p->inversion);
@@ -358,10 +346,6 @@ static int cx22702_init (struct dvb_frontend* fe)
 
        cx22702_writereg (state, 0xf8, (state->config->output_mode << 1) & 0x02);
 
-       /* init PLL */
-       if (state->config->pll_init)
-               state->config->pll_init(fe);
-
        cx22702_i2c_gate_ctrl(fe, 0);
 
        return 0;
@@ -530,6 +514,7 @@ static struct dvb_frontend_ops cx22702_ops = {
        .release = cx22702_release,
 
        .init = cx22702_init,
+       .i2c_gate_ctrl = cx22702_i2c_gate_ctrl,
 
        .set_frontend = cx22702_set_tps,
        .get_frontend = cx22702_get_frontend,
@@ -540,7 +525,6 @@ static struct dvb_frontend_ops cx22702_ops = {
        .read_signal_strength = cx22702_read_signal_strength,
        .read_snr = cx22702_read_snr,
        .read_ucblocks = cx22702_read_ucblocks,
-       .i2c_gate_ctrl = cx22702_i2c_gate_ctrl,
 };
 
 module_param(debug, int, 0644);
index 5633976a58f19b9e90cf5b566510c4c481df6ead..7f2f241e5d4485985cfe0c0c23ddafd489e8add5 100644 (file)
@@ -39,13 +39,6 @@ struct cx22702_config
 #define CX22702_PARALLEL_OUTPUT 0
 #define CX22702_SERIAL_OUTPUT   1
        u8 output_mode;
-
-       /* PLL maintenance */
-       u8 pll_address;
-       struct dvb_pll_desc *pll_desc;
-
-       int (*pll_init)(struct dvb_frontend* fe);
-       int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
 };
 
 extern struct dvb_frontend* cx22702_attach(const struct cx22702_config* config,