linux-stable/drivers/media/common/tuners
Seth Barry a57c1dcb93 V4L/DVB (13109): tda18271: fix signedness issue in tda18271_rf_tracking_filters_init
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>
2009-11-07 12:55:04 -02:00
..
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-04-03 15:24:35 -07:00
Makefile V4L/DVB (10452): Add Freescale MC44S803 tuner driver 2009-03-30 12:42:39 -03:00
mc44s803.c V4L/DVB (10452): Add Freescale MC44S803 tuner driver 2009-03-30 12:42:39 -03:00
mc44s803.h V4L/DVB (10452): Add Freescale MC44S803 tuner driver 2009-03-30 12:42:39 -03:00
mc44s803_priv.h V4L/DVB (10452): Add Freescale MC44S803 tuner driver 2009-03-30 12:42:39 -03:00
mt20xx.c V4L/DVB (10730): v4l-dvb: cleanup obsolete references to v4l1 headers. 2009-03-30 12:42:59 -03:00
mt20xx.h
mt2060.c V4L/DVB: calibration still successful at 10 2009-03-30 12:42:49 -03:00
mt2060.h
mt2060_priv.h
mt2131.c V4L/DVB (8805): Steven Toth email address change 2008-09-03 18:37:21 -03:00
mt2131.h V4L/DVB (8805): Steven Toth email address change 2008-09-03 18:37:21 -03:00
mt2131_priv.h V4L/DVB (8805): Steven Toth email address change 2008-09-03 18:37:21 -03:00
mt2266.c
mt2266.h
mxl5005s.c V4L/DVB (11233): mxl5005s: Switch in mxl5005s_set_params should operate on correct values 2009-03-30 12:43:42 -03:00
mxl5005s.h V4L/DVB (8805): Steven Toth email address change 2008-09-03 18:37:21 -03:00
mxl5007t.c V4L/DVB (10784): mxl5007t: update driver for MxL 5007T V4 2009-03-30 12:43:03 -03:00
mxl5007t.h V4L/DVB (8549): mxl5007: Fix an error at include file 2008-07-27 19:36:08 -03:00
qt1010.c V4L/DVB (12341): zl10353 and qt1010: fix stack corruption bug 2009-08-13 20:39:02 -03:00
qt1010.h
qt1010_priv.h
tda827x.c V4L/DVB (11236): tda827x: fix locking issues with DVB-C 2009-03-30 12:43:42 -03:00
tda827x.h V4L/DVB (9049): convert tuner drivers to use dvb_frontend->callback 2008-10-12 09:37:09 -02:00
tda8290.c V4L/DVB (10876): tda18271: add support for AGC configuration via tuner callback 2009-03-30 12:43:11 -03:00
tda8290.h V4L/DVB (9049): convert tuner drivers to use dvb_frontend->callback 2008-10-12 09:37:09 -02:00
tda9887.c V4L/DVB (9497): tda9887/cx88: Adds SECAM/BGH standards 2008-12-29 17:53:25 -02:00
tda9887.h
tda18271-common.c V4L/DVB (12868): tda18271: improve error log in function tda18271_write_regs 2009-09-19 00:13:48 -03:00
tda18271-fe.c V4L/DVB (13109): tda18271: fix signedness issue in tda18271_rf_tracking_filters_init 2009-11-07 12:55:04 -02:00
tda18271-maps.c V4L/DVB (12871): tda18271: fix bad data in tda18271_cid_target table 2009-09-19 00:13:52 -03:00
tda18271-priv.h V4L/DVB (12864): tda18271: change output feature configuration to a bitmask 2009-09-19 00:13:43 -03:00
tda18271.h V4L/DVB (12864): tda18271: change output feature configuration to a bitmask 2009-09-19 00:13:43 -03:00
tea5761.c V4L/DVB (10730): v4l-dvb: cleanup obsolete references to v4l1 headers. 2009-03-30 12:42:59 -03:00
tea5761.h
tea5767.c V4L/DVB (10730): v4l-dvb: cleanup obsolete references to v4l1 headers. 2009-03-30 12:42:59 -03:00
tea5767.h
tuner-i2c.h
tuner-simple.c V4L/DVB (12573): FM1216MK5 FM radio 2009-09-12 12:19:33 -03:00
tuner-simple.h
tuner-types.c V4L/DVB (12964): tuner-core: add support for NXP TDA18271 without TDA829X demod 2009-09-19 00:16:01 -03:00
tuner-xc2028-types.h
tuner-xc2028.c V4L/DVB (12394): cx88: Disable xc3028 power management for Geniatech x8000 2009-08-13 20:39:07 -03:00
tuner-xc2028.h V4L/DVB (12394): cx88: Disable xc3028 power management for Geniatech x8000 2009-08-13 20:39:07 -03:00
xc5000.c V4L/DVB (11806): xc5000: add copyright line 2009-06-16 18:21:08 -03:00
xc5000.h V4L/DVB (9261): xc5000: Checkpatch compliance 2008-10-17 17:27:59 -03:00