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>
This commit is contained in:
Michael Krufky 2008-01-05 15:42:54 -03:00 committed by Mauro Carvalho Chehab
parent 0e1fab90a8
commit d2c932a1f7
2 changed files with 5 additions and 7 deletions

View file

@ -601,13 +601,11 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq)
unsigned char *regs = priv->tda18271_regs; unsigned char *regs = priv->tda18271_regs;
u8 val; u8 val;
int ret = tda18271_lookup_map(fe, RF_CAL, freq, &val); tda18271_lookup_map(fe, RF_CAL, freq, &val);
if (ret < 0)
goto fail;
regs[R_EB14] = val; regs[R_EB14] = val;
fail:
return ret; return 0;
} }
/* /*

View file

@ -1098,7 +1098,7 @@ int tda18271_lookup_pll_map(struct dvb_frontend *fe,
} }
while ((map[i].lomax * 1000) < *freq) { while ((map[i].lomax * 1000) < *freq) {
if (map[i].lomax == 0) { if (map[i + 1].lomax == 0) {
tda_map("%s: frequency (%d) out of range\n", tda_map("%s: frequency (%d) out of range\n",
map_name, *freq); map_name, *freq);
ret = -ERANGE; ret = -ERANGE;
@ -1169,7 +1169,7 @@ int tda18271_lookup_map(struct dvb_frontend *fe,
} }
while ((map[i].rfmax * 1000) < *freq) { while ((map[i].rfmax * 1000) < *freq) {
if (map[i].rfmax == 0) { if (map[i + 1].rfmax == 0) {
tda_map("%s: frequency (%d) out of range\n", tda_map("%s: frequency (%d) out of range\n",
map_name, *freq); map_name, *freq);
ret = -ERANGE; ret = -ERANGE;