aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-11-24 09:07:12 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:02:57 -0500
commitb542dfdc9f6e6eaf3cc2ede27dbaf50425f8b4b5 (patch)
treea9f9c9c335c501af72f4d2a333cefb5160df8617 /drivers
parentd04aa54a27f7bc6f051e55c47abbc0a1db1718bc (diff)
V4L/DVB (6675): Allow selecting the proper SCode table for DTV
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/tuner-xc2028.c18
-rw-r--r--drivers/media/video/tuner-xc2028.h15
2 files changed, 33 insertions, 0 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c
index 42fb141fc386..9743331c895c 100644
--- a/drivers/media/video/tuner-xc2028.c
+++ b/drivers/media/video/tuner-xc2028.c
@@ -914,6 +914,19 @@ static int xc2028_set_analog_freq(struct dvb_frontend *fe,
914 T_ANALOG_TV, type, p->std); 914 T_ANALOG_TV, type, p->std);
915} 915}
916 916
917static unsigned int demod_type [] = {
918 [XC3028_FE_DEFAULT] = 0,
919 [XC3028_FE_LG60] = LG60,
920 [XC3028_FE_ATI638] = ATI638,
921 [XC3028_FE_OREN538] = OREN538,
922 [XC3028_FE_OREN36] = OREN36,
923 [XC3028_FE_TOYOTA388] = TOYOTA388,
924 [XC3028_FE_TOYOTA794] = TOYOTA794,
925 [XC3028_FE_DIBCOM52] = DIBCOM52,
926 [XC3028_FE_ZARLINK456] = ZARLINK456,
927 [XC3028_FE_CHINA] = CHINA,
928};
929
917static int xc2028_set_params(struct dvb_frontend *fe, 930static int xc2028_set_params(struct dvb_frontend *fe,
918 struct dvb_frontend_parameters *p) 931 struct dvb_frontend_parameters *p)
919{ 932{
@@ -965,6 +978,11 @@ static int xc2028_set_params(struct dvb_frontend *fe,
965 tuner_err("error: bandwidth not supported.\n"); 978 tuner_err("error: bandwidth not supported.\n");
966 }; 979 };
967 980
981 if (priv->ctrl.demod < 0 || priv->ctrl.demod > ARRAY_SIZE(demod_type))
982 tuner_err("error: demod type invalid. Assuming default.\n");
983 else
984 type |= demod_type[priv->ctrl.demod];
985
968 return generic_set_freq(fe, p->frequency, 986 return generic_set_freq(fe, p->frequency,
969 T_DIGITAL_TV, type, 0); 987 T_DIGITAL_TV, type, 0);
970} 988}
diff --git a/drivers/media/video/tuner-xc2028.h b/drivers/media/video/tuner-xc2028.h
index 02e116b54592..9b4224e2fe53 100644
--- a/drivers/media/video/tuner-xc2028.h
+++ b/drivers/media/video/tuner-xc2028.h
@@ -11,6 +11,20 @@
11 11
12#define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw" 12#define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw"
13 13
14enum xc2028_demod_types
15{
16 XC3028_FE_DEFAULT = 0,
17 XC3028_FE_LG60, /* IF = 6.00 MHz */
18 XC3028_FE_ATI638, /* IF = 6.38 MHz */
19 XC3028_FE_OREN538, /* IF = 5.38 MHz */
20 XC3028_FE_OREN36, /* IF = 3.60 MHz */
21 XC3028_FE_TOYOTA388, /* IF = 3.88 MHz */
22 XC3028_FE_TOYOTA794, /* IF = 7.94 MHz */
23 XC3028_FE_DIBCOM52, /* IF = 5.20 MHz */
24 XC3028_FE_ZARLINK456, /* IF = 4.56 MHz */
25 XC3028_FE_CHINA, /* IF = 5.20 MHz */
26};
27
14struct xc2028_ctrl { 28struct xc2028_ctrl {
15 char *fname; 29 char *fname;
16 int max_len; 30 int max_len;
@@ -18,6 +32,7 @@ struct xc2028_ctrl {
18 unsigned int mts :1; 32 unsigned int mts :1;
19 unsigned int d2633 :1; 33 unsigned int d2633 :1;
20 unsigned int input1:1; 34 unsigned int input1:1;
35 enum xc2028_demod_types demod;
21}; 36};
22 37
23struct xc2028_config { 38struct xc2028_config {