Commit 4fa102d5 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] vp702x-fe: 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 531157b3
...@@ -135,9 +135,9 @@ static int vp702x_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_front ...@@ -135,9 +135,9 @@ static int vp702x_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_front
return 0; return 0;
} }
static int vp702x_fe_set_frontend(struct dvb_frontend* fe, static int vp702x_fe_set_frontend(struct dvb_frontend *fe)
struct dvb_frontend_parameters *fep)
{ {
struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
struct vp702x_fe_state *st = fe->demodulator_priv; struct vp702x_fe_state *st = fe->demodulator_priv;
struct vp702x_device_state *dst = st->d->priv; struct vp702x_device_state *dst = st->d->priv;
u32 freq = fep->frequency/1000; u32 freq = fep->frequency/1000;
...@@ -155,14 +155,14 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe, ...@@ -155,14 +155,14 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe,
cmd[1] = freq & 0xff; cmd[1] = freq & 0xff;
cmd[2] = 1; /* divrate == 4 -> frequencyRef[1] -> 1 here */ cmd[2] = 1; /* divrate == 4 -> frequencyRef[1] -> 1 here */
sr = (u64) (fep->u.qpsk.symbol_rate/1000) << 20; sr = (u64) (fep->symbol_rate/1000) << 20;
do_div(sr,88000); do_div(sr,88000);
cmd[3] = (sr >> 12) & 0xff; cmd[3] = (sr >> 12) & 0xff;
cmd[4] = (sr >> 4) & 0xff; cmd[4] = (sr >> 4) & 0xff;
cmd[5] = (sr << 4) & 0xf0; cmd[5] = (sr << 4) & 0xf0;
deb_fe("setting frontend to: %u -> %u (%x) LNB-based GHz, symbolrate: %d -> %lu (%lx)\n", deb_fe("setting frontend to: %u -> %u (%x) LNB-based GHz, symbolrate: %d -> %lu (%lx)\n",
fep->frequency,freq,freq, fep->u.qpsk.symbol_rate, fep->frequency, freq, freq, fep->symbol_rate,
(unsigned long) sr, (unsigned long) sr); (unsigned long) sr, (unsigned long) sr);
/* if (fep->inversion == INVERSION_ON) /* if (fep->inversion == INVERSION_ON)
...@@ -171,7 +171,7 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe, ...@@ -171,7 +171,7 @@ static int vp702x_fe_set_frontend(struct dvb_frontend* fe,
if (st->voltage == SEC_VOLTAGE_18) if (st->voltage == SEC_VOLTAGE_18)
cmd[6] |= 0x40; cmd[6] |= 0x40;
/* if (fep->u.qpsk.symbol_rate > 8000000) /* if (fep->symbol_rate > 8000000)
cmd[6] |= 0x20; cmd[6] |= 0x20;
if (fep->frequency < 1531000) if (fep->frequency < 1531000)
...@@ -212,7 +212,7 @@ static int vp702x_fe_sleep(struct dvb_frontend *fe) ...@@ -212,7 +212,7 @@ static int vp702x_fe_sleep(struct dvb_frontend *fe)
} }
static int vp702x_fe_get_frontend(struct dvb_frontend* fe, static int vp702x_fe_get_frontend(struct dvb_frontend* fe,
struct dvb_frontend_parameters *fep) struct dtv_frontend_properties *fep)
{ {
deb_fe("%s\n",__func__); deb_fe("%s\n",__func__);
return 0; return 0;
...@@ -350,6 +350,7 @@ struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d) ...@@ -350,6 +350,7 @@ struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d)
static struct dvb_frontend_ops vp702x_fe_ops = { static struct dvb_frontend_ops vp702x_fe_ops = {
.delsys = { SYS_DVBS },
.info = { .info = {
.name = "Twinhan DST-like frontend (VP7021/VP7020) DVB-S", .name = "Twinhan DST-like frontend (VP7021/VP7020) DVB-S",
.type = FE_QPSK, .type = FE_QPSK,
...@@ -370,8 +371,8 @@ static struct dvb_frontend_ops vp702x_fe_ops = { ...@@ -370,8 +371,8 @@ static struct dvb_frontend_ops vp702x_fe_ops = {
.init = vp702x_fe_init, .init = vp702x_fe_init,
.sleep = vp702x_fe_sleep, .sleep = vp702x_fe_sleep,
.set_frontend_legacy = vp702x_fe_set_frontend, .set_frontend = vp702x_fe_set_frontend,
.get_frontend_legacy = vp702x_fe_get_frontend, .get_frontend = vp702x_fe_get_frontend,
.get_tune_settings = vp702x_fe_get_tune_settings, .get_tune_settings = vp702x_fe_get_tune_settings,
.read_status = vp702x_fe_read_status, .read_status = vp702x_fe_read_status,
......
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