diff options
Diffstat (limited to 'drivers/media/dvb/frontends/ves1820.c')
-rw-r--r-- | drivers/media/dvb/frontends/ves1820.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c index 550a07a8a997..bb42b563c42d 100644 --- a/drivers/media/dvb/frontends/ves1820.c +++ b/drivers/media/dvb/frontends/ves1820.c | |||
@@ -205,25 +205,26 @@ static int ves1820_init(struct dvb_frontend* fe) | |||
205 | return 0; | 205 | return 0; |
206 | } | 206 | } |
207 | 207 | ||
208 | static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 208 | static int ves1820_set_parameters(struct dvb_frontend *fe) |
209 | { | 209 | { |
210 | struct dtv_frontend_properties *p = &fe->dtv_property_cache; | ||
210 | struct ves1820_state* state = fe->demodulator_priv; | 211 | struct ves1820_state* state = fe->demodulator_priv; |
211 | static const u8 reg0x00[] = { 0x00, 0x04, 0x08, 0x0c, 0x10 }; | 212 | static const u8 reg0x00[] = { 0x00, 0x04, 0x08, 0x0c, 0x10 }; |
212 | static const u8 reg0x01[] = { 140, 140, 106, 100, 92 }; | 213 | static const u8 reg0x01[] = { 140, 140, 106, 100, 92 }; |
213 | static const u8 reg0x05[] = { 135, 100, 70, 54, 38 }; | 214 | static const u8 reg0x05[] = { 135, 100, 70, 54, 38 }; |
214 | static const u8 reg0x08[] = { 162, 116, 67, 52, 35 }; | 215 | static const u8 reg0x08[] = { 162, 116, 67, 52, 35 }; |
215 | static const u8 reg0x09[] = { 145, 150, 106, 126, 107 }; | 216 | static const u8 reg0x09[] = { 145, 150, 106, 126, 107 }; |
216 | int real_qam = p->u.qam.modulation - QAM_16; | 217 | int real_qam = p->modulation - QAM_16; |
217 | 218 | ||
218 | if (real_qam < 0 || real_qam > 4) | 219 | if (real_qam < 0 || real_qam > 4) |
219 | return -EINVAL; | 220 | return -EINVAL; |
220 | 221 | ||
221 | if (fe->ops.tuner_ops.set_params) { | 222 | if (fe->ops.tuner_ops.set_params) { |
222 | fe->ops.tuner_ops.set_params(fe, p); | 223 | fe->ops.tuner_ops.set_params(fe); |
223 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); | 224 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); |
224 | } | 225 | } |
225 | 226 | ||
226 | ves1820_set_symbolrate(state, p->u.qam.symbol_rate); | 227 | ves1820_set_symbolrate(state, p->symbol_rate); |
227 | ves1820_writereg(state, 0x34, state->pwm); | 228 | ves1820_writereg(state, 0x34, state->pwm); |
228 | 229 | ||
229 | ves1820_writereg(state, 0x01, reg0x01[real_qam]); | 230 | ves1820_writereg(state, 0x01, reg0x01[real_qam]); |
@@ -309,8 +310,9 @@ static int ves1820_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
309 | return 0; | 310 | return 0; |
310 | } | 311 | } |
311 | 312 | ||
312 | static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 313 | static int ves1820_get_frontend(struct dvb_frontend *fe) |
313 | { | 314 | { |
315 | struct dtv_frontend_properties *p = &fe->dtv_property_cache; | ||
314 | struct ves1820_state* state = fe->demodulator_priv; | 316 | struct ves1820_state* state = fe->demodulator_priv; |
315 | int sync; | 317 | int sync; |
316 | s8 afc = 0; | 318 | s8 afc = 0; |
@@ -320,7 +322,7 @@ static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
320 | if (verbose) { | 322 | if (verbose) { |
321 | /* AFC only valid when carrier has been recovered */ | 323 | /* AFC only valid when carrier has been recovered */ |
322 | printk(sync & 2 ? "ves1820: AFC (%d) %dHz\n" : | 324 | printk(sync & 2 ? "ves1820: AFC (%d) %dHz\n" : |
323 | "ves1820: [AFC (%d) %dHz]\n", afc, -((s32) p->u.qam.symbol_rate * afc) >> 10); | 325 | "ves1820: [AFC (%d) %dHz]\n", afc, -((s32) p->symbol_rate * afc) >> 10); |
324 | } | 326 | } |
325 | 327 | ||
326 | if (!state->config->invert) { | 328 | if (!state->config->invert) { |
@@ -329,13 +331,13 @@ static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
329 | p->inversion = (!(state->reg0 & 0x20)) ? INVERSION_ON : INVERSION_OFF; | 331 | p->inversion = (!(state->reg0 & 0x20)) ? INVERSION_ON : INVERSION_OFF; |
330 | } | 332 | } |
331 | 333 | ||
332 | p->u.qam.modulation = ((state->reg0 >> 2) & 7) + QAM_16; | 334 | p->modulation = ((state->reg0 >> 2) & 7) + QAM_16; |
333 | 335 | ||
334 | p->u.qam.fec_inner = FEC_NONE; | 336 | p->fec_inner = FEC_NONE; |
335 | 337 | ||
336 | p->frequency = ((p->frequency + 31250) / 62500) * 62500; | 338 | p->frequency = ((p->frequency + 31250) / 62500) * 62500; |
337 | if (sync & 2) | 339 | if (sync & 2) |
338 | p->frequency -= ((s32) p->u.qam.symbol_rate * afc) >> 10; | 340 | p->frequency -= ((s32) p->symbol_rate * afc) >> 10; |
339 | 341 | ||
340 | return 0; | 342 | return 0; |
341 | } | 343 | } |
@@ -405,10 +407,9 @@ error: | |||
405 | } | 407 | } |
406 | 408 | ||
407 | static struct dvb_frontend_ops ves1820_ops = { | 409 | static struct dvb_frontend_ops ves1820_ops = { |
408 | 410 | .delsys = { SYS_DVBC_ANNEX_A }, | |
409 | .info = { | 411 | .info = { |
410 | .name = "VLSI VES1820 DVB-C", | 412 | .name = "VLSI VES1820 DVB-C", |
411 | .type = FE_QAM, | ||
412 | .frequency_stepsize = 62500, | 413 | .frequency_stepsize = 62500, |
413 | .frequency_min = 47000000, | 414 | .frequency_min = 47000000, |
414 | .frequency_max = 862000000, | 415 | .frequency_max = 862000000, |