linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / media / dvb / frontends / cx24110.c
index ce3c739..d15d32c 100644 (file)
@@ -36,6 +36,8 @@ struct cx24110_state {
 
        struct i2c_adapter* i2c;
 
+       struct dvb_frontend_ops ops;
+
        const struct cx24110_config* config;
 
        struct dvb_frontend frontend;
@@ -248,7 +250,7 @@ static int cx24110_set_symbolrate (struct cx24110_state* state, u32 srate)
        static const u32 bands[]={5000000UL,15000000UL,90999000UL/2};
        int i;
 
-       dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate);
+dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate);
        if (srate>90999000UL/2)
                srate=90999000UL/2;
        if (srate<500000)
@@ -364,6 +366,8 @@ static int cx24110_initfe(struct dvb_frontend* fe)
                cx24110_writereg(state, cx24110_regdata[i].reg, cx24110_regdata[i].data);
        };
 
+       if (state->config->pll_init) state->config->pll_init(fe);
+
        return 0;
 }
 
@@ -414,9 +418,6 @@ static int cx24110_send_diseqc_msg(struct dvb_frontend* fe,
        struct cx24110_state *state = fe->demodulator_priv;
        unsigned long timeout;
 
-       if (cmd->msg_len < 3 || cmd->msg_len > 6)
-               return -EINVAL;  /* not implemented */
-
        for (i = 0; i < cmd->msg_len; i++)
                cx24110_writereg(state, 0x79 + i, cmd->msg[i]);
 
@@ -535,12 +536,7 @@ static int cx24110_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
 {
        struct cx24110_state *state = fe->demodulator_priv;
 
-
-       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);
-       }
-
+       state->config->pll_set(fe, p);
        cx24110_set_inversion (state, p->inversion);
        cx24110_set_fec (state, p->u.qpsk.fec_inner);
        cx24110_set_symbolrate (state, p->u.qpsk.symbol_rate);
@@ -604,6 +600,7 @@ struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
        /* setup the state */
        state->config = config;
        state->i2c = i2c;
+       memcpy(&state->ops, &cx24110_ops, sizeof(struct dvb_frontend_ops));
        state->lastber = 0;
        state->lastbler = 0;
        state->lastesn0 = 0;
@@ -613,7 +610,7 @@ struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
        if ((ret != 0x5a) && (ret != 0x69)) goto error;
 
        /* create dvb_frontend */
-       memcpy(&state->frontend.ops, &cx24110_ops, sizeof(struct dvb_frontend_ops));
+       state->frontend.ops = &state->ops;
        state->frontend.demodulator_priv = state;
        return &state->frontend;