Re: Twinhan VP1025 problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been able to get my VP1025 to work with the latest v4l-dvb tree from 
Mercurial and FC5 kernel 2.6.16-1.2111_FC5 by manually applying the patches 
at 
http://www.thadathil.net/cgi-bin/hgwebdir.cgi/v4l-algo-test?cmd=changeset;node=675755d11eb289dc063d4fc3fcc0e7503bbd5928
I believe that these were credited to Manu when the v4l-algo-test tree first 
appeared on this mailing list, so I'm giving credit here where it's due.

Mercurial could not apply many of the patches automatically. Also, two or 
three lines of code needed to be modified. It looks like they were affected 
by under-the-hood changes in the last few months. It took me a while to do 
this, and if anyone else finds themself in my position, I'd like to save them 
the time, so I'm attaching a patch against the latest v4l-dvb tree which will 
give you the build tree that worked for me. 

I wasn't sure how to use the hg diff function for what I needed to do, so I 
directly used diff with --unified=5 (to help others apply this after more 
changes have been made in the repo). A patch -p1 command should work to apply 
this to your v4l-dvb tree.

I've only tested this to receive DVB-S IP multicast data. I don't use my card 
for TV or audio, so I have no idea if this patch works for those uses. All I 
can say is that it's good enough to receive NOAAPort data from AMC-4.

Also note that the dmesg lines I reported reading:
> bt878: Unknown symbol bttv_read_gpio
> bt878: Unknown symbol bttv_write_gpio
> bt878: Unknown symbol bttv_gpio_enable
are not very significant. Different kernel configurations caused those to go 
away, but the "Could not find a Twinhan DST" error still occurred.

Best of luck to anyone else with this card. Thank you to Ken Harris for 
pointing me in the right direction, and thanks to everyone who gave him the 
info he gave me.

Nick


On Saturday 20 May 2006 9:12 pm, Nick Luther wrote:
> Hello,
>
> I've Googled and looked through the archives, and seen many threads on this
> topic, but so far none of the solutions have worked for me. I have a
> Twinhan VP1025 and I can't get the frontend to work. I've tried different
> PCI slots, added/removed PCI cards, adjusted BIOS configuration, and
> changed the latency timer. I've used FC5 kernels 2.6.15-1.2054_FC5 and
> 2.6.16-1.2111_FC5. I've also tried a vanilla 2.6.16. I've downloaded the
> most recent drivers from Mercurial and compiled and installed them (today).
> So far nothing has worked, and I always get the same _exact_ error
> messages.
>
> The interesting dmesg lines:
> write_dst: _write_dst error (err == -5, len == 0x08, b0 == 0x00)
> frontend_init: Could not find a Twinhan DST.
> dvb-bt8xx: A frontend driver was not found for device 109e/0878 subsystem
> 1822/0001
>
> The _write_dst error code of -5 is returned from an i2c function call, but
> you already know that.
>
> Any thoughts on what I should do next? Thanks for your help!
>
> Nick Luther
>
> --
>
> lspci -vvv
>
> 00:00.0 Host bridge: VIA Technologies, Inc. VT8361 [KLE133] Host Bridge
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort+ >SERR- <PERR-
>         Latency: 8
>         Region 0: Memory at e0000000 (32-bit, prefetchable) [size=64M]
>         Capabilities: [a0] AGP version 2.0
>                 Status: RQ=8 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64-
> HTrans- 64bit- FW- AGP3- Rate=x1,x2,x4
>                 Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit- FW-
> Rate=<none>
>         Capabilities: [c0] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:01.0 PCI bridge: VIA Technologies, Inc. VT8361 [KLE133] AGP Bridge
> (prog-if 00 [Normal decode])
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort+ >SERR- <PERR+
>         Latency: 0
>         Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
>         I/O behind bridge: 0000f000-00000fff
>         Memory behind bridge: e4000000-e6ffffff
>         Prefetchable memory behind bridge: 10000000-100fffff
>         Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort-
> <TAbort- <MAbort- <SERR- <PERR-
>         BridgeCtl: Parity- SERR- NoISA+ VGA+ MAbort- >Reset- FastB2B-
>         Capabilities: [80] Power Management version 2
>                 Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:07.0 ISA bridge: VIA Technologies, Inc. VT82C686 [Apollo Super South]
> (rev 40)
>         Subsystem: VIA Technologies, Inc. VT82C686/A PCI to ISA Bridge
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping+ SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 0
>         Capabilities: [c0] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:07.1 IDE interface: VIA Technologies, Inc.
> VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06) (prog-if
> 8a [Master SecP PriP])
>         Subsystem: VIA Technologies, Inc.
> VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32
>         Region 4: I/O ports at d000 [size=16]
>         Capabilities: [c0] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:07.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
> Controller (rev 1a) (prog-if 00 [UHCI])
>         Subsystem: VIA Technologies, Inc. (Wrong ID) USB Controller
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32, Cache Line Size 08
>         Interrupt: pin D routed to IRQ 10
>         Region 4: I/O ports at d400 [size=32]
>         Capabilities: [80] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:07.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1
> Controller (rev 1a) (prog-if 00 [UHCI])
>         Subsystem: VIA Technologies, Inc. (Wrong ID) USB Controller
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32, Cache Line Size 08
>         Interrupt: pin D routed to IRQ 10
>         Region 4: I/O ports at d800 [size=32]
>         Capabilities: [80] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:07.4 Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev
> 40) Subsystem: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] Control:
> I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR-
> FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Interrupt: pin ? routed to IRQ 3
>         Capabilities: [68] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:07.5 Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97
> Audio Controller (rev 50)
>         Subsystem: Realtek Semiconductor Co., Ltd. Unknown device 4710
>         Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Interrupt: pin C routed to IRQ 11
>         Region 0: I/O ports at dc00 [size=256]
>         Region 1: I/O ports at e000 [size=4]
>         Region 2: I/O ports at e400 [size=4]
>         Capabilities: [c0] Power Management version 2
>                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:09.0 Multimedia video controller: Brooktree Corporation Bt878 Video
> Capture (rev 11)
>         Subsystem: Twinhan Technology Co. Ltd VisionPlus DVB card
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32 (4000ns min, 10000ns max)
>         Interrupt: pin A routed to IRQ 17
>         Region 0: Memory at e8002000 (32-bit, prefetchable) [size=4K]
>         Capabilities: [44] Vital Product Data
>         Capabilities: [4c] Power Management version 2
>                 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:09.1 Multimedia controller: Brooktree Corporation Bt878 Audio Capture
> (rev 11)
>         Subsystem: Twinhan Technology Co. Ltd VisionPlus DVB Card
>         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32 (1000ns min, 63750ns max)
>         Interrupt: pin A routed to IRQ 17
>         Region 0: Memory at e8000000 (32-bit, prefetchable) [size=4K]
>         Capabilities: [44] Vital Product Data
>         Capabilities: [4c] Power Management version 2
>                 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 00:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
> RTL-8139/8139C/8139C+ (rev 10)
>         Subsystem: Biostar Microtech Int'l Corp Unknown device 0039
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32 (8000ns min, 16000ns max)
>         Interrupt: pin A routed to IRQ 16
>         Region 0: I/O ports at e800 [size=256]
>         Region 1: Memory at e8001000 (32-bit, non-prefetchable) [size=256]
>         [virtual] Expansion ROM at 10100000 [disabled] [size=64K]
>         Capabilities: [50] Power Management version 2
>                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA
> PME(D0-,D1+,D2+,D3hot+,D3cold+)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
> 01:00.0 VGA compatible controller: Trident Microsystems CyberBlade/i1
> (prog-if 00 [VGA])
>         Subsystem: Trident Microsystems CyberBlade/i1
>         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
>         Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
> <TAbort- <MAbort- >SERR- <PERR-
>         Latency: 32
>         Interrupt: pin A routed to IRQ 18
>         Region 0: Memory at e5800000 (32-bit, non-prefetchable) [size=8M]
>         Region 1: Memory at e6000000 (32-bit, non-prefetchable) [size=128K]
>         Region 2: Memory at e5000000 (32-bit, non-prefetchable) [size=8M]
>         [virtual] Expansion ROM at 10000000 [disabled] [size=64K]
>         Capabilities: [80] AGP version 1.0
>                 Status: RQ=33 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64-
> HTrans- 64bit- FW- AGP3- Rate=x1,x2,x4
>                 Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit- FW-
> Rate=<none>
>         Capabilities: [90] Power Management version 1
>                 Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA
> PME(D0-,D1-,D2-,D3hot-,D3cold-)
>                 Status: D0 PME-Enable- DSel=0 DScale=0 PME-
>
>
>
>
> dmesg excerpt:
>
> Linux video capture interface: v1.00
> parport_pc: VIA parallel port: io=0x378, irq=7
> ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
> ACPI: PCI Interrupt 0000:00:07.5[C] -> Link [LNKC] -> GSI 11 (level, low)
> -> IRQ 11
> PCI: Via IRQ fixup for 0000:00:07.5, from 5 to 11
> PCI: Setting latency timer of device 0000:00:07.5 to 64
> bttv: driver version 0.9.16 loaded
> bttv: using 8 buffers with 2080k (520 pages) each for capture
> bt878: Unknown symbol bttv_read_gpio
> bt878: Unknown symbol bttv_write_gpio
> bt878: Unknown symbol bttv_gpio_enable
> bttv: Bt8xx card found (0).
> ACPI: PCI Interrupt 0000:00:09.0[A] -> GSI 17 (level, low) -> IRQ 17
> bttv0: Bt878 (rev 17) at 0000:00:09.0, irq: 17, latency: 32, mmio:
> 0xe8002000 bttv0: detected: Twinhan VisionPlus DVB [card=113], PCI
> subsystem ID is 1822:0001
> bttv0: using: Twinhan DST + clones [card=113,insmod option]
> bttv0: gpio: en=00000000, out=00000000 in=00d500ff [init]
> bttv0: using tuner=4
> bttv0: add subdevice "dvb0"
> cyblafb: CyblaFB version 0.62 initializing
> ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 18
> Console: switching to colour frame buffer device 80x25
> USB Universal Host Controller Interface driver v2.3
> ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 10
> ACPI: PCI Interrupt 0000:00:07.2[D] -> Link [LNKD] -> GSI 10 (level, low)
> -> IRQ 10
> PCI: Via IRQ fixup for 0000:00:07.2, from 11 to 10
> uhci_hcd 0000:00:07.2: UHCI Host Controller
> uhci_hcd 0000:00:07.2: new USB bus registered, assigned bus number 1
> uhci_hcd 0000:00:07.2: irq 10, io base 0x0000d400
> usb usb1: configuration #1 chosen from 1 choice
> hub 1-0:1.0: USB hub found
> hub 1-0:1.0: 2 ports detected
> ACPI: PCI Interrupt 0000:00:07.3[D] -> Link [LNKD] -> GSI 10 (level, low)
> -> IRQ 10
> PCI: Via IRQ fixup for 0000:00:07.3, from 11 to 10
> uhci_hcd 0000:00:07.3: UHCI Host Controller
> uhci_hcd 0000:00:07.3: new USB bus registered, assigned bus number 2
> uhci_hcd 0000:00:07.3: irq 10, io base 0x0000d800
> usb usb2: configuration #1 chosen from 1 choice
> hub 2-0:1.0: USB hub found
> hub 2-0:1.0: 2 ports detected
> Non-volatile memory driver v1.2
> Floppy drive(s): fd0 is 1.44M
> FDC 0 is a post-1991 82077
> lp0: using parport0 (interrupt-driven).
> lp0: console ready
> ACPI: Power Button (FF) [PWRF]
> ACPI: Power Button (CM) [PWRB]
> ACPI: Sleep Button (CM) [SLPB]
> ibm_acpi: ec object not found
> md: Autodetecting RAID arrays.
> md: autorun ...
> md: ... autorun DONE.
> device-mapper: 4.5.0-ioctl (2005-10-04) initialised: dm-devel@xxxxxxxxxx
> device-mapper: dm-multipath version 1.0.4 loaded
> EXT3 FS on hda1, internal journal
> Adding 554232k swap on /dev/hda2.  Priority:-1 extents:1 across:554232k
> ip_tables: (C) 2000-2006 Netfilter Core Team
> Netfilter messages via NETLINK v0.30.
> ip_conntrack version 2.4 (1983 buckets, 15864 max) - 232 bytes per
> conntrack eth0: link up, 10Mbps, half-duplex, lpa 0x0000
> Bluetooth: Core ver 2.8
> NET: Registered protocol family 31
> Bluetooth: HCI device and connection manager initialized
> Bluetooth: HCI socket layer initialized
> Bluetooth: L2CAP ver 2.8
> Bluetooth: L2CAP socket layer initialized
> Bluetooth: RFCOMM socket layer initialized
> Bluetooth: RFCOMM TTY layer initialized
> Bluetooth: RFCOMM ver 1.7
> Bluetooth: HIDP (Human Interface Emulation) ver 1.1
> ppdev: user-space parallel port driver
> ppdev0: registered pardevice
> ppdev0: unregistered pardevice
> ppdev1: claim the port first
> ppdev2: claim the port first
> ppdev3: claim the port first
> NET: Registered protocol family 10
> lo: Disabled Privacy Extensions
> IPv6 over IPv4 tunneling driver
> eth0: no IPv6 routers present
> bt878: AUDIO driver version 0.0.0 loaded
> bt878: Bt878 AUDIO function found (0).
> ACPI: PCI Interrupt 0000:00:09.1[A] -> GSI 17 (level, low) -> IRQ 17
> bt878_probe: card id=[0x11822],[ Twinhan VisionPlus DVB ] has DVB
> functions. bt878(0): Bt878 (rev 17) at 00:09.1, irq: 17, latency: 32,
> memory: 0xe8000000 DVB: registering new adapter (bttv0).
> rdc_8820_reset: Resetting DST
> dst_gpio_outb: mask=[0004], enbb=[0004], outhigh=[0000]
> dst_gpio_outb: mask=[0004], enbb=[0004], outhigh=[0004]
> dst_comm_init: Initializing DST.
> dst_gpio_outb: mask=[ffffffff], enbb=[0001], outhigh=[0000]
> rdc_reset_state: Resetting state machine
> dst_gpio_outb: mask=[0002], enbb=[0002], outhigh=[0000]
> dst_gpio_outb: mask=[0002], enbb=[0002], outhigh=[0002]
> writing [ 00 06 00 00 00 00 00 fa ]
> write_dst: _write_dst error (err == -5, len == 0x08, b0 == 0x00)
> dst_error_recovery: Trying to return from previous errors.
> dst_gpio_outb: mask=[ffffffff], enbb=[0000], outhigh=[0000]
> dst_gpio_outb: mask=[ffffffff], enbb=[0001], outhigh=[0000]
> write_dst: _write_dst error (err == -5, len == 0x08, b0 == 0x00)
> dst_error_recovery: Trying to return from previous errors.
> dst_gpio_outb: mask=[ffffffff], enbb=[0000], outhigh=[0000]
> dst_gpio_outb: mask=[ffffffff], enbb=[0001], outhigh=[0000]
> write_dst: RDC 8820 RESET
> dst_error_bailout: Trying to bailout from previous error.
> rdc_8820_reset: Resetting DST
> dst_gpio_outb: mask=[0004], enbb=[0004], outhigh=[0000]
> dst_gpio_outb: mask=[0004], enbb=[0004], outhigh=[0004]
> dst_gpio_outb: mask=[ffffffff], enbb=[0000], outhigh=[0000]
> dst_probe: unknown device.
> frontend_init: Could not find a Twinhan DST.
> dvb-bt8xx: A frontend driver was not found for device 109e/0878 subsystem
> 1822/0001
>
>
>
> Relevant modprobe.conf lines:
>
> options dst verbose=4
> options bttv card=0x71 i2c_hw=1
>
> alias char-major-81 bttv
>
>
>
> ls /dev/dvb/adapter0
>
> total 0
> crw-rw---- 1 root root 212, 4 May 20 20:22 demux0
> crw-rw---- 1 root root 212, 5 May 20 20:22 dvr0
> crw-rw---- 1 root root 212, 7 May 20 20:22 net0
>
>
> _______________________________________________
> 
> linux-dvb@xxxxxxxxxxx
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
diff -r --unified=5 --exclude='*.orig' --exclude='*.rej' v4l-dvb/linux/drivers/media/dvb/bt8xx/dst.c v4l-dvb-test2/linux/drivers/media/dvb/bt8xx/dst.c
--- v4l-dvb/linux/drivers/media/dvb/bt8xx/dst.c	2006-05-20 17:52:49.000000000 -0500
+++ v4l-dvb-test2/linux/drivers/media/dvb/bt8xx/dst.c	2006-05-28 14:42:18.000000000 -0500
@@ -36,10 +36,14 @@
 
 static unsigned int dst_addons;
 module_param(dst_addons, int, 0644);
 MODULE_PARM_DESC(dst_addons, "CA daughterboard, default is 0 (No addons)");
 
+static unsigned int dst_algo = 1;
+module_param(dst_algo, int, 0644);
+MODULE_PARM_DESC(dst_algo, "tuning algo: default is 1=(Hardware), 0=(Software)");
+
 #define HAS_LOCK		1
 #define ATTEMPT_TUNE		2
 #define HAS_POWER		4
 
 #define DST_ERROR		0
@@ -361,10 +365,21 @@
 	} else if (state->dst_type == DST_TYPE_IS_CABLE) {
 		freq = freq / 1000;
 		state->tx_tuna[2] = (freq >> 16) & 0xff;
 		state->tx_tuna[3] = (freq >> 8) & 0xff;
 		state->tx_tuna[4] = (u8) freq;
+	} else if (state->dst_type == DST_TYPE_IS_ATSC) {
+		freq = freq / 1000;
+		if (freq < 51000 || freq > 858000)
+			return -EINVAL;
+		state->tx_tuna[2] = (freq >> 16) & 0xff;
+		state->tx_tuna[3] = (freq >> 8) & 0xff;
+		state->tx_tuna[4] = (u8) freq;
+		state->tx_tuna[5] = 0x00;		/*	ATSC	*/
+		state->tx_tuna[6] = 0x00;
+		if (state->dst_hw_cap & DST_TYPE_HAS_ANALOG)
+			state->tx_tuna[7] = 0x00;	/*	Digital	*/
 	} else
 		return -EINVAL;
 
 	return 0;
 }
@@ -556,10 +571,14 @@
 
 	case DST_TYPE_IS_CABLE:
 		otype = "cable";
 		break;
 
+	case DST_TYPE_IS_ATSC:
+		otype = "atsc";
+		break;
+
 	default:
 		dprintk(verbose, DST_INFO, 1, "invalid dst type %d", type);
 		return -EINVAL;
 	}
 	dprintk(verbose, DST_INFO, 1, "DST type: %s", otype);
@@ -646,11 +665,11 @@
 
 	{
 		.device_id = "DST-CI",
 		.offset = 1,
 		.dst_type = DST_TYPE_IS_SAT,
-		.type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_1,
+		.type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_FW_1,
 		.dst_feature = DST_TYPE_HAS_CA
 	},	/*	An OEM board	*/
 
 	{
 		.device_id = "DSTMCI",
@@ -671,12 +690,11 @@
 
 	{
 		.device_id = "DCT-CI",
 		.offset = 1,
 		.dst_type = DST_TYPE_IS_CABLE,
-		.type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_1
-							| DST_TYPE_HAS_FW_2,
+		.type_flags = DST_TYPE_HAS_MULTI_FE | DST_TYPE_HAS_FW_1	| DST_TYPE_HAS_FW_2,
 		.dst_feature = DST_TYPE_HAS_CA
 	},
 
 	{
 		.device_id = "DCTNEW",
@@ -688,11 +706,11 @@
 
 	{
 		.device_id = "DTT-CI",
 		.offset = 1,
 		.dst_type = DST_TYPE_IS_TERR,
-		.type_flags = DST_TYPE_HAS_TS204 | DST_TYPE_HAS_NEWTUNE | DST_TYPE_HAS_FW_2 | DST_TYPE_HAS_MULTI_FE,
+		.type_flags = DST_TYPE_HAS_FW_2 | DST_TYPE_HAS_MULTI_FE,
 		.dst_feature = DST_TYPE_HAS_CA
 	},
 
 	{
 		.device_id = "DTTDIG",
@@ -720,18 +738,20 @@
 
 	{
 		.device_id = "ATSCAD",
 		.offset = 1,
 		.dst_type = DST_TYPE_IS_ATSC,
-		.type_flags = DST_TYPE_HAS_FW_2,
-		.dst_feature = 0
+		.type_flags = DST_TYPE_HAS_MULTI_FE | DST_TYPE_HAS_FW_2 | DST_TYPE_HAS_FW_BUILD,
+		.dst_feature = DST_TYPE_HAS_MAC | DST_TYPE_HAS_ANALOG
+
 	},
 
 	{ }
 
 };
 
+
 static int dst_get_mac(struct dst_state *state)
 {
 	u8 get_mac[] = { 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
 	get_mac[7] = dst_check_sum(get_mac, 7);
 	if (dst_command(state, get_mac, 8) < 0) {
@@ -802,49 +822,69 @@
 	u8 get_tuner_2[] = { 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
 
 	get_tuner_1[7] = dst_check_sum(get_tuner_1, 7);
 	get_tuner_2[7] = dst_check_sum(get_tuner_2, 7);
 	if (state->type_flags & DST_TYPE_HAS_MULTI_FE) {
-		if (dst_command(state, get_tuner_2, 8) < 0) {
-			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
+		dprintk(verbose, DST_ERROR, 1, "DST Type = Multi FE");
+//		if (dst_command(state, get_tuner_2, 8) < 0) {
+		if (dst_command(state, get_tuner_1, 8) < 0) {
+			dprintk(verbose, DST_ERROR, 1, "Cmd=[0x13], Unsupported Command");
 			return -1;
 		}
 	} else {
-		if (dst_command(state, get_tuner_1, 8) < 0) {
-			dprintk(verbose, DST_INFO, 1, "Unsupported Command");
+//		if (dst_command(state, get_tuner_1, 8) < 0) {
+		if (dst_command(state, get_tuner_2, 8) < 0) {
+			dprintk(verbose, DST_ERROR, 1, "Cmd=[0x0b], Unsupported Command");
 			return -1;
 		}
 	}
-	memset(&state->board_info, '\0', 8);
 	memcpy(&state->board_info, &state->rxbuffer, 8);
 	if (state->type_flags & DST_TYPE_HAS_MULTI_FE) {
+		dprintk(verbose, DST_ERROR, 1, "DST Type: Multi FE=[0x%02x, 0x%02x]",
+			state->board_info[0], state->board_info[1]);
+/*
 		if (state->board_info[1] == 0x0b) {
 			if (state->type_flags & DST_TYPE_HAS_TS204)
 				state->type_flags &= ~DST_TYPE_HAS_TS204;
 			state->type_flags |= DST_TYPE_HAS_NEWTUNE;
-			dprintk(verbose, DST_INFO, 1, "DST type has TS=188");
+			dprintk(verbose, DST_ERROR, 1, "DST type has TS=188");
 		} else {
 			if (state->type_flags & DST_TYPE_HAS_NEWTUNE)
 				state->type_flags &= ~DST_TYPE_HAS_NEWTUNE;
 			state->type_flags |= DST_TYPE_HAS_TS204;
-			dprintk(verbose, DST_INFO, 1, "DST type has TS=204");
+			dprintk(verbose, DST_ERROR, 1, "DST type has TS=204");
 		}
+*/
+		if (state->board_info[0] == 0xbc) {
+//			if (state->type_flags & DST_TYPE_HAS_TS204)
+//				state->type_flags &= ~DST_TYPE_HAS_TS204;
+			state->type_flags |= DST_TYPE_HAS_NEWTUNE;
+			dprintk(verbose, DST_ERROR, 1, "DST Type has TS=188");
+		} else if (state->board_info[0] == 0xcc) {
+//			if (state->type_flags & DST_TYPE_HAS_NEWTUNE)
+//				state->type_flags &= ~DST_TYPE_HAS_NEWTUNE;
+			state->type_flags |= DST_TYPE_HAS_TS204;
+			dprintk(verbose, DST_ERROR, 1, "DST Type has TS=204");
+		}
+
+	}
+/*
 	} else {
 		if (state->board_info[0] == 0xbc) {
 			if (state->type_flags & DST_TYPE_HAS_TS204)
 				state->type_flags &= ~DST_TYPE_HAS_TS204;
 			state->type_flags |= DST_TYPE_HAS_NEWTUNE;
-			dprintk(verbose, DST_INFO, 1, "DST type has TS=188, Daughterboard=[%d]", state->board_info[1]);
+			dprintk(verbose, DST_ERROR, 1, "DST type has TS=188, Daughterboard=[%d]", state->board_info[1]);
 
 		} else if (state->board_info[0] == 0xcc) {
 			if (state->type_flags & DST_TYPE_HAS_NEWTUNE)
 				state->type_flags &= ~DST_TYPE_HAS_NEWTUNE;
 			state->type_flags |= DST_TYPE_HAS_TS204;
-			dprintk(verbose, DST_INFO, 1, "DST type has TS=204 Daughterboard=[%d]", state->board_info[1]);
+			dprintk(verbose, DST_ERROR, 1, "DST type has TS=204 Daughterboard=[%d]", state->board_info[1]);
 		}
 	}
-
+*/
 	return 0;
 }
 
 static int dst_get_device_id(struct dst_state *state)
 {
@@ -909,18 +949,10 @@
 }
 
 static int dst_probe(struct dst_state *state)
 {
 	mutex_init(&state->dst_mutex);
-	if ((rdc_8820_reset(state)) < 0) {
-		dprintk(verbose, DST_ERROR, 1, "RDC 8820 RESET Failed.");
-		return -1;
-	}
-	if (dst_addons & DST_TYPE_HAS_CA)
-		msleep(4000);
-	else
-		msleep(100);
 
 	if ((dst_comm_init(state)) < 0) {
 		dprintk(verbose, DST_ERROR, 1, "DST Initialization Failed.");
 		return -1;
 	}
@@ -1046,10 +1078,14 @@
 			state->decode_snr = state->rxbuffer[2] << 8 | state->rxbuffer[3];
 		} else if ((state->dst_type == DST_TYPE_IS_TERR) || (state->dst_type == DST_TYPE_IS_CABLE)) {
 			state->decode_lock = (state->rxbuffer[1]) ? 1 : 0;
 			state->decode_strength = state->rxbuffer[4] << 8;
 			state->decode_snr = state->rxbuffer[3] << 8;
+		} else if (state->dst_type == DST_TYPE_IS_ATSC) {
+			state->decode_lock = (state->rxbuffer[6] == 0x00) ? 1 : 0;
+			state->decode_strength = state->rxbuffer[4] << 8;
+			state->decode_snr = state->rxbuffer[2] << 8 | state->rxbuffer[3];
 		}
 		state->cur_jiff = jiffies;
 	}
 	return 0;
 }
@@ -1287,10 +1323,12 @@
 	static u8 sat_tuna_204[] = { 0x00, 0x00, 0x03, 0xb6, 0x01, 0x55, 0xbd, 0x50, 0x00, 0x00 };
 	static u8 ter_tuna_188[] = { 0x09, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
 	static u8 ter_tuna_204[] = { 0x00, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
 	static u8 cab_tuna_204[] = { 0x00, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
 	static u8 cab_tuna_188[] = { 0x09, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
+	static u8 atsc_tuna_188[] = { 0x09, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
+	static u8 atsc_tuna_204[] = { 0x00, 0x00, 0x03, 0xb6, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00 };
 
 	state->inversion = INVERSION_OFF;
 	state->voltage = SEC_VOLTAGE_13;
 	state->tone = SEC_TONE_OFF;
 	state->diseq_flags = 0;
@@ -1301,10 +1339,12 @@
 		memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_NEWTUNE) ? sat_tuna_188 : sat_tuna_204), sizeof (sat_tuna_204));
 	else if (state->dst_type == DST_TYPE_IS_TERR)
 		memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_NEWTUNE) ? ter_tuna_188 : ter_tuna_204), sizeof (ter_tuna_204));
 	else if (state->dst_type == DST_TYPE_IS_CABLE)
 		memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_NEWTUNE) ? cab_tuna_188 : cab_tuna_204), sizeof (cab_tuna_204));
+	else if (state->dst_type == DST_TYPE_IS_ATSC)
+		memcpy(state->tx_tuna, ((state->type_flags & DST_TYPE_HAS_NEWTUNE) ? atsc_tuna_188 : atsc_tuna_204), sizeof (atsc_tuna_204));
 
 	return 0;
 }
 
 static int dst_read_status(struct dvb_frontend *fe, fe_status_t *status)
@@ -1339,15 +1379,45 @@
 	*snr = state->decode_snr;
 
 	return 0;
 }
 
-static int dst_set_frontend(struct dvb_frontend* fe,
-			    struct dvb_frontend_parameters* p,
-			    unsigned int mode_flags,
-			    int *delay,
-			    fe_status_t *status)
+static int dst_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p)
+{
+	struct dst_state *state = fe->demodulator_priv;
+
+	if (p != NULL) {
+		dst_set_freq(state, p->frequency);
+		dprintk(verbose, DST_DEBUG, 1, "Set Frequency=[%d]", p->frequency);
+
+		if (state->dst_type == DST_TYPE_IS_SAT) {
+			if (state->type_flags & DST_TYPE_HAS_OBS_REGS)
+				dst_set_inversion(state, p->inversion);
+			dst_set_fec(state, p->u.qpsk.fec_inner);
+			dst_set_symbolrate(state, p->u.qpsk.symbol_rate);
+			dst_set_polarization(state);
+			dprintk(verbose, DST_DEBUG, 1, "Set Symbolrate=[%d]", p->u.qpsk.symbol_rate);
+
+		} else if (state->dst_type == DST_TYPE_IS_TERR)
+			dst_set_bandwidth(state, p->u.ofdm.bandwidth);
+		else if (state->dst_type == DST_TYPE_IS_CABLE) {
+			dst_set_fec(state, p->u.qam.fec_inner);
+			dst_set_symbolrate(state, p->u.qam.symbol_rate);
+			dst_set_modulation(state, p->u.qam.modulation);
+		}
+		dst_write_tuna(fe);
+
+	}
+
+	return 0;
+}
+
+static int dst_tune_frontend(struct dvb_frontend* fe,
+			     struct dvb_frontend_parameters* p,
+			     unsigned int mode_flags,
+			     int *delay,
+			     fe_status_t *status)
 {
 	struct dst_state *state = fe->demodulator_priv;
 
 	if (p != NULL) {
 		dst_set_freq(state, p->frequency);
@@ -1397,19 +1467,25 @@
 	}
 
 	return 0;
 }
 
+static int dst_get_tuning_algo(struct dvb_frontend *fe)
+{
+	return dst_algo;
+}
+
 static void dst_release(struct dvb_frontend *fe)
 {
 	struct dst_state *state = fe->demodulator_priv;
 	kfree(state);
 }
 
 static struct dvb_frontend_ops dst_dvbt_ops;
 static struct dvb_frontend_ops dst_dvbs_ops;
 static struct dvb_frontend_ops dst_dvbc_ops;
+static struct dvb_frontend_ops dst_atsc_ops;
 
 struct dst_state *dst_attach(struct dst_state *state, struct dvb_adapter *dvb_adapter)
 {
 	/* check if the ASIC is there */
 	if (dst_probe(state) < 0) {
@@ -1426,10 +1502,13 @@
 		memcpy(&state->frontend.ops, &dst_dvbc_ops, sizeof(struct dvb_frontend_ops));
 		break;
 	case DST_TYPE_IS_SAT:
 		memcpy(&state->frontend.ops, &dst_dvbs_ops, sizeof(struct dvb_frontend_ops));
 		break;
+	case DST_TYPE_IS_ATSC:
+		memcpy(&state->frontend.ops, &dst_atsc_ops, sizeof(struct dvb_frontend_ops));
+		break;
 	default:
 		dprintk(verbose, DST_ERROR, 1, "unknown DST type. please report to the LinuxTV.org DVB mailinglist.");
 		kfree(state);
 		return NULL;
 	}
@@ -1451,12 +1530,14 @@
 		.caps = FE_CAN_FEC_AUTO | FE_CAN_QAM_AUTO | FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO
 	},
 
 	.release = dst_release,
 	.init = dst_init,
-	.tune = dst_set_frontend,
+	.tune = dst_tune_frontend,
+	.set_frontend = dst_set_frontend,
 	.get_frontend = dst_get_frontend,
+	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
 	.read_snr = dst_read_snr,
 };
 
@@ -1475,12 +1556,14 @@
 		.caps = FE_CAN_FEC_AUTO | FE_CAN_QPSK
 	},
 
 	.release = dst_release,
 	.init = dst_init,
-	.tune = dst_set_frontend,
+	.tune = dst_tune_frontend,
+	.set_frontend = dst_set_frontend,
 	.get_frontend = dst_get_frontend,
+	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
 	.read_snr = dst_read_snr,
 	.diseqc_send_burst = dst_send_burst,
 	.diseqc_send_master_cmd = dst_set_diseqc,
@@ -1502,15 +1585,42 @@
 		.caps = FE_CAN_FEC_AUTO | FE_CAN_QAM_AUTO
 	},
 
 	.release = dst_release,
 	.init = dst_init,
-	.tune = dst_set_frontend,
+	.tune = dst_tune_frontend,
+	.set_frontend = dst_set_frontend,
 	.get_frontend = dst_get_frontend,
+	.get_frontend_algo = dst_get_tuning_algo,
 	.read_status = dst_read_status,
 	.read_signal_strength = dst_read_signal_strength,
 	.read_snr = dst_read_snr,
 };
 
-MODULE_DESCRIPTION("DST DVB-S/T/C Combo Frontend driver");
+static struct dvb_frontend_ops dst_atsc_ops = {
+
+       .info = {
+               .name = "DST ATSC",
+               .type = FE_ATSC,
+               .frequency_stepsize = 62500,
+               .frequency_min = 51000000,
+               .frequency_max = 858000000,
+               .symbol_rate_min = 1000000,
+               .symbol_rate_max = 45000000,
+       /*     . symbol_rate_tolerance  =       ???,*/
+               .caps = FE_CAN_FEC_AUTO | FE_CAN_QAM_AUTO | FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB
+       },
+
+       .release = dst_release,
+       .init = dst_init,
+       .tune = dst_tune_frontend,
+       .set_frontend = dst_set_frontend,
+       .get_frontend = dst_get_frontend,
+       .get_frontend_algo = dst_get_tuning_algo,
+       .read_status = dst_read_status,
+       .read_signal_strength = dst_read_signal_strength,
+       .read_snr = dst_read_snr,
+};
+
+MODULE_DESCRIPTION("DST DVB-S/T/C/ATSC Combo Frontend driver");
 MODULE_AUTHOR("Jamie Honan, Manu Abraham");
 MODULE_LICENSE("GPL");
diff -r --unified=5 --exclude='*.orig' --exclude='*.rej' v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.c v4l-dvb-test2/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
--- v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.c	2006-05-20 17:52:49.000000000 -0500
+++ v4l-dvb-test2/linux/drivers/media/dvb/dvb-core/dvb_frontend.c	2006-05-28 14:31:18.000000000 -0500
@@ -70,10 +70,13 @@
 #define FESTATE_DISEQC 128
 #define FESTATE_WAITFORLOCK (FESTATE_TUNING_FAST | FESTATE_TUNING_SLOW | FESTATE_ZIGZAG_FAST | FESTATE_ZIGZAG_SLOW | FESTATE_DISEQC)
 #define FESTATE_SEARCHING_FAST (FESTATE_TUNING_FAST | FESTATE_ZIGZAG_FAST)
 #define FESTATE_SEARCHING_SLOW (FESTATE_TUNING_SLOW | FESTATE_ZIGZAG_SLOW)
 #define FESTATE_LOSTLOCK (FESTATE_ZIGZAG_FAST | FESTATE_ZIGZAG_SLOW)
+
+#define FE_ALGO_HW	1
+
 /*
  * FESTATE_IDLE. No tuning parameters have been supplied and the loop is idling.
  * FESTATE_RETUNE. Parameters have been supplied, but we have not yet performed the first tune.
  * FESTATE_TUNING_FAST. Tuning parameters have been supplied and fast zigzag scan is in progress.
  * FESTATE_TUNING_SLOW. Tuning parameters have been supplied. Fast zigzag failed, so we're trying again, but slower.
@@ -558,11 +561,13 @@
 			}
 			fepriv->reinitialise = 0;
 		}
 
 		/* do an iteration of the tuning loop */
-		if (fe->ops.tune) {
+		if (fe->ops.get_frontend_algo(fe) == FE_ALGO_HW) {
+			printk("%s: using FE_ALGO_HW \n", __func__);
+
 			/* have we been asked to retune? */
 			params = NULL;
 			if (fepriv->state & FESTATE_RETUNE) {
 				params = &fepriv->parameters;
 				fepriv->state = FESTATE_TUNED;
diff -r --unified=5 --exclude='*.orig' --exclude='*.rej' v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.h v4l-dvb-test2/linux/drivers/media/dvb/dvb-core/dvb_frontend.h
--- v4l-dvb/linux/drivers/media/dvb/dvb-core/dvb_frontend.h	2006-05-20 17:52:49.000000000 -0500
+++ v4l-dvb-test2/linux/drivers/media/dvb/dvb-core/dvb_frontend.h	2006-05-28 14:12:17.000000000 -0500
@@ -100,10 +100,12 @@
 	int (*tune)(struct dvb_frontend* fe,
 		    struct dvb_frontend_parameters* params,
 		    unsigned int mode_flags,
 		    int *delay,
 		    fe_status_t *status);
+	/*	get frontend tuning algorithm from module	*/
+	int (*get_frontend_algo)(struct dvb_frontend *fe);
 
 	/* these two are only used for the swzigzag code */
 	int (*set_frontend)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params);
 	int (*get_tune_settings)(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* settings);
 
_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux