aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/ves1x93.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-12-26 09:49:34 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-31 06:26:37 -0500
commitdba2b0c8120915f602c96af54f11147eb5ae9749 (patch)
tree8141c58655862e7fc90146204dc17bb68ce6df7c /drivers/media/dvb/frontends/ves1x93.c
parentfd91f267d72858dc2f06cde756dc4d5658469c31 (diff)
[media] vez1x93: convert set_fontend to use DVBv5 parameters
Instead of using dvb_frontend_parameters struct, that were designed for a subset of the supported standards, use the DVBv5 cache information. Also, fill the supported delivery systems at dvb_frontend_ops struct. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/ves1x93.c')
-rw-r--r--drivers/media/dvb/frontends/ves1x93.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/media/dvb/frontends/ves1x93.c b/drivers/media/dvb/frontends/ves1x93.c
index a95619e61fb2..54c70b07d815 100644
--- a/drivers/media/dvb/frontends/ves1x93.c
+++ b/drivers/media/dvb/frontends/ves1x93.c
@@ -46,6 +46,7 @@ struct ves1x93_state {
46 u8 *init_1x93_wtab; 46 u8 *init_1x93_wtab;
47 u8 tab_size; 47 u8 tab_size;
48 u8 demod_type; 48 u8 demod_type;
49 u32 frequency;
49}; 50};
50 51
51static int debug; 52static int debug;
@@ -384,8 +385,9 @@ static int ves1x93_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
384 return 0; 385 return 0;
385} 386}
386 387
387static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 388static int ves1x93_set_frontend(struct dvb_frontend *fe)
388{ 389{
390 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
389 struct ves1x93_state* state = fe->demodulator_priv; 391 struct ves1x93_state* state = fe->demodulator_priv;
390 392
391 if (fe->ops.tuner_ops.set_params) { 393 if (fe->ops.tuner_ops.set_params) {
@@ -393,22 +395,24 @@ static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
393 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); 395 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
394 } 396 }
395 ves1x93_set_inversion (state, p->inversion); 397 ves1x93_set_inversion (state, p->inversion);
396 ves1x93_set_fec (state, p->u.qpsk.fec_inner); 398 ves1x93_set_fec(state, p->fec_inner);
397 ves1x93_set_symbolrate (state, p->u.qpsk.symbol_rate); 399 ves1x93_set_symbolrate(state, p->symbol_rate);
398 state->inversion = p->inversion; 400 state->inversion = p->inversion;
401 state->frequency = p->frequency;
399 402
400 return 0; 403 return 0;
401} 404}
402 405
403static int ves1x93_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 406static int ves1x93_get_frontend(struct dvb_frontend *fe,
407 struct dtv_frontend_properties *p)
404{ 408{
405 struct ves1x93_state* state = fe->demodulator_priv; 409 struct ves1x93_state* state = fe->demodulator_priv;
406 int afc; 410 int afc;
407 411
408 afc = ((int)((char)(ves1x93_readreg (state, 0x0a) << 1)))/2; 412 afc = ((int)((char)(ves1x93_readreg (state, 0x0a) << 1)))/2;
409 afc = (afc * (int)(p->u.qpsk.symbol_rate/1000/8))/16; 413 afc = (afc * (int)(p->symbol_rate/1000/8))/16;
410 414
411 p->frequency -= afc; 415 p->frequency = state->frequency - afc;
412 416
413 /* 417 /*
414 * inversion indicator is only valid 418 * inversion indicator is only valid
@@ -417,7 +421,7 @@ static int ves1x93_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
417 if (state->inversion == INVERSION_AUTO) 421 if (state->inversion == INVERSION_AUTO)
418 p->inversion = (ves1x93_readreg (state, 0x0f) & 2) ? 422 p->inversion = (ves1x93_readreg (state, 0x0f) & 2) ?
419 INVERSION_OFF : INVERSION_ON; 423 INVERSION_OFF : INVERSION_ON;
420 p->u.qpsk.fec_inner = ves1x93_get_fec (state); 424 p->fec_inner = ves1x93_get_fec(state);
421 /* XXX FIXME: timing offset !! */ 425 /* XXX FIXME: timing offset !! */
422 426
423 return 0; 427 return 0;
@@ -506,7 +510,7 @@ error:
506} 510}
507 511
508static struct dvb_frontend_ops ves1x93_ops = { 512static struct dvb_frontend_ops ves1x93_ops = {
509 513 .delsys = { SYS_DVBS },
510 .info = { 514 .info = {
511 .name = "VLSI VES1x93 DVB-S", 515 .name = "VLSI VES1x93 DVB-S",
512 .type = FE_QPSK, 516 .type = FE_QPSK,
@@ -529,8 +533,8 @@ static struct dvb_frontend_ops ves1x93_ops = {
529 .sleep = ves1x93_sleep, 533 .sleep = ves1x93_sleep,
530 .i2c_gate_ctrl = ves1x93_i2c_gate_ctrl, 534 .i2c_gate_ctrl = ves1x93_i2c_gate_ctrl,
531 535
532 .set_frontend_legacy = ves1x93_set_frontend, 536 .set_frontend = ves1x93_set_frontend,
533 .get_frontend_legacy = ves1x93_get_frontend, 537 .get_frontend = ves1x93_get_frontend,
534 538
535 .read_status = ves1x93_read_status, 539 .read_status = ves1x93_read_status,
536 .read_ber = ves1x93_read_ber, 540 .read_ber = ves1x93_read_ber,