aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2008-01-05 13:42:54 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:04:38 -0500
commitd2c932a1f7aca16727ce6670c5eccb0a4e2b47a5 (patch)
tree707c1c1ac999127b7afdf9889e41e9bff6a462eb /drivers/media/dvb
parent0e1fab90a8a76e09b669d3159ec910eab7ee97d6 (diff)
V4L/DVB (6965): tda18271: fix analog tuning regression caused by earlier changeset
An earlier patch, "tda18271: fail table lookups if frequency is out of range" broke analog support on certain hardware. This patch fixes that problem, by allowing the RF_CAL byte to be set to the maximum value, in cases of the frequency being out of range. Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/tda18271-common.c8
-rw-r--r--drivers/media/dvb/frontends/tda18271-tables.c4
2 files changed, 5 insertions, 7 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-common.c b/drivers/media/dvb/frontends/tda18271-common.c
index 4adc7390ba00..d7a335659474 100644
--- a/drivers/media/dvb/frontends/tda18271-common.c
+++ b/drivers/media/dvb/frontends/tda18271-common.c
@@ -601,13 +601,11 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq)
601 unsigned char *regs = priv->tda18271_regs; 601 unsigned char *regs = priv->tda18271_regs;
602 u8 val; 602 u8 val;
603 603
604 int ret = tda18271_lookup_map(fe, RF_CAL, freq, &val); 604 tda18271_lookup_map(fe, RF_CAL, freq, &val);
605 if (ret < 0)
606 goto fail;
607 605
608 regs[R_EB14] = val; 606 regs[R_EB14] = val;
609fail: 607
610 return ret; 608 return 0;
611} 609}
612 610
613/* 611/*
diff --git a/drivers/media/dvb/frontends/tda18271-tables.c b/drivers/media/dvb/frontends/tda18271-tables.c
index 528a2ec9e967..0402c7dab19d 100644
--- a/drivers/media/dvb/frontends/tda18271-tables.c
+++ b/drivers/media/dvb/frontends/tda18271-tables.c
@@ -1098,7 +1098,7 @@ int tda18271_lookup_pll_map(struct dvb_frontend *fe,
1098 } 1098 }
1099 1099
1100 while ((map[i].lomax * 1000) < *freq) { 1100 while ((map[i].lomax * 1000) < *freq) {
1101 if (map[i].lomax == 0) { 1101 if (map[i + 1].lomax == 0) {
1102 tda_map("%s: frequency (%d) out of range\n", 1102 tda_map("%s: frequency (%d) out of range\n",
1103 map_name, *freq); 1103 map_name, *freq);
1104 ret = -ERANGE; 1104 ret = -ERANGE;
@@ -1169,7 +1169,7 @@ int tda18271_lookup_map(struct dvb_frontend *fe,
1169 } 1169 }
1170 1170
1171 while ((map[i].rfmax * 1000) < *freq) { 1171 while ((map[i].rfmax * 1000) < *freq) {
1172 if (map[i].rfmax == 0) { 1172 if (map[i + 1].rfmax == 0) {
1173 tda_map("%s: frequency (%d) out of range\n", 1173 tda_map("%s: frequency (%d) out of range\n",
1174 map_name, *freq); 1174 map_name, *freq);
1175 ret = -ERANGE; 1175 ret = -ERANGE;