Skip to content

Commit

Permalink
[media] ttusb-dec: convert set_fontend to use DVBv5 parameters
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mauro Carvalho Chehab committed Dec 31, 2011
1 parent 15115c1 commit f159451
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions drivers/media/dvb/ttusb-dec/ttusbdecfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ static int ttusbdecfe_dvbt_read_status(struct dvb_frontend *fe,
return 0;
}

static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv;
u8 b[] = { 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x00,
Expand All @@ -113,8 +114,9 @@ static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe,
return 0;
}

static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv;

u8 b[] = { 0x00, 0x00, 0x00, 0x01,
Expand All @@ -135,7 +137,7 @@ static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend* fe, struct dvb_fron
freq = htonl(p->frequency +
(state->hi_band ? LOF_HI : LOF_LO));
memcpy(&b[4], &freq, sizeof(u32));
sym_rate = htonl(p->u.qam.symbol_rate);
sym_rate = htonl(p->symbol_rate);
memcpy(&b[12], &sym_rate, sizeof(u32));
band = htonl(state->hi_band ? LOF_HI : LOF_LO);
memcpy(&b[24], &band, sizeof(u32));
Expand Down Expand Up @@ -241,7 +243,7 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf
}

static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {

.delsys = { SYS_DVBT },
.info = {
.name = "TechnoTrend/Hauppauge DEC2000-t Frontend",
.type = FE_OFDM,
Expand All @@ -257,15 +259,15 @@ static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = {

.release = ttusbdecfe_release,

.set_frontend_legacy = ttusbdecfe_dvbt_set_frontend,
.set_frontend = ttusbdecfe_dvbt_set_frontend,

.get_tune_settings = ttusbdecfe_dvbt_get_tune_settings,

.read_status = ttusbdecfe_dvbt_read_status,
};

static struct dvb_frontend_ops ttusbdecfe_dvbs_ops = {

.delsys = { SYS_DVBS },
.info = {
.name = "TechnoTrend/Hauppauge DEC3000-s Frontend",
.type = FE_QPSK,
Expand All @@ -281,7 +283,7 @@ static struct dvb_frontend_ops ttusbdecfe_dvbs_ops = {

.release = ttusbdecfe_release,

.set_frontend_legacy = ttusbdecfe_dvbs_set_frontend,
.set_frontend = ttusbdecfe_dvbs_set_frontend,

.read_status = ttusbdecfe_dvbs_read_status,

Expand Down

0 comments on commit f159451

Please sign in to comment.