Commit adcc8f0e authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] dtt200u-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 7830bbaf
...@@ -16,7 +16,7 @@ struct dtt200u_fe_state { ...@@ -16,7 +16,7 @@ struct dtt200u_fe_state {
fe_status_t stat; fe_status_t stat;
struct dvb_frontend_parameters fep; struct dtv_frontend_properties fep;
struct dvb_frontend frontend; struct dvb_frontend frontend;
}; };
...@@ -100,22 +100,27 @@ static int dtt200u_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_fron ...@@ -100,22 +100,27 @@ static int dtt200u_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_fron
return 0; return 0;
} }
static int dtt200u_fe_set_frontend(struct dvb_frontend* fe, static int dtt200u_fe_set_frontend(struct dvb_frontend *fe)
struct dvb_frontend_parameters *fep)
{ {
struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
struct dtt200u_fe_state *state = fe->demodulator_priv; struct dtt200u_fe_state *state = fe->demodulator_priv;
int i; int i;
fe_status_t st; fe_status_t st;
u16 freq = fep->frequency / 250000; u16 freq = fep->frequency / 250000;
u8 bwbuf[2] = { SET_BANDWIDTH, 0 },freqbuf[3] = { SET_RF_FREQ, 0, 0 }; u8 bwbuf[2] = { SET_BANDWIDTH, 0 },freqbuf[3] = { SET_RF_FREQ, 0, 0 };
switch (fep->u.ofdm.bandwidth) { switch (fep->bandwidth_hz) {
case BANDWIDTH_8_MHZ: bwbuf[1] = 8; break; case 8000000:
case BANDWIDTH_7_MHZ: bwbuf[1] = 7; break; bwbuf[1] = 8;
case BANDWIDTH_6_MHZ: bwbuf[1] = 6; break; break;
case BANDWIDTH_AUTO: return -EOPNOTSUPP; case 7000000:
default: bwbuf[1] = 7;
return -EINVAL; break;
case 6000000:
bwbuf[1] = 6;
break;
default:
return -EINVAL;
} }
dvb_usb_generic_write(state->d,bwbuf,2); dvb_usb_generic_write(state->d,bwbuf,2);
...@@ -135,10 +140,10 @@ static int dtt200u_fe_set_frontend(struct dvb_frontend* fe, ...@@ -135,10 +140,10 @@ static int dtt200u_fe_set_frontend(struct dvb_frontend* fe,
} }
static int dtt200u_fe_get_frontend(struct dvb_frontend* fe, static int dtt200u_fe_get_frontend(struct dvb_frontend* fe,
struct dvb_frontend_parameters *fep) struct dtv_frontend_properties *fep)
{ {
struct dtt200u_fe_state *state = fe->demodulator_priv; struct dtt200u_fe_state *state = fe->demodulator_priv;
memcpy(fep,&state->fep,sizeof(struct dvb_frontend_parameters)); memcpy(fep, &state->fep, sizeof(struct dtv_frontend_properties));
return 0; return 0;
} }
...@@ -172,6 +177,7 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d) ...@@ -172,6 +177,7 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d)
} }
static struct dvb_frontend_ops dtt200u_fe_ops = { static struct dvb_frontend_ops dtt200u_fe_ops = {
.delsys = { SYS_DVBT },
.info = { .info = {
.name = "WideView USB DVB-T", .name = "WideView USB DVB-T",
.type = FE_OFDM, .type = FE_OFDM,
...@@ -193,8 +199,8 @@ static struct dvb_frontend_ops dtt200u_fe_ops = { ...@@ -193,8 +199,8 @@ static struct dvb_frontend_ops dtt200u_fe_ops = {
.init = dtt200u_fe_init, .init = dtt200u_fe_init,
.sleep = dtt200u_fe_sleep, .sleep = dtt200u_fe_sleep,
.set_frontend_legacy = dtt200u_fe_set_frontend, .set_frontend = dtt200u_fe_set_frontend,
.get_frontend_legacy = dtt200u_fe_get_frontend, .get_frontend = dtt200u_fe_get_frontend,
.get_tune_settings = dtt200u_fe_get_tune_settings, .get_tune_settings = dtt200u_fe_get_tune_settings,
.read_status = dtt200u_fe_read_status, .read_status = dtt200u_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