diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-26 18:49:34 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-31 15:26:37 +0400 |
commit | dba2b0c8120915f602c96af54f11147eb5ae9749 (patch) | |
tree | 8141c58655862e7fc90146204dc17bb68ce6df7c /drivers/media/dvb/frontends/ves1x93.c | |
parent | fd91f267d72858dc2f06cde756dc4d5658469c31 (diff) | |
download | linux-dba2b0c8120915f602c96af54f11147eb5ae9749.tar.xz |
[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.c | 24 |
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 { u8 *init_1x93_wtab; u8 tab_size; u8 demod_type; + u32 frequency; }; static int debug; @@ -384,8 +385,9 @@ static int ves1x93_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) return 0; } -static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) +static int ves1x93_set_frontend(struct dvb_frontend *fe) { + struct dtv_frontend_properties *p = &fe->dtv_property_cache; struct ves1x93_state* state = fe->demodulator_priv; if (fe->ops.tuner_ops.set_params) { @@ -393,22 +395,24 @@ static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); } ves1x93_set_inversion (state, p->inversion); - ves1x93_set_fec (state, p->u.qpsk.fec_inner); - ves1x93_set_symbolrate (state, p->u.qpsk.symbol_rate); + ves1x93_set_fec(state, p->fec_inner); + ves1x93_set_symbolrate(state, p->symbol_rate); state->inversion = p->inversion; + state->frequency = p->frequency; return 0; } -static int ves1x93_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) +static int ves1x93_get_frontend(struct dvb_frontend *fe, + struct dtv_frontend_properties *p) { struct ves1x93_state* state = fe->demodulator_priv; int afc; afc = ((int)((char)(ves1x93_readreg (state, 0x0a) << 1)))/2; - afc = (afc * (int)(p->u.qpsk.symbol_rate/1000/8))/16; + afc = (afc * (int)(p->symbol_rate/1000/8))/16; - p->frequency -= afc; + p->frequency = state->frequency - afc; /* * inversion indicator is only valid @@ -417,7 +421,7 @@ static int ves1x93_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par if (state->inversion == INVERSION_AUTO) p->inversion = (ves1x93_readreg (state, 0x0f) & 2) ? INVERSION_OFF : INVERSION_ON; - p->u.qpsk.fec_inner = ves1x93_get_fec (state); + p->fec_inner = ves1x93_get_fec(state); /* XXX FIXME: timing offset !! */ return 0; @@ -506,7 +510,7 @@ error: } static struct dvb_frontend_ops ves1x93_ops = { - + .delsys = { SYS_DVBS }, .info = { .name = "VLSI VES1x93 DVB-S", .type = FE_QPSK, @@ -529,8 +533,8 @@ static struct dvb_frontend_ops ves1x93_ops = { .sleep = ves1x93_sleep, .i2c_gate_ctrl = ves1x93_i2c_gate_ctrl, - .set_frontend_legacy = ves1x93_set_frontend, - .get_frontend_legacy = ves1x93_get_frontend, + .set_frontend = ves1x93_set_frontend, + .get_frontend = ves1x93_get_frontend, .read_status = ves1x93_read_status, .read_ber = ves1x93_read_ber, |