Skip to content

Commit 7830bba

Browse files
author
Mauro Carvalho Chehab
committed
[media] cinergyT2-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: Mauro Carvalho Chehab <[email protected]>
1 parent f9e5451 commit 7830bba

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

drivers/media/dvb/dvb-usb/cinergyT2-fe.c

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,8 @@
4040
* We replace errornous fields by default TPS fields (the ones with value 0).
4141
*/
4242

43-
static uint16_t compute_tps(struct dvb_frontend_parameters *p)
43+
static uint16_t compute_tps(struct dtv_frontend_properties *op)
4444
{
45-
struct dvb_ofdm_parameters *op = &p->u.ofdm;
4645
uint16_t tps = 0;
4746

4847
switch (op->code_rate_HP) {
@@ -83,7 +82,7 @@ static uint16_t compute_tps(struct dvb_frontend_parameters *p)
8382
/* tps |= (0 << 4) */;
8483
}
8584

86-
switch (op->constellation) {
85+
switch (op->modulation) {
8786
case QAM_16:
8887
tps |= (1 << 13);
8988
break;
@@ -119,7 +118,7 @@ static uint16_t compute_tps(struct dvb_frontend_parameters *p)
119118
/* tps |= (0 << 2) */;
120119
}
121120

122-
switch (op->hierarchy_information) {
121+
switch (op->hierarchy) {
123122
case HIERARCHY_1:
124123
tps |= (1 << 10);
125124
break;
@@ -263,9 +262,9 @@ static int cinergyt2_fe_get_tune_settings(struct dvb_frontend *fe,
263262
return 0;
264263
}
265264

266-
static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe,
267-
struct dvb_frontend_parameters *fep)
265+
static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe)
268266
{
267+
struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
269268
struct cinergyt2_fe_state *state = fe->demodulator_priv;
270269
struct dvbt_set_parameters_msg param;
271270
char result[2];
@@ -274,9 +273,20 @@ static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe,
274273
param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;
275274
param.tps = cpu_to_le16(compute_tps(fep));
276275
param.freq = cpu_to_le32(fep->frequency / 1000);
277-
param.bandwidth = 8 - fep->u.ofdm.bandwidth - BANDWIDTH_8_MHZ;
278276
param.flags = 0;
279277

278+
switch (fep->bandwidth_hz) {
279+
case 8000000:
280+
param.bandwidth = 0;
281+
break;
282+
case 7000000:
283+
param.bandwidth = 1;
284+
break;
285+
case 6000000:
286+
param.bandwidth = 2;
287+
break;
288+
}
289+
280290
err = dvb_usb_generic_rw(state->d,
281291
(char *)&param, sizeof(param),
282292
result, sizeof(result), 0);
@@ -287,7 +297,7 @@ static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe,
287297
}
288298

289299
static int cinergyt2_fe_get_frontend(struct dvb_frontend *fe,
290-
struct dvb_frontend_parameters *fep)
300+
struct dtv_frontend_properties *fep)
291301
{
292302
return 0;
293303
}
@@ -316,6 +326,7 @@ struct dvb_frontend *cinergyt2_fe_attach(struct dvb_usb_device *d)
316326

317327

318328
static struct dvb_frontend_ops cinergyt2_fe_ops = {
329+
.delsys = { SYS_DVBT },
319330
.info = {
320331
.name = DRIVER_NAME,
321332
.type = FE_OFDM,
@@ -340,8 +351,8 @@ static struct dvb_frontend_ops cinergyt2_fe_ops = {
340351
.init = cinergyt2_fe_init,
341352
.sleep = cinergyt2_fe_sleep,
342353

343-
.set_frontend_legacy = cinergyt2_fe_set_frontend,
344-
.get_frontend_legacy = cinergyt2_fe_get_frontend,
354+
.set_frontend = cinergyt2_fe_set_frontend,
355+
.get_frontend = cinergyt2_fe_get_frontend,
345356
.get_tune_settings = cinergyt2_fe_get_tune_settings,
346357

347358
.read_status = cinergyt2_fe_read_status,

0 commit comments

Comments
 (0)