From jamesn@here.what.net  Fri Nov  6 23:41:09 1998
Received: from here.what.net (here.what.net [207.136.36.35])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA05952
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 6 Nov 1998 23:41:00 -0800 (PST)
          (envelope-from jamesn@here.what.net)
Received: (from jamesn@localhost)
	by here.what.net (8.9.1/8.9.1) id BAA01553;
	Sat, 7 Nov 1998 01:40:47 -0600 (CST)
	(envelope-from jamesn)
Message-Id: <199811070740.BAA01553@here.what.net>
Date: Sat, 7 Nov 1998 01:40:47 -0600 (CST)
From: jamesn@airmail.net
Reply-To: jamesn@airmail.net
To: FreeBSD-gnats-submit@freebsd.org
Cc: jamesn@airmail.net
Subject:
X-Send-Pr-Version: 3.2

>Number:         8585
>Category:       kern
>Synopsis:       bktr driver does not correctly identify I2C devices in some cases
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov  6 23:50:01 PST 1998
>Closed-Date:    Tue Jun 29 10:08:58 PDT 1999
>Last-Modified:  Tue Jun 29 10:15:19 PDT 1999
>Originator:     James Nuckolls
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

Hauppauge WinTV/DBX/FM (Model 401)

Output of uname -a:
FreeBSD here.what.net 3.0-CURRENT FreeBSD 3.0-CURRENT #13: Sat Nov  7 01:11:19 CST 1998     root@here.what.net:/usr/src/sys/compile/HERE  i386

dmesg:
Copyright (c) 1992-1998 FreeBSD Inc.
Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California. All rights reserved.
FreeBSD 3.0-CURRENT #13: Sat Nov  7 01:11:19 CST 1998
    root@here.what.net:/usr/src/sys/compile/HERE
Calibrating clock(s) ... TSC clock: 198923195 Hz, i8254 clock: 1193039 Hz
CLK_USE_I8254_CALIBRATION not specified - using default frequency
Timecounter "i8254"  frequency 1193182 Hz
CLK_USE_TSC_CALIBRATION not specified - using old calibration method
Timecounter "TSC"  frequency 198948149 Hz
CPU: Pentium/P55C (198.95-MHz 586-class CPU)
  Origin = "GenuineIntel"  Id = 0x543  Stepping=3
  Features=0x8001bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,MMX>
real memory  = 67108864 (65536K bytes)
Physical memory chunk(s):
0x00001000 - 0x0009efff, 647168 bytes (158 pages)
0x002a5000 - 0x03febfff, 64253952 bytes (15687 pages)
config> quit
avail memory = 62455808 (60992K bytes)
Found BIOS32 Service Directory header at 0xf00fb090
Entry = 0xfb510 (0xf00fb510)  Rev = 0  Len = 1
PCI BIOS entry at 0xb540
DMI header at 0xf00f5ee0
Version 2.0
Table at 0xf0800, 32 entries, 746 bytes
Other BIOS signatures found:
ACPI: 00000000
$PnP: 000fc070
Preloaded elf kernel "kernel" at 0xf0298000.
pci_open(1):	mode 1 addr port (0x0cf8) is 0x8000005c
pci_open(1a):	mode1res=0x80000000 (0x80000000)
pci_cfgcheck:	device 0 [class=060000] [hdr=00] is there (id=12508086)
Probing for devices on PCI bus 0:
found->	vendor=0x8086, dev=0x1250, revid=0x03
	class=06-00-00, hdrtype=0x00, mfdev=0
	subordinatebus=0 	secondarybus=0
chip0: <Intel 82439> rev 0x03 on pci0.0.0
found->	vendor=0x8086, dev=0x7000, revid=0x01
	class=06-01-00, hdrtype=0x00, mfdev=1
	subordinatebus=0 	secondarybus=0
chip1: <Intel 82371SB PCI to ISA bridge> rev 0x01 on pci0.7.0
	I/O Recovery Timing: 8-bit 1 clocks, 16-bit 1 clocks
	Extended BIOS: disabled
	Lower BIOS: disabled
	Coprocessor IRQ13: enabled
	Mouse IRQ12: disabled
	Interrupt Routing: A: IRQ15, B: IRQ11, C: IRQ10, D: IRQ12
		MB0: , MB1: 
found->	vendor=0x8086, dev=0x7010, revid=0x00
	class=01-01-80, hdrtype=0x00, mfdev=0
	subordinatebus=0 	secondarybus=0
	map[0]: type 4, range 32, base 0000f000, size  4
found->	vendor=0x109e, dev=0x036e, revid=0x02
	class=04-00-00, hdrtype=0x00, mfdev=1
	subordinatebus=0 	secondarybus=0
	intpin=a, irq=12
	map[0]: type 3, range 32, base e4001000, size 12
bktr0: <BrookTree 878> rev 0x02 int a irq 12 on pci0.17.0
bti2c0: <bt848 Hard/Soft I2C controller>
iicbb0: <I2C generic bit-banging driver> on bti2c0
iicbus0: <Philips I2C bus> on iicbb0 master-only
Probing for devices on iicbus0: <a0> <a1> <b6> <b7> <c2> <c3>
iicsmb0: <I2C to SMB bridge> on iicbus0
smbus0: <System Management Bus> on iicsmb0
smbus1: <System Management Bus> on bti2c0
brooktree0: PCI bus latency is 64.
bktr0: buffer size 3555328, addr 0x3000000
bktr: no I2C device found!
bktr: GPIO is 0x00fffffb
Intel Smart Video III/VideoLogic Captivator PCI, <none> tuner.
found->	vendor=0x109e, dev=0x0878, revid=0x02
	class=04-80-00, hdrtype=0x00, mfdev=1
	subordinatebus=0 	secondarybus=0
	intpin=a, irq=12
	map[0]: type 3, range 32, base e4000000, size 12
found->	vendor=0x5333, dev=0x88f0, revid=0x00
	class=03-00-00, hdrtype=0x00, mfdev=0
	subordinatebus=0 	secondarybus=0
	intpin=a, irq=10
	map[0]: type 1, range 32, base e0000000, size 25
vga0: <S3 968 graphics accelerator> rev 0x00 int a irq 10 on pci0.18.0
found->	vendor=0x1011, dev=0x0009, revid=0x22
	class=02-00-00, hdrtype=0x00, mfdev=0
	subordinatebus=0 	secondarybus=0
	intpin=a, irq=11
	map[0]: type 4, range 32, base 00006400, size  7
	map[1]: type 1, range 32, base e4002000, size  7
de0: <Digital 21140A Fast Ethernet> rev 0x22 int a irq 11 on pci0.19.0
de0: 21140A [10-100Mb/s] pass 2.2
de0: address 00:40:05:a2:c8:c6
bpf: de0 attached
found->	vendor=0x9004, dev=0x8178, revid=0x00
	class=01-00-00, hdrtype=0x00, mfdev=0
	subordinatebus=0 	secondarybus=0
	intpin=a, irq=15
	map[0]: type 4, range 32, base 00006800, size  8
	map[1]: type 1, range 32, base e4003000, size 12
ahc0: <Adaptec 2940 Ultra SCSI adapter> rev 0x00 int a irq 15 on pci0.20.0
ahc0: Reading SEEPROM...done.
ahc0: internal 50 cable is present, internal 68 cable not present
ahc0: external cable not present
ahc0: BIOS eeprom not present
ahc0: Low byte termination Enabled
ahc0: aic7880 Single Channel A, SCSI Id=7, 16/255 SCBs
ahc0: Resetting Channel A
ahc0: Downloading Sequencer Program... 411 instructions downloaded
Initializing PnP override table
Probing for PnP devices:
Trying Read_Port at 203
Trying Read_Port at 243
PnP: CSN 1 COMP_DEVICE_ID = 0x2fb0d041
CSN 1 Vendor ID: CTL00c3 [0xc3008c0e] Serial 0x1187b75f Comp ID: PNPb02f [0x2fb0d041]
Called nullpnp_probe with tag 0x00000001, type 0xc3008c0e
Called nullpnp_probe with tag 0x00000001, type 0x2fb0d041
port 0x0220 0x0330 0x0388 0x0000 irq 5:0 drq 1:5 en 1
port 0x0220 0x0330 0x0388 0x0000 irq 5:0 drq 1:5 en 1
pcm1 (SB16pnp <SB16 PnP> sn 0x1187b75f) at 0x220-0x22f irq 5 drq 1 flags 0x15 on isa
Probing for devices on the ISA bus:
video: RTC equip. code:0x0f, DCC code:0x09
video: CRTC:0x3d4, video option:0x60, rows:80, cols:25, font height:16
video: param table EGA/VGA:0xf00c39ae, CGA/MDA:0
video: rows_offset:1
video#0: adapter type:VGA (5), flags:0x7f, CRTC:0x3d4
video#0: init mode:24, bios mode:3, current mode:24
video#0: window:0xf00b8000 size:32k gran:32k, buf:0xf0000000 size:0k
video#0: mode:0, flags:0x1 T 40x25, font:8x8, win:0xb8000
video#0: mode:1, flags:0x1 T 40x25, font:8x8, win:0xb8000
[snip video mode description...]
video#0: mode:37, flags:0x3 G 320x240x8, 1 plane(s), font:8x8, win:0xa0000
VGA parameters upon power-up
50 18 10 00 00 00 03 00 02 67 5f 4f 50 82 55 81 
bf 1f 00 4f 0e 0f 00 00 07 80 9c 8e 8f 28 1f 96 
b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b 3c 
3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00 ff 
VGA parameters in BIOS for mode 24
50 18 10 00 10 00 03 00 02 67 5f 4f 50 82 55 81 
bf 1f 00 4f 0d 0e 00 00 00 00 9c 8e 8f 28 1f 96 
b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b 3c 
3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00 ff 
EGA/VGA parameters to be used for mode 24
50 18 10 00 10 00 03 00 02 67 5f 4f 50 82 55 81 
bf 1f 00 4f 0d 0e 00 00 00 00 9c 8e 8f 28 1f 96 
b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b 3c 
3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00 ff 
sc0: the current keyboard controller command byte 0065
kbdio: DIAGNOSE status:0055
kbdio: TEST_KBD_PORT status:0000
kbdio: RESET_KBD return code:00fa
kbdio: RESET_KBD status:00aa
sc0: keyboard device ID: ab41
sc0 at 0x60-0x6f irq 1 on motherboard
sc0: VGA color <16 virtual consoles, flags=0x0>
sio0: irq maps: 0x1 0x11 0x1 0x1
sio0 at 0x3f8-0x3ff irq 4 flags 0x10 on isa
sio0: type 16550A
sio1: irq maps: 0x1 0x9 0x1 0x1
sio1 at 0x2f8-0x2ff irq 3 on isa
sio1: type 16550A
lpt0 at 0x3bc-0x3c3 irq 7 on isa
lpt0: Interrupt-driven port
lp0: TCP/IP capable interface
bpf: lp0 attached
mss_probe: no address supplied, try default 0x530
mss_detect error, busy still set (0xff)
sb_probe: no address supplied, try defaults (0x220,0x240)
device at 0x220 already attached as unit 1
pcm0 not found
fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
fdc0: FIFO enabled, 8 bytes threshold
fd0: 1.44MB 3.5in
npx0 on motherboard
npx0: INT 16 interface
i586_bzero() bandwidth = 173973556 bytes/sec
bzero() bandwidth = 87935279 bytes/sec
imasks: bio c0080040, tty c00300ba, net c0061800
BIOS Geometries:
 0:00000000 0..0=1 cylinders, 0..0=1 heads, 1..0=0 sectors
 1:00000000 0..0=1 cylinders, 0..0=1 heads, 1..0=0 sectors
 2:00000000 0..0=1 cylinders, 0..0=1 heads, 1..0=0 sectors
 3:00000000 0..0=1 cylinders, 0..0=1 heads, 1..0=0 sectors
 4:00000000 0..0=1 cylinders, 0..0=1 heads, 1..0=0 sectors
 5:00000000 0..0=1 cylinders, 0..0=1 heads, 1..0=0 sectors
 6:00000000 0..0=1 cylinders, 0..0=1 heads, 1..0=0 sectors
 7:00000000 0..0=1 cylinders, 0..0=1 heads, 1..0=0 sectors
 0 accounted for
Device configuration finished.
Intel Pentium F00F detected, installing workaround
bpf: lo0 attached
Waiting 2 seconds for SCSI devices to settle
(noperiph:ahc0:0:X:X): SCSI bus reset delivered. 0 SCBs aborted.
de0: enabling 10baseT port
ahc0: Selection Timeout on A:1. 1 SCBs aborted
ahc0: Selection Timeout on A:2. 1 SCBs aborted
ahc0: Selection Timeout on A:3. 1 SCBs aborted
ahc0: Selection Timeout on A:6. 1 SCBs aborted
ahc0: target 0 synchronous at 10.0MHz, offset = 0xf
(probe5:ahc0:0:5:0): INQUIRY. CDB: 12 1 80 0 ff 0 
(probe5:ahc0:0:5:0): ILLEGAL REQUEST asc:24,0
(probe5:ahc0:0:5:0): Invalid field in CDB
sa0 at ahc0 bus 0 target 4 lun 0
sa0: <Seagate STT8000N 3.22> Removable Sequential Access SCSI2 device 
sa0: Serial Number 
sa0: 3.300MB/s transfers
pass0 at ahc0 bus 0 target 0 lun 0
pass0: <QUANTUM XP39100J LYK8> Fixed Direct Access SCSI2 device 
pass0: Serial Number PCB=20-113021-02; HDA=189706533229
pass0: 10.0MB/s transfers (10.0MHz, offset 15), Tagged Queueing Enabled
pass1 at ahc0 bus 0 target 4 lun 0
pass1: <Seagate STT8000N 3.22> Removable Sequential Access SCSI2 device 
pass1: Serial Number 
pass1: 3.300MB/s transfers
pass2 at ahc0 bus 0 target 5 lun 0
pass2: <NEC CD-ROM DRIVE:222 3.0i> Removable CD-ROM SCSI2 device 
pass2: 3.300MB/s transfers
da0 at ahc0 bus 0 target 0 lun 0
da0: <QUANTUM XP39100J LYK8> Fixed Direct Access SCSI2 device 
da0: Serial Number PCB=20-113021-02; HDA=189706533229
da0: 10.0MB/s transfers (10.0MHz, offset 15), Tagged Queueing Enabled
da0: 8682MB (17781520 512 byte sectors: 255H 63S/T 1106C)
Considering FFS root f/s.
changing root device to da0s1a
da0s1: type 0xa5, start 63, end = 17767889, size 17767827 : OK
ffs_mountfs: superblock updated for soft updates
ffs_mountfs: superblock updated for soft updates
de0: enabling 10baseT port
(cd0:ahc0:0:5:0): READ CD RECORDED CAPACITY. CDB: 25 0 0 0 0 0 0 0 0 0 
(cd0:ahc0:0:5:0): NOT READY asc:3a,0
(cd0:ahc0:0:5:0): Medium not present
cd0 at ahc0 bus 0 target 5 lun 0
cd0: <NEC CD-ROM DRIVE:222 3.0i> Removable CD-ROM SCSI2 device 
cd0: 3.300MB/s transfers
cd0: Attempt to query device size failed: NOT READY, Medium not present

Relevnet sections of kernel config:

controller iicbus0
controller iicbb0

device iic0 at iicbus?
device ic0 at iicbus?
device iicsmb0 at iicbus?

controller smbus0

device smb0     at smbus?

device          bktr0


>Description:

bktr driver failes to correctly identify any I2C devices, including
tuner.  This renders the card (nearly) useless (the tuner is still
set to the channel I last watched.   fxtv does display this channel,
though it's (of course) unable to change frequency.  

Any attemptes to alter volume levels (clicking the 'mute' button)
fail.  When this happens, fxtv outputs:

ioctl(BT848_SAUDIO, 129) failed: Input/output error

(the ioctl BT848_SAUDIO failes).


>How-To-Repeat:

Install BT878 card, add iicbus, smbus and bktr driver device/controller
lines to kernel config, build kernel, reboot.

>Fix:
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-ports 
Responsible-Changed-By: steve 
Responsible-Changed-When: Sun Nov 8 17:31:33 PST 1998 
Responsible-Changed-Why:  
Misfiled PR. 
Responsible-Changed-From-To: freebsd-ports->freebsd-bugs
Responsible-Changed-By: jseger
Responsible-Changed-When: Thu Dec 24 19:29:48 GMT 1998
Responsible-Changed-Why: 
This looks like a kernel problem, not a port problem.
State-Changed-From-To: open->closed 
State-Changed-By: roger 
State-Changed-When: Tue Jun 29 10:08:58 PDT 1999 
State-Changed-Why:  
Problem was due to mixing char and unsighed char in the 
bt848_i2c.c file. 
Fixed in 3.1 and 4.x 
>Unformatted:
