android_kernel_xiaomi_sm8350/drivers/media/common/tuners
Mauro Carvalho Chehab ef88f2b563 V4L/DVB (10527): tuner: fix TUV1236D analog/digital setup
As reported by David Engel <david@istwok.net>, ATSC115 doesn't work
fine with mythtv. This software opens both analog and dvb interfaces of
saa7134.

What happens is that some tuner commands are going to the wrong place,
as shown at the logs:

Feb 12 20:37:48 opus kernel: tuner-simple 1-0061: using tuner params #0 (ntsc)
Feb 12 20:37:48 opus kernel: tuner-simple 1-0061: freq = 67.25 (1076), range = 0, config = 0xce, cb = 0x01
Feb 12 20:37:48 opus kernel: tuner-simple 1-0061: Freq= 67.25 MHz, V_IF=45.75 MHz, Offset=0.00 MHz, div=1808
Feb 12 20:37:48 opus kernel: tuner 1-0061: tv freq set to 67.25
Feb 12 20:37:48 opus kernel: tuner-simple 1-000a: using tuner params #0 (ntsc)
Feb 12 20:37:48 opus kernel: tuner-simple 1-000a: freq = 67.25 (1076), range = 0, config = 0xce, cb = 0x01
Feb 12 20:37:48 opus kernel: tuner-simple 1-000a: Freq= 67.25 MHz, V_IF=45.75 MHz, Offset=0.00 MHz, div=1808
Feb 12 20:37:48 opus kernel: tuner-simple 1-000a: tv 0x07 0x10 0xce 0x01
Feb 12 20:37:48 opus kernel: tuner-simple 1-0061: tv 0x07 0x10 0xce 0x01

This happens due to a hack at TUV1236D analog setup, where it replaces
tuner address, at 0x61 for 0x0a, in order to save a few memory bytes.

The code assumes that nobody else would try to access the tuner during
that setup, but the point is that there's no lock to protect such
access. So, this opens the possibility of race conditions to happen.

Instead of hacking tuner address, this patch uses a temporary var with
the proper tuner value to be used during the setup. This should save
the issue, although we should consider to write some analog/digital
lock at saa7134 driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-02-17 09:43:08 -03:00
..
Kconfig
Makefile
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 V4L/DVB (10248): v4l-dvb: fix a bunch of compile warnings. 2009-01-29 08:38:04 -02:00
mxl5007t.h
qt1010_priv.h
qt1010.c
qt1010.h
tda827x.c V4L/DVB (9774): tda827x: fix returned frequency 2008-12-30 09:38:18 -02:00
tda827x.h
tda8290.c V4L/DVB (10182): tda8290: fix TDA8290 + TDA18271 initialization 2009-01-07 22:18:55 -02:00
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 V4L/DVB (10527): tuner: fix TUV1236D analog/digital setup 2009-02-17 09:43:08 -03:00
tuner-simple.h
tuner-types.c
tuner-xc2028-types.h
tuner-xc2028.c V4L/DVB (9913): tuner-xc2028: allow printing stack trace as debug on sleep code 2008-12-30 09:39:15 -02:00
tuner-xc2028.h
xc5000.c V4L/DVB (9923): xc5000: remove init_fw option 2008-12-30 09:39:19 -02:00
xc5000.h