aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-21 05:58:48 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:44 -0400
commit33e5316113b1a472f54579f014739e4a4a53d704 (patch)
tree3126994d51273f09b3da41b25a3bfa83ac187970 /drivers/media
parentd1e0b57162f45bb9c6bff25aa33b6e8424556422 (diff)
V4L/DVB (7651): tuner-xc2028: Several fixes to SCODE
This patch fixes several issues on SCODE: 1) The extracting tool weren't generating the proper tags for SCODE. This has almost no effect, since those tags shouldn't be used; 2) DIBCOM52 were using a wrong IF. It should be 5200, instead of 5700; 3) seek_firmware were wanting an exact match for firmware type. This is wrong. As result, no SCODE firmware were loaded; 4) A few files were including the wrong file for seeking demod firmwares; 5) XC3028_FE_DEFAULT can be used, if user doesn't want to load a firmware. However, this weren't documentated. This feature require more testing. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/dvb-usb/cxusb.c3
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c3
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c3
-rw-r--r--drivers/media/video/tuner-xc2028-types.h18
-rw-r--r--drivers/media/video/tuner-xc2028.c21
-rw-r--r--drivers/media/video/tuner-xc2028.h4
6 files changed, 31 insertions, 21 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c
index c4b00660c65f..720fcd1c3c1d 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -33,7 +33,6 @@
33#include "mt352_priv.h" 33#include "mt352_priv.h"
34#include "zl10353.h" 34#include "zl10353.h"
35#include "tuner-xc2028.h" 35#include "tuner-xc2028.h"
36#include "tuner-xc2028-types.h"
37#include "tuner-simple.h" 36#include "tuner-simple.h"
38 37
39/* debug */ 38/* debug */
@@ -521,7 +520,7 @@ static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap)
521 static struct xc2028_ctrl ctl = { 520 static struct xc2028_ctrl ctl = {
522 .fname = "xc3028-dvico-au-01.fw", 521 .fname = "xc3028-dvico-au-01.fw",
523 .max_len = 64, 522 .max_len = 64,
524 .scode_table = ZARLINK456, 523 .scode_table = XC3028_FE_ZARLINK456,
525 }; 524 };
526 525
527 fe = dvb_attach(xc2028_attach, adap->fe, &cfg); 526 fe = dvb_attach(xc2028_attach, adap->fe, &cfg);
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index a1086c8b66ee..1b9a85e43d44 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -39,7 +39,6 @@
39#include "tda10048.h" 39#include "tda10048.h"
40#include "dvb-pll.h" 40#include "dvb-pll.h"
41#include "tuner-xc2028.h" 41#include "tuner-xc2028.h"
42#include "tuner-xc2028-types.h"
43#include "tuner-simple.h" 42#include "tuner-simple.h"
44 43
45static unsigned int debug; 44static unsigned int debug;
@@ -320,7 +319,7 @@ static int dvb_register(struct cx23885_tsport *port)
320 static struct xc2028_ctrl ctl = { 319 static struct xc2028_ctrl ctl = {
321 .fname = "xc3028-v27.fw", 320 .fname = "xc3028-v27.fw",
322 .max_len = 64, 321 .max_len = 64,
323 .scode_table = OREN538, 322 .scode_table = XC3028_FE_OREN538,
324 }; 323 };
325 324
326 fe = dvb_attach(xc2028_attach, 325 fe = dvb_attach(xc2028_attach,
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index fda7334d934b..f1251b844e08 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -45,7 +45,6 @@
45#include "nxt200x.h" 45#include "nxt200x.h"
46#include "cx24123.h" 46#include "cx24123.h"
47#include "isl6421.h" 47#include "isl6421.h"
48#include "tuner-xc2028-types.h"
49#include "tuner-simple.h" 48#include "tuner-simple.h"
50#include "tda9887.h" 49#include "tda9887.h"
51 50
@@ -813,7 +812,7 @@ static int dvb_register(struct cx8802_dev *dev)
813 static struct xc2028_ctrl ctl = { 812 static struct xc2028_ctrl ctl = {
814 .fname = "xc3028-v27.fw", 813 .fname = "xc3028-v27.fw",
815 .max_len = 64, 814 .max_len = 64,
816 .scode_table = OREN538, 815 .scode_table = XC3028_FE_OREN538,
817 }; 816 };
818 817
819 fe = dvb_attach(xc2028_attach, 818 fe = dvb_attach(xc2028_attach,
diff --git a/drivers/media/video/tuner-xc2028-types.h b/drivers/media/video/tuner-xc2028-types.h
index d0057fbf0ec7..17633c316c28 100644
--- a/drivers/media/video/tuner-xc2028-types.h
+++ b/drivers/media/video/tuner-xc2028-types.h
@@ -1,6 +1,9 @@
1/* tuner-xc2028_types 1/* tuner-xc2028_types
2 * 2 *
3 * Copyright (c) 2007 Mauro Carvalho Chehab (mchehab@infradead.org) 3 * This file includes internal tipes to be used inside tuner-xc2028.
4 * Shouldn't be included outside tuner-xc2028
5 *
6 * Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org)
4 * This code is placed under the terms of the GNU General Public License v2 7 * This code is placed under the terms of the GNU General Public License v2
5 */ 8 */
6 9
@@ -85,11 +88,16 @@
85/* This flag identifies that the scode table has a new format */ 88/* This flag identifies that the scode table has a new format */
86#define HAS_IF (1 << 30) 89#define HAS_IF (1 << 30)
87 90
88#define SCODE_TYPES (MTS|DTV6|QAM|DTV7|DTV78|DTV8|LCD|NOGD|MONO|ATSC|IF| \ 91#define SCODE_TYPES SCODE
89 LG60|ATI638|OREN538|OREN36|TOYOTA388|TOYOTA794| \ 92
90 DIBCOM52|ZARLINK456|CHINA|F6MHZ|SCODE)
91 93
92/* Newer types to be moved to videodev2.h */ 94/* Newer types not defined on videodev2.h.
95 The original idea were to move all those types to videodev2.h, but
96 it seemed overkill, since, with the exception of SECAM/K3, the other
97 types seem to be autodetected.
98 It is not clear where secam/k3 is used, nor we have a feedback of this
99 working or being autodetected by the standard secam firmware.
100 */
93 101
94#define V4L2_STD_SECAM_K3 (0x04000000) 102#define V4L2_STD_SECAM_K3 (0x04000000)
95 103
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;
diff --git a/drivers/media/video/tuner-xc2028.h b/drivers/media/video/tuner-xc2028.h
index 612e490634d0..fc2f132a5541 100644
--- a/drivers/media/video/tuner-xc2028.h
+++ b/drivers/media/video/tuner-xc2028.h
@@ -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 * This code is placed under the terms of the GNU General Public License v2 4 * This code is placed under the terms of the GNU General Public License v2
5 */ 5 */
6 6
@@ -12,7 +12,7 @@
12#define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw" 12#define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw"
13 13
14/* Dmoduler IF (kHz) */ 14/* Dmoduler IF (kHz) */
15#define XC3028_FE_DEFAULT 0 15#define XC3028_FE_DEFAULT 0 /* Don't load SCODE */
16#define XC3028_FE_LG60 6000 16#define XC3028_FE_LG60 6000
17#define XC3028_FE_ATI638 6380 17#define XC3028_FE_ATI638 6380
18#define XC3028_FE_OREN538 5380 18#define XC3028_FE_OREN538 5380