diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-01-05 13:42:54 -0500 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2008-01-05 13:42:54 -0500 |
commit | f6446935a2e144e7f845a951e80a9bf2d313ffda (patch) | |
tree | 1f821b3e538dfeaf9daacdfaa7254f703224dce5 /linux/drivers/media | |
parent | fa2e4221bd85a1f3e9666a4236950e2d2a02a388 (diff) | |
download | mediapointer-dvb-s2-f6446935a2e144e7f845a951e80a9bf2d313ffda.tar.gz mediapointer-dvb-s2-f6446935a2e144e7f845a951e80a9bf2d313ffda.tar.bz2 |
tda18271: fix analog tuning regression caused by earlier changeset
From: Michael Krufky <mkrufky@linuxtv.org>
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>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda18271-common.c | 8 | ||||
-rw-r--r-- | linux/drivers/media/dvb/frontends/tda18271-tables.c | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda18271-common.c b/linux/drivers/media/dvb/frontends/tda18271-common.c index e612c18cd..6d45313d6 100644 --- a/linux/drivers/media/dvb/frontends/tda18271-common.c +++ b/linux/drivers/media/dvb/frontends/tda18271-common.c @@ -669,13 +669,11 @@ int tda18271_calc_rf_cal(struct dvb_frontend *fe, u32 *freq) unsigned char *regs = priv->tda18271_regs; u8 val; - int ret = tda18271_lookup_map(fe, RF_CAL, freq, &val); - if (ret < 0) - goto fail; + tda18271_lookup_map(fe, RF_CAL, freq, &val); regs[R_EB14] = val; -fail: - return ret; + + return 0; } /* diff --git a/linux/drivers/media/dvb/frontends/tda18271-tables.c b/linux/drivers/media/dvb/frontends/tda18271-tables.c index cea60843b..a39725f7b 100644 --- a/linux/drivers/media/dvb/frontends/tda18271-tables.c +++ b/linux/drivers/media/dvb/frontends/tda18271-tables.c @@ -1098,7 +1098,7 @@ int tda18271_lookup_pll_map(struct dvb_frontend *fe, } 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", map_name, *freq); ret = -ERANGE; @@ -1169,7 +1169,7 @@ int tda18271_lookup_map(struct dvb_frontend *fe, } 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", map_name, *freq); ret = -ERANGE; |