Bug 5699

Summary: saa7134 tuner no longer detected (i2c bugs?)
Product: Drivers Reporter: Jan de Groot (jan)
Component: Video(Other)Assignee: Mauro Carvalho Chehab (mchehab)
Status: REJECTED INSUFFICIENT_DATA    
Severity: normal CC: jdelvare, nshmyrev
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.15-rc3 / rc5 Subsystem:
Regression: --- Bisected commit-id:
Attachments: output of saa7134 modprobe with debug turned on
i2c output with 2.6.14
kernel log output with new requested options, 2.6.15-rc5
2.6.14 with updated v4l snapshot... doesn't work either

Description Jan de Groot 2005-12-04 06:17:08 UTC
Most recent kernel where this bug did not occur: 2.6.14
Distribution: Archlinux
Hardware Environment: saa7134 based Pinnacle PCTV Stereo card
Software Environment: tvtime or whatever TV application
Problem Description:
Tuner is no longer detected.
Output from 2.6.14:
Nov 27 11:12:14 server saa7130/34: v4l2 driver version 0.2.14 loaded
Nov 27 11:12:14 server ACPI: PCI Interrupt 0000:00:0d.0[A] -> GSI 17 (level,
low) -> IRQ 16
Nov 27 11:12:14 server saa7134[0]: found at 0000:00:0d.0, rev: 1, irq: 16,
latency: 32, mmio: 0xcfff6c00
Nov 27 11:12:14 server saa7134[0]: subsystem: 11bd:002b, board: Pinnacle PCTV
Stereo (saa7134) [card=26,autodetected]
Nov 27 11:12:14 server saa7134[0]: board init: gpio is 0
Nov 27 11:12:14 server saa7134[0]: i2c eeprom 00: bd 11 2b 00 f8 f8 1c 00 43 43
a9 1c 55 d2 b2 92
Nov 27 11:12:14 server saa7134[0]: i2c eeprom 10: 00 00 19 0e ff 20 ff ff ff ff
ff ff ff ff ff ff
Nov 27 11:12:14 server saa7134[0]: i2c eeprom 20: 01 40 01 03 03 ff 03 01 08 ff
00 53 ff ff ff ff
Nov 27 11:12:14 server saa7134[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff
ff ff ff ff ff ff
Nov 27 11:12:14 server tuner 0-0060: chip found @ 0xc0 (saa7134[0])
Nov 27 11:12:14 server tuner 0-0060: Chip ID is not zero. It is not a TEA5767
Nov 27 11:12:14 server tuner 0-0060: microtune: companycode=3cbf part=42 rev=2f
Nov 27 11:12:14 server tuner 0-0060: microtune MT2050 found, OK
Nov 27 11:12:14 server usb 3-1: new full speed USB device using ohci_hcd and
address 2
Nov 27 11:12:14 server tda9885/6/7: chip found @ 0x86
Nov 27 11:12:14 server saa7134[0]: registered device video0 [v4l2]
Nov 27 11:12:14 server saa7134[0]: registered device vbi0

Output from 2.6.15-rc3 and rc5:
saa7130/34: v4l2 driver version 0.2.14 loaded
ACPI: PCI Interrupt 0000:00:0d.0[A] -> GSI 17 (level, low) -> IRQ 16
saa7134[0]: found at 0000:00:0d.0, rev: 1, irq: 16, latency: 32, mmio: 0xcfff6c00
saa7134[0]: subsystem: 11bd:002b, board: Pinnacle PCTV Stereo (saa7134)
[card=26,autodetected]
saa7134[0]: board init: gpio is 0
saa7134[0]: i2c eeprom 00: bd 11 2b 00 f8 f8 1c 00 43 43 a9 1c 55 d2 b2 92
saa7134[0]: i2c eeprom 10: 00 00 19 0e ff 20 ff ff ff ff ff ff ff ff ff ff
saa7134[0]: i2c eeprom 20: 01 40 01 03 03 ff 03 01 08 ff 00 53 ff ff ff ff
saa7134[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7134[0]: i2c eeprom 40: ff 07 00 c0 86 ff 01 01 ff ff ff ff ff ff ff ff
saa7134[0]: i2c eeprom 50: 0c 22 17 34 02 7f 67 46 ff ff ff ff ff ff ff ff
saa7134[0]: i2c eeprom 60: 03 03 19 71 fb ff ff ff ff ff ff ff ff ff ff ff
saa7134[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
tuner 0-0060: Chip ID is not zero. It is not a TEA5767
tuner 0-0060: chip found @ 0xc0 (saa7134[0])
tuner 0-0060: microtune: companycode=0000 part=00 rev=00
tuner 0-0060: microtune unknown found, not (yet?) supported, sorry :-/
tda9887 0-0043: chip found @ 0x86 (saa7134[0])
tda9887 0-0043: i2c i/o error: rc == -5 (should be 4)
saa7134[0]: registered device video0 [v4l2]
saa7134[0]: registered device vbi0

After this update, my tuner is no longer detected and TV input stays blank in
tvtime or whatever other application that uses v4l.
Comment 1 Jean Delvare 2005-12-04 06:57:57 UTC
The "i2c i/o error -5" is -EIO being returned by saa7134_i2c_xfer. However this
part of the saa7134 driver did not change since 2.6.14.

Please load the saa7134 driver with parameter i2c_debug=2, and provide the logs
for both 2.6.15-rc5 and 2.6.14 for comparison.
Comment 2 Jan de Groot 2005-12-04 07:06:48 UTC
Created attachment 6761 [details]
output of saa7134 modprobe with debug turned on
Comment 3 Mauro Carvalho Chehab 2005-12-04 07:18:36 UTC
We should isolate the bug if it is related to V4L infrastructure or something else.
Please test it again with 2.6.14 and v4l tree (you can download it from
http://linuxtv.org)
Just download latest snapshot or CVS tree, do make/make install
it will override kernel's v4l drivers.
Please use the following insmod options:
tuner tuner_debug=1 show_i2c=1
tda9887 debug=1
saa7134 i2c_scan=1 i2c_debug=2
Comment 4 Jan de Groot 2005-12-04 07:19:48 UTC
Created attachment 6762 [details]
i2c output with 2.6.14
Comment 5 Jan de Groot 2005-12-04 07:25:41 UTC
Created attachment 6763 [details]
kernel log output with new requested options, 2.6.15-rc5
Comment 6 Jan de Groot 2005-12-04 07:40:17 UTC
Created attachment 6764 [details]
2.6.14 with updated v4l snapshot... doesn't work either
Comment 7 Mauro Carvalho Chehab 2005-12-04 08:33:17 UTC
please try to disable IR with
saa7134 disable_ir=1
Comment 8 Jan de Groot 2005-12-04 09:02:01 UTC
Doesn't change anything in the detection of the tuner. What I notice as main
difference between the two dmesg outputs:
Dec  4 16:44:06 server tuner 0-0060: MT20xx hexdump: 00 00 00 00 00 00 00 00  00
00 00 00 00 00 00 00  00 00 00 00 00
Dec  4 16:44:06 server tuner 0-0060: microtune: companycode=0000 part=00 rev=00
Dec  4 16:44:06 server tuner 0-0060: microtune unknown found, not (yet?)
supported, sorry :-/

or this:
Nov 29 07:21:56 server tuner 0-0060: microtune: companycode=3cbf part=42 rev=2f
Nov 29 07:21:56 server tuner 0-0060: microtune MT2050 found, OK

Somehow the MT20xx hexdump data isn't assigned somewhere in 2.6.15.
Comment 9 Nickolay V. Shmyrev 2005-12-04 11:50:35 UTC
Jan, sorry for bothering, can you try also with option no_autodetect to tuner
module (and with a reboot I suspect, to return i2c bus to working state).
Comment 10 Jan de Groot 2005-12-05 04:06:59 UTC
This is what I get with no_autodetect:

tuner 0-0043: MT20xx hexdump: 10 10 10 10 10 10 10 10  10 10 10 10 10 10 10 10
10 10 10 10 10
tuner 0-0043: microtune: companycode=1010 part=10 rev=10
tuner 0-0043: microtune unknown found, not (yet?) supported, sorry :-/
Comment 11 Nickolay V. Shmyrev 2005-12-07 14:11:13 UTC
I've just remembered that we have the following probably related comment in tda
sources:

   - Pinnacle PCTV (Jul.2002 Version with MT2032, bttv)
      TDA9887 (world), TDA9885 (USA)
      Note: OP2 of tda988x must be set to 1, else MT2032 is disabled!

Please make sure you have correct port2 option to tda9887
Comment 12 Jan de Groot 2005-12-07 14:42:59 UTC
Bingo, that brought back my TV tuner :)

Seems there's a change in the code that doesn't set this option by default
anymore. Putting "options tda9887 port2=1" in modprobe.conf fixes my tuner
detection.
Comment 13 Mauro Carvalho Chehab 2005-12-08 09:44:13 UTC
Patch added to v4l tree. Fix will be sent to kernel at the next patchset.
Comment 14 Jan de Groot 2006-01-05 11:50:09 UTC
With 2.6.15 final I have to set the port2=1 option for tda9887
/etc/modprobe.conf, load the tda9887 module first and then load up the saa7134
module. When I load saa7134 first, which autoloads the tuner modules, no tuner
is detected. 
Comment 15 Jan de Groot 2006-01-13 15:15:41 UTC
To be correct on this one: the port2=1 workaround is required for 2.6.14 final
also. The last version I had on my system that worked out of the box was 2.6.14-rc4.
Comment 16 Nickolay V. Shmyrev 2006-01-18 13:16:21 UTC
Sorry, Jan. Can you confirm that with recent v4l-dvb cvs error is reproduced and
port2=1 is still needed?