aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/cinergyT2-fe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb/cinergyT2-fe.c')
-rw-r--r--drivers/media/dvb/dvb-usb/cinergyT2-fe.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/media/dvb/dvb-usb/cinergyT2-fe.c b/drivers/media/dvb/dvb-usb/cinergyT2-fe.c
index 9cd51ac12076..8a57ed8272de 100644
--- a/drivers/media/dvb/dvb-usb/cinergyT2-fe.c
+++ b/drivers/media/dvb/dvb-usb/cinergyT2-fe.c
@@ -40,9 +40,8 @@
40 * We replace errornous fields by default TPS fields (the ones with value 0). 40 * We replace errornous fields by default TPS fields (the ones with value 0).
41 */ 41 */
42 42
43static uint16_t compute_tps(struct dvb_frontend_parameters *p) 43static uint16_t compute_tps(struct dtv_frontend_properties *op)
44{ 44{
45 struct dvb_ofdm_parameters *op = &p->u.ofdm;
46 uint16_t tps = 0; 45 uint16_t tps = 0;
47 46
48 switch (op->code_rate_HP) { 47 switch (op->code_rate_HP) {
@@ -83,7 +82,7 @@ static uint16_t compute_tps(struct dvb_frontend_parameters *p)
83 /* tps |= (0 << 4) */; 82 /* tps |= (0 << 4) */;
84 } 83 }
85 84
86 switch (op->constellation) { 85 switch (op->modulation) {
87 case QAM_16: 86 case QAM_16:
88 tps |= (1 << 13); 87 tps |= (1 << 13);
89 break; 88 break;
@@ -119,7 +118,7 @@ static uint16_t compute_tps(struct dvb_frontend_parameters *p)
119 /* tps |= (0 << 2) */; 118 /* tps |= (0 << 2) */;
120 } 119 }
121 120
122 switch (op->hierarchy_information) { 121 switch (op->hierarchy) {
123 case HIERARCHY_1: 122 case HIERARCHY_1:
124 tps |= (1 << 10); 123 tps |= (1 << 10);
125 break; 124 break;
@@ -263,9 +262,9 @@ static int cinergyt2_fe_get_tune_settings(struct dvb_frontend *fe,
263 return 0; 262 return 0;
264} 263}
265 264
266static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe, 265static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe)
267 struct dvb_frontend_parameters *fep)
268{ 266{
267 struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
269 struct cinergyt2_fe_state *state = fe->demodulator_priv; 268 struct cinergyt2_fe_state *state = fe->demodulator_priv;
270 struct dvbt_set_parameters_msg param; 269 struct dvbt_set_parameters_msg param;
271 char result[2]; 270 char result[2];
@@ -274,9 +273,20 @@ static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe,
274 param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS; 273 param.cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;
275 param.tps = cpu_to_le16(compute_tps(fep)); 274 param.tps = cpu_to_le16(compute_tps(fep));
276 param.freq = cpu_to_le32(fep->frequency / 1000); 275 param.freq = cpu_to_le32(fep->frequency / 1000);
277 param.bandwidth = 8 - fep->u.ofdm.bandwidth - BANDWIDTH_8_MHZ;
278 param.flags = 0; 276 param.flags = 0;
279 277
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
280 err = dvb_usb_generic_rw(state->d, 290 err = dvb_usb_generic_rw(state->d,
281 (char *)&param, sizeof(param), 291 (char *)&param, sizeof(param),
282 result, sizeof(result), 0); 292 result, sizeof(result), 0);
@@ -286,12 +296,6 @@ static int cinergyt2_fe_set_frontend(struct dvb_frontend *fe,
286 return (err < 0) ? err : 0; 296 return (err < 0) ? err : 0;
287} 297}
288 298
289static int cinergyt2_fe_get_frontend(struct dvb_frontend *fe,
290 struct dvb_frontend_parameters *fep)
291{
292 return 0;
293}
294
295static void cinergyt2_fe_release(struct dvb_frontend *fe) 299static void cinergyt2_fe_release(struct dvb_frontend *fe)
296{ 300{
297 struct cinergyt2_fe_state *state = fe->demodulator_priv; 301 struct cinergyt2_fe_state *state = fe->demodulator_priv;
@@ -316,9 +320,9 @@ struct dvb_frontend *cinergyt2_fe_attach(struct dvb_usb_device *d)
316 320
317 321
318static struct dvb_frontend_ops cinergyt2_fe_ops = { 322static struct dvb_frontend_ops cinergyt2_fe_ops = {
323 .delsys = { SYS_DVBT },
319 .info = { 324 .info = {
320 .name = DRIVER_NAME, 325 .name = DRIVER_NAME,
321 .type = FE_OFDM,
322 .frequency_min = 174000000, 326 .frequency_min = 174000000,
323 .frequency_max = 862000000, 327 .frequency_max = 862000000,
324 .frequency_stepsize = 166667, 328 .frequency_stepsize = 166667,
@@ -341,7 +345,6 @@ static struct dvb_frontend_ops cinergyt2_fe_ops = {
341 .sleep = cinergyt2_fe_sleep, 345 .sleep = cinergyt2_fe_sleep,
342 346
343 .set_frontend = cinergyt2_fe_set_frontend, 347 .set_frontend = cinergyt2_fe_set_frontend,
344 .get_frontend = cinergyt2_fe_get_frontend,
345 .get_tune_settings = cinergyt2_fe_get_tune_settings, 348 .get_tune_settings = cinergyt2_fe_get_tune_settings,
346 349
347 .read_status = cinergyt2_fe_read_status, 350 .read_status = cinergyt2_fe_read_status,