aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/ves1820.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/frontends/ves1820.c')
-rw-r--r--drivers/media/dvb/frontends/ves1820.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c
index ad8647a3c85e..6bffe85c161c 100644
--- a/drivers/media/dvb/frontends/ves1820.c
+++ b/drivers/media/dvb/frontends/ves1820.c
@@ -35,7 +35,6 @@
35 35
36struct ves1820_state { 36struct ves1820_state {
37 struct i2c_adapter* i2c; 37 struct i2c_adapter* i2c;
38 struct dvb_frontend_ops ops;
39 /* configuration settings */ 38 /* configuration settings */
40 const struct ves1820_config* config; 39 const struct ves1820_config* config;
41 struct dvb_frontend frontend; 40 struct dvb_frontend frontend;
@@ -204,9 +203,6 @@ static int ves1820_init(struct dvb_frontend* fe)
204 203
205 ves1820_writereg(state, 0x34, state->pwm); 204 ves1820_writereg(state, 0x34, state->pwm);
206 205
207 if (state->config->pll_init)
208 state->config->pll_init(fe);
209
210 return 0; 206 return 0;
211} 207}
212 208
@@ -223,7 +219,11 @@ static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_p
223 if (real_qam < 0 || real_qam > 4) 219 if (real_qam < 0 || real_qam > 4)
224 return -EINVAL; 220 return -EINVAL;
225 221
226 state->config->pll_set(fe, p); 222 if (fe->ops.tuner_ops.set_params) {
223 fe->ops.tuner_ops.set_params(fe, p);
224 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
225 }
226
227 ves1820_set_symbolrate(state, p->u.qam.symbol_rate); 227 ves1820_set_symbolrate(state, p->u.qam.symbol_rate);
228 ves1820_writereg(state, 0x34, state->pwm); 228 ves1820_writereg(state, 0x34, state->pwm);
229 229
@@ -380,7 +380,6 @@ struct dvb_frontend* ves1820_attach(const struct ves1820_config* config,
380 goto error; 380 goto error;
381 381
382 /* setup the state */ 382 /* setup the state */
383 memcpy(&state->ops, &ves1820_ops, sizeof(struct dvb_frontend_ops));
384 state->reg0 = ves1820_inittab[0]; 383 state->reg0 = ves1820_inittab[0];
385 state->config = config; 384 state->config = config;
386 state->i2c = i2c; 385 state->i2c = i2c;
@@ -393,12 +392,12 @@ struct dvb_frontend* ves1820_attach(const struct ves1820_config* config,
393 if (verbose) 392 if (verbose)
394 printk("ves1820: pwm=0x%02x\n", state->pwm); 393 printk("ves1820: pwm=0x%02x\n", state->pwm);
395 394
396 state->ops.info.symbol_rate_min = (state->config->xin / 2) / 64; /* SACLK/64 == (XIN/2)/64 */
397 state->ops.info.symbol_rate_max = (state->config->xin / 2) / 4; /* SACLK/4 */
398
399 /* create dvb_frontend */ 395 /* create dvb_frontend */
400 state->frontend.ops = &state->ops; 396 memcpy(&state->frontend.ops, &ves1820_ops, sizeof(struct dvb_frontend_ops));
397 state->frontend.ops.info.symbol_rate_min = (state->config->xin / 2) / 64; /* SACLK/64 == (XIN/2)/64 */
398 state->frontend.ops.info.symbol_rate_max = (state->config->xin / 2) / 4; /* SACLK/4 */
401 state->frontend.demodulator_priv = state; 399 state->frontend.demodulator_priv = state;
400
402 return &state->frontend; 401 return &state->frontend;
403 402
404error: 403error: