Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[pandora-kernel.git] / drivers / media / common / tuners / tuner-xc2028.c
index 27e7cb6..aa20ce8 100644 (file)
@@ -48,7 +48,7 @@ MODULE_PARM_DESC(audio_std,
        "NICAM/A\n"
        "NICAM/B\n");
 
-static char firmware_name[FIRMWARE_NAME_MAX];
+static char firmware_name[30];
 module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0);
 MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the "
                                "default firmware name\n");
@@ -925,7 +925,7 @@ static int generic_set_freq(struct dvb_frontend *fe, u32 freq /* in HZ */,
         * proper frequency.
         * Analog modes require offset = 0
         */
-       if (new_mode != T_ANALOG_TV) {
+       if (new_mode == T_DIGITAL_TV) {
                /* Sets the offset according with firmware */
                if (priv->cur_fw.type & DTV6)
                        offset = 1750000;
@@ -998,7 +998,7 @@ static int xc2028_set_analog_freq(struct dvb_frontend *fe,
                if (priv->ctrl.input1)
                        type |= INPUT1;
                return generic_set_freq(fe, (625l * p->frequency) / 10,
-                               T_ANALOG_TV, type, 0, 0);
+                               T_RADIO, type, 0, 0);
        }
 
        /* if std is not defined, choose one */
@@ -1096,8 +1096,19 @@ static int xc2028_set_params(struct dvb_frontend *fe,
        }
 
        /* All S-code tables need a 200kHz shift */
-       if (priv->ctrl.demod)
+       if (priv->ctrl.demod) {
                demod = priv->ctrl.demod + 200;
+               /*
+                * The DTV7 S-code table needs a 700 kHz shift.
+                * Thanks to Terry Wu <terrywu2009@gmail.com> for reporting this
+                *
+                * DTV7 is only used in Australia.  Germany or Italy may also
+                * use this firmware after initialization, but a tune to a UHF
+                * channel should then cause DTV78 to be used.
+                */
+               if (type & DTV7)
+                       demod += 500;
+       }
 
        return generic_set_freq(fe, p->frequency,
                                T_DIGITAL_TV, type, 0, demod);