XC3028: Adds additional check for correct firmware From: Stephen Backway This patch fixes firmware load issues, where only one firmware fits the required type, but has an additional type (e.g. QAM). It achieves this by adding an additional check if all others have failed. This bug occured when scanning for channels using tw-Taipei. Signed-off-by: Stephen Backway diff -Naur v4l-dvb/linux/drivers/media/common/tuners/tuner-xc2028.c v4l-dvb_tuner_fw_fix/linux/drivers/media/common/tuners/tuner-xc2028.c --- v4l-dvb/linux/drivers/media/common/tuners/tuner-xc2028.c 2008-08-04 18:43:28.000000000 +1000 +++ v4l-dvb_tuner_fw_fix/linux/drivers/media/common/tuners/tuner-xc2028.c 2008-09-07 13:36:29.000000000 +1000 @@ -470,6 +470,21 @@ } } + /* Seek for firmware with only one match possible, i.e. D2620 DTV6 match with D2620 DTV6 QAM */ + if (best_nr_matches == 0) { + for (i = 0; i < priv->firm_size; i++) { + if ((priv->firm[i].type & type) == type) { + best_nr_matches++; + best_i = i; + } + /* Check to see if single match has failed */ + if (best_nr_matches > 1) { + best_nr_matches = 0; + break; + } + } + } + if (best_nr_matches > 0) { tuner_dbg("Selecting best matching firmware (%d bits) for " "type=", best_nr_matches);