--- zzzz-none-000/linux-3.10.107/drivers/media/tuners/xc4000.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/media/tuners/xc4000.c 2021-02-04 17:41:59.000000000 +0000 @@ -116,6 +116,7 @@ #define XC4000_AUDIO_STD_MONO 32 #define XC4000_DEFAULT_FIRMWARE "dvb-fe-xc4000-1.4.fw" +#define XC4000_DEFAULT_FIRMWARE_NEW "dvb-fe-xc4000-1.4.1.fw" /* Misc Defines */ #define MAX_TV_STANDARD 24 @@ -568,67 +569,67 @@ #define dump_firm_type(t) dump_firm_type_and_int_freq(t, 0) static void dump_firm_type_and_int_freq(unsigned int type, u16 int_freq) { - if (type & BASE) + if (type & BASE) printk(KERN_CONT "BASE "); - if (type & INIT1) + if (type & INIT1) printk(KERN_CONT "INIT1 "); - if (type & F8MHZ) + if (type & F8MHZ) printk(KERN_CONT "F8MHZ "); - if (type & MTS) + if (type & MTS) printk(KERN_CONT "MTS "); - if (type & D2620) + if (type & D2620) printk(KERN_CONT "D2620 "); - if (type & D2633) + if (type & D2633) printk(KERN_CONT "D2633 "); - if (type & DTV6) + if (type & DTV6) printk(KERN_CONT "DTV6 "); - if (type & QAM) + if (type & QAM) printk(KERN_CONT "QAM "); - if (type & DTV7) + if (type & DTV7) printk(KERN_CONT "DTV7 "); - if (type & DTV78) + if (type & DTV78) printk(KERN_CONT "DTV78 "); - if (type & DTV8) + if (type & DTV8) printk(KERN_CONT "DTV8 "); - if (type & FM) + if (type & FM) printk(KERN_CONT "FM "); - if (type & INPUT1) + if (type & INPUT1) printk(KERN_CONT "INPUT1 "); - if (type & LCD) + if (type & LCD) printk(KERN_CONT "LCD "); - if (type & NOGD) + if (type & NOGD) printk(KERN_CONT "NOGD "); - if (type & MONO) + if (type & MONO) printk(KERN_CONT "MONO "); - if (type & ATSC) + if (type & ATSC) printk(KERN_CONT "ATSC "); - if (type & IF) + if (type & IF) printk(KERN_CONT "IF "); - if (type & LG60) + if (type & LG60) printk(KERN_CONT "LG60 "); - if (type & ATI638) + if (type & ATI638) printk(KERN_CONT "ATI638 "); - if (type & OREN538) + if (type & OREN538) printk(KERN_CONT "OREN538 "); - if (type & OREN36) + if (type & OREN36) printk(KERN_CONT "OREN36 "); - if (type & TOYOTA388) + if (type & TOYOTA388) printk(KERN_CONT "TOYOTA388 "); - if (type & TOYOTA794) + if (type & TOYOTA794) printk(KERN_CONT "TOYOTA794 "); - if (type & DIBCOM52) + if (type & DIBCOM52) printk(KERN_CONT "DIBCOM52 "); - if (type & ZARLINK456) + if (type & ZARLINK456) printk(KERN_CONT "ZARLINK456 "); - if (type & CHINA) + if (type & CHINA) printk(KERN_CONT "CHINA "); - if (type & F6MHZ) + if (type & F6MHZ) printk(KERN_CONT "F6MHZ "); - if (type & INPUT2) + if (type & INPUT2) printk(KERN_CONT "INPUT2 "); - if (type & SCODE) + if (type & SCODE) printk(KERN_CONT "SCODE "); - if (type & HAS_IF) + if (type & HAS_IF) printk(KERN_CONT "HAS_IF_%d ", int_freq); } @@ -730,13 +731,25 @@ char name[33]; const char *fname; - if (firmware_name[0] != '\0') + if (firmware_name[0] != '\0') { fname = firmware_name; - else - fname = XC4000_DEFAULT_FIRMWARE; - dprintk(1, "Reading firmware %s\n", fname); - rc = request_firmware(&fw, fname, priv->i2c_props.adap->dev.parent); + dprintk(1, "Reading custom firmware %s\n", fname); + rc = request_firmware(&fw, fname, + priv->i2c_props.adap->dev.parent); + } else { + fname = XC4000_DEFAULT_FIRMWARE_NEW; + dprintk(1, "Trying to read firmware %s\n", fname); + rc = request_firmware(&fw, fname, + priv->i2c_props.adap->dev.parent); + if (rc == -ENOENT) { + fname = XC4000_DEFAULT_FIRMWARE; + dprintk(1, "Trying to read firmware %s\n", fname); + rc = request_firmware(&fw, fname, + priv->i2c_props.adap->dev.parent); + } + } + if (rc < 0) { if (rc == -ENOENT) printk(KERN_ERR "Error: firmware %s not found.\n", fname); @@ -746,6 +759,8 @@ return rc; } + dprintk(1, "Loading Firmware: %s\n", fname); + p = fw->data; endp = p + fw->size; @@ -1670,7 +1685,6 @@ switch (instance) { case 0: goto fail; - break; case 1: /* new tuner instance */ priv->bandwidth = 6000000; @@ -1757,3 +1771,5 @@ MODULE_AUTHOR("Steven Toth, Davide Ferri"); MODULE_DESCRIPTION("Xceive xc4000 silicon tuner driver"); MODULE_LICENSE("GPL"); +MODULE_FIRMWARE(XC4000_DEFAULT_FIRMWARE_NEW); +MODULE_FIRMWARE(XC4000_DEFAULT_FIRMWARE);