;==============================================================================
; TerraTec Cinergy Dual T PCIe
; BDA Driver Install Script
; Copyright (c) 2005, TerraTec Electronic GmbH
;------------------------------------------------------------------------------
; Notes:    Search for token "; TESTDEVICE:" to enable/disable the testdevice
;------------------------------------------------------------------------------
; History:
;------------------------------------------------------------------------------
; 31-May-05 FMB 1st version
; 01-Jun-05 FMB Bugfix: test device was not correctly installed
; 16-Jun-05 FMB new driver 1.0.2.0225
; 29-Jun-05 FMB new driver 1.0.2.0227
; 05-Jul-05 FMB uncommented prototype SSIDs and test device
; 06-Jul-05 FMB new name Cinergy Dual T PCIe
; 08-Jul-05 FMB new driver 1.0.2.0232
; 13-Jul-05 FMB added resistance values (IFAGCR1,IFAGCR2,IFAGCR3)
; 15-Jul-05 FMB removed TW comments; added OscDeviation
; 20-Jul-05 MS  new MicNgTun.sys: removed calculation of deviation
; 22-Jul-05 FMB new driver 1.0.2.0234
; 05-Aug-05 FMB new driver 1.0.2.0236: support for new EEPROM configuration
; 28-Sep-05 LI  new MicNgTun.sys, MicNgCap.sys, MicNgBas.sys
;------------------------------------------------------------------------------

[Version]
Signature   =$Windows NT$
Class       =Media
ClassGUID   ={4d36e96c-e325-11ce-bfc1-08002be10318}
Provider    =%TerraTec%
DriverVer   =09/22/2005,1.0.2.0241
CatalogFile =TTCinergy_Dual_T_PCIe.cat

[Manufacturer]
%TerraTec%=TerraTec

[TerraTec]																								
; Cinergy Dual T PCIe
%BASE_APPBOARD_DRXD% =MicNgBasDrxd ,PCI\VEN_18C3&DEV_0720&SUBSYS_1167153B
%CAPTURE_APPBOARD_50%=MicNgCap50BDA,Ngene\VEN_18C3&DEV_0720&SUBSYS_1167153B&Capture
%TUNER_APPBOARD_DVBT%=MicNgTunDVBT ,Ngene\VEN_18C3&DEV_0720&SUBSYS_1167153B&Tuner
%TEST_APPBOARD%      =MicNgTst     ,Ngene\VEN_18C3&DEV_0720&SUBSYS_1167153B&Test

[ControlFlags]
ExcludeFromSelect=*

[DestinationDirs]
Ngene.CopyFiles=10,System32\Drivers

[SourceDisksNames]
1 = %DiskName%,,

[SourceDisksFiles]
MicNgBas.sys = 1
MicNgCap.sys = 1
MicNgTun.sys = 1
;TESTDEVICE: uncomment the following line
;MicNgTst.sys = 1

;===============================================================
;  Base driver sections (Windows XP)
;===============================================================

[MicNgBasDrxd.NT]
Include=ks.inf, kscaptur.inf, bda.inf
Needs=KS.Registration.NT,KSCAPTUR.Registration.NT, BDA.Registration.NT,bda.Installation.NT,bdacap.Installation.NT
CopyFiles=Ngene.CopyFiles

[MicNgBasDrxd.NT.HW]
AddReg=MicNgBas.NT.HW.AddReg,MicNgBas.Drxd.AddReg

[Ngene.CopyFiles]
MicNgBas.sys,,,2
MicNgCap.sys,,,2
MicNgTun.sys,,,2
;TESTDEVICE: uncomment the following line
;MicNgTst.sys,,,2

[MicNgBasDrxd.NT.Services]
AddService=MicNgBas,0x00000002,MicNgBas.Service

[MicNgBas.Service]
DisplayName   = %MicNgBas.ServiceDesc%
ServiceType   = %SERVICE_KERNEL_DRIVER%
StartType     = %SERVICE_DEMAND_START%
ErrorControl  = %SERVICE_ERROR_NORMAL%
ServiceBinary = %10%\system32\drivers\MicNgBas.sys

[MicNgBas.NT.HW.AddReg]
;TESTDEVICE: Set param to 1
;HKR,,"TestDevice",1,01        ; Create PDO for test device

[MicNgBas.Drxd.AddReg]
HKR,,"TSFeatureDecoder",1,42,00,00,02,02,BC,00,00 

;===============================================================
;  Capture driver sections (Windows XP)
;===============================================================

[MicNgCap50BDA.NT]
AddReg=MicNgCap50BDA.NT.AddReg

[MicNgCap50BDA.NT.Services]
AddService=MicNgCap,0x00000002,MicNgCap.Service

[MicNgCap.Service]
DisplayName   = %MicNgCap.ServiceDesc%
ServiceType   = %SERVICE_KERNEL_DRIVER%
StartType     = %SERVICE_DEMAND_START%
ErrorControl  = %SERVICE_ERROR_NORMAL%
ServiceBinary = %10%\system32\drivers\MicNgCap.sys

; ----------------------------------------------------------------------------
; Capture configuration
; Config\
;  VideoStandard : Default video standard
;           one of the %KS_AnalogVideo_XXX% values
;
;    HKR,"Config","VBIMode",%REG_DWORD%,0xNNNNNNNN
;    HKR,"Config","StandardsSupported",%REG_DWORD%,0xNNNNNNNN
;    
;  VBIMode
;      Bit 0 :  Use Closed Caption polling via i2c (implies bit 1 and 2 also)
;      Bit 1 :  Use Hardware VBI slicer
;      Bit 2 :  VBI Data will be supplied from other source
;               (i.e. extracted from mpeg data stream, requires custom
;               extension of driver)
;      default: 0x00000000
;               
;  StandardsSupported
;        Any combinations of KS_AnalogVideo_XXX values (see inf file)
;        Most common values:
;            0x00000A07  All 60 Hz Standards
;            0x00000003  Common NTSC Standards (US/Japan)
;            0x00000001  US only NTSC
;            0x001FF5F0  All 50 Hz Standards
;            0x001005F0  All 50 Hz PAL Standards
;            0x000FF000  All SECAM Standards 
;            0x0013F5F0  All 50 Hz Standards but SECAM L/L'
;
;  Filter :   bit 0 = Analog Capture 1
;                 1 = Analog Capture 2
;                 2 = Digital Capture 1
;                 3 = Digital Capture 2
;              4-31 = reserved, set to 0
;
;  Decoder1,Decoder2 : Video/Audio Decoder configuration
;           byte 0 : Decoder type
;           byte 1 : Video Decoder i2c address
;           byte 2 : Audio Decoder i2c address
;           byte 3 : Type of i2c gate (default = 0)
;           byte 4..11 : Parameters to i2c gate
;
;       Tuner types :  0 = Micronas AVF4910A
;
;       I2c Gate : 0 = none
;                  1 = unused
;                  2 = via ngene gpio pin
;                      byte 4 : pin nbr (0-4), high opens the gate.
;                  8 = via IO Expander high active
;                      byte 4 : expander i2c address 
;                      byte 5 : bit mask
;                  9 = via IO Expander low active
;                      byte 4 : expander i2c address 
;                      byte 5 : bit mask
;       I2c Gate bit 7 = 1 : use global mutex. 
;       Type 8,9 assume a switch instead of a gate, it will not switched back
;       on release to reduce i2c traffic.
;
;  CrossBar,CrossBar1,CrossBar2 : Crossbar configuration
;           byte 0 : Number of input pins
;           byte 1 : default video input pin (normally tuner)
;           byte 2 : default audio input pin (normally tuner)
;           byte 3 : reserved (set to 0)
;       For each pin follow four bytes :
;           byte n+0 : Pin type
;                        0 : Video Tuner
;                        1 : Video Composite
;                        2 : Video SVideo
;                        3 : Video Component (YCrCb,YRYBY)
;                        4 : Audio Tuner
;                        5 : Audio Line in
;                        6 : Audio SPDIF
;           byte n+1 : Input selection
;                      Video pins:
;                         bit 0..3 : Video input (1 = VIN1 .. 4 = VIN4)
;                         bit 4..7 : Chroma input for SVideo (1 = CIN1, 2 = CIN2)
;                      Audio pins:
;                         0 = SIF (Tuner) input
;                         1..4 : Line input (1 = SC1 .. 4 = SC4)
;                         (not used for SPDIF, set to 0)
;           byte n+2 : related audio/video input pin
;           byte n+3 : reserved (set to 0)


[MicNgCap50BDA.NT.AddReg]
HKR,"Config","Filter",%REG_DWORD%,0x0000000C

[MicNgCap50BDA.NT.Interfaces]
AddInterface = %KSCATEGORY_BDARECEIVER%, %KSSTRING_Ngene_DigitalCaptureFilter1%, Ngene.DigitalCapture.Filter1
AddInterface = %KSCATEGORY_BDARECEIVER%, %KSSTRING_Ngene_DigitalCaptureFilter2%, Ngene.DigitalCapture.Filter2

[Ngene.DigitalCapture.Filter1]
AddReg=Ngene.DigitalCapture.Filter1.AddReg

[Ngene.DigitalCapture.Filter1.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%Ngene.DigitalCapture.Filter1Desc%

[Ngene.DigitalCapture.Filter2]
AddReg=Ngene.DigitalCapture.Filter2.AddReg

[Ngene.DigitalCapture.Filter2.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%Ngene.DigitalCapture.Filter2Desc%

;===============================================================
;  Tuner driver sections (Windows XP)
;===============================================================

[MicNgTunDVBT.NT]
AddReg=MicNgTunDVBT.AddReg

[MicNgTunDVBT.NT.Services]
AddService=MicNgTun,0x00000002,MicNgTun.Service

[MicNgTun.Service]
DisplayName   = %MicNgTun.ServiceDesc%
ServiceType   = %SERVICE_KERNEL_DRIVER%
StartType     = %SERVICE_DEMAND_START%
ErrorControl  = %SERVICE_ERROR_NORMAL%
ServiceBinary = %10%\system32\drivers\MicNgTun.sys
;LoadOrderGroup=ExtendedBase




; ----------------------------------------------------------------------------
; Tuner configuration
;
; Config1\Filter,Config2\Filter
;         bit 0 = Analog TV Tuner
;             1 = DVB-T 
;             2 = DVB-C         
;             3 = DVB-S         
;             4 = ATSC         
;             5 - 7  = ISDB-x ???         
;             8 - 31  = Reserved for future standards (China)         
;                       or proprietary US cable standards         
;        default: 0x00000001 
;
;   Note: BDA currently only supports DVB-x and ATSC
;         for now only one digital standard will be allowed
;         can be enhanced in the future i.e. for DVB-C/ATSC combi cards
;
; Digital\BandwidthSelect : frequency for automatic DVBT Bandwidth select
;                           Set to          0 for 6 MHz countries (Taiwan,South America)
;                           Set to  299000000 for 7/8 Mhz countries (most Pal B/G countries)
;                           Set to          1 for 8 Mhz countries (i.e. France)
;                           Set to 1000000000 for 7 Mhz countries (i.e. Australia)
;         This setting only has effect for applications which don't select
;         the bandwidth as required. 
;
; Config1\Tuner,Config2\Tuner : Tuner frontend and analog demodulator configuration
;           byte 0 : Tuner type
;           byte 1 : Frontend i2c address
;           byte 2 : Analog demodulator i2c address (types 0 - 239 )
;                    Ngene gpio pin to reset tuner  (types 240-255 )
;                          Bit 3 = 0 : low active reset
;                          Bit 3 = 1 : high active reset
;           byte 3 : Type of i2c gate (default = 0)
;           byte 4..11 : Parameters to i2c gate
;
;       Tuner types :  0 (0x00) = Microtune 3x0819,3x0909 with DRX3960A (All Analog, DVBT supported)
;                      1 (0x01) = Microtune 3x0823 with DRX3960A (M/N, DVBT 6 MHz and  ATSC supported)
;                      2 (0x02) = Philips FQ1216ME MK3		BG/DK/I/L
;                      3 (0x03) = Philips FQ1216AME MK4	BG/DK/I/L 
;                      4 (0x04) = Philips FQ1216ME MK5		BG/DK/I/L 
;                      5 (0x05) = Philips FQ1236 MK3		M/N 
;                      6 (0x06) = Philips FQ1236A MK4		M/N 
;                      7 (0x07) = Philips FQ1236 MK5		M/N
;                      8 (0x08) = Philips FQ1286 MK3		M/N-EAJ
;                      9 (0x09) = Philips FQ1286A MK4		M/N-EAJ 
;                     10 (0x0A) = Philips FQ1286 MK5		M/N-EAJ
;                     11 (0x0B) = Philips FM1216ME MK3		BG/DK/I/L
;                     12 (0x0C) = Philips FM1216AME MK4	BG/DK/I/L 
;                     13 (0x0D) = Philips FM1216ME MK5		BG/DK/I/L 
;                     14 (0x0E) = Philips FM1236 MK3		M/N 
;                     15 (0x0F) = Philips FM1236A MK4		M/N 
;                     16 (0x10) = Philips FM1236 MK5		M/N
;                     17 (0x11) = Philips FM1286 MK3		M/N-EAJ
;                     18 (0x12) = Philips FM1286A MK4		M/N-EAJ 
;                     19 (0x13) = Philips FM1286 MK5		M/N-EAJ
;                     20 (0x14) = Microtune 3x0819,3x0909  DVBT
;                     21 (0x15) = Microtune 3x0823         DVBT 6 MHz, ATSC
;                     22 (0x16) = Thomson DTT7520x         DVBT
;                     23 (0x17) = Philips FMD1216ME        BG/DK/I/L, DVBT 7/8 MHz
;
;                    224 (0xE0) = Microtune MT2060         DVBT                 
;                    225 (0xE1) = Microtune MT2060         DVBT 6 MHz, ATSC     
;                    226 (0xE2) = Microtune MT2060         All Analog, DVBT     
;                    227 (0xE3) = Microtune MT2060         M/N, DVBT 6 MHz, ATSC
;
;                    240 (0xF0) = XC2028 Silicon tuner
;                    241 (0xF1) = XC3028 Silicon tuner
;
;                    255 [0xFF] = use the tuner defined on other channel (SHARING)
;                    
;
;       I2c Gate : 0 = none
;                  1 = via digital demodulator (DRXD/DRXH)
;                  2 = via ngene gpio pin
;                      byte 4 : pin nbr (0-4), high opens the gate.
;                  8 = via IO Expander high active
;                      byte 4 : expander i2c address 
;                      byte 5 : bit mask
;                  9 = via IO Expander low active
;                      byte 4 : expander i2c address 
;                      byte 5 : bit mask
;       I2c Gate bit 7 = 1 : use global mutex. Needed if more than the tuner will be switched
;       Type 8,9 assume a switch instead of a gate, it will not switched back
;       on release to reduce i2c traffic.


[MicNgTunDVBT.AddReg]
HKR,"Config1","Filter",%REG_DWORD%,0x00000002	
HKR,"Config1","Tuner",1,16,C0,00,01,00		
HKR,"Config2","Filter",%REG_DWORD%,0x00000002	
HKR,"Config2","Tuner",1,16,C0,00,01,00		
HKR,"Digital","BandwidthSelect",%REG_DWORD%,299000000
HKR,"DRXD","IFAGCR1",%REG_DWORD%,0x2A8 ;R6=680 ohm
HKR,"DRXD","IFAGCR2",%REG_DWORD%,0x1D6 ;R14=470 ohm
HKR,"DRXD","IFAGCR3",%REG_DWORD%,0x096 ;R12=150 ohm
HKR,"DRXD1","I2cAddr",%REG_DWORD%,0xE0 ;	
HKR,"DRXD2","I2cAddr",%REG_DWORD%,0xE2 ;
; FMB NOTE: XTal deviation in ppm
;HKR,"DRXD","OscDeviation",%REG_DWORD%,0x00000000

; ----------------------------------------------------------------------------

[MicNgTunDVBT.NT.Interfaces]
AddInterface = %KSCATEGORY_BDATUNER%, %KSSTRING_Ngene_BdaDVBTTunerFilter1%, Ngene.DVBTTuner.Filter1
AddInterface = %KSCATEGORY_BDATUNER%, %KSSTRING_Ngene_BdaDVBTTunerFilter2%, Ngene.DVBTTuner.Filter2

[Ngene.DVBTTuner.Filter1]
AddReg=Ngene.DVBTTuner.Filter1.AddReg

[Ngene.DVBTTuner.Filter1.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%Ngene.DVBTTuner.Filter1Desc%

[Ngene.DVBTTuner.Filter2]
AddReg=Ngene.DVBTTuner.Filter2.AddReg

[Ngene.DVBTTuner.Filter2.AddReg]
HKR,,CLSID,,%Proxy.CLSID%
HKR,,FriendlyName,,%Ngene.DVBTTuner.Filter2Desc%

;===============================================================
; Test device
;===============================================================

[MicNgTst.NT]
AddReg = MicNgTst.NT.AddReg

[MicNgTst.NT.AddReg]
; FMB NOTE : dummy to avoid CHKINF warning

;TESTDEVICE: uncomment the following two lines 
;[MicNgTst.NT.Services]
;AddService=MicNgTst,2,MicNgTst.Service

[MicNgTst.Service]
DisplayName   = %MicNgTst.ServiceDesc%
ServiceType   = %SERVICE_KERNEL_DRIVER%
StartType     = %SERVICE_DEMAND_START%
ErrorControl  = %SERVICE_ERROR_NORMAL%
ServiceBinary =%10%\system32\drivers\MicNgTst.sys



;===============================================================
;  String Definitions
;===============================================================

[Strings]
;---------------------------------------------------------------
; Non-Localizable (Windows)
;---------------------------------------------------------------

FLG_REGSVR_DLLREGISTER = 0x00000001
REG_EXPAND_SZ          = 0x00020000
REG_DWORD              = 0x00010001

; Service loader
SERVICE_BOOT_START     = 0x0 
SERVICE_SYSTEM_START   = 0x1 
SERVICE_AUTO_START     = 0x2 
SERVICE_DEMAND_START   = 0x3 
SERVICE_DISABLED       = 0x4 

SERVICE_KERNEL_DRIVER  = 0x1 

SERVICE_ERROR_IGNORE   = 0x0 
SERVICE_ERROR_NORMAL   = 0x1 
SERVICE_ERROR_SEVERE   = 0x2
SERVICE_ERROR_CRITICAL = 0x3 

; Device manager classes
DEVCLASS_MEDIA     = "{4d36e96c-e325-11ce-bfc1-08002be10318}"
DEVCLASS_IMAGE     = "{6bdd1fc6-810f-11d0-bec7-08002be2092f}"

; Proxies                     
Proxy.CLSID        = "{17CCA71B-ECD7-11D0-B908-00A0C9223196}"
CrossBar.CLSID     = "{71F96460-78F3-11d0-A18C-00A0C9118956}"
TVAudio.CLSID      = "{71F96462-78F3-11d0-A18C-00A0C9118956}"
TvTuner.CLSID      = "{266EEE40-6C63-11cf-8A03-00AA006ECB65}"

; WDM filter categories

KSCATEGORY_AUDIO   = "{6994AD04-93EF-11D0-A3CC-00A0C9223196}"
KSCATEGORY_VIDEO   = "{6994AD05-93EF-11D0-A3CC-00A0C9223196}"
KSCATEGORY_CAPTURE = "{65E8773D-8F56-11D0-A3B9-00A0C9223196}"
KSCATEGORY_CROSSBAR= "{a799a801-A46D-11D0-A18C-00a02401dcd4}"
KSCATEGORY_TVAUDIO = "{a799a802-A46D-11D0-A18C-00a02401dcd4}"
KSCATEGORY_TVTUNER = "{a799a800-A46D-11D0-A18C-00a02401dcd4}"
KSCATEGORY_VBICODEC= "{07dad660-22f1-11D1-a9f4-00c04fbbde8f}"

; BDA filter categories
;##### FMB NOTE: defined in <ddk>\inc\wxp\bdamedia.h
KSCATEGORY_BDARECEIVER   = "{FD0A5AF4-B41D-11d2-9C95-00C04F7971E0}"
KSCATEGORY_BDATUNER      = "{71985F48-1CA1-11d3-9CC8-00C04F7971E0}"


KS_AnalogVideo_None        = 0x00000000
KS_AnalogVideo_NTSC_M      = 0x00000001
KS_AnalogVideo_NTSC_M_J    = 0x00000002
KS_AnalogVideo_NTSC_433    = 0x00000004
KS_AnalogVideo_PAL_B       = 0x00000010
KS_AnalogVideo_PAL_D       = 0x00000020
KS_AnalogVideo_PAL_G       = 0x00000040
KS_AnalogVideo_PAL_H       = 0x00000080
KS_AnalogVideo_PAL_I       = 0x00000100
KS_AnalogVideo_PAL_M       = 0x00000200
KS_AnalogVideo_PAL_N       = 0x00000400
KS_AnalogVideo_PAL_60      = 0x00000800
KS_AnalogVideo_SECAM_B     = 0x00001000
KS_AnalogVideo_SECAM_D     = 0x00002000
KS_AnalogVideo_SECAM_G     = 0x00004000
KS_AnalogVideo_SECAM_H     = 0x00008000
KS_AnalogVideo_SECAM_K     = 0x00010000
KS_AnalogVideo_SECAM_K1    = 0x00020000
KS_AnalogVideo_SECAM_L     = 0x00040000
KS_AnalogVideo_SECAM_L1    = 0x00080000
KS_AnalogVideo_PAL_N_COMBO = 0x00100000


;---------------------------------------------------------------
; Non-Localizable (this driver)
;---------------------------------------------------------------
; Our Filter GUIDs
KSSTRING_Ngene_TvTunerFilter1       ="{2745a786-e8ca-11d8-a988-004030004d56}"
KSSTRING_Ngene_TvTunerFilter2       ="{2745a787-e8ca-11d8-a988-004030004d56}"
KSSTRING_Ngene_DigitalCaptureFilter1="{2745a796-e8ca-11d8-a988-004030005452}"
KSSTRING_Ngene_DigitalCaptureFilter2="{2745a797-e8ca-11d8-a988-004030005452}"
KSSTRING_Ngene_BdaDVBTTunerFilter1  ="{2745a7ad-e8ca-11d8-a988-004030004d56}"
KSSTRING_Ngene_BdaDVBTTunerFilter2  ="{2745a7ae-e8ca-11d8-a988-004030004d56}"

;---------------------------------------------------------------
; Localizable
;---------------------------------------------------------------

TerraTec            = "TerraTec "
DiskName            = "Cinergy Driver CD"

; Service strings
MicNgBas.ServiceDesc="Cinergy Dual T PCIe Base Driver"
MicNgCap.ServiceDesc="Cinergy Dual T PCIe Capture Driver"
MicNgTun.ServiceDesc="Cinergy Dual T PCIe Tuner Driver"
MicNgTst.ServiceDesc="Cinergy Dual T PCIe Test Driver"


; Device Manager strings
BASE_APPBOARD_DRXD  ="Cinergy Dual T PCIe Bridge"
CAPTURE_APPBOARD_50 ="Cinergy Dual T PCIe Capture"
TUNER_APPBOARD_DVBT ="Cinergy Dual T PCIe Tuner"
TEST_APPBOARD       ="Cinergy Dual T PCIe Test Device"

; DirectShow filter names
; Receiver component
Ngene.DigitalCapture.Filter1Desc="Cinergy Dual T PCIe Capture 1"
Ngene.DigitalCapture.Filter2Desc="Cinergy Dual T PCIe Capture 2"
; Network tuner
Ngene.DVBTTuner.Filter1Desc     ="Cinergy Dual T PCIe Tuner 1"
Ngene.DVBTTuner.Filter2Desc     ="Cinergy Dual T PCIe Tuner 2"
