Commit 9fe33018 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] ds3000: 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: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ed5452a2
...@@ -934,20 +934,6 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config, ...@@ -934,20 +934,6 @@ struct dvb_frontend *ds3000_attach(const struct ds3000_config *config,
} }
EXPORT_SYMBOL(ds3000_attach); EXPORT_SYMBOL(ds3000_attach);
static int ds3000_set_property(struct dvb_frontend *fe,
struct dtv_property *tvp)
{
dprintk("%s(..)\n", __func__);
return 0;
}
static int ds3000_get_property(struct dvb_frontend *fe,
struct dtv_property *tvp)
{
dprintk("%s(..)\n", __func__);
return 0;
}
static int ds3000_set_carrier_offset(struct dvb_frontend *fe, static int ds3000_set_carrier_offset(struct dvb_frontend *fe,
s32 carrier_offset_khz) s32 carrier_offset_khz)
{ {
...@@ -967,8 +953,7 @@ static int ds3000_set_carrier_offset(struct dvb_frontend *fe, ...@@ -967,8 +953,7 @@ static int ds3000_set_carrier_offset(struct dvb_frontend *fe,
return 0; return 0;
} }
static int ds3000_set_frontend(struct dvb_frontend *fe, static int ds3000_set_frontend(struct dvb_frontend *fe)
struct dvb_frontend_parameters *p)
{ {
struct ds3000_state *state = fe->demodulator_priv; struct ds3000_state *state = fe->demodulator_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache; struct dtv_frontend_properties *c = &fe->dtv_property_cache;
...@@ -994,15 +979,15 @@ static int ds3000_set_frontend(struct dvb_frontend *fe, ...@@ -994,15 +979,15 @@ static int ds3000_set_frontend(struct dvb_frontend *fe,
div4 = 0; div4 = 0;
/* calculate and set freq divider */ /* calculate and set freq divider */
if (p->frequency < 1146000) { if (c->frequency < 1146000) {
ds3000_tuner_writereg(state, 0x10, 0x11); ds3000_tuner_writereg(state, 0x10, 0x11);
div4 = 1; div4 = 1;
ndiv = ((p->frequency * (6 + 8) * 4) + ndiv = ((c->frequency * (6 + 8) * 4) +
(DS3000_XTAL_FREQ / 2)) / (DS3000_XTAL_FREQ / 2)) /
DS3000_XTAL_FREQ - 1024; DS3000_XTAL_FREQ - 1024;
} else { } else {
ds3000_tuner_writereg(state, 0x10, 0x01); ds3000_tuner_writereg(state, 0x10, 0x01);
ndiv = ((p->frequency * (6 + 8) * 2) + ndiv = ((c->frequency * (6 + 8) * 2) +
(DS3000_XTAL_FREQ / 2)) / (DS3000_XTAL_FREQ / 2)) /
DS3000_XTAL_FREQ - 1024; DS3000_XTAL_FREQ - 1024;
} }
...@@ -1101,7 +1086,7 @@ static int ds3000_set_frontend(struct dvb_frontend *fe, ...@@ -1101,7 +1086,7 @@ static int ds3000_set_frontend(struct dvb_frontend *fe,
msleep(60); msleep(60);
offset_khz = (ndiv - ndiv % 2 + 1024) * DS3000_XTAL_FREQ offset_khz = (ndiv - ndiv % 2 + 1024) * DS3000_XTAL_FREQ
/ (6 + 8) / (div4 + 1) / 2 - p->frequency; / (6 + 8) / (div4 + 1) / 2 - c->frequency;
/* ds3000 global reset */ /* ds3000 global reset */
ds3000_writereg(state, 0x07, 0x80); ds3000_writereg(state, 0x07, 0x80);
...@@ -1226,7 +1211,7 @@ static int ds3000_tune(struct dvb_frontend *fe, ...@@ -1226,7 +1211,7 @@ static int ds3000_tune(struct dvb_frontend *fe,
fe_status_t *status) fe_status_t *status)
{ {
if (p) { if (p) {
int ret = ds3000_set_frontend(fe, p); int ret = ds3000_set_frontend(fe);
if (ret) if (ret)
return ret; return ret;
} }
...@@ -1279,7 +1264,7 @@ static int ds3000_sleep(struct dvb_frontend *fe) ...@@ -1279,7 +1264,7 @@ static int ds3000_sleep(struct dvb_frontend *fe)
} }
static struct dvb_frontend_ops ds3000_ops = { static struct dvb_frontend_ops ds3000_ops = {
.delsys = { SYS_DVBS, SYS_DVBS2},
.info = { .info = {
.name = "Montage Technology DS3000/TS2020", .name = "Montage Technology DS3000/TS2020",
.type = FE_QPSK, .type = FE_QPSK,
...@@ -1312,9 +1297,7 @@ static struct dvb_frontend_ops ds3000_ops = { ...@@ -1312,9 +1297,7 @@ static struct dvb_frontend_ops ds3000_ops = {
.diseqc_send_burst = ds3000_diseqc_send_burst, .diseqc_send_burst = ds3000_diseqc_send_burst,
.get_frontend_algo = ds3000_get_algo, .get_frontend_algo = ds3000_get_algo,
.set_property = ds3000_set_property, .set_frontend = ds3000_set_frontend,
.get_property = ds3000_get_property,
.set_frontend_legacy = ds3000_set_frontend,
.tune = ds3000_tune, .tune = ds3000_tune,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment