aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-xc2028.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/tuner-xc2028.c')
-rw-r--r--drivers/media/video/tuner-xc2028.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c
index 9dd688ec3cff..0e580bcd0e09 100644
--- a/drivers/media/video/tuner-xc2028.c
+++ b/drivers/media/video/tuner-xc2028.c
@@ -1,6 +1,6 @@
1/* tuner-xc2028 1/* tuner-xc2028
2 * 2 *
3 * Copyright (c) 2007 Mauro Carvalho Chehab (mchehab@infradead.org) 3 * Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org)
4 * 4 *
5 * Copyright (c) 2007 Michel Ludwig (michel.ludwig@gmail.com) 5 * Copyright (c) 2007 Michel Ludwig (michel.ludwig@gmail.com)
6 * - frontend interface 6 * - frontend interface
@@ -404,7 +404,7 @@ static int seek_firmware(struct dvb_frontend *fe, unsigned int type,
404{ 404{
405 struct xc2028_data *priv = fe->tuner_priv; 405 struct xc2028_data *priv = fe->tuner_priv;
406 int i, best_i = -1, best_nr_matches = 0; 406 int i, best_i = -1, best_nr_matches = 0;
407 unsigned int ign_firm_type_mask = 0; 407 unsigned int type_mask = 0;
408 408
409 tuner_dbg("%s called, want type=", __func__); 409 tuner_dbg("%s called, want type=", __func__);
410 if (debug) { 410 if (debug) {
@@ -421,18 +421,23 @@ static int seek_firmware(struct dvb_frontend *fe, unsigned int type,
421 *id = V4L2_STD_PAL; 421 *id = V4L2_STD_PAL;
422 422
423 if (type & BASE) 423 if (type & BASE)
424 type &= BASE_TYPES; 424 type_mask = BASE_TYPES;
425 else if (type & SCODE) { 425 else if (type & SCODE) {
426 type &= SCODE_TYPES; 426 type &= SCODE_TYPES;
427 ign_firm_type_mask = HAS_IF; 427 type_mask = SCODE_TYPES & ~HAS_IF;
428 } else if (type & DTV_TYPES) 428 } else if (type & DTV_TYPES)
429 type &= DTV_TYPES; 429 type_mask = DTV_TYPES;
430 else if (type & STD_SPECIFIC_TYPES) 430 else if (type & STD_SPECIFIC_TYPES)
431 type &= STD_SPECIFIC_TYPES; 431 type_mask = STD_SPECIFIC_TYPES;
432
433 type &= type_mask;
434
435 if (!type & SCODE)
436 type_mask = ~0;
432 437
433 /* Seek for exact match */ 438 /* Seek for exact match */
434 for (i = 0; i < priv->firm_size; i++) { 439 for (i = 0; i < priv->firm_size; i++) {
435 if ((type == (priv->firm[i].type & ~ign_firm_type_mask)) && 440 if ((type == (priv->firm[i].type & type_mask)) &&
436 (*id == priv->firm[i].id)) 441 (*id == priv->firm[i].id))
437 goto found; 442 goto found;
438 } 443 }
@@ -442,7 +447,7 @@ static int seek_firmware(struct dvb_frontend *fe, unsigned int type,
442 v4l2_std_id match_mask; 447 v4l2_std_id match_mask;
443 int nr_matches; 448 int nr_matches;
444 449
445 if (type != (priv->firm[i].type & ~ign_firm_type_mask)) 450 if (type != (priv->firm[i].type & type_mask))
446 continue; 451 continue;
447 452
448 match_mask = *id & priv->firm[i].id; 453 match_mask = *id & priv->firm[i].id;