]> err.no Git - linux-2.6/commitdiff
V4L/DVB (6675): Allow selecting the proper SCode table for DTV
authorMauro Carvalho Chehab <mchehab@infradead.org>
Sat, 24 Nov 2007 14:07:12 +0000 (11:07 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:02:57 +0000 (19:02 -0200)
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/tuner-xc2028.c
drivers/media/video/tuner-xc2028.h

index 42fb141fc386d5af11a9d546c77cfa72093f9291..9743331c895c072ce12c94ef51208c6ac89300c0 100644 (file)
@@ -914,6 +914,19 @@ static int xc2028_set_analog_freq(struct dvb_frontend *fe,
                                T_ANALOG_TV, type, p->std);
 }
 
+static unsigned int demod_type [] = {
+       [XC3028_FE_DEFAULT]     = 0,
+       [XC3028_FE_LG60]        = LG60,
+       [XC3028_FE_ATI638]      = ATI638,
+       [XC3028_FE_OREN538]     = OREN538,
+       [XC3028_FE_OREN36]      = OREN36,
+       [XC3028_FE_TOYOTA388]   = TOYOTA388,
+       [XC3028_FE_TOYOTA794]   = TOYOTA794,
+       [XC3028_FE_DIBCOM52]    = DIBCOM52,
+       [XC3028_FE_ZARLINK456]  = ZARLINK456,
+       [XC3028_FE_CHINA]       = CHINA,
+};
+
 static int xc2028_set_params(struct dvb_frontend *fe,
                             struct dvb_frontend_parameters *p)
 {
@@ -965,6 +978,11 @@ static int xc2028_set_params(struct dvb_frontend *fe,
                tuner_err("error: bandwidth not supported.\n");
        };
 
+       if (priv->ctrl.demod < 0 || priv->ctrl.demod > ARRAY_SIZE(demod_type))
+               tuner_err("error: demod type invalid. Assuming default.\n");
+       else
+               type |= demod_type[priv->ctrl.demod];
+
        return generic_set_freq(fe, p->frequency,
                                T_DIGITAL_TV, type, 0);
 }
index 02e116b54592deb50be251c98363b6df46be1fa9..9b4224e2fe53702319ca3a7bbdf2f1be0c0156ae 100644 (file)
 
 #define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw"
 
+enum xc2028_demod_types
+{
+       XC3028_FE_DEFAULT = 0,
+       XC3028_FE_LG60,         /* IF = 6.00 MHz */
+       XC3028_FE_ATI638,       /* IF = 6.38 MHz */
+       XC3028_FE_OREN538,      /* IF = 5.38 MHz */
+       XC3028_FE_OREN36,       /* IF = 3.60 MHz */
+       XC3028_FE_TOYOTA388,    /* IF = 3.88 MHz */
+       XC3028_FE_TOYOTA794,    /* IF = 7.94 MHz */
+       XC3028_FE_DIBCOM52,     /* IF = 5.20 MHz */
+       XC3028_FE_ZARLINK456,   /* IF = 4.56 MHz */
+       XC3028_FE_CHINA,        /* IF = 5.20 MHz */
+};
+
 struct xc2028_ctrl {
        char                    *fname;
        int                     max_len;
@@ -18,6 +32,7 @@ struct xc2028_ctrl {
        unsigned int            mts   :1;
        unsigned int            d2633 :1;
        unsigned int            input1:1;
+       enum xc2028_demod_types demod;
 };
 
 struct xc2028_config {