aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDarron Broad <darron@kewl.org>2008-12-18 04:21:51 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:39:15 -0500
commit3569476dcebc7d6154815239ec982dee77511581 (patch)
tree491351162491c98639eb75f3b03d06ddc35baabb /drivers
parente278e746bc95dd1e7aa90eb5b858c309266797cd (diff)
V4L/DVB (9914): cx24116: bugfix: add missing delsys in FEC lookup
Delsys was missing when searching for FEC in table. This fixes FEC lookup for DVB-S2 QPSK modulation. Cc: Steven Toth <stoth@hauppauge.com> Signed-off-by: Darron Broad <darron@kewl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/frontends/cx24116.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/media/dvb/frontends/cx24116.c b/drivers/media/dvb/frontends/cx24116.c
index b144b308a4dd..414bec9b5b64 100644
--- a/drivers/media/dvb/frontends/cx24116.c
+++ b/drivers/media/dvb/frontends/cx24116.c
@@ -160,6 +160,7 @@ struct cx24116_tuning {
160 fe_spectral_inversion_t inversion; 160 fe_spectral_inversion_t inversion;
161 fe_code_rate_t fec; 161 fe_code_rate_t fec;
162 162
163 fe_delivery_system_t delsys;
163 fe_modulation_t modulation; 164 fe_modulation_t modulation;
164 fe_pilot_t pilot; 165 fe_pilot_t pilot;
165 fe_rolloff_t rolloff; 166 fe_rolloff_t rolloff;
@@ -411,14 +412,15 @@ struct cx24116_modfec {
411}; 412};
412 413
413static int cx24116_lookup_fecmod(struct cx24116_state *state, 414static int cx24116_lookup_fecmod(struct cx24116_state *state,
414 fe_modulation_t m, fe_code_rate_t f) 415 fe_delivery_system_t d, fe_modulation_t m, fe_code_rate_t f)
415{ 416{
416 int i, ret = -EOPNOTSUPP; 417 int i, ret = -EOPNOTSUPP;
417 418
418 dprintk("%s(0x%02x,0x%02x)\n", __func__, m, f); 419 dprintk("%s(0x%02x,0x%02x)\n", __func__, m, f);
419 420
420 for (i = 0; i < ARRAY_SIZE(CX24116_MODFEC_MODES); i++) { 421 for (i = 0; i < ARRAY_SIZE(CX24116_MODFEC_MODES); i++) {
421 if ((m == CX24116_MODFEC_MODES[i].modulation) && 422 if ((d == CX24116_MODFEC_MODES[i].delivery_system) &&
423 (m == CX24116_MODFEC_MODES[i].modulation) &&
422 (f == CX24116_MODFEC_MODES[i].fec)) { 424 (f == CX24116_MODFEC_MODES[i].fec)) {
423 ret = i; 425 ret = i;
424 break; 426 break;
@@ -429,13 +431,13 @@ static int cx24116_lookup_fecmod(struct cx24116_state *state,
429} 431}
430 432
431static int cx24116_set_fec(struct cx24116_state *state, 433static int cx24116_set_fec(struct cx24116_state *state,
432 fe_modulation_t mod, fe_code_rate_t fec) 434 fe_delivery_system_t delsys, fe_modulation_t mod, fe_code_rate_t fec)
433{ 435{
434 int ret = 0; 436 int ret = 0;
435 437
436 dprintk("%s(0x%02x,0x%02x)\n", __func__, mod, fec); 438 dprintk("%s(0x%02x,0x%02x)\n", __func__, mod, fec);
437 439
438 ret = cx24116_lookup_fecmod(state, mod, fec); 440 ret = cx24116_lookup_fecmod(state, delsys, mod, fec);
439 441
440 if (ret < 0) 442 if (ret < 0)
441 return ret; 443 return ret;
@@ -1287,6 +1289,7 @@ static int cx24116_set_frontend(struct dvb_frontend *fe,
1287 __func__, c->delivery_system); 1289 __func__, c->delivery_system);
1288 return -EOPNOTSUPP; 1290 return -EOPNOTSUPP;
1289 } 1291 }
1292 state->dnxt.delsys = c->delivery_system;
1290 state->dnxt.modulation = c->modulation; 1293 state->dnxt.modulation = c->modulation;
1291 state->dnxt.frequency = c->frequency; 1294 state->dnxt.frequency = c->frequency;
1292 state->dnxt.pilot = c->pilot; 1295 state->dnxt.pilot = c->pilot;
@@ -1297,7 +1300,7 @@ static int cx24116_set_frontend(struct dvb_frontend *fe,
1297 return ret; 1300 return ret;
1298 1301
1299 /* FEC_NONE/AUTO for DVB-S2 is not supported and detected here */ 1302 /* FEC_NONE/AUTO for DVB-S2 is not supported and detected here */
1300 ret = cx24116_set_fec(state, c->modulation, c->fec_inner); 1303 ret = cx24116_set_fec(state, c->delivery_system, c->modulation, c->fec_inner);
1301 if (ret != 0) 1304 if (ret != 0)
1302 return ret; 1305 return ret;
1303 1306
@@ -1308,6 +1311,7 @@ static int cx24116_set_frontend(struct dvb_frontend *fe,
1308 /* discard the 'current' tuning parameters and prepare to tune */ 1311 /* discard the 'current' tuning parameters and prepare to tune */
1309 cx24116_clone_params(fe); 1312 cx24116_clone_params(fe);
1310 1313
1314 dprintk("%s: delsys = %d\n", __func__, state->dcur.delsys);
1311 dprintk("%s: modulation = %d\n", __func__, state->dcur.modulation); 1315 dprintk("%s: modulation = %d\n", __func__, state->dcur.modulation);
1312 dprintk("%s: frequency = %d\n", __func__, state->dcur.frequency); 1316 dprintk("%s: frequency = %d\n", __func__, state->dcur.frequency);
1313 dprintk("%s: pilot = %d (val = 0x%02x)\n", __func__, 1317 dprintk("%s: pilot = %d (val = 0x%02x)\n", __func__,