forked from Minki/linux
a57c1dcb93
While having tda18271 module set with debug=17 (cal & info prints) and cal=0 (delay calibration process until first use) - I discovered that during the calibration process, if the frequency test for 69750000 returned a bcal of 0 (see tda18721-fe.c in tda18271_powerscan func) that the tuner wouldn't be able to pickup any of the frequencies in the range (all the other frequencies bands returned bcal=1). I spent some time going over the code and the NXP's tda18271 spec (ver.4 of it i think) and adding a lot of debug prints and walking/stepping through the calibration process. I found that when the powerscan fails to find a frequency, the rf calibration is not run and the default value is supposed to be used in its place (pulled from the RF_CAL_map table) - but something was getting goofed up there. Now, my c coding skills are very rusty, but i think root of the problem is a signedness issue with the math operation for calculating the rf_a1 and rf_a2 values in tda18271_rf_tracking_filters_init func, which results in values like 20648 for rf_a1 (when it should probably have a value like 0, or so slightly negative that it should be zero - this bad value for rf_a1 would in turn makes the approx calc within tda18271c2_rf_tracking_filters_correction go out of whack). The simplest solution i found was to explicitly convert the signedness of the denominator to avoid the implicit conversion. The values placed into the u32 rf_freq array should never exceed about 900mhz, so i think the s32 max value shouldn't be an issue in this case. I've tested it out a little, and even when i get a bcal=0 with the modified code, the default calibration value gets used, rf_a1 is zero, and the tuner seems to lock on the stream and mythtv seems to play it fine. Signed-off-by: Seth Barry <seth@cyberseth.com> Signed-off-by: Michael Krufky <mkrufky@kernellabs.com> CC: stable@kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> |
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
mc44s803_priv.h | ||
mc44s803.c | ||
mc44s803.h | ||
mt20xx.c | ||
mt20xx.h | ||
mt2060_priv.h | ||
mt2060.c | ||
mt2060.h | ||
mt2131_priv.h | ||
mt2131.c | ||
mt2131.h | ||
mt2266.c | ||
mt2266.h | ||
mxl5005s.c | ||
mxl5005s.h | ||
mxl5007t.c | ||
mxl5007t.h | ||
qt1010_priv.h | ||
qt1010.c | ||
qt1010.h | ||
tda827x.c | ||
tda827x.h | ||
tda8290.c | ||
tda8290.h | ||
tda9887.c | ||
tda9887.h | ||
tda18271-common.c | ||
tda18271-fe.c | ||
tda18271-maps.c | ||
tda18271-priv.h | ||
tda18271.h | ||
tea5761.c | ||
tea5761.h | ||
tea5767.c | ||
tea5767.h | ||
tuner-i2c.h | ||
tuner-simple.c | ||
tuner-simple.h | ||
tuner-types.c | ||
tuner-xc2028-types.h | ||
tuner-xc2028.c | ||
tuner-xc2028.h | ||
xc5000.c | ||
xc5000.h |