bttv-cards.c 137 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632
  1. /*
  2. bttv-cards.c
  3. this file has configuration informations - card-specific stuff
  4. like the big tvcards array for the most part
  5. Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
  6. & Marcus Metzler (mocm@thp.uni-koeln.de)
  7. (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #include <linux/delay.h>
  21. #include <linux/module.h>
  22. #include <linux/kmod.h>
  23. #include <linux/init.h>
  24. #include <linux/pci.h>
  25. #include <linux/vmalloc.h>
  26. #include <linux/firmware.h>
  27. #include <net/checksum.h>
  28. #include <asm/unaligned.h>
  29. #include <asm/io.h>
  30. #include "bttvp.h"
  31. #include <media/v4l2-common.h>
  32. #include <media/tvaudio.h>
  33. #include "bttv-audio-hook.h"
  34. /* fwd decl */
  35. static void boot_msp34xx(struct bttv *btv, int pin);
  36. static void hauppauge_eeprom(struct bttv *btv);
  37. static void avermedia_eeprom(struct bttv *btv);
  38. static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);
  39. static void modtec_eeprom(struct bttv *btv);
  40. static void init_PXC200(struct bttv *btv);
  41. static void init_RTV24(struct bttv *btv);
  42. static void rv605_muxsel(struct bttv *btv, unsigned int input);
  43. static void eagle_muxsel(struct bttv *btv, unsigned int input);
  44. static void xguard_muxsel(struct bttv *btv, unsigned int input);
  45. static void ivc120_muxsel(struct bttv *btv, unsigned int input);
  46. static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
  47. static void PXC200_muxsel(struct bttv *btv, unsigned int input);
  48. static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
  49. static void picolo_tetra_init(struct bttv *btv);
  50. static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
  51. static void tibetCS16_init(struct bttv *btv);
  52. static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
  53. static void kodicom4400r_init(struct bttv *btv);
  54. static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
  55. static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
  56. static void geovision_muxsel(struct bttv *btv, unsigned int input);
  57. static void phytec_muxsel(struct bttv *btv, unsigned int input);
  58. static int terratec_active_radio_upgrade(struct bttv *btv);
  59. static int tea5757_read(struct bttv *btv);
  60. static int tea5757_write(struct bttv *btv, int value);
  61. static void identify_by_eeprom(struct bttv *btv,
  62. unsigned char eeprom_data[256]);
  63. static int __devinit pvr_boot(struct bttv *btv);
  64. /* config variables */
  65. static unsigned int triton1;
  66. static unsigned int vsfx;
  67. static unsigned int latency = UNSET;
  68. int no_overlay=-1;
  69. static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
  70. static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
  71. static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
  72. static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
  73. static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
  74. static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
  75. #ifdef MODULE
  76. static unsigned int autoload = 1;
  77. #else
  78. static unsigned int autoload;
  79. #endif
  80. static unsigned int gpiomask = UNSET;
  81. static unsigned int audioall = UNSET;
  82. static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
  83. /* insmod options */
  84. module_param(triton1, int, 0444);
  85. module_param(vsfx, int, 0444);
  86. module_param(no_overlay, int, 0444);
  87. module_param(latency, int, 0444);
  88. module_param(gpiomask, int, 0444);
  89. module_param(audioall, int, 0444);
  90. module_param(autoload, int, 0444);
  91. module_param_array(card, int, NULL, 0444);
  92. module_param_array(pll, int, NULL, 0444);
  93. module_param_array(tuner, int, NULL, 0444);
  94. module_param_array(svhs, int, NULL, 0444);
  95. module_param_array(remote, int, NULL, 0444);
  96. module_param_array(audiomux, int, NULL, 0444);
  97. MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
  98. "[enable bug compatibility for triton1 + others]");
  99. MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
  100. "[yet another chipset flaw workaround]");
  101. MODULE_PARM_DESC(latency,"pci latency timer");
  102. MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
  103. MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
  104. MODULE_PARM_DESC(tuner,"specify installed tuner type");
  105. MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
  106. MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
  107. " [some VIA/SIS chipsets are known to have problem with overlay]");
  108. /* ----------------------------------------------------------------------- */
  109. /* list of card IDs for bt878+ cards */
  110. static struct CARD {
  111. unsigned id;
  112. int cardnr;
  113. char *name;
  114. } cards[] __devinitdata = {
  115. { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
  116. { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
  117. { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
  118. { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
  119. { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
  120. { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
  121. { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
  122. { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
  123. { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
  124. { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
  125. { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
  126. { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
  127. { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
  128. { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
  129. { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
  130. { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
  131. { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
  132. { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
  133. { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
  134. { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
  135. { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
  136. /* some cards ship with byteswapped IDs ... */
  137. { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
  138. { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
  139. /* this seems to happen as well ... */
  140. { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
  141. { 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },
  142. { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },
  143. { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
  144. { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
  145. { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
  146. { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
  147. { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
  148. { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
  149. { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
  150. { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
  151. { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
  152. { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
  153. { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
  154. { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
  155. { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
  156. { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
  157. { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
  158. { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
  159. { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
  160. { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
  161. { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
  162. /* clashes with FlyVideo
  163. *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
  164. { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
  165. { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
  166. { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
  167. { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
  168. { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
  169. { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
  170. { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
  171. { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
  172. { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
  173. { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
  174. { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
  175. { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
  176. { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
  177. { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
  178. { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
  179. { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
  180. { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
  181. { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
  182. { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
  183. { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
  184. { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
  185. { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
  186. { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
  187. { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
  188. { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
  189. { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
  190. { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
  191. { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
  192. { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
  193. { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
  194. { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
  195. { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
  196. { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
  197. { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
  198. { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
  199. { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
  200. { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
  201. { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
  202. { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
  203. { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
  204. { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
  205. { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
  206. { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
  207. { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
  208. { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
  209. { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
  210. { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
  211. { 0xf0500000, BTTV_BOARD_IVCE8784, "IVCE-8784" },
  212. { 0xf0500001, BTTV_BOARD_IVCE8784, "IVCE-8784" },
  213. { 0xf0500002, BTTV_BOARD_IVCE8784, "IVCE-8784" },
  214. { 0xf0500003, BTTV_BOARD_IVCE8784, "IVCE-8784" },
  215. { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
  216. { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
  217. { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
  218. { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
  219. { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
  220. { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
  221. { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
  222. { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
  223. { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
  224. { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
  225. { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
  226. { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
  227. { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
  228. { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
  229. { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
  230. { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
  231. { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
  232. { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
  233. { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
  234. { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
  235. { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
  236. { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
  237. { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
  238. { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
  239. { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
  240. { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
  241. { 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },
  242. { 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },
  243. /* likely broken, vendor id doesn't match the other magic views ...
  244. * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
  245. /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
  246. * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
  247. /* DVB cards (using pci function .1 for mpeg data xfer) */
  248. { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
  249. { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
  250. { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
  251. { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
  252. { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
  253. { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
  254. { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
  255. { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
  256. { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
  257. { 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },
  258. { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
  259. { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
  260. { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" },
  261. { 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" },
  262. { 0x18011000, BTTV_BOARD_ENLTV_FM_2, "Encore ENL TV-FM-2" },
  263. { 0, -1, NULL }
  264. };
  265. /* ----------------------------------------------------------------------- */
  266. /* array with description for bt848 / bt878 tv/grabber cards */
  267. struct tvcard bttv_tvcards[] = {
  268. /* ---- card 0x00 ---------------------------------- */
  269. [BTTV_BOARD_UNKNOWN] = {
  270. .name = " *** UNKNOWN/GENERIC *** ",
  271. .video_inputs = 4,
  272. .svhs = 2,
  273. .muxsel = { 2, 3, 1, 0 },
  274. .tuner_type = UNSET,
  275. .tuner_addr = ADDR_UNSET,
  276. },
  277. [BTTV_BOARD_MIRO] = {
  278. .name = "MIRO PCTV",
  279. .video_inputs = 4,
  280. /* .audio_inputs= 1, */
  281. .svhs = 2,
  282. .gpiomask = 15,
  283. .muxsel = { 2, 3, 1, 1 },
  284. .gpiomux = { 2, 0, 0, 0 },
  285. .gpiomute = 10,
  286. .needs_tvaudio = 1,
  287. .tuner_type = UNSET,
  288. .tuner_addr = ADDR_UNSET,
  289. },
  290. [BTTV_BOARD_HAUPPAUGE] = {
  291. .name = "Hauppauge (bt848)",
  292. .video_inputs = 4,
  293. /* .audio_inputs= 1, */
  294. .svhs = 2,
  295. .gpiomask = 7,
  296. .muxsel = { 2, 3, 1, 1 },
  297. .gpiomux = { 0, 1, 2, 3 },
  298. .gpiomute = 4,
  299. .needs_tvaudio = 1,
  300. .tuner_type = UNSET,
  301. .tuner_addr = ADDR_UNSET,
  302. },
  303. [BTTV_BOARD_STB] = {
  304. .name = "STB, Gateway P/N 6000699 (bt848)",
  305. .video_inputs = 3,
  306. /* .audio_inputs= 1, */
  307. .svhs = 2,
  308. .gpiomask = 7,
  309. .muxsel = { 2, 3, 1, 1 },
  310. .gpiomux = { 4, 0, 2, 3 },
  311. .gpiomute = 1,
  312. .no_msp34xx = 1,
  313. .needs_tvaudio = 1,
  314. .tuner_type = TUNER_PHILIPS_NTSC,
  315. .tuner_addr = ADDR_UNSET,
  316. .pll = PLL_28,
  317. .has_radio = 1,
  318. },
  319. /* ---- card 0x04 ---------------------------------- */
  320. [BTTV_BOARD_INTEL] = {
  321. .name = "Intel Create and Share PCI/ Smart Video Recorder III",
  322. .video_inputs = 4,
  323. /* .audio_inputs= 0, */
  324. .svhs = 2,
  325. .gpiomask = 0,
  326. .muxsel = { 2, 3, 1, 1 },
  327. .gpiomux = { 0 },
  328. .needs_tvaudio = 0,
  329. .tuner_type = TUNER_ABSENT,
  330. .tuner_addr = ADDR_UNSET,
  331. },
  332. [BTTV_BOARD_DIAMOND] = {
  333. .name = "Diamond DTV2000",
  334. .video_inputs = 4,
  335. /* .audio_inputs= 1, */
  336. .svhs = 2,
  337. .gpiomask = 3,
  338. .muxsel = { 2, 3, 1, 0 },
  339. .gpiomux = { 0, 1, 0, 1 },
  340. .gpiomute = 3,
  341. .needs_tvaudio = 1,
  342. .tuner_type = UNSET,
  343. .tuner_addr = ADDR_UNSET,
  344. },
  345. [BTTV_BOARD_AVERMEDIA] = {
  346. .name = "AVerMedia TVPhone",
  347. .video_inputs = 3,
  348. /* .audio_inputs= 1, */
  349. .svhs = 3,
  350. .muxsel = { 2, 3, 1, 1 },
  351. .gpiomask = 0x0f,
  352. .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
  353. /* 0x04 for some cards ?? */
  354. .needs_tvaudio = 1,
  355. .tuner_type = UNSET,
  356. .tuner_addr = ADDR_UNSET,
  357. .audio_mode_gpio= avermedia_tvphone_audio,
  358. .has_remote = 1,
  359. },
  360. [BTTV_BOARD_MATRIX_VISION] = {
  361. .name = "MATRIX-Vision MV-Delta",
  362. .video_inputs = 5,
  363. /* .audio_inputs= 1, */
  364. .svhs = 3,
  365. .gpiomask = 0,
  366. .muxsel = { 2, 3, 1, 0, 0 },
  367. .gpiomux = { 0 },
  368. .needs_tvaudio = 1,
  369. .tuner_type = TUNER_ABSENT,
  370. .tuner_addr = ADDR_UNSET,
  371. },
  372. /* ---- card 0x08 ---------------------------------- */
  373. [BTTV_BOARD_FLYVIDEO] = {
  374. .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
  375. .video_inputs = 4,
  376. /* .audio_inputs= 1, */
  377. .svhs = 2,
  378. .gpiomask = 0xc00,
  379. .muxsel = { 2, 3, 1, 1 },
  380. .gpiomux = { 0, 0xc00, 0x800, 0x400 },
  381. .gpiomute = 0xc00,
  382. .needs_tvaudio = 1,
  383. .pll = PLL_28,
  384. .tuner_type = UNSET,
  385. .tuner_addr = ADDR_UNSET,
  386. },
  387. [BTTV_BOARD_TURBOTV] = {
  388. .name = "IMS/IXmicro TurboTV",
  389. .video_inputs = 3,
  390. /* .audio_inputs= 1, */
  391. .svhs = 2,
  392. .gpiomask = 3,
  393. .muxsel = { 2, 3, 1, 1 },
  394. .gpiomux = { 1, 1, 2, 3 },
  395. .needs_tvaudio = 0,
  396. .pll = PLL_28,
  397. .tuner_type = TUNER_TEMIC_PAL,
  398. .tuner_addr = ADDR_UNSET,
  399. },
  400. [BTTV_BOARD_HAUPPAUGE878] = {
  401. .name = "Hauppauge (bt878)",
  402. .video_inputs = 4,
  403. /* .audio_inputs= 1, */
  404. .svhs = 2,
  405. .gpiomask = 0x0f, /* old: 7 */
  406. .muxsel = { 2, 0, 1, 1 },
  407. .gpiomux = { 0, 1, 2, 3 },
  408. .gpiomute = 4,
  409. .needs_tvaudio = 1,
  410. .pll = PLL_28,
  411. .tuner_type = UNSET,
  412. .tuner_addr = ADDR_UNSET,
  413. },
  414. [BTTV_BOARD_MIROPRO] = {
  415. .name = "MIRO PCTV pro",
  416. .video_inputs = 3,
  417. /* .audio_inputs= 1, */
  418. .svhs = 2,
  419. .gpiomask = 0x3014f,
  420. .muxsel = { 2, 3, 1, 1 },
  421. .gpiomux = { 0x20001,0x10001, 0, 0 },
  422. .gpiomute = 10,
  423. .needs_tvaudio = 1,
  424. .tuner_type = UNSET,
  425. .tuner_addr = ADDR_UNSET,
  426. },
  427. /* ---- card 0x0c ---------------------------------- */
  428. [BTTV_BOARD_ADSTECH_TV] = {
  429. .name = "ADS Technologies Channel Surfer TV (bt848)",
  430. .video_inputs = 3,
  431. /* .audio_inputs= 1, */
  432. .svhs = 2,
  433. .gpiomask = 15,
  434. .muxsel = { 2, 3, 1, 1 },
  435. .gpiomux = { 13, 14, 11, 7 },
  436. .needs_tvaudio = 1,
  437. .tuner_type = UNSET,
  438. .tuner_addr = ADDR_UNSET,
  439. },
  440. [BTTV_BOARD_AVERMEDIA98] = {
  441. .name = "AVerMedia TVCapture 98",
  442. .video_inputs = 3,
  443. /* .audio_inputs= 4, */
  444. .svhs = 2,
  445. .gpiomask = 15,
  446. .muxsel = { 2, 3, 1, 1 },
  447. .gpiomux = { 13, 14, 11, 7 },
  448. .needs_tvaudio = 1,
  449. .msp34xx_alt = 1,
  450. .pll = PLL_28,
  451. .tuner_type = TUNER_PHILIPS_PAL,
  452. .tuner_addr = ADDR_UNSET,
  453. .audio_mode_gpio= avermedia_tv_stereo_audio,
  454. .no_gpioirq = 1,
  455. },
  456. [BTTV_BOARD_VHX] = {
  457. .name = "Aimslab Video Highway Xtreme (VHX)",
  458. .video_inputs = 3,
  459. /* .audio_inputs= 1, */
  460. .svhs = 2,
  461. .gpiomask = 7,
  462. .muxsel = { 2, 3, 1, 1 },
  463. .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
  464. .gpiomute = 4,
  465. .needs_tvaudio = 1,
  466. .pll = PLL_28,
  467. .tuner_type = UNSET,
  468. .tuner_addr = ADDR_UNSET,
  469. },
  470. [BTTV_BOARD_ZOLTRIX] = {
  471. .name = "Zoltrix TV-Max",
  472. .video_inputs = 3,
  473. /* .audio_inputs= 1, */
  474. .svhs = 2,
  475. .gpiomask = 15,
  476. .muxsel = { 2, 3, 1, 1 },
  477. .gpiomux = { 0, 0, 1, 0 },
  478. .gpiomute = 10,
  479. .needs_tvaudio = 1,
  480. .tuner_type = UNSET,
  481. .tuner_addr = ADDR_UNSET,
  482. },
  483. /* ---- card 0x10 ---------------------------------- */
  484. [BTTV_BOARD_PIXVIEWPLAYTV] = {
  485. .name = "Prolink Pixelview PlayTV (bt878)",
  486. .video_inputs = 3,
  487. /* .audio_inputs= 1, */
  488. .svhs = 2,
  489. .gpiomask = 0x01fe00,
  490. .muxsel = { 2, 3, 1, 1 },
  491. /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
  492. .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
  493. .gpiomute = 0x002000,
  494. .needs_tvaudio = 1,
  495. .pll = PLL_28,
  496. .tuner_type = UNSET,
  497. .tuner_addr = ADDR_UNSET,
  498. },
  499. [BTTV_BOARD_WINVIEW_601] = {
  500. .name = "Leadtek WinView 601",
  501. .video_inputs = 3,
  502. /* .audio_inputs= 1, */
  503. .svhs = 2,
  504. .gpiomask = 0x8300f8,
  505. .muxsel = { 2, 3, 1, 1,0 },
  506. .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
  507. .gpiomute = 0xcfa007,
  508. .needs_tvaudio = 1,
  509. .tuner_type = UNSET,
  510. .tuner_addr = ADDR_UNSET,
  511. .volume_gpio = winview_volume,
  512. .has_radio = 1,
  513. },
  514. [BTTV_BOARD_AVEC_INTERCAP] = {
  515. .name = "AVEC Intercapture",
  516. .video_inputs = 3,
  517. /* .audio_inputs= 2, */
  518. .svhs = 2,
  519. .gpiomask = 0,
  520. .muxsel = { 2, 3, 1, 1 },
  521. .gpiomux = { 1, 0, 0, 0 },
  522. .needs_tvaudio = 1,
  523. .tuner_type = UNSET,
  524. .tuner_addr = ADDR_UNSET,
  525. },
  526. [BTTV_BOARD_LIFE_FLYKIT] = {
  527. .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
  528. .video_inputs = 4,
  529. /* .audio_inputs= 1, */
  530. .svhs = NO_SVHS,
  531. .gpiomask = 0x8dff00,
  532. .muxsel = { 2, 3, 1, 1 },
  533. .gpiomux = { 0 },
  534. .no_msp34xx = 1,
  535. .tuner_type = TUNER_ABSENT,
  536. .tuner_addr = ADDR_UNSET,
  537. },
  538. /* ---- card 0x14 ---------------------------------- */
  539. [BTTV_BOARD_CEI_RAFFLES] = {
  540. .name = "CEI Raffles Card",
  541. .video_inputs = 3,
  542. /* .audio_inputs= 3, */
  543. .svhs = 2,
  544. .muxsel = { 2, 3, 1, 1 },
  545. .tuner_type = UNSET,
  546. .tuner_addr = ADDR_UNSET,
  547. },
  548. [BTTV_BOARD_CONFERENCETV] = {
  549. .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
  550. .video_inputs = 4,
  551. /* .audio_inputs= 2, tuner, line in */
  552. .svhs = 2,
  553. .gpiomask = 0x1800,
  554. .muxsel = { 2, 3, 1, 1 },
  555. .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
  556. .gpiomute = 0x1800,
  557. .pll = PLL_28,
  558. .tuner_type = TUNER_PHILIPS_PAL_I,
  559. .tuner_addr = ADDR_UNSET,
  560. },
  561. [BTTV_BOARD_PHOEBE_TVMAS] = {
  562. .name = "Askey CPH050/ Phoebe Tv Master + FM",
  563. .video_inputs = 3,
  564. /* .audio_inputs= 1, */
  565. .svhs = 2,
  566. .gpiomask = 0xc00,
  567. .muxsel = { 2, 3, 1, 1 },
  568. .gpiomux = { 0, 1, 0x800, 0x400 },
  569. .gpiomute = 0xc00,
  570. .needs_tvaudio = 1,
  571. .pll = PLL_28,
  572. .tuner_type = UNSET,
  573. .tuner_addr = ADDR_UNSET,
  574. },
  575. [BTTV_BOARD_MODTEC_205] = {
  576. .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
  577. .video_inputs = 3,
  578. /* .audio_inputs= 1, */
  579. .svhs = NO_SVHS,
  580. .has_dig_in = 1,
  581. .gpiomask = 7,
  582. .muxsel = { 2, 3, 0 }, /* input 2 is digital */
  583. /* .digital_mode= DIGITAL_MODE_CAMERA, */
  584. .gpiomux = { 0, 0, 0, 0 },
  585. .no_msp34xx = 1,
  586. .pll = PLL_28,
  587. .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
  588. .tuner_addr = ADDR_UNSET,
  589. },
  590. /* ---- card 0x18 ---------------------------------- */
  591. [BTTV_BOARD_MAGICTVIEW061] = {
  592. .name = "Askey CPH05X/06X (bt878) [many vendors]",
  593. .video_inputs = 3,
  594. /* .audio_inputs= 1, */
  595. .svhs = 2,
  596. .gpiomask = 0xe00,
  597. .muxsel = { 2, 3, 1, 1 },
  598. .gpiomux = {0x400, 0x400, 0x400, 0x400 },
  599. .gpiomute = 0xc00,
  600. .needs_tvaudio = 1,
  601. .pll = PLL_28,
  602. .tuner_type = UNSET,
  603. .tuner_addr = ADDR_UNSET,
  604. .has_remote = 1,
  605. },
  606. [BTTV_BOARD_VOBIS_BOOSTAR] = {
  607. .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
  608. .video_inputs = 3,
  609. /* .audio_inputs= 1, */
  610. .svhs = 2,
  611. .gpiomask = 0x1f0fff,
  612. .muxsel = { 2, 3, 1, 1 },
  613. .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
  614. .gpiomute = 0x40000,
  615. .needs_tvaudio = 0,
  616. .tuner_type = TUNER_PHILIPS_PAL,
  617. .tuner_addr = ADDR_UNSET,
  618. .audio_mode_gpio= terratv_audio,
  619. },
  620. [BTTV_BOARD_HAUPPAUG_WCAM] = {
  621. .name = "Hauppauge WinCam newer (bt878)",
  622. .video_inputs = 4,
  623. /* .audio_inputs= 1, */
  624. .svhs = 3,
  625. .gpiomask = 7,
  626. .muxsel = { 2, 0, 1, 1 },
  627. .gpiomux = { 0, 1, 2, 3 },
  628. .gpiomute = 4,
  629. .needs_tvaudio = 1,
  630. .tuner_type = UNSET,
  631. .tuner_addr = ADDR_UNSET,
  632. },
  633. [BTTV_BOARD_MAXI] = {
  634. .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
  635. .video_inputs = 4,
  636. /* .audio_inputs= 2, */
  637. .svhs = 2,
  638. .gpiomask = 0x1800,
  639. .muxsel = { 2, 3, 1, 1 },
  640. .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
  641. .gpiomute = 0x1800,
  642. .pll = PLL_28,
  643. .tuner_type = TUNER_PHILIPS_SECAM,
  644. .tuner_addr = ADDR_UNSET,
  645. },
  646. /* ---- card 0x1c ---------------------------------- */
  647. [BTTV_BOARD_TERRATV] = {
  648. .name = "Terratec TerraTV+ Version 1.1 (bt878)",
  649. .video_inputs = 3,
  650. /* .audio_inputs= 1, */
  651. .svhs = 2,
  652. .gpiomask = 0x1f0fff,
  653. .muxsel = { 2, 3, 1, 1 },
  654. .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
  655. .gpiomute = 0x40000,
  656. .needs_tvaudio = 0,
  657. .tuner_type = TUNER_PHILIPS_PAL,
  658. .tuner_addr = ADDR_UNSET,
  659. .audio_mode_gpio= terratv_audio,
  660. /* GPIO wiring:
  661. External 20 pin connector (for Active Radio Upgrade board)
  662. gpio00: i2c-sda
  663. gpio01: i2c-scl
  664. gpio02: om5610-data
  665. gpio03: om5610-clk
  666. gpio04: om5610-wre
  667. gpio05: om5610-stereo
  668. gpio06: rds6588-davn
  669. gpio07: Pin 7 n.c.
  670. gpio08: nIOW
  671. gpio09+10: nIOR, nSEL ?? (bt878)
  672. gpio09: nIOR (bt848)
  673. gpio10: nSEL (bt848)
  674. Sound Routing:
  675. gpio16: u2-A0 (1st 4052bt)
  676. gpio17: u2-A1
  677. gpio18: u2-nEN
  678. gpio19: u4-A0 (2nd 4052)
  679. gpio20: u4-A1
  680. u4-nEN - GND
  681. Btspy:
  682. 00000 : Cdrom (internal audio input)
  683. 10000 : ext. Video audio input
  684. 20000 : TV Mono
  685. a0000 : TV Mono/2
  686. 1a0000 : TV Stereo
  687. 30000 : Radio
  688. 40000 : Mute
  689. */
  690. },
  691. [BTTV_BOARD_PXC200] = {
  692. /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
  693. .name = "Imagenation PXC200",
  694. .video_inputs = 5,
  695. /* .audio_inputs= 1, */
  696. .svhs = 1, /* was: 4 */
  697. .gpiomask = 0,
  698. .muxsel = { 2, 3, 1, 0, 0},
  699. .gpiomux = { 0 },
  700. .needs_tvaudio = 1,
  701. .tuner_type = TUNER_ABSENT,
  702. .tuner_addr = ADDR_UNSET,
  703. .muxsel_hook = PXC200_muxsel,
  704. },
  705. [BTTV_BOARD_FLYVIDEO_98] = {
  706. .name = "Lifeview FlyVideo 98 LR50",
  707. .video_inputs = 4,
  708. /* .audio_inputs= 1, */
  709. .svhs = 2,
  710. .gpiomask = 0x1800, /* 0x8dfe00 */
  711. .muxsel = { 2, 3, 1, 1 },
  712. .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
  713. .gpiomute = 0x1800,
  714. .pll = PLL_28,
  715. .tuner_type = UNSET,
  716. .tuner_addr = ADDR_UNSET,
  717. },
  718. [BTTV_BOARD_IPROTV] = {
  719. .name = "Formac iProTV, Formac ProTV I (bt848)",
  720. .video_inputs = 4,
  721. /* .audio_inputs= 1, */
  722. .svhs = 3,
  723. .gpiomask = 1,
  724. .muxsel = { 2, 3, 1, 1 },
  725. .gpiomux = { 1, 0, 0, 0 },
  726. .pll = PLL_28,
  727. .tuner_type = TUNER_PHILIPS_PAL,
  728. .tuner_addr = ADDR_UNSET,
  729. },
  730. /* ---- card 0x20 ---------------------------------- */
  731. [BTTV_BOARD_INTEL_C_S_PCI] = {
  732. .name = "Intel Create and Share PCI/ Smart Video Recorder III",
  733. .video_inputs = 4,
  734. /* .audio_inputs= 0, */
  735. .svhs = 2,
  736. .gpiomask = 0,
  737. .muxsel = { 2, 3, 1, 1 },
  738. .gpiomux = { 0 },
  739. .needs_tvaudio = 0,
  740. .tuner_type = TUNER_ABSENT,
  741. .tuner_addr = ADDR_UNSET,
  742. },
  743. [BTTV_BOARD_TERRATVALUE] = {
  744. .name = "Terratec TerraTValue Version Bt878",
  745. .video_inputs = 3,
  746. /* .audio_inputs= 1, */
  747. .svhs = 2,
  748. .gpiomask = 0xffff00,
  749. .muxsel = { 2, 3, 1, 1 },
  750. .gpiomux = { 0x500, 0, 0x300, 0x900 },
  751. .gpiomute = 0x900,
  752. .needs_tvaudio = 1,
  753. .pll = PLL_28,
  754. .tuner_type = TUNER_PHILIPS_PAL,
  755. .tuner_addr = ADDR_UNSET,
  756. },
  757. [BTTV_BOARD_WINFAST2000] = {
  758. .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
  759. .video_inputs = 4,
  760. /* .audio_inputs= 1, */
  761. .svhs = 2,
  762. .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
  763. /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
  764. .gpiomask = 0xb33000,
  765. .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
  766. .gpiomute = 0x800000,
  767. /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
  768. gpio23 -- hef4052:nEnable (0x800000)
  769. gpio12 -- hef4052:A1
  770. gpio13 -- hef4052:A0
  771. 0x0000: external audio
  772. 0x1000: FM
  773. 0x2000: TV
  774. 0x3000: n.c.
  775. Note: There exists another variant "Winfast 2000" with tv stereo !?
  776. Note: eeprom only contains FF and pci subsystem id 107d:6606
  777. */
  778. .needs_tvaudio = 0,
  779. .pll = PLL_28,
  780. .has_radio = 1,
  781. .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
  782. .tuner_addr = ADDR_UNSET,
  783. .audio_mode_gpio= winfast2000_audio,
  784. .has_remote = 1,
  785. },
  786. [BTTV_BOARD_CHRONOS_VS2] = {
  787. .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
  788. .video_inputs = 4,
  789. /* .audio_inputs= 3, */
  790. .svhs = 2,
  791. .gpiomask = 0x1800,
  792. .muxsel = { 2, 3, 1, 1 },
  793. .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
  794. .gpiomute = 0x1800,
  795. .pll = PLL_28,
  796. .tuner_type = UNSET,
  797. .tuner_addr = ADDR_UNSET,
  798. },
  799. /* ---- card 0x24 ---------------------------------- */
  800. [BTTV_BOARD_TYPHOON_TVIEW] = {
  801. .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
  802. .video_inputs = 4,
  803. /* .audio_inputs= 3, */
  804. .svhs = 2,
  805. .gpiomask = 0x1800,
  806. .muxsel = { 2, 3, 1, 1 },
  807. .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
  808. .gpiomute = 0x1800,
  809. .pll = PLL_28,
  810. .tuner_type = UNSET,
  811. .tuner_addr = ADDR_UNSET,
  812. .has_radio = 1,
  813. },
  814. [BTTV_BOARD_PXELVWPLTVPRO] = {
  815. .name = "Prolink PixelView PlayTV pro",
  816. .video_inputs = 3,
  817. /* .audio_inputs= 1, */
  818. .svhs = 2,
  819. .gpiomask = 0xff,
  820. .muxsel = { 2, 3, 1, 1 },
  821. .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
  822. .gpiomute = 0x29,
  823. .no_msp34xx = 1,
  824. .pll = PLL_28,
  825. .tuner_type = UNSET,
  826. .tuner_addr = ADDR_UNSET,
  827. },
  828. [BTTV_BOARD_MAGICTVIEW063] = {
  829. .name = "Askey CPH06X TView99",
  830. .video_inputs = 4,
  831. /* .audio_inputs= 1, */
  832. .svhs = 2,
  833. .gpiomask = 0x551e00,
  834. .muxsel = { 2, 3, 1, 0 },
  835. .gpiomux = { 0x551400, 0x551200, 0, 0 },
  836. .gpiomute = 0x551c00,
  837. .needs_tvaudio = 1,
  838. .pll = PLL_28,
  839. .tuner_type = TUNER_PHILIPS_PAL_I,
  840. .tuner_addr = ADDR_UNSET,
  841. .has_remote = 1,
  842. },
  843. [BTTV_BOARD_PINNACLE] = {
  844. .name = "Pinnacle PCTV Studio/Rave",
  845. .video_inputs = 3,
  846. /* .audio_inputs= 1, */
  847. .svhs = 2,
  848. .gpiomask = 0x03000F,
  849. .muxsel = { 2, 3, 1, 1 },
  850. .gpiomux = { 2, 0xd0001, 0, 0 },
  851. .gpiomute = 1,
  852. .needs_tvaudio = 0,
  853. .pll = PLL_28,
  854. .tuner_type = UNSET,
  855. .tuner_addr = ADDR_UNSET,
  856. },
  857. /* ---- card 0x28 ---------------------------------- */
  858. [BTTV_BOARD_STB2] = {
  859. .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
  860. .video_inputs = 3,
  861. /* .audio_inputs= 1, */
  862. .svhs = 2,
  863. .gpiomask = 7,
  864. .muxsel = { 2, 3, 1, 1 },
  865. .gpiomux = { 4, 0, 2, 3 },
  866. .gpiomute = 1,
  867. .no_msp34xx = 1,
  868. .needs_tvaudio = 1,
  869. .tuner_type = TUNER_PHILIPS_NTSC,
  870. .tuner_addr = ADDR_UNSET,
  871. .pll = PLL_28,
  872. .has_radio = 1,
  873. },
  874. [BTTV_BOARD_AVPHONE98] = {
  875. .name = "AVerMedia TVPhone 98",
  876. .video_inputs = 3,
  877. /* .audio_inputs= 4, */
  878. .svhs = 2,
  879. .gpiomask = 15,
  880. .muxsel = { 2, 3, 1, 1 },
  881. .gpiomux = { 13, 4, 11, 7 },
  882. .needs_tvaudio = 1,
  883. .pll = PLL_28,
  884. .tuner_type = UNSET,
  885. .tuner_addr = ADDR_UNSET,
  886. .has_radio = 1,
  887. .audio_mode_gpio= avermedia_tvphone_audio,
  888. },
  889. [BTTV_BOARD_PV951] = {
  890. .name = "ProVideo PV951", /* pic16c54 */
  891. .video_inputs = 3,
  892. /* .audio_inputs= 1, */
  893. .svhs = 2,
  894. .gpiomask = 0,
  895. .muxsel = { 2, 3, 1, 1},
  896. .gpiomux = { 0, 0, 0, 0},
  897. .needs_tvaudio = 1,
  898. .no_msp34xx = 1,
  899. .pll = PLL_28,
  900. .tuner_type = TUNER_PHILIPS_PAL_I,
  901. .tuner_addr = ADDR_UNSET,
  902. },
  903. [BTTV_BOARD_ONAIR_TV] = {
  904. .name = "Little OnAir TV",
  905. .video_inputs = 3,
  906. /* .audio_inputs= 1, */
  907. .svhs = 2,
  908. .gpiomask = 0xe00b,
  909. .muxsel = { 2, 3, 1, 1 },
  910. .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
  911. .gpiomute = 0xff3ffc,
  912. .no_msp34xx = 1,
  913. .tuner_type = UNSET,
  914. .tuner_addr = ADDR_UNSET,
  915. },
  916. /* ---- card 0x2c ---------------------------------- */
  917. [BTTV_BOARD_SIGMA_TVII_FM] = {
  918. .name = "Sigma TVII-FM",
  919. .video_inputs = 2,
  920. /* .audio_inputs= 1, */
  921. .svhs = NO_SVHS,
  922. .gpiomask = 3,
  923. .muxsel = { 2, 3, 1, 1 },
  924. .gpiomux = { 1, 1, 0, 2 },
  925. .gpiomute = 3,
  926. .no_msp34xx = 1,
  927. .pll = PLL_NONE,
  928. .tuner_type = UNSET,
  929. .tuner_addr = ADDR_UNSET,
  930. },
  931. [BTTV_BOARD_MATRIX_VISION2] = {
  932. .name = "MATRIX-Vision MV-Delta 2",
  933. .video_inputs = 5,
  934. /* .audio_inputs= 1, */
  935. .svhs = 3,
  936. .gpiomask = 0,
  937. .muxsel = { 2, 3, 1, 0, 0 },
  938. .gpiomux = { 0 },
  939. .no_msp34xx = 1,
  940. .pll = PLL_28,
  941. .tuner_type = TUNER_ABSENT,
  942. .tuner_addr = ADDR_UNSET,
  943. },
  944. [BTTV_BOARD_ZOLTRIX_GENIE] = {
  945. .name = "Zoltrix Genie TV/FM",
  946. .video_inputs = 3,
  947. /* .audio_inputs= 1, */
  948. .svhs = 2,
  949. .gpiomask = 0xbcf03f,
  950. .muxsel = { 2, 3, 1, 1 },
  951. .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
  952. .gpiomute = 0xbcb03f,
  953. .no_msp34xx = 1,
  954. .pll = PLL_28,
  955. .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
  956. .tuner_addr = ADDR_UNSET,
  957. },
  958. [BTTV_BOARD_TERRATVRADIO] = {
  959. .name = "Terratec TV/Radio+",
  960. .video_inputs = 3,
  961. /* .audio_inputs= 1, */
  962. .svhs = 2,
  963. .gpiomask = 0x70000,
  964. .muxsel = { 2, 3, 1, 1 },
  965. .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
  966. .gpiomute = 0x40000,
  967. .needs_tvaudio = 1,
  968. .no_msp34xx = 1,
  969. .pll = PLL_35,
  970. .tuner_type = TUNER_PHILIPS_PAL_I,
  971. .tuner_addr = ADDR_UNSET,
  972. .has_radio = 1,
  973. },
  974. /* ---- card 0x30 ---------------------------------- */
  975. [BTTV_BOARD_DYNALINK] = {
  976. .name = "Askey CPH03x/ Dynalink Magic TView",
  977. .video_inputs = 3,
  978. /* .audio_inputs= 1, */
  979. .svhs = 2,
  980. .gpiomask = 15,
  981. .muxsel = { 2, 3, 1, 1 },
  982. .gpiomux = {2,0,0,0 },
  983. .gpiomute = 1,
  984. .needs_tvaudio = 1,
  985. .pll = PLL_28,
  986. .tuner_type = UNSET,
  987. .tuner_addr = ADDR_UNSET,
  988. },
  989. [BTTV_BOARD_GVBCTV3PCI] = {
  990. .name = "IODATA GV-BCTV3/PCI",
  991. .video_inputs = 3,
  992. /* .audio_inputs= 1, */
  993. .svhs = 2,
  994. .gpiomask = 0x010f00,
  995. .muxsel = {2, 3, 0, 0 },
  996. .gpiomux = {0x10000, 0, 0x10000, 0 },
  997. .no_msp34xx = 1,
  998. .pll = PLL_28,
  999. .tuner_type = TUNER_ALPS_TSHC6_NTSC,
  1000. .tuner_addr = ADDR_UNSET,
  1001. .audio_mode_gpio= gvbctv3pci_audio,
  1002. },
  1003. [BTTV_BOARD_PXELVWPLTVPAK] = {
  1004. .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
  1005. .video_inputs = 5,
  1006. /* .audio_inputs= 1, */
  1007. .svhs = 3,
  1008. .has_dig_in = 1,
  1009. .gpiomask = 0xAA0000,
  1010. .muxsel = { 2, 3, 1, 1, 0 }, /* input 4 is digital */
  1011. /* .digital_mode= DIGITAL_MODE_CAMERA, */
  1012. .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
  1013. .gpiomute = 0xa8000,
  1014. .no_msp34xx = 1,
  1015. .pll = PLL_28,
  1016. .tuner_type = TUNER_PHILIPS_PAL_I,
  1017. .tuner_addr = ADDR_UNSET,
  1018. .has_remote = 1,
  1019. /* GPIO wiring: (different from Rev.4C !)
  1020. GPIO17: U4.A0 (first hef4052bt)
  1021. GPIO19: U4.A1
  1022. GPIO20: U5.A1 (second hef4052bt)
  1023. GPIO21: U4.nEN
  1024. GPIO22: BT832 Reset Line
  1025. GPIO23: A5,A0, U5,nEN
  1026. Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
  1027. */
  1028. },
  1029. [BTTV_BOARD_EAGLE] = {
  1030. .name = "Eagle Wireless Capricorn2 (bt878A)",
  1031. .video_inputs = 4,
  1032. /* .audio_inputs= 1, */
  1033. .svhs = 2,
  1034. .gpiomask = 7,
  1035. .muxsel = { 2, 0, 1, 1 },
  1036. .gpiomux = { 0, 1, 2, 3 },
  1037. .gpiomute = 4,
  1038. .pll = PLL_28,
  1039. .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,
  1040. .tuner_addr = ADDR_UNSET,
  1041. },
  1042. /* ---- card 0x34 ---------------------------------- */
  1043. [BTTV_BOARD_PINNACLEPRO] = {
  1044. /* David Härdeman <david@2gen.com> */
  1045. .name = "Pinnacle PCTV Studio Pro",
  1046. .video_inputs = 4,
  1047. /* .audio_inputs= 1, */
  1048. .svhs = 3,
  1049. .gpiomask = 0x03000F,
  1050. .muxsel = { 2, 3, 1, 1 },
  1051. .gpiomux = { 1, 0xd0001, 0, 0 },
  1052. .gpiomute = 10,
  1053. /* sound path (5 sources):
  1054. MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
  1055. 0= ext. Audio IN
  1056. 1= from MUX2
  1057. 2= Mono TV sound from Tuner
  1058. 3= not connected
  1059. MUX2 (mask 0x30000):
  1060. 0,2,3= from MSP34xx
  1061. 1= FM stereo Radio from Tuner */
  1062. .needs_tvaudio = 0,
  1063. .pll = PLL_28,
  1064. .tuner_type = UNSET,
  1065. .tuner_addr = ADDR_UNSET,
  1066. },
  1067. [BTTV_BOARD_TVIEW_RDS_FM] = {
  1068. /* Claas Langbehn <claas@bigfoot.com>,
  1069. Sven Grothklags <sven@upb.de> */
  1070. .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
  1071. .video_inputs = 4,
  1072. /* .audio_inputs= 3, */
  1073. .svhs = 2,
  1074. .gpiomask = 0x1c,
  1075. .muxsel = { 2, 3, 1, 1 },
  1076. .gpiomux = { 0, 0, 0x10, 8 },
  1077. .gpiomute = 4,
  1078. .needs_tvaudio = 1,
  1079. .pll = PLL_28,
  1080. .tuner_type = TUNER_PHILIPS_PAL,
  1081. .tuner_addr = ADDR_UNSET,
  1082. .has_radio = 1,
  1083. },
  1084. [BTTV_BOARD_LIFETEC_9415] = {
  1085. /* Tim Röstermundt <rosterm@uni-muenster.de>
  1086. in de.comp.os.unix.linux.hardware:
  1087. options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
  1088. gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
  1089. options tuner type=5 */
  1090. .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
  1091. .video_inputs = 4,
  1092. /* .audio_inputs= 1, */
  1093. .svhs = 2,
  1094. .gpiomask = 0x18e0,
  1095. .muxsel = { 2, 3, 1, 1 },
  1096. .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
  1097. .gpiomute = 0x18e0,
  1098. /* For cards with tda9820/tda9821:
  1099. 0x0000: Tuner normal stereo
  1100. 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
  1101. 0x0880: Tuner A2 stereo */
  1102. .pll = PLL_28,
  1103. .tuner_type = UNSET,
  1104. .tuner_addr = ADDR_UNSET,
  1105. },
  1106. [BTTV_BOARD_BESTBUY_EASYTV] = {
  1107. /* Miguel Angel Alvarez <maacruz@navegalia.com>
  1108. old Easy TV BT848 version (model CPH031) */
  1109. .name = "Askey CPH031/ BESTBUY Easy TV",
  1110. .video_inputs = 4,
  1111. /* .audio_inputs= 1, */
  1112. .svhs = 2,
  1113. .gpiomask = 0xF,
  1114. .muxsel = { 2, 3, 1, 0 },
  1115. .gpiomux = { 2, 0, 0, 0 },
  1116. .gpiomute = 10,
  1117. .needs_tvaudio = 0,
  1118. .pll = PLL_28,
  1119. .tuner_type = TUNER_TEMIC_PAL,
  1120. .tuner_addr = ADDR_UNSET,
  1121. },
  1122. /* ---- card 0x38 ---------------------------------- */
  1123. [BTTV_BOARD_FLYVIDEO_98FM] = {
  1124. /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
  1125. .name = "Lifeview FlyVideo 98FM LR50",
  1126. .video_inputs = 4,
  1127. /* .audio_inputs= 3, */
  1128. .svhs = 2,
  1129. .gpiomask = 0x1800,
  1130. .muxsel = { 2, 3, 1, 1 },
  1131. .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
  1132. .gpiomute = 0x1800,
  1133. .pll = PLL_28,
  1134. .tuner_type = TUNER_PHILIPS_PAL,
  1135. .tuner_addr = ADDR_UNSET,
  1136. },
  1137. /* This is the ultimate cheapo capture card
  1138. * just a BT848A on a small PCB!
  1139. * Steve Hosgood <steve@equiinet.com> */
  1140. [BTTV_BOARD_GRANDTEC] = {
  1141. .name = "GrandTec 'Grand Video Capture' (Bt848)",
  1142. .video_inputs = 2,
  1143. /* .audio_inputs= 0, */
  1144. .svhs = 1,
  1145. .gpiomask = 0,
  1146. .muxsel = { 3, 1 },
  1147. .gpiomux = { 0 },
  1148. .needs_tvaudio = 0,
  1149. .no_msp34xx = 1,
  1150. .pll = PLL_35,
  1151. .tuner_type = TUNER_ABSENT,
  1152. .tuner_addr = ADDR_UNSET,
  1153. },
  1154. [BTTV_BOARD_ASKEY_CPH060] = {
  1155. /* Daniel Herrington <daniel.herrington@home.com> */
  1156. .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
  1157. .video_inputs = 3,
  1158. /* .audio_inputs= 1, */
  1159. .svhs = 2,
  1160. .gpiomask = 0xe00,
  1161. .muxsel = { 2, 3, 1, 1},
  1162. .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
  1163. .gpiomute = 0x800,
  1164. .needs_tvaudio = 1,
  1165. .pll = PLL_28,
  1166. .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
  1167. .tuner_addr = ADDR_UNSET,
  1168. },
  1169. [BTTV_BOARD_ASKEY_CPH03X] = {
  1170. /* Matti Mottus <mottus@physic.ut.ee> */
  1171. .name = "Askey CPH03x TV Capturer",
  1172. .video_inputs = 4,
  1173. /* .audio_inputs= 1, */
  1174. .svhs = 2,
  1175. .gpiomask = 0x03000F,
  1176. .muxsel = { 2, 3, 1, 0 },
  1177. .gpiomux = { 2, 0, 0, 0 },
  1178. .gpiomute = 1,
  1179. .pll = PLL_28,
  1180. .tuner_type = TUNER_TEMIC_PAL,
  1181. .tuner_addr = ADDR_UNSET,
  1182. },
  1183. /* ---- card 0x3c ---------------------------------- */
  1184. [BTTV_BOARD_MM100PCTV] = {
  1185. /* Philip Blundell <philb@gnu.org> */
  1186. .name = "Modular Technology MM100PCTV",
  1187. .video_inputs = 2,
  1188. /* .audio_inputs= 2, */
  1189. .svhs = NO_SVHS,
  1190. .gpiomask = 11,
  1191. .muxsel = { 2, 3, 1, 1 },
  1192. .gpiomux = { 2, 0, 0, 1 },
  1193. .gpiomute = 8,
  1194. .pll = PLL_35,
  1195. .tuner_type = TUNER_TEMIC_PAL,
  1196. .tuner_addr = ADDR_UNSET,
  1197. },
  1198. [BTTV_BOARD_GMV1] = {
  1199. /* Adrian Cox <adrian@humboldt.co.uk */
  1200. .name = "AG Electronics GMV1",
  1201. .video_inputs = 2,
  1202. /* .audio_inputs= 0, */
  1203. .svhs = 1,
  1204. .gpiomask = 0xF,
  1205. .muxsel = { 2, 2 },
  1206. .gpiomux = { },
  1207. .no_msp34xx = 1,
  1208. .needs_tvaudio = 0,
  1209. .pll = PLL_28,
  1210. .tuner_type = TUNER_ABSENT,
  1211. .tuner_addr = ADDR_UNSET,
  1212. },
  1213. [BTTV_BOARD_BESTBUY_EASYTV2] = {
  1214. /* Miguel Angel Alvarez <maacruz@navegalia.com>
  1215. new Easy TV BT878 version (model CPH061)
  1216. special thanks to Informatica Mieres for providing the card */
  1217. .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
  1218. .video_inputs = 3,
  1219. /* .audio_inputs= 2, */
  1220. .svhs = 2,
  1221. .gpiomask = 0xFF,
  1222. .muxsel = { 2, 3, 1, 0 },
  1223. .gpiomux = { 1, 0, 4, 4 },
  1224. .gpiomute = 9,
  1225. .needs_tvaudio = 0,
  1226. .pll = PLL_28,
  1227. .tuner_type = TUNER_PHILIPS_PAL,
  1228. .tuner_addr = ADDR_UNSET,
  1229. },
  1230. [BTTV_BOARD_ATI_TVWONDER] = {
  1231. /* Lukas Gebauer <geby@volny.cz> */
  1232. .name = "ATI TV-Wonder",
  1233. .video_inputs = 3,
  1234. /* .audio_inputs= 1, */
  1235. .svhs = 2,
  1236. .gpiomask = 0xf03f,
  1237. .muxsel = { 2, 3, 1, 0 },
  1238. .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
  1239. .gpiomute = 0xbffe,
  1240. .pll = PLL_28,
  1241. .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
  1242. .tuner_addr = ADDR_UNSET,
  1243. },
  1244. /* ---- card 0x40 ---------------------------------- */
  1245. [BTTV_BOARD_ATI_TVWONDERVE] = {
  1246. /* Lukas Gebauer <geby@volny.cz> */
  1247. .name = "ATI TV-Wonder VE",
  1248. .video_inputs = 2,
  1249. /* .audio_inputs= 1, */
  1250. .svhs = NO_SVHS,
  1251. .gpiomask = 1,
  1252. .muxsel = { 2, 3, 0, 1 },
  1253. .gpiomux = { 0, 0, 1, 0 },
  1254. .no_msp34xx = 1,
  1255. .pll = PLL_28,
  1256. .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
  1257. .tuner_addr = ADDR_UNSET,
  1258. },
  1259. [BTTV_BOARD_FLYVIDEO2000] = {
  1260. /* DeeJay <deejay@westel900.net (2000S) */
  1261. .name = "Lifeview FlyVideo 2000S LR90",
  1262. .video_inputs = 3,
  1263. /* .audio_inputs= 3, */
  1264. .svhs = 2,
  1265. .gpiomask = 0x18e0,
  1266. .muxsel = { 2, 3, 0, 1 },
  1267. /* Radio changed from 1e80 to 0x800 to make
  1268. FlyVideo2000S in .hu happy (gm)*/
  1269. /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
  1270. .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
  1271. .gpiomute = 0x1800,
  1272. .audio_mode_gpio= fv2000s_audio,
  1273. .no_msp34xx = 1,
  1274. .no_tda9875 = 1,
  1275. .needs_tvaudio = 1,
  1276. .pll = PLL_28,
  1277. .tuner_type = TUNER_PHILIPS_PAL,
  1278. .tuner_addr = ADDR_UNSET,
  1279. },
  1280. [BTTV_BOARD_TERRATVALUER] = {
  1281. .name = "Terratec TValueRadio",
  1282. .video_inputs = 3,
  1283. /* .audio_inputs= 1, */
  1284. .svhs = 2,
  1285. .gpiomask = 0xffff00,
  1286. .muxsel = { 2, 3, 1, 1 },
  1287. .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
  1288. .gpiomute = 0x900,
  1289. .needs_tvaudio = 1,
  1290. .pll = PLL_28,
  1291. .tuner_type = TUNER_PHILIPS_PAL,
  1292. .tuner_addr = ADDR_UNSET,
  1293. .has_radio = 1,
  1294. },
  1295. [BTTV_BOARD_GVBCTV4PCI] = {
  1296. /* TANAKA Kei <peg00625@nifty.com> */
  1297. .name = "IODATA GV-BCTV4/PCI",
  1298. .video_inputs = 3,
  1299. /* .audio_inputs= 1, */
  1300. .svhs = 2,
  1301. .gpiomask = 0x010f00,
  1302. .muxsel = {2, 3, 0, 0 },
  1303. .gpiomux = {0x10000, 0, 0x10000, 0 },
  1304. .no_msp34xx = 1,
  1305. .pll = PLL_28,
  1306. .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
  1307. .tuner_addr = ADDR_UNSET,
  1308. .audio_mode_gpio= gvbctv3pci_audio,
  1309. },
  1310. /* ---- card 0x44 ---------------------------------- */
  1311. [BTTV_BOARD_VOODOOTV_FM] = {
  1312. .name = "3Dfx VoodooTV FM (Euro)",
  1313. /* try "insmod msp3400 simple=0" if you have
  1314. * sound problems with this card. */
  1315. .video_inputs = 4,
  1316. /* .audio_inputs= 1, */
  1317. .svhs = NO_SVHS,
  1318. .gpiomask = 0x4f8a00,
  1319. /* 0x100000: 1=MSP enabled (0=disable again)
  1320. * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
  1321. .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
  1322. .gpiomute = 0x947fff,
  1323. /* tvtuner, radio, external,internal, mute, stereo
  1324. * tuner, Composit, SVid, Composit-on-Svid-adapter */
  1325. .muxsel = { 2, 3 ,0 ,1 },
  1326. .tuner_type = TUNER_MT2032,
  1327. .tuner_addr = ADDR_UNSET,
  1328. .pll = PLL_28,
  1329. .has_radio = 1,
  1330. },
  1331. [BTTV_BOARD_VOODOOTV_200] = {
  1332. .name = "VoodooTV 200 (USA)",
  1333. /* try "insmod msp3400 simple=0" if you have
  1334. * sound problems with this card. */
  1335. .video_inputs = 4,
  1336. /* .audio_inputs= 1, */
  1337. .svhs = NO_SVHS,
  1338. .gpiomask = 0x4f8a00,
  1339. /* 0x100000: 1=MSP enabled (0=disable again)
  1340. * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
  1341. .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
  1342. .gpiomute = 0x947fff,
  1343. /* tvtuner, radio, external,internal, mute, stereo
  1344. * tuner, Composit, SVid, Composit-on-Svid-adapter */
  1345. .muxsel = { 2, 3 ,0 ,1 },
  1346. .tuner_type = TUNER_MT2032,
  1347. .tuner_addr = ADDR_UNSET,
  1348. .pll = PLL_28,
  1349. .has_radio = 1,
  1350. },
  1351. [BTTV_BOARD_AIMMS] = {
  1352. /* Philip Blundell <pb@nexus.co.uk> */
  1353. .name = "Active Imaging AIMMS",
  1354. .video_inputs = 1,
  1355. /* .audio_inputs= 0, */
  1356. .tuner_type = TUNER_ABSENT,
  1357. .tuner_addr = ADDR_UNSET,
  1358. .pll = PLL_28,
  1359. .muxsel = { 2 },
  1360. .gpiomask = 0
  1361. },
  1362. [BTTV_BOARD_PV_BT878P_PLUS] = {
  1363. /* Tomasz Pyra <hellfire@sedez.iq.pl> */
  1364. .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
  1365. .video_inputs = 3,
  1366. /* .audio_inputs= 4, */
  1367. .svhs = 2,
  1368. .gpiomask = 15,
  1369. .muxsel = { 2, 3, 1, 1 },
  1370. .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
  1371. .gpiomute = 13,
  1372. .needs_tvaudio = 1,
  1373. .pll = PLL_28,
  1374. .tuner_type = TUNER_LG_PAL_I_FM,
  1375. .tuner_addr = ADDR_UNSET,
  1376. .has_remote = 1,
  1377. /* GPIO wiring:
  1378. GPIO0: U4.A0 (hef4052bt)
  1379. GPIO1: U4.A1
  1380. GPIO2: U4.A1 (second hef4052bt)
  1381. GPIO3: U4.nEN, U5.A0, A5.nEN
  1382. GPIO8-15: vrd866b ?
  1383. */
  1384. },
  1385. [BTTV_BOARD_FLYVIDEO98EZ] = {
  1386. .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
  1387. .video_inputs = 4,
  1388. /* .audio_inputs= 0, */
  1389. .svhs = 2,
  1390. .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
  1391. .pll = PLL_28,
  1392. .no_msp34xx = 1,
  1393. .tuner_type = TUNER_ABSENT,
  1394. .tuner_addr = ADDR_UNSET,
  1395. },
  1396. /* ---- card 0x48 ---------------------------------- */
  1397. [BTTV_BOARD_PV_BT878P_9B] = {
  1398. /* Dariusz Kowalewski <darekk@automex.pl> */
  1399. .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
  1400. .video_inputs = 4,
  1401. /* .audio_inputs= 1, */
  1402. .svhs = 2,
  1403. .gpiomask = 0x3f,
  1404. .muxsel = { 2, 3, 1, 1 },
  1405. .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
  1406. .gpiomute = 0x09,
  1407. .needs_tvaudio = 1,
  1408. .no_msp34xx = 1,
  1409. .no_tda9875 = 1,
  1410. .pll = PLL_28,
  1411. .tuner_type = TUNER_PHILIPS_PAL,
  1412. .tuner_addr = ADDR_UNSET,
  1413. .audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */
  1414. .has_radio = 1, /* Note: not all cards have radio */
  1415. .has_remote = 1,
  1416. /* GPIO wiring:
  1417. GPIO0: A0 hef4052
  1418. GPIO1: A1 hef4052
  1419. GPIO3: nEN hef4052
  1420. GPIO8-15: vrd866b
  1421. GPIO20,22,23: R30,R29,R28
  1422. */
  1423. },
  1424. [BTTV_BOARD_SENSORAY311] = {
  1425. /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
  1426. /* you must jumper JP5 for the card to work */
  1427. .name = "Sensoray 311",
  1428. .video_inputs = 5,
  1429. /* .audio_inputs= 0, */
  1430. .svhs = 4,
  1431. .gpiomask = 0,
  1432. .muxsel = { 2, 3, 1, 0, 0 },
  1433. .gpiomux = { 0 },
  1434. .needs_tvaudio = 0,
  1435. .tuner_type = TUNER_ABSENT,
  1436. .tuner_addr = ADDR_UNSET,
  1437. },
  1438. [BTTV_BOARD_RV605] = {
  1439. /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
  1440. .name = "RemoteVision MX (RV605)",
  1441. .video_inputs = 16,
  1442. /* .audio_inputs= 0, */
  1443. .svhs = NO_SVHS,
  1444. .gpiomask = 0x00,
  1445. .gpiomask2 = 0x07ff,
  1446. .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
  1447. .no_msp34xx = 1,
  1448. .no_tda9875 = 1,
  1449. .tuner_type = TUNER_ABSENT,
  1450. .tuner_addr = ADDR_UNSET,
  1451. .muxsel_hook = rv605_muxsel,
  1452. },
  1453. [BTTV_BOARD_POWERCLR_MTV878] = {
  1454. .name = "Powercolor MTV878/ MTV878R/ MTV878F",
  1455. .video_inputs = 3,
  1456. /* .audio_inputs= 2, */
  1457. .svhs = 2,
  1458. .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
  1459. .muxsel = { 2, 1, 1, },
  1460. .gpiomux = { 0, 1, 2, 2 },
  1461. .gpiomute = 4,
  1462. .needs_tvaudio = 0,
  1463. .tuner_type = TUNER_PHILIPS_PAL,
  1464. .tuner_addr = ADDR_UNSET,
  1465. .pll = PLL_28,
  1466. .has_radio = 1,
  1467. },
  1468. /* ---- card 0x4c ---------------------------------- */
  1469. [BTTV_BOARD_WINDVR] = {
  1470. /* Masaki Suzuki <masaki@btree.org> */
  1471. .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
  1472. .video_inputs = 3,
  1473. /* .audio_inputs= 1, */
  1474. .svhs = 2,
  1475. .gpiomask = 0x140007,
  1476. .muxsel = { 2, 3, 1, 1 },
  1477. .gpiomux = { 0, 1, 2, 3 },
  1478. .gpiomute = 4,
  1479. .tuner_type = TUNER_PHILIPS_NTSC,
  1480. .tuner_addr = ADDR_UNSET,
  1481. .audio_mode_gpio= windvr_audio,
  1482. },
  1483. [BTTV_BOARD_GRANDTEC_MULTI] = {
  1484. .name = "GrandTec Multi Capture Card (Bt878)",
  1485. .video_inputs = 4,
  1486. /* .audio_inputs= 0, */
  1487. .svhs = NO_SVHS,
  1488. .gpiomask = 0,
  1489. .muxsel = { 2, 3, 1, 0 },
  1490. .gpiomux = { 0 },
  1491. .needs_tvaudio = 0,
  1492. .no_msp34xx = 1,
  1493. .pll = PLL_28,
  1494. .tuner_type = TUNER_ABSENT,
  1495. .tuner_addr = ADDR_UNSET,
  1496. },
  1497. [BTTV_BOARD_KWORLD] = {
  1498. .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
  1499. .video_inputs = 4,
  1500. /* .audio_inputs= 3, */
  1501. .svhs = 2,
  1502. .gpiomask = 7,
  1503. .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
  1504. .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
  1505. * This card lacks external Audio In, so we mute it on Ext. & Int.
  1506. * The PCB can take a sbx1637/sbx1673, wiring unknown.
  1507. * This card lacks PCI subsystem ID, sigh.
  1508. * gpiomux =1: lower volume, 2+3: mute
  1509. * btwincap uses 0x80000/0x80003
  1510. */
  1511. .gpiomute = 4,
  1512. .needs_tvaudio = 0,
  1513. .no_msp34xx = 1,
  1514. .pll = PLL_28,
  1515. .tuner_type = TUNER_PHILIPS_PAL,
  1516. .tuner_addr = ADDR_UNSET,
  1517. /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
  1518. radio signal strength indicators work fine. */
  1519. .has_radio = 1,
  1520. /* GPIO Info:
  1521. GPIO0,1: HEF4052 A0,A1
  1522. GPIO2: HEF4052 nENABLE
  1523. GPIO3-7: n.c.
  1524. GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
  1525. GPIO14,15: ??
  1526. GPIO16-21: n.c.
  1527. GPIO22,23: ??
  1528. ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
  1529. },
  1530. [BTTV_BOARD_DSP_TCVIDEO] = {
  1531. /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
  1532. .name = "DSP Design TCVIDEO",
  1533. .video_inputs = 4,
  1534. .svhs = NO_SVHS,
  1535. .muxsel = { 2, 3, 1, 0 },
  1536. .pll = PLL_28,
  1537. .tuner_type = UNSET,
  1538. .tuner_addr = ADDR_UNSET,
  1539. },
  1540. /* ---- card 0x50 ---------------------------------- */
  1541. [BTTV_BOARD_HAUPPAUGEPVR] = {
  1542. .name = "Hauppauge WinTV PVR",
  1543. .video_inputs = 4,
  1544. /* .audio_inputs= 1, */
  1545. .svhs = 2,
  1546. .muxsel = { 2, 0, 1, 1 },
  1547. .needs_tvaudio = 1,
  1548. .pll = PLL_28,
  1549. .tuner_type = UNSET,
  1550. .tuner_addr = ADDR_UNSET,
  1551. .gpiomask = 7,
  1552. .gpiomux = {7},
  1553. },
  1554. [BTTV_BOARD_GVBCTV5PCI] = {
  1555. .name = "IODATA GV-BCTV5/PCI",
  1556. .video_inputs = 3,
  1557. /* .audio_inputs= 1, */
  1558. .svhs = 2,
  1559. .gpiomask = 0x0f0f80,
  1560. .muxsel = {2, 3, 1, 0 },
  1561. .gpiomux = {0x030000, 0x010000, 0, 0 },
  1562. .gpiomute = 0x020000,
  1563. .no_msp34xx = 1,
  1564. .pll = PLL_28,
  1565. .tuner_type = TUNER_PHILIPS_NTSC_M,
  1566. .tuner_addr = ADDR_UNSET,
  1567. .audio_mode_gpio= gvbctv5pci_audio,
  1568. .has_radio = 1,
  1569. },
  1570. [BTTV_BOARD_OSPREY1x0] = {
  1571. .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
  1572. .video_inputs = 4, /* id-inputs-clock */
  1573. /* .audio_inputs= 0, */
  1574. .svhs = 3,
  1575. .muxsel = { 3, 2, 0, 1 },
  1576. .pll = PLL_28,
  1577. .tuner_type = TUNER_ABSENT,
  1578. .tuner_addr = ADDR_UNSET,
  1579. .no_msp34xx = 1,
  1580. .no_tda9875 = 1,
  1581. .no_tda7432 = 1,
  1582. },
  1583. [BTTV_BOARD_OSPREY1x0_848] = {
  1584. .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
  1585. .video_inputs = 3,
  1586. /* .audio_inputs= 0, */
  1587. .svhs = 2,
  1588. .muxsel = { 2, 3, 1 },
  1589. .pll = PLL_28,
  1590. .tuner_type = TUNER_ABSENT,
  1591. .tuner_addr = ADDR_UNSET,
  1592. .no_msp34xx = 1,
  1593. .no_tda9875 = 1,
  1594. .no_tda7432 = 1,
  1595. },
  1596. /* ---- card 0x54 ---------------------------------- */
  1597. [BTTV_BOARD_OSPREY101_848] = {
  1598. .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
  1599. .video_inputs = 2,
  1600. /* .audio_inputs= 0, */
  1601. .svhs = 1,
  1602. .muxsel = { 3, 1 },
  1603. .pll = PLL_28,
  1604. .tuner_type = TUNER_ABSENT,
  1605. .tuner_addr = ADDR_UNSET,
  1606. .no_msp34xx = 1,
  1607. .no_tda9875 = 1,
  1608. .no_tda7432 = 1,
  1609. },
  1610. [BTTV_BOARD_OSPREY1x1] = {
  1611. .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
  1612. .video_inputs = 1,
  1613. /* .audio_inputs= 0, */
  1614. .svhs = NO_SVHS,
  1615. .muxsel = { 0 },
  1616. .pll = PLL_28,
  1617. .tuner_type = TUNER_ABSENT,
  1618. .tuner_addr = ADDR_UNSET,
  1619. .no_msp34xx = 1,
  1620. .no_tda9875 = 1,
  1621. .no_tda7432 = 1,
  1622. },
  1623. [BTTV_BOARD_OSPREY1x1_SVID] = {
  1624. .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
  1625. .video_inputs = 2,
  1626. /* .audio_inputs= 0, */
  1627. .svhs = 1,
  1628. .muxsel = { 0, 1 },
  1629. .pll = PLL_28,
  1630. .tuner_type = TUNER_ABSENT,
  1631. .tuner_addr = ADDR_UNSET,
  1632. .no_msp34xx = 1,
  1633. .no_tda9875 = 1,
  1634. .no_tda7432 = 1,
  1635. },
  1636. [BTTV_BOARD_OSPREY2xx] = {
  1637. .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
  1638. .video_inputs = 1,
  1639. /* .audio_inputs= 1, */
  1640. .svhs = NO_SVHS,
  1641. .muxsel = { 0 },
  1642. .pll = PLL_28,
  1643. .tuner_type = TUNER_ABSENT,
  1644. .tuner_addr = ADDR_UNSET,
  1645. .no_msp34xx = 1,
  1646. .no_tda9875 = 1,
  1647. .no_tda7432 = 1,
  1648. },
  1649. /* ---- card 0x58 ---------------------------------- */
  1650. [BTTV_BOARD_OSPREY2x0_SVID] = {
  1651. .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
  1652. .video_inputs = 2,
  1653. /* .audio_inputs= 1, */
  1654. .svhs = 1,
  1655. .muxsel = { 0, 1 },
  1656. .pll = PLL_28,
  1657. .tuner_type = TUNER_ABSENT,
  1658. .tuner_addr = ADDR_UNSET,
  1659. .no_msp34xx = 1,
  1660. .no_tda9875 = 1,
  1661. .no_tda7432 = 1,
  1662. },
  1663. [BTTV_BOARD_OSPREY2x0] = {
  1664. .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
  1665. .video_inputs = 2,
  1666. /* .audio_inputs= 1, */
  1667. .svhs = 1,
  1668. .muxsel = { 2, 3 },
  1669. .pll = PLL_28,
  1670. .tuner_type = TUNER_ABSENT,
  1671. .tuner_addr = ADDR_UNSET,
  1672. .no_msp34xx = 1,
  1673. .no_tda9875 = 1,
  1674. .no_tda7432 = 1,
  1675. },
  1676. [BTTV_BOARD_OSPREY500] = {
  1677. .name = "Osprey 500", /* 500 */
  1678. .video_inputs = 2,
  1679. /* .audio_inputs= 1, */
  1680. .svhs = 1,
  1681. .muxsel = { 2, 3 },
  1682. .pll = PLL_28,
  1683. .tuner_type = TUNER_ABSENT,
  1684. .tuner_addr = ADDR_UNSET,
  1685. .no_msp34xx = 1,
  1686. .no_tda9875 = 1,
  1687. .no_tda7432 = 1,
  1688. },
  1689. [BTTV_BOARD_OSPREY540] = {
  1690. .name = "Osprey 540", /* 540 */
  1691. .video_inputs = 4,
  1692. /* .audio_inputs= 1, */
  1693. .pll = PLL_28,
  1694. .tuner_type = TUNER_ABSENT,
  1695. .tuner_addr = ADDR_UNSET,
  1696. .no_msp34xx = 1,
  1697. .no_tda9875 = 1,
  1698. .no_tda7432 = 1,
  1699. },
  1700. /* ---- card 0x5C ---------------------------------- */
  1701. [BTTV_BOARD_OSPREY2000] = {
  1702. .name = "Osprey 2000", /* 2000 */
  1703. .video_inputs = 2,
  1704. /* .audio_inputs= 1, */
  1705. .svhs = 1,
  1706. .muxsel = { 2, 3 },
  1707. .pll = PLL_28,
  1708. .tuner_type = TUNER_ABSENT,
  1709. .tuner_addr = ADDR_UNSET,
  1710. .no_msp34xx = 1,
  1711. .no_tda9875 = 1,
  1712. .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
  1713. },
  1714. [BTTV_BOARD_IDS_EAGLE] = {
  1715. /* M G Berberich <berberic@forwiss.uni-passau.de> */
  1716. .name = "IDS Eagle",
  1717. .video_inputs = 4,
  1718. /* .audio_inputs= 0, */
  1719. .tuner_type = TUNER_ABSENT,
  1720. .tuner_addr = ADDR_UNSET,
  1721. .svhs = NO_SVHS,
  1722. .gpiomask = 0,
  1723. .muxsel = { 0, 1, 2, 3 },
  1724. .muxsel_hook = eagle_muxsel,
  1725. .no_msp34xx = 1,
  1726. .no_tda9875 = 1,
  1727. .pll = PLL_28,
  1728. },
  1729. [BTTV_BOARD_PINNACLESAT] = {
  1730. .name = "Pinnacle PCTV Sat",
  1731. .video_inputs = 2,
  1732. /* .audio_inputs= 0, */
  1733. .svhs = 1,
  1734. .tuner_type = TUNER_ABSENT,
  1735. .tuner_addr = ADDR_UNSET,
  1736. .no_msp34xx = 1,
  1737. .no_tda9875 = 1,
  1738. .no_tda7432 = 1,
  1739. .muxsel = { 3, 1 },
  1740. .pll = PLL_28,
  1741. .no_gpioirq = 1,
  1742. .has_dvb = 1,
  1743. },
  1744. [BTTV_BOARD_FORMAC_PROTV] = {
  1745. .name = "Formac ProTV II (bt878)",
  1746. .video_inputs = 4,
  1747. /* .audio_inputs= 1, */
  1748. .svhs = 3,
  1749. .gpiomask = 2,
  1750. /* TV, Comp1, Composite over SVID con, SVID */
  1751. .muxsel = { 2, 3, 1, 1 },
  1752. .gpiomux = { 2, 2, 0, 0 },
  1753. .pll = PLL_28,
  1754. .has_radio = 1,
  1755. .tuner_type = TUNER_PHILIPS_PAL,
  1756. .tuner_addr = ADDR_UNSET,
  1757. /* sound routing:
  1758. GPIO=0x00,0x01,0x03: mute (?)
  1759. 0x02: both TV and radio (tuner: FM1216/I)
  1760. The card has onboard audio connectors labeled "cdrom" and "board",
  1761. not soldered here, though unknown wiring.
  1762. Card lacks: external audio in, pci subsystem id.
  1763. */
  1764. },
  1765. /* ---- card 0x60 ---------------------------------- */
  1766. [BTTV_BOARD_MACHTV] = {
  1767. .name = "MachTV",
  1768. .video_inputs = 3,
  1769. /* .audio_inputs= 1, */
  1770. .svhs = NO_SVHS,
  1771. .gpiomask = 7,
  1772. .muxsel = { 2, 3, 1, 1},
  1773. .gpiomux = { 0, 1, 2, 3},
  1774. .gpiomute = 4,
  1775. .needs_tvaudio = 1,
  1776. .tuner_type = TUNER_PHILIPS_PAL,
  1777. .tuner_addr = ADDR_UNSET,
  1778. .pll = PLL_28,
  1779. },
  1780. [BTTV_BOARD_EURESYS_PICOLO] = {
  1781. .name = "Euresys Picolo",
  1782. .video_inputs = 3,
  1783. /* .audio_inputs= 0, */
  1784. .svhs = 2,
  1785. .gpiomask = 0,
  1786. .no_msp34xx = 1,
  1787. .no_tda9875 = 1,
  1788. .no_tda7432 = 1,
  1789. .muxsel = { 2, 0, 1},
  1790. .pll = PLL_28,
  1791. .tuner_type = TUNER_ABSENT,
  1792. .tuner_addr = ADDR_UNSET,
  1793. },
  1794. [BTTV_BOARD_PV150] = {
  1795. /* Luc Van Hoeylandt <luc@e-magic.be> */
  1796. .name = "ProVideo PV150", /* 0x4f */
  1797. .video_inputs = 2,
  1798. /* .audio_inputs= 0, */
  1799. .svhs = NO_SVHS,
  1800. .gpiomask = 0,
  1801. .muxsel = { 2, 3 },
  1802. .gpiomux = { 0 },
  1803. .needs_tvaudio = 0,
  1804. .no_msp34xx = 1,
  1805. .pll = PLL_28,
  1806. .tuner_type = TUNER_ABSENT,
  1807. .tuner_addr = ADDR_UNSET,
  1808. },
  1809. [BTTV_BOARD_AD_TVK503] = {
  1810. /* Hiroshi Takekawa <sian@big.or.jp> */
  1811. /* This card lacks subsystem ID */
  1812. .name = "AD-TVK503", /* 0x63 */
  1813. .video_inputs = 4,
  1814. /* .audio_inputs= 1, */
  1815. .svhs = 2,
  1816. .gpiomask = 0x001e8007,
  1817. .muxsel = { 2, 3, 1, 0 },
  1818. /* Tuner, Radio, external, internal, off, on */
  1819. .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
  1820. .gpiomute = 0x0f,
  1821. .needs_tvaudio = 0,
  1822. .no_msp34xx = 1,
  1823. .pll = PLL_28,
  1824. .tuner_type = TUNER_PHILIPS_NTSC,
  1825. .tuner_addr = ADDR_UNSET,
  1826. .audio_mode_gpio= adtvk503_audio,
  1827. },
  1828. /* ---- card 0x64 ---------------------------------- */
  1829. [BTTV_BOARD_HERCULES_SM_TV] = {
  1830. .name = "Hercules Smart TV Stereo",
  1831. .video_inputs = 4,
  1832. /* .audio_inputs= 1, */
  1833. .svhs = 2,
  1834. .gpiomask = 0x00,
  1835. .muxsel = { 2, 3, 1, 1 },
  1836. .needs_tvaudio = 1,
  1837. .no_msp34xx = 1,
  1838. .pll = PLL_28,
  1839. .tuner_type = TUNER_PHILIPS_PAL,
  1840. .tuner_addr = ADDR_UNSET,
  1841. /* Notes:
  1842. - card lacks subsystem ID
  1843. - stereo variant w/ daughter board with tda9874a @0xb0
  1844. - Audio Routing:
  1845. always from tda9874 independent of GPIO (?)
  1846. external line in: unknown
  1847. - Other chips: em78p156elp @ 0x96 (probably IR remote control)
  1848. hef4053 (instead 4052) for unknown function
  1849. */
  1850. },
  1851. [BTTV_BOARD_PACETV] = {
  1852. .name = "Pace TV & Radio Card",
  1853. .video_inputs = 4,
  1854. /* .audio_inputs= 1, */
  1855. .svhs = 2,
  1856. .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
  1857. .gpiomask = 0,
  1858. .no_tda9875 = 1,
  1859. .no_tda7432 = 1,
  1860. .tuner_type = TUNER_PHILIPS_PAL_I,
  1861. .tuner_addr = ADDR_UNSET,
  1862. .has_radio = 1,
  1863. .pll = PLL_28,
  1864. /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
  1865. only internal line out: (4pin header) RGGL
  1866. Radio must be decoded by msp3410d (not routed through)*/
  1867. /*
  1868. .digital_mode = DIGITAL_MODE_CAMERA, todo!
  1869. */
  1870. },
  1871. [BTTV_BOARD_IVC200] = {
  1872. /* Chris Willing <chris@vislab.usyd.edu.au> */
  1873. .name = "IVC-200",
  1874. .video_inputs = 1,
  1875. /* .audio_inputs= 0, */
  1876. .tuner_type = TUNER_ABSENT,
  1877. .tuner_addr = ADDR_UNSET,
  1878. .svhs = NO_SVHS,
  1879. .gpiomask = 0xdf,
  1880. .muxsel = { 2 },
  1881. .pll = PLL_28,
  1882. },
  1883. [BTTV_BOARD_IVCE8784] = {
  1884. .name = "IVCE-8784",
  1885. .video_inputs = 1,
  1886. /* .audio_inputs= 0, */
  1887. .tuner_type = TUNER_ABSENT,
  1888. .tuner_addr = ADDR_UNSET,
  1889. .svhs = NO_SVHS,
  1890. .gpiomask = 0xdf,
  1891. .muxsel = { 2 },
  1892. .pll = PLL_28,
  1893. },
  1894. [BTTV_BOARD_XGUARD] = {
  1895. .name = "Grand X-Guard / Trust 814PCI",
  1896. .video_inputs = 16,
  1897. /* .audio_inputs= 0, */
  1898. .svhs = NO_SVHS,
  1899. .tuner_type = TUNER_ABSENT,
  1900. .tuner_addr = ADDR_UNSET,
  1901. .gpiomask2 = 0xff,
  1902. .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
  1903. .muxsel_hook = xguard_muxsel,
  1904. .no_msp34xx = 1,
  1905. .no_tda9875 = 1,
  1906. .no_tda7432 = 1,
  1907. .pll = PLL_28,
  1908. },
  1909. /* ---- card 0x68 ---------------------------------- */
  1910. [BTTV_BOARD_NEBULA_DIGITV] = {
  1911. .name = "Nebula Electronics DigiTV",
  1912. .video_inputs = 1,
  1913. .svhs = NO_SVHS,
  1914. .muxsel = { 2, 3, 1, 0 },
  1915. .no_msp34xx = 1,
  1916. .no_tda9875 = 1,
  1917. .no_tda7432 = 1,
  1918. .pll = PLL_28,
  1919. .tuner_type = TUNER_ABSENT,
  1920. .tuner_addr = ADDR_UNSET,
  1921. .has_dvb = 1,
  1922. .has_remote = 1,
  1923. .gpiomask = 0x1b,
  1924. .no_gpioirq = 1,
  1925. },
  1926. [BTTV_BOARD_PV143] = {
  1927. /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
  1928. .name = "ProVideo PV143",
  1929. .video_inputs = 4,
  1930. /* .audio_inputs= 0, */
  1931. .svhs = NO_SVHS,
  1932. .gpiomask = 0,
  1933. .muxsel = { 2, 3, 1, 0 },
  1934. .gpiomux = { 0 },
  1935. .needs_tvaudio = 0,
  1936. .no_msp34xx = 1,
  1937. .pll = PLL_28,
  1938. .tuner_type = TUNER_ABSENT,
  1939. .tuner_addr = ADDR_UNSET,
  1940. },
  1941. [BTTV_BOARD_VD009X1_VD011_MINIDIN] = {
  1942. /* M.Klahr@phytec.de */
  1943. .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
  1944. .video_inputs = 4,
  1945. /* .audio_inputs= 0, */
  1946. .svhs = 3,
  1947. .gpiomask = 0x00,
  1948. .muxsel = { 2, 3, 1, 0 },
  1949. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  1950. .needs_tvaudio = 0,
  1951. .pll = PLL_28,
  1952. .tuner_type = TUNER_ABSENT,
  1953. .tuner_addr = ADDR_UNSET,
  1954. },
  1955. [BTTV_BOARD_VD009X1_VD011_COMBI] = {
  1956. .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",
  1957. .video_inputs = 4,
  1958. /* .audio_inputs= 0, */
  1959. .svhs = 3,
  1960. .gpiomask = 0x00,
  1961. .muxsel = { 2, 3, 1, 1 },
  1962. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  1963. .needs_tvaudio = 0,
  1964. .pll = PLL_28,
  1965. .tuner_type = TUNER_ABSENT,
  1966. .tuner_addr = ADDR_UNSET,
  1967. },
  1968. /* ---- card 0x6c ---------------------------------- */
  1969. [BTTV_BOARD_VD009_MINIDIN] = {
  1970. .name = "PHYTEC VD-009 MiniDIN (bt878)",
  1971. .video_inputs = 10,
  1972. /* .audio_inputs= 0, */
  1973. .svhs = 9,
  1974. .gpiomask = 0x00,
  1975. .gpiomask2 = 0x03, /* used for external vodeo mux */
  1976. .muxsel = { 2, 2, 2, 2, 3, 3, 3, 3, 1, 0 },
  1977. .muxsel_hook = phytec_muxsel,
  1978. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  1979. .needs_tvaudio = 1,
  1980. .pll = PLL_28,
  1981. .tuner_type = TUNER_ABSENT,
  1982. .tuner_addr = ADDR_UNSET,
  1983. },
  1984. [BTTV_BOARD_VD009_COMBI] = {
  1985. .name = "PHYTEC VD-009 Combi (bt878)",
  1986. .video_inputs = 10,
  1987. /* .audio_inputs= 0, */
  1988. .svhs = 9,
  1989. .gpiomask = 0x00,
  1990. .gpiomask2 = 0x03, /* used for external vodeo mux */
  1991. .muxsel = { 2, 2, 2, 2, 3, 3, 3, 3, 1, 1 },
  1992. .muxsel_hook = phytec_muxsel,
  1993. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  1994. .needs_tvaudio = 1,
  1995. .pll = PLL_28,
  1996. .tuner_type = TUNER_ABSENT,
  1997. .tuner_addr = ADDR_UNSET,
  1998. },
  1999. [BTTV_BOARD_IVC100] = {
  2000. .name = "IVC-100",
  2001. .video_inputs = 4,
  2002. /* .audio_inputs= 0, */
  2003. .tuner_type = TUNER_ABSENT,
  2004. .tuner_addr = ADDR_UNSET,
  2005. .svhs = NO_SVHS,
  2006. .gpiomask = 0xdf,
  2007. .muxsel = { 2, 3, 1, 0 },
  2008. .pll = PLL_28,
  2009. },
  2010. [BTTV_BOARD_IVC120] = {
  2011. /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
  2012. .name = "IVC-120G",
  2013. .video_inputs = 16,
  2014. /* .audio_inputs= 0, */
  2015. .tuner_type = TUNER_ABSENT,
  2016. .tuner_addr = ADDR_UNSET,
  2017. .svhs = NO_SVHS, /* card has no svhs */
  2018. .needs_tvaudio = 0,
  2019. .no_msp34xx = 1,
  2020. .no_tda9875 = 1,
  2021. .no_tda7432 = 1,
  2022. .gpiomask = 0x00,
  2023. .muxsel = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
  2024. .muxsel_hook = ivc120_muxsel,
  2025. .pll = PLL_28,
  2026. },
  2027. /* ---- card 0x70 ---------------------------------- */
  2028. [BTTV_BOARD_PC_HDTV] = {
  2029. .name = "pcHDTV HD-2000 TV",
  2030. .video_inputs = 4,
  2031. /* .audio_inputs= 1, */
  2032. .svhs = 2,
  2033. .muxsel = { 2, 3, 1, 0 },
  2034. .tuner_type = TUNER_PHILIPS_FCV1236D,
  2035. .tuner_addr = ADDR_UNSET,
  2036. .has_dvb = 1,
  2037. },
  2038. [BTTV_BOARD_TWINHAN_DST] = {
  2039. .name = "Twinhan DST + clones",
  2040. .no_msp34xx = 1,
  2041. .no_tda9875 = 1,
  2042. .no_tda7432 = 1,
  2043. .tuner_type = TUNER_ABSENT,
  2044. .tuner_addr = ADDR_UNSET,
  2045. .no_video = 1,
  2046. .has_dvb = 1,
  2047. },
  2048. [BTTV_BOARD_WINFASTVC100] = {
  2049. .name = "Winfast VC100",
  2050. .video_inputs = 3,
  2051. /* .audio_inputs= 0, */
  2052. .svhs = 1,
  2053. .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
  2054. .no_msp34xx = 1,
  2055. .no_tda9875 = 1,
  2056. .no_tda7432 = 1,
  2057. .tuner_type = TUNER_ABSENT,
  2058. .tuner_addr = ADDR_UNSET,
  2059. .pll = PLL_28,
  2060. },
  2061. [BTTV_BOARD_TEV560] = {
  2062. .name = "Teppro TEV-560/InterVision IV-560",
  2063. .video_inputs = 3,
  2064. /* .audio_inputs= 1, */
  2065. .svhs = 2,
  2066. .gpiomask = 3,
  2067. .muxsel = { 2, 3, 1, 1 },
  2068. .gpiomux = { 1, 1, 1, 1 },
  2069. .needs_tvaudio = 1,
  2070. .tuner_type = TUNER_PHILIPS_PAL,
  2071. .tuner_addr = ADDR_UNSET,
  2072. .pll = PLL_35,
  2073. },
  2074. /* ---- card 0x74 ---------------------------------- */
  2075. [BTTV_BOARD_SIMUS_GVC1100] = {
  2076. .name = "SIMUS GVC1100",
  2077. .video_inputs = 4,
  2078. /* .audio_inputs= 0, */
  2079. .svhs = NO_SVHS,
  2080. .tuner_type = TUNER_ABSENT,
  2081. .tuner_addr = ADDR_UNSET,
  2082. .pll = PLL_28,
  2083. .muxsel = { 2, 2, 2, 2 },
  2084. .gpiomask = 0x3F,
  2085. .muxsel_hook = gvc1100_muxsel,
  2086. },
  2087. [BTTV_BOARD_NGSTV_PLUS] = {
  2088. /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
  2089. .name = "NGS NGSTV+",
  2090. .video_inputs = 3,
  2091. .svhs = 2,
  2092. .gpiomask = 0x008007,
  2093. .muxsel = { 2, 3, 0, 0 },
  2094. .gpiomux = { 0, 0, 0, 0 },
  2095. .gpiomute = 0x000003,
  2096. .pll = PLL_28,
  2097. .tuner_type = TUNER_PHILIPS_PAL,
  2098. .tuner_addr = ADDR_UNSET,
  2099. .has_remote = 1,
  2100. },
  2101. [BTTV_BOARD_LMLBT4] = {
  2102. /* http://linuxmedialabs.com */
  2103. .name = "LMLBT4",
  2104. .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
  2105. /* .audio_inputs= 0, */
  2106. .svhs = NO_SVHS,
  2107. .muxsel = { 2, 3, 1, 0 },
  2108. .no_msp34xx = 1,
  2109. .no_tda9875 = 1,
  2110. .no_tda7432 = 1,
  2111. .needs_tvaudio = 0,
  2112. .tuner_type = TUNER_ABSENT,
  2113. .tuner_addr = ADDR_UNSET,
  2114. },
  2115. [BTTV_BOARD_TEKRAM_M205] = {
  2116. /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
  2117. .name = "Tekram M205 PRO",
  2118. .video_inputs = 3,
  2119. /* .audio_inputs= 1, */
  2120. .tuner_type = TUNER_PHILIPS_PAL,
  2121. .tuner_addr = ADDR_UNSET,
  2122. .svhs = 2,
  2123. .needs_tvaudio = 0,
  2124. .gpiomask = 0x68,
  2125. .muxsel = { 2, 3, 1 },
  2126. .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
  2127. .pll = PLL_28,
  2128. },
  2129. /* ---- card 0x78 ---------------------------------- */
  2130. [BTTV_BOARD_CONTVFMI] = {
  2131. /* Javier Cendan Ares <jcendan@lycos.es> */
  2132. /* bt878 TV + FM without subsystem ID */
  2133. .name = "Conceptronic CONTVFMi",
  2134. .video_inputs = 3,
  2135. /* .audio_inputs= 1, */
  2136. .svhs = 2,
  2137. .gpiomask = 0x008007,
  2138. .muxsel = { 2, 3, 1, 1 },
  2139. .gpiomux = { 0, 1, 2, 2 },
  2140. .gpiomute = 3,
  2141. .needs_tvaudio = 0,
  2142. .pll = PLL_28,
  2143. .tuner_type = TUNER_PHILIPS_PAL,
  2144. .tuner_addr = ADDR_UNSET,
  2145. .has_remote = 1,
  2146. .has_radio = 1,
  2147. },
  2148. [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
  2149. /*Eric DEBIEF <debief@telemsa.com>*/
  2150. /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
  2151. /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
  2152. /*0x79 in bttv.h*/
  2153. .name = "Euresys Picolo Tetra",
  2154. .video_inputs = 4,
  2155. /* .audio_inputs= 0, */
  2156. .svhs = NO_SVHS,
  2157. .gpiomask = 0,
  2158. .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
  2159. .no_msp34xx = 1,
  2160. .no_tda9875 = 1,
  2161. .no_tda7432 = 1,
  2162. .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
  2163. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  2164. .pll = PLL_28,
  2165. .needs_tvaudio = 0,
  2166. .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
  2167. .tuner_type = TUNER_ABSENT,
  2168. .tuner_addr = ADDR_UNSET,
  2169. },
  2170. [BTTV_BOARD_SPIRIT_TV] = {
  2171. /* Spirit TV Tuner from http://spiritmodems.com.au */
  2172. /* Stafford Goodsell <surge@goliath.homeunix.org> */
  2173. .name = "Spirit TV Tuner",
  2174. .video_inputs = 3,
  2175. /* .audio_inputs= 1, */
  2176. .svhs = 2,
  2177. .gpiomask = 0x0000000f,
  2178. .muxsel = { 2, 1, 1 },
  2179. .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
  2180. .tuner_type = TUNER_TEMIC_PAL,
  2181. .tuner_addr = ADDR_UNSET,
  2182. .no_msp34xx = 1,
  2183. .no_tda9875 = 1,
  2184. },
  2185. [BTTV_BOARD_AVDVBT_771] = {
  2186. /* Wolfram Joost <wojo@frokaschwei.de> */
  2187. .name = "AVerMedia AVerTV DVB-T 771",
  2188. .video_inputs = 2,
  2189. .svhs = 1,
  2190. .tuner_type = TUNER_ABSENT,
  2191. .tuner_addr = ADDR_UNSET,
  2192. .muxsel = { 3 , 3 },
  2193. .no_msp34xx = 1,
  2194. .no_tda9875 = 1,
  2195. .no_tda7432 = 1,
  2196. .pll = PLL_28,
  2197. .has_dvb = 1,
  2198. .no_gpioirq = 1,
  2199. .has_remote = 1,
  2200. },
  2201. /* ---- card 0x7c ---------------------------------- */
  2202. [BTTV_BOARD_AVDVBT_761] = {
  2203. /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
  2204. /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
  2205. .name = "AverMedia AverTV DVB-T 761",
  2206. .video_inputs = 2,
  2207. .svhs = 1,
  2208. .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
  2209. .no_msp34xx = 1,
  2210. .no_tda9875 = 1,
  2211. .no_tda7432 = 1,
  2212. .pll = PLL_28,
  2213. .tuner_type = TUNER_ABSENT,
  2214. .tuner_addr = ADDR_UNSET,
  2215. .has_dvb = 1,
  2216. .no_gpioirq = 1,
  2217. .has_remote = 1,
  2218. },
  2219. [BTTV_BOARD_MATRIX_VISIONSQ] = {
  2220. /* andre.schwarz@matrix-vision.de */
  2221. .name = "MATRIX Vision Sigma-SQ",
  2222. .video_inputs = 16,
  2223. /* .audio_inputs= 0, */
  2224. .svhs = NO_SVHS,
  2225. .gpiomask = 0x0,
  2226. .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
  2227. 3, 3, 3, 3, 3, 3, 3, 3 },
  2228. .muxsel_hook = sigmaSQ_muxsel,
  2229. .gpiomux = { 0 },
  2230. .no_msp34xx = 1,
  2231. .pll = PLL_28,
  2232. .tuner_type = TUNER_ABSENT,
  2233. .tuner_addr = ADDR_UNSET,
  2234. },
  2235. [BTTV_BOARD_MATRIX_VISIONSLC] = {
  2236. /* andre.schwarz@matrix-vision.de */
  2237. .name = "MATRIX Vision Sigma-SLC",
  2238. .video_inputs = 4,
  2239. /* .audio_inputs= 0, */
  2240. .svhs = NO_SVHS,
  2241. .gpiomask = 0x0,
  2242. .muxsel = { 2, 2, 2, 2 },
  2243. .muxsel_hook = sigmaSLC_muxsel,
  2244. .gpiomux = { 0 },
  2245. .no_msp34xx = 1,
  2246. .pll = PLL_28,
  2247. .tuner_type = TUNER_ABSENT,
  2248. .tuner_addr = ADDR_UNSET,
  2249. },
  2250. /* BTTV_BOARD_APAC_VIEWCOMP */
  2251. [BTTV_BOARD_APAC_VIEWCOMP] = {
  2252. /* Attila Kondoros <attila.kondoros@chello.hu> */
  2253. /* bt878 TV + FM 0x00000000 subsystem ID */
  2254. .name = "APAC Viewcomp 878(AMAX)",
  2255. .video_inputs = 2,
  2256. /* .audio_inputs= 1, */
  2257. .svhs = NO_SVHS,
  2258. .gpiomask = 0xFF,
  2259. .muxsel = { 2, 3, 1, 1 },
  2260. .gpiomux = { 2, 0, 0, 0 },
  2261. .gpiomute = 10,
  2262. .needs_tvaudio = 0,
  2263. .pll = PLL_28,
  2264. .tuner_type = TUNER_PHILIPS_PAL,
  2265. .tuner_addr = ADDR_UNSET,
  2266. .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
  2267. .has_radio = 1, /* not every card has radio */
  2268. },
  2269. /* ---- card 0x80 ---------------------------------- */
  2270. [BTTV_BOARD_DVICO_DVBT_LITE] = {
  2271. /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
  2272. .name = "DViCO FusionHDTV DVB-T Lite",
  2273. .no_msp34xx = 1,
  2274. .no_tda9875 = 1,
  2275. .no_tda7432 = 1,
  2276. .pll = PLL_28,
  2277. .no_video = 1,
  2278. .has_dvb = 1,
  2279. .tuner_type = TUNER_ABSENT,
  2280. .tuner_addr = ADDR_UNSET,
  2281. },
  2282. [BTTV_BOARD_VGEAR_MYVCD] = {
  2283. /* Steven <photon38@pchome.com.tw> */
  2284. .name = "V-Gear MyVCD",
  2285. .video_inputs = 3,
  2286. /* .audio_inputs= 1, */
  2287. .svhs = 2,
  2288. .gpiomask = 0x3f,
  2289. .muxsel = {2, 3, 1, 0 },
  2290. .gpiomux = {0x31, 0x31, 0x31, 0x31 },
  2291. .gpiomute = 0x31,
  2292. .no_msp34xx = 1,
  2293. .pll = PLL_28,
  2294. .tuner_type = TUNER_PHILIPS_NTSC_M,
  2295. .tuner_addr = ADDR_UNSET,
  2296. .has_radio = 0,
  2297. },
  2298. [BTTV_BOARD_SUPER_TV] = {
  2299. /* Rick C <cryptdragoon@gmail.com> */
  2300. .name = "Super TV Tuner",
  2301. .video_inputs = 4,
  2302. /* .audio_inputs= 1, */
  2303. .svhs = 2,
  2304. .muxsel = { 2, 3, 1, 0 },
  2305. .tuner_type = TUNER_PHILIPS_NTSC,
  2306. .tuner_addr = ADDR_UNSET,
  2307. .gpiomask = 0x008007,
  2308. .gpiomux = { 0, 0x000001,0,0 },
  2309. .needs_tvaudio = 1,
  2310. .has_radio = 1,
  2311. },
  2312. [BTTV_BOARD_TIBET_CS16] = {
  2313. /* Chris Fanning <video4linux@haydon.net> */
  2314. .name = "Tibet Systems 'Progress DVR' CS16",
  2315. .video_inputs = 16,
  2316. /* .audio_inputs= 0, */
  2317. .svhs = NO_SVHS,
  2318. .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
  2319. .pll = PLL_28,
  2320. .no_msp34xx = 1,
  2321. .no_tda9875 = 1,
  2322. .no_tda7432 = 1,
  2323. .tuner_type = TUNER_ABSENT,
  2324. .tuner_addr = ADDR_UNSET,
  2325. .muxsel_hook = tibetCS16_muxsel,
  2326. },
  2327. [BTTV_BOARD_KODICOM_4400R] = {
  2328. /* Bill Brack <wbrack@mmm.com.hk> */
  2329. /*
  2330. * Note that, because of the card's wiring, the "master"
  2331. * BT878A chip (i.e. the one which controls the analog switch
  2332. * and must use this card type) is the 2nd one detected. The
  2333. * other 3 chips should use card type 0x85, whose description
  2334. * follows this one. There is a EEPROM on the card (which is
  2335. * connected to the I2C of one of those other chips), but is
  2336. * not currently handled. There is also a facility for a
  2337. * "monitor", which is also not currently implemented.
  2338. */
  2339. .name = "Kodicom 4400R (master)",
  2340. .video_inputs = 16,
  2341. /* .audio_inputs= 0, */
  2342. .tuner_type = TUNER_ABSENT,
  2343. .tuner_addr = ADDR_UNSET,
  2344. .svhs = NO_SVHS,
  2345. /* GPIO bits 0-9 used for analog switch:
  2346. * 00 - 03: camera selector
  2347. * 04 - 06: channel (controller) selector
  2348. * 07: data (1->on, 0->off)
  2349. * 08: strobe
  2350. * 09: reset
  2351. * bit 16 is input from sync separator for the channel
  2352. */
  2353. .gpiomask = 0x0003ff,
  2354. .no_gpioirq = 1,
  2355. .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
  2356. .pll = PLL_28,
  2357. .no_msp34xx = 1,
  2358. .no_tda7432 = 1,
  2359. .no_tda9875 = 1,
  2360. .muxsel_hook = kodicom4400r_muxsel,
  2361. },
  2362. [BTTV_BOARD_KODICOM_4400R_SL] = {
  2363. /* Bill Brack <wbrack@mmm.com.hk> */
  2364. /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
  2365. * one which controls the analog switch, and must use the card type)
  2366. * is the 2nd one detected. The other 3 chips should use this card
  2367. * type
  2368. */
  2369. .name = "Kodicom 4400R (slave)",
  2370. .video_inputs = 16,
  2371. /* .audio_inputs= 0, */
  2372. .tuner_type = TUNER_ABSENT,
  2373. .tuner_addr = ADDR_UNSET,
  2374. .svhs = NO_SVHS,
  2375. .gpiomask = 0x010000,
  2376. .no_gpioirq = 1,
  2377. .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
  2378. .pll = PLL_28,
  2379. .no_msp34xx = 1,
  2380. .no_tda7432 = 1,
  2381. .no_tda9875 = 1,
  2382. .muxsel_hook = kodicom4400r_muxsel,
  2383. },
  2384. /* ---- card 0x86---------------------------------- */
  2385. [BTTV_BOARD_ADLINK_RTV24] = {
  2386. /* Michael Henson <mhenson@clarityvi.com> */
  2387. /* Adlink RTV24 with special unlock codes */
  2388. .name = "Adlink RTV24",
  2389. .video_inputs = 4,
  2390. /* .audio_inputs= 1, */
  2391. .svhs = 2,
  2392. .muxsel = { 2, 3, 1, 0 },
  2393. .tuner_type = UNSET,
  2394. .tuner_addr = ADDR_UNSET,
  2395. .pll = PLL_28,
  2396. },
  2397. /* ---- card 0x87---------------------------------- */
  2398. [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
  2399. /* Michael Krufky <mkrufky@m1k.net> */
  2400. .name = "DViCO FusionHDTV 5 Lite",
  2401. .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
  2402. .tuner_addr = ADDR_UNSET,
  2403. .video_inputs = 3,
  2404. /* .audio_inputs= 1, */
  2405. .svhs = 2,
  2406. .muxsel = { 2, 3, 1 },
  2407. .gpiomask = 0x00e00007,
  2408. .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
  2409. .gpiomute = 0x00c00007,
  2410. .no_msp34xx = 1,
  2411. .no_tda9875 = 1,
  2412. .no_tda7432 = 1,
  2413. .has_dvb = 1,
  2414. },
  2415. /* ---- card 0x88---------------------------------- */
  2416. [BTTV_BOARD_ACORP_Y878F] = {
  2417. /* Mauro Carvalho Chehab <mchehab@infradead.org> */
  2418. .name = "Acorp Y878F",
  2419. .video_inputs = 3,
  2420. /* .audio_inputs= 1, */
  2421. .svhs = 2,
  2422. .gpiomask = 0x01fe00,
  2423. .muxsel = { 2, 3, 1, 1 },
  2424. .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
  2425. .gpiomute = 0x002000,
  2426. .needs_tvaudio = 1,
  2427. .pll = PLL_28,
  2428. .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
  2429. .tuner_addr = 0xc1 >>1,
  2430. .has_radio = 1,
  2431. },
  2432. /* ---- card 0x89 ---------------------------------- */
  2433. [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
  2434. .name = "Conceptronic CTVFMi v2",
  2435. .video_inputs = 3,
  2436. /* .audio_inputs= 1, */
  2437. .svhs = 2,
  2438. .gpiomask = 0x001c0007,
  2439. .muxsel = { 2, 3, 1, 1 },
  2440. .gpiomux = { 0, 1, 2, 2 },
  2441. .gpiomute = 3,
  2442. .needs_tvaudio = 0,
  2443. .pll = PLL_28,
  2444. .tuner_type = TUNER_TENA_9533_DI,
  2445. .tuner_addr = ADDR_UNSET,
  2446. .has_remote = 1,
  2447. .has_radio = 1,
  2448. },
  2449. /* ---- card 0x8a ---------------------------------- */
  2450. [BTTV_BOARD_PV_BT878P_2E] = {
  2451. .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
  2452. .video_inputs = 5,
  2453. /* .audio_inputs= 1, */
  2454. .svhs = 3,
  2455. .has_dig_in = 1,
  2456. .gpiomask = 0x01fe00,
  2457. .muxsel = { 2, 3, 1, 1, 0 }, /* in 4 is digital */
  2458. /* .digital_mode= DIGITAL_MODE_CAMERA, */
  2459. .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
  2460. .gpiomute = 0x12400,
  2461. .no_msp34xx = 1,
  2462. .pll = PLL_28,
  2463. .tuner_type = TUNER_LG_PAL_FM,
  2464. .tuner_addr = ADDR_UNSET,
  2465. .has_remote = 1,
  2466. },
  2467. /* ---- card 0x8b ---------------------------------- */
  2468. [BTTV_BOARD_PV_M4900] = {
  2469. /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
  2470. .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
  2471. .video_inputs = 3,
  2472. /* .audio_inputs= 1, */
  2473. .svhs = 2,
  2474. .gpiomask = 0x3f,
  2475. .muxsel = { 2, 3, 1, 1 },
  2476. .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
  2477. .gpiomute = 0x29,
  2478. .no_msp34xx = 1,
  2479. .pll = PLL_28,
  2480. .tuner_type = TUNER_YMEC_TVF_5533MF,
  2481. .tuner_addr = ADDR_UNSET,
  2482. .has_radio = 1,
  2483. .has_remote = 1,
  2484. },
  2485. /* ---- card 0x8c ---------------------------------- */
  2486. /* Has four Bt878 chips behind a PCI bridge, each chip has:
  2487. one external BNC composite input (mux 2)
  2488. three internal composite inputs (unknown muxes)
  2489. an 18-bit stereo A/D (CS5331A), which has:
  2490. one external stereo unblanced (RCA) audio connection
  2491. one (or 3?) internal stereo balanced (XLR) audio connection
  2492. input is selected via gpio to a 14052B mux
  2493. (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)
  2494. gain is controlled via an X9221A chip on the I2C bus @0x28
  2495. sample rate is controlled via gpio to an MK1413S
  2496. (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)
  2497. There is neither a tuner nor an svideo input. */
  2498. [BTTV_BOARD_OSPREY440] = {
  2499. .name = "Osprey 440",
  2500. .video_inputs = 4,
  2501. /* .audio_inputs= 2, */
  2502. .svhs = NO_SVHS,
  2503. .muxsel = { 2, 3, 0, 1 }, /* 3,0,1 are guesses */
  2504. .gpiomask = 0x303,
  2505. .gpiomute = 0x000, /* int + 32kHz */
  2506. .gpiomux = { 0, 0, 0x000, 0x100},
  2507. .pll = PLL_28,
  2508. .tuner_type = TUNER_ABSENT,
  2509. .tuner_addr = ADDR_UNSET,
  2510. .no_msp34xx = 1,
  2511. .no_tda9875 = 1,
  2512. .no_tda7432 = 1,
  2513. },
  2514. /* ---- card 0x8d ---------------------------------- */
  2515. [BTTV_BOARD_ASOUND_SKYEYE] = {
  2516. .name = "Asound Skyeye PCTV",
  2517. .video_inputs = 3,
  2518. /* .audio_inputs= 1, */
  2519. .svhs = 2,
  2520. .gpiomask = 15,
  2521. .muxsel = { 2, 3, 1, 1 },
  2522. .gpiomux = { 2, 0, 0, 0 },
  2523. .gpiomute = 1,
  2524. .needs_tvaudio = 1,
  2525. .pll = PLL_28,
  2526. .tuner_type = TUNER_PHILIPS_NTSC,
  2527. .tuner_addr = ADDR_UNSET,
  2528. },
  2529. /* ---- card 0x8e ---------------------------------- */
  2530. [BTTV_BOARD_SABRENT_TVFM] = {
  2531. .name = "Sabrent TV-FM (bttv version)",
  2532. .video_inputs = 3,
  2533. /* .audio_inputs= 1, */
  2534. .svhs = 2,
  2535. .gpiomask = 0x108007,
  2536. .muxsel = { 2, 3, 1, 1 },
  2537. .gpiomux = { 100000, 100002, 100002, 100000 },
  2538. .no_msp34xx = 1,
  2539. .no_tda9875 = 1,
  2540. .no_tda7432 = 1,
  2541. .pll = PLL_28,
  2542. .tuner_type = TUNER_TNF_5335MF,
  2543. .tuner_addr = ADDR_UNSET,
  2544. .has_radio = 1,
  2545. },
  2546. /* ---- card 0x8f ---------------------------------- */
  2547. [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
  2548. .name = "Hauppauge ImpactVCB (bt878)",
  2549. .video_inputs = 4,
  2550. /* .audio_inputs= 0, */
  2551. .svhs = NO_SVHS,
  2552. .gpiomask = 0x0f, /* old: 7 */
  2553. .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
  2554. .no_msp34xx = 1,
  2555. .no_tda9875 = 1,
  2556. .no_tda7432 = 1,
  2557. .tuner_type = TUNER_ABSENT,
  2558. .tuner_addr = ADDR_UNSET,
  2559. },
  2560. [BTTV_BOARD_MACHTV_MAGICTV] = {
  2561. /* Julian Calaby <julian.calaby@gmail.com>
  2562. * Slightly different from original MachTV definition (0x60)
  2563. * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
  2564. * stuffs up remote chip. Bug is a pin on the jaecs is not set
  2565. * properly (methinks) causing no keyup bits being set */
  2566. .name = "MagicTV", /* rebranded MachTV */
  2567. .video_inputs = 3,
  2568. /* .audio_inputs= 1, */
  2569. .svhs = 2,
  2570. .gpiomask = 7,
  2571. .muxsel = { 2, 3, 1, 1 },
  2572. .gpiomux = { 0, 1, 2, 3 },
  2573. .gpiomute = 4,
  2574. .tuner_type = TUNER_TEMIC_4009FR5_PAL,
  2575. .tuner_addr = ADDR_UNSET,
  2576. .pll = PLL_28,
  2577. .has_radio = 1,
  2578. .has_remote = 1,
  2579. },
  2580. [BTTV_BOARD_SSAI_SECURITY] = {
  2581. .name = "SSAI Security Video Interface",
  2582. .video_inputs = 4,
  2583. /* .audio_inputs= 0, */
  2584. .svhs = NO_SVHS,
  2585. .muxsel = { 0, 1, 2, 3 },
  2586. .tuner_type = TUNER_ABSENT,
  2587. .tuner_addr = ADDR_UNSET,
  2588. },
  2589. [BTTV_BOARD_SSAI_ULTRASOUND] = {
  2590. .name = "SSAI Ultrasound Video Interface",
  2591. .video_inputs = 2,
  2592. /* .audio_inputs= 0, */
  2593. .svhs = 1,
  2594. .muxsel = { 2, 0, 1, 3 },
  2595. .tuner_type = TUNER_ABSENT,
  2596. .tuner_addr = ADDR_UNSET,
  2597. },
  2598. /* ---- card 0x94---------------------------------- */
  2599. [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
  2600. .name = "DViCO FusionHDTV 2",
  2601. .tuner_type = TUNER_PHILIPS_FCV1236D,
  2602. .tuner_addr = ADDR_UNSET,
  2603. .video_inputs = 3,
  2604. /* .audio_inputs= 1, */
  2605. .svhs = 2,
  2606. .muxsel = { 2, 3, 1 },
  2607. .gpiomask = 0x00e00007,
  2608. .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
  2609. .gpiomute = 0x00c00007,
  2610. .no_msp34xx = 1,
  2611. .no_tda9875 = 1,
  2612. .no_tda7432 = 1,
  2613. },
  2614. /* ---- card 0x95---------------------------------- */
  2615. [BTTV_BOARD_TYPHOON_TVTUNERPCI] = {
  2616. .name = "Typhoon TV-Tuner PCI (50684)",
  2617. .video_inputs = 3,
  2618. /* .audio_inputs= 1, */
  2619. .svhs = 2,
  2620. .gpiomask = 0x3014f,
  2621. .muxsel = { 2, 3, 1, 1 },
  2622. .gpiomux = { 0x20001,0x10001, 0, 0 },
  2623. .gpiomute = 10,
  2624. .needs_tvaudio = 1,
  2625. .pll = PLL_28,
  2626. .tuner_type = TUNER_PHILIPS_PAL_I,
  2627. .tuner_addr = ADDR_UNSET,
  2628. },
  2629. [BTTV_BOARD_GEOVISION_GV600] = {
  2630. /* emhn@usb.ve */
  2631. .name = "Geovision GV-600",
  2632. .video_inputs = 16,
  2633. /* .audio_inputs= 0, */
  2634. .svhs = NO_SVHS,
  2635. .gpiomask = 0x0,
  2636. .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
  2637. 2, 2, 2, 2, 2, 2, 2, 2 },
  2638. .muxsel_hook = geovision_muxsel,
  2639. .gpiomux = { 0 },
  2640. .no_msp34xx = 1,
  2641. .pll = PLL_28,
  2642. .tuner_type = TUNER_ABSENT,
  2643. .tuner_addr = ADDR_UNSET,
  2644. },
  2645. [BTTV_BOARD_KOZUMI_KTV_01C] = {
  2646. /* Mauro Lacy <mauro@lacy.com.ar>
  2647. * Based on MagicTV and Conceptronic CONTVFMi */
  2648. .name = "Kozumi KTV-01C",
  2649. .video_inputs = 3,
  2650. /* .audio_inputs= 1, */
  2651. .svhs = 2,
  2652. .gpiomask = 0x008007,
  2653. .muxsel = { 2, 3, 1, 1 },
  2654. .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */
  2655. .gpiomute = 3, /* CONTVFMi */
  2656. .needs_tvaudio = 0,
  2657. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */
  2658. .tuner_addr = ADDR_UNSET,
  2659. .pll = PLL_28,
  2660. .has_radio = 1,
  2661. .has_remote = 1,
  2662. },
  2663. [BTTV_BOARD_ENLTV_FM_2] = {
  2664. /* Encore TV Tuner Pro ENL TV-FM-2
  2665. Mauro Carvalho Chehab <mchehab@infradead.org */
  2666. .name = "Encore ENL TV-FM-2",
  2667. .video_inputs = 3,
  2668. /* .audio_inputs= 1, */
  2669. .svhs = 2,
  2670. /* bit 6 -> IR disabled
  2671. bit 18/17 = 00 -> mute
  2672. 01 -> enable external audio input
  2673. 10 -> internal audio input (mono?)
  2674. 11 -> internal audio input
  2675. */
  2676. .gpiomask = 0x060040,
  2677. .muxsel = { 2, 3, 3 },
  2678. .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
  2679. .gpiomute = 0,
  2680. .tuner_type = TUNER_TCL_MF02GIP_5N,
  2681. .tuner_addr = ADDR_UNSET,
  2682. .pll = PLL_28,
  2683. .has_radio = 1,
  2684. .has_remote = 1,
  2685. },
  2686. [BTTV_BOARD_VD012] = {
  2687. /* D.Heer@Phytec.de */
  2688. .name = "PHYTEC VD-012 (bt878)",
  2689. .video_inputs = 4,
  2690. /* .audio_inputs= 0, */
  2691. .svhs = NO_SVHS,
  2692. .gpiomask = 0x00,
  2693. .muxsel = { 0, 2, 3, 1 },
  2694. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  2695. .needs_tvaudio = 0,
  2696. .pll = PLL_28,
  2697. .tuner_type = TUNER_ABSENT,
  2698. .tuner_addr = ADDR_UNSET,
  2699. },
  2700. [BTTV_BOARD_VD012_X1] = {
  2701. /* D.Heer@Phytec.de */
  2702. .name = "PHYTEC VD-012-X1 (bt878)",
  2703. .video_inputs = 4,
  2704. /* .audio_inputs= 0, */
  2705. .svhs = 3,
  2706. .gpiomask = 0x00,
  2707. .muxsel = { 2, 3, 1 },
  2708. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  2709. .needs_tvaudio = 0,
  2710. .pll = PLL_28,
  2711. .tuner_type = TUNER_ABSENT,
  2712. .tuner_addr = ADDR_UNSET,
  2713. },
  2714. [BTTV_BOARD_VD012_X2] = {
  2715. /* D.Heer@Phytec.de */
  2716. .name = "PHYTEC VD-012-X2 (bt878)",
  2717. .video_inputs = 4,
  2718. /* .audio_inputs= 0, */
  2719. .svhs = 3,
  2720. .gpiomask = 0x00,
  2721. .muxsel = { 3, 2, 1 },
  2722. .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
  2723. .needs_tvaudio = 0,
  2724. .pll = PLL_28,
  2725. .tuner_type = TUNER_ABSENT,
  2726. .tuner_addr = ADDR_UNSET,
  2727. }
  2728. };
  2729. static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
  2730. /* ----------------------------------------------------------------------- */
  2731. static unsigned char eeprom_data[256];
  2732. /*
  2733. * identify card
  2734. */
  2735. void __devinit bttv_idcard(struct bttv *btv)
  2736. {
  2737. unsigned int gpiobits;
  2738. int i,type;
  2739. unsigned short tmp;
  2740. /* read PCI subsystem ID */
  2741. pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
  2742. btv->cardid = tmp << 16;
  2743. pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
  2744. btv->cardid |= tmp;
  2745. if (0 != btv->cardid && 0xffffffff != btv->cardid) {
  2746. /* look for the card */
  2747. for (type = -1, i = 0; cards[i].id != 0; i++)
  2748. if (cards[i].id == btv->cardid)
  2749. type = i;
  2750. if (type != -1) {
  2751. /* found it */
  2752. printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
  2753. "PCI subsystem ID is %04x:%04x\n",
  2754. btv->c.nr,cards[type].name,cards[type].cardnr,
  2755. btv->cardid & 0xffff,
  2756. (btv->cardid >> 16) & 0xffff);
  2757. btv->c.type = cards[type].cardnr;
  2758. } else {
  2759. /* 404 */
  2760. printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
  2761. btv->c.nr, btv->cardid & 0xffff,
  2762. (btv->cardid >> 16) & 0xffff);
  2763. printk(KERN_DEBUG "please mail id, board name and "
  2764. "the correct card= insmod option to video4linux-list@redhat.com\n");
  2765. }
  2766. }
  2767. /* let the user override the autodetected type */
  2768. if (card[btv->c.nr] < bttv_num_tvcards)
  2769. btv->c.type=card[btv->c.nr];
  2770. /* print which card config we are using */
  2771. printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
  2772. bttv_tvcards[btv->c.type].name, btv->c.type,
  2773. card[btv->c.nr] < bttv_num_tvcards
  2774. ? "insmod option" : "autodetected");
  2775. /* overwrite gpio stuff ?? */
  2776. if (UNSET == audioall && UNSET == audiomux[0])
  2777. return;
  2778. if (UNSET != audiomux[0]) {
  2779. gpiobits = 0;
  2780. for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
  2781. bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
  2782. gpiobits |= audiomux[i];
  2783. }
  2784. } else {
  2785. gpiobits = audioall;
  2786. for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
  2787. bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
  2788. }
  2789. }
  2790. bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
  2791. printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
  2792. btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
  2793. for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
  2794. printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
  2795. }
  2796. printk("\n");
  2797. }
  2798. /*
  2799. * (most) board specific initialisations goes here
  2800. */
  2801. /* Some Modular Technology cards have an eeprom, but no subsystem ID */
  2802. static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
  2803. {
  2804. int type = -1;
  2805. if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
  2806. type = BTTV_BOARD_MODTEC_205;
  2807. else if (0 == strncmp(eeprom_data+20,"Picolo",7))
  2808. type = BTTV_BOARD_EURESYS_PICOLO;
  2809. else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
  2810. type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
  2811. if (-1 != type) {
  2812. btv->c.type = type;
  2813. printk("bttv%d: detected by eeprom: %s [card=%d]\n",
  2814. btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
  2815. }
  2816. }
  2817. static void flyvideo_gpio(struct bttv *btv)
  2818. {
  2819. int gpio, has_remote, has_radio, is_capture_only;
  2820. int is_lr90, has_tda9820_tda9821;
  2821. int tuner_type = UNSET, ttype;
  2822. gpio_inout(0xffffff, 0);
  2823. udelay(8); /* without this we would see the 0x1800 mask */
  2824. gpio = gpio_read();
  2825. /* FIXME: must restore OUR_EN ??? */
  2826. /* all cards provide GPIO info, some have an additional eeprom
  2827. * LR50: GPIO coding can be found lower right CP1 .. CP9
  2828. * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
  2829. * GPIO14-12: n.c.
  2830. * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
  2831. * lowest 3 bytes are remote control codes (no handshake needed)
  2832. * xxxFFF: No remote control chip soldered
  2833. * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
  2834. * Note: Some bits are Audio_Mask !
  2835. */
  2836. ttype = (gpio & 0x0f0000) >> 16;
  2837. switch (ttype) {
  2838. case 0x0:
  2839. tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */
  2840. break;
  2841. case 0x2:
  2842. tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */
  2843. break;
  2844. case 0x4:
  2845. tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
  2846. break;
  2847. case 0x6:
  2848. tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */
  2849. break;
  2850. case 0xC:
  2851. tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
  2852. break;
  2853. default:
  2854. printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
  2855. break;
  2856. }
  2857. has_remote = gpio & 0x800000;
  2858. has_radio = gpio & 0x400000;
  2859. /* unknown 0x200000;
  2860. * unknown2 0x100000; */
  2861. is_capture_only = !(gpio & 0x008000); /* GPIO15 */
  2862. has_tda9820_tda9821 = !(gpio & 0x004000);
  2863. is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
  2864. /*
  2865. * gpio & 0x001000 output bit for audio routing */
  2866. if (is_capture_only)
  2867. tuner_type = TUNER_ABSENT; /* No tuner present */
  2868. printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
  2869. btv->c.nr, has_radio ? "yes" : "no ",
  2870. has_remote ? "yes" : "no ", tuner_type, gpio);
  2871. printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
  2872. btv->c.nr, is_lr90 ? "yes" : "no ",
  2873. has_tda9820_tda9821 ? "yes" : "no ",
  2874. is_capture_only ? "yes" : "no ");
  2875. if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
  2876. btv->tuner_type = tuner_type;
  2877. btv->has_radio = has_radio;
  2878. /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
  2879. * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
  2880. * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
  2881. if (has_tda9820_tda9821)
  2882. btv->audio_mode_gpio = lt9415_audio;
  2883. /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */
  2884. }
  2885. static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
  2886. 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
  2887. static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
  2888. 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
  2889. static void miro_pinnacle_gpio(struct bttv *btv)
  2890. {
  2891. int id,msp,gpio;
  2892. char *info;
  2893. gpio_inout(0xffffff, 0);
  2894. gpio = gpio_read();
  2895. id = ((gpio>>10) & 63) -1;
  2896. msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
  2897. if (id < 32) {
  2898. btv->tuner_type = miro_tunermap[id];
  2899. if (0 == (gpio & 0x20)) {
  2900. btv->has_radio = 1;
  2901. if (!miro_fmtuner[id]) {
  2902. btv->has_matchbox = 1;
  2903. btv->mbox_we = (1<<6);
  2904. btv->mbox_most = (1<<7);
  2905. btv->mbox_clk = (1<<8);
  2906. btv->mbox_data = (1<<9);
  2907. btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
  2908. }
  2909. } else {
  2910. btv->has_radio = 0;
  2911. }
  2912. if (-1 != msp) {
  2913. if (btv->c.type == BTTV_BOARD_MIRO)
  2914. btv->c.type = BTTV_BOARD_MIROPRO;
  2915. if (btv->c.type == BTTV_BOARD_PINNACLE)
  2916. btv->c.type = BTTV_BOARD_PINNACLEPRO;
  2917. }
  2918. printk(KERN_INFO
  2919. "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
  2920. btv->c.nr, id+1, btv->tuner_type,
  2921. !btv->has_radio ? "no" :
  2922. (btv->has_matchbox ? "matchbox" : "fmtuner"),
  2923. (-1 == msp) ? "no" : "yes");
  2924. } else {
  2925. /* new cards with microtune tuner */
  2926. id = 63 - id;
  2927. btv->has_radio = 0;
  2928. switch (id) {
  2929. case 1:
  2930. info = "PAL / mono";
  2931. btv->tda9887_conf = TDA9887_INTERCARRIER;
  2932. break;
  2933. case 2:
  2934. info = "PAL+SECAM / stereo";
  2935. btv->has_radio = 1;
  2936. btv->tda9887_conf = TDA9887_QSS;
  2937. break;
  2938. case 3:
  2939. info = "NTSC / stereo";
  2940. btv->has_radio = 1;
  2941. btv->tda9887_conf = TDA9887_QSS;
  2942. break;
  2943. case 4:
  2944. info = "PAL+SECAM / mono";
  2945. btv->tda9887_conf = TDA9887_QSS;
  2946. break;
  2947. case 5:
  2948. info = "NTSC / mono";
  2949. btv->tda9887_conf = TDA9887_INTERCARRIER;
  2950. break;
  2951. case 6:
  2952. info = "NTSC / stereo";
  2953. btv->tda9887_conf = TDA9887_INTERCARRIER;
  2954. break;
  2955. case 7:
  2956. info = "PAL / stereo";
  2957. btv->tda9887_conf = TDA9887_INTERCARRIER;
  2958. break;
  2959. default:
  2960. info = "oops: unknown card";
  2961. break;
  2962. }
  2963. if (-1 != msp)
  2964. btv->c.type = BTTV_BOARD_PINNACLEPRO;
  2965. printk(KERN_INFO
  2966. "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
  2967. btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
  2968. btv->tuner_type = TUNER_MT2032;
  2969. }
  2970. }
  2971. /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
  2972. #define LM1882_SYNC_DRIVE 0x200000L
  2973. static void init_ids_eagle(struct bttv *btv)
  2974. {
  2975. gpio_inout(0xffffff,0xFFFF37);
  2976. gpio_write(0x200020);
  2977. /* flash strobe inverter ?! */
  2978. gpio_write(0x200024);
  2979. /* switch sync drive off */
  2980. gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
  2981. /* set BT848 muxel to 2 */
  2982. btaor((2)<<5, ~(2<<5), BT848_IFORM);
  2983. }
  2984. /* Muxsel helper for the IDS Eagle.
  2985. * the eagles does not use the standard muxsel-bits but
  2986. * has its own multiplexer */
  2987. static void eagle_muxsel(struct bttv *btv, unsigned int input)
  2988. {
  2989. btaor((2)<<5, ~(3<<5), BT848_IFORM);
  2990. gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
  2991. /* composite */
  2992. /* set chroma ADC to sleep */
  2993. btor(BT848_ADC_C_SLEEP, BT848_ADC);
  2994. /* set to composite video */
  2995. btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
  2996. btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
  2997. /* switch sync drive off */
  2998. gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
  2999. }
  3000. static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
  3001. {
  3002. static const int masks[] = {0x30, 0x01, 0x12, 0x23};
  3003. gpio_write(masks[input%4]);
  3004. }
  3005. /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
  3006. alarms output
  3007. GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  3008. assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
  3009. IN - sensor inputs, INx - sensor inputs and TI XORed together
  3010. O1,O2,O3 - alarm outputs (relays)
  3011. OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
  3012. */
  3013. static void init_lmlbt4x(struct bttv *btv)
  3014. {
  3015. printk(KERN_DEBUG "LMLBT4x init\n");
  3016. btwrite(0x000000, BT848_GPIO_REG_INP);
  3017. gpio_inout(0xffffff, 0x0006C0);
  3018. gpio_write(0x000000);
  3019. }
  3020. static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
  3021. {
  3022. unsigned int inmux = input % 8;
  3023. gpio_inout( 0xf, 0xf );
  3024. gpio_bits( 0xf, inmux );
  3025. }
  3026. static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
  3027. {
  3028. unsigned int inmux = input % 4;
  3029. gpio_inout( 3<<9, 3<<9 );
  3030. gpio_bits( 3<<9, inmux<<9 );
  3031. }
  3032. static void geovision_muxsel(struct bttv *btv, unsigned int input)
  3033. {
  3034. unsigned int inmux = input % 16;
  3035. gpio_inout(0xf, 0xf);
  3036. gpio_bits(0xf, inmux);
  3037. }
  3038. /* ----------------------------------------------------------------------- */
  3039. static void bttv_reset_audio(struct bttv *btv)
  3040. {
  3041. /*
  3042. * BT878A has a audio-reset register.
  3043. * 1. This register is an audio reset function but it is in
  3044. * function-0 (video capture) address space.
  3045. * 2. It is enough to do this once per power-up of the card.
  3046. * 3. There is a typo in the Conexant doc -- it is not at
  3047. * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
  3048. * --//Shrikumar 030609
  3049. */
  3050. if (btv->id != 878)
  3051. return;
  3052. if (bttv_debug)
  3053. printk("bttv%d: BT878A ARESET\n",btv->c.nr);
  3054. btwrite((1<<7), 0x058);
  3055. udelay(10);
  3056. btwrite( 0, 0x058);
  3057. }
  3058. /* initialization part one -- before registering i2c bus */
  3059. void __devinit bttv_init_card1(struct bttv *btv)
  3060. {
  3061. switch (btv->c.type) {
  3062. case BTTV_BOARD_HAUPPAUGE:
  3063. case BTTV_BOARD_HAUPPAUGE878:
  3064. boot_msp34xx(btv,5);
  3065. break;
  3066. case BTTV_BOARD_VOODOOTV_200:
  3067. case BTTV_BOARD_VOODOOTV_FM:
  3068. boot_msp34xx(btv,20);
  3069. break;
  3070. case BTTV_BOARD_AVERMEDIA98:
  3071. boot_msp34xx(btv,11);
  3072. break;
  3073. case BTTV_BOARD_HAUPPAUGEPVR:
  3074. pvr_boot(btv);
  3075. break;
  3076. case BTTV_BOARD_TWINHAN_DST:
  3077. case BTTV_BOARD_AVDVBT_771:
  3078. case BTTV_BOARD_PINNACLESAT:
  3079. btv->use_i2c_hw = 1;
  3080. break;
  3081. case BTTV_BOARD_ADLINK_RTV24:
  3082. init_RTV24( btv );
  3083. break;
  3084. }
  3085. if (!bttv_tvcards[btv->c.type].has_dvb)
  3086. bttv_reset_audio(btv);
  3087. }
  3088. /* initialization part two -- after registering i2c bus */
  3089. void __devinit bttv_init_card2(struct bttv *btv)
  3090. {
  3091. int addr=ADDR_UNSET;
  3092. btv->tuner_type = UNSET;
  3093. if (BTTV_BOARD_UNKNOWN == btv->c.type) {
  3094. bttv_readee(btv,eeprom_data,0xa0);
  3095. identify_by_eeprom(btv,eeprom_data);
  3096. }
  3097. switch (btv->c.type) {
  3098. case BTTV_BOARD_MIRO:
  3099. case BTTV_BOARD_MIROPRO:
  3100. case BTTV_BOARD_PINNACLE:
  3101. case BTTV_BOARD_PINNACLEPRO:
  3102. /* miro/pinnacle */
  3103. miro_pinnacle_gpio(btv);
  3104. break;
  3105. case BTTV_BOARD_FLYVIDEO_98:
  3106. case BTTV_BOARD_MAXI:
  3107. case BTTV_BOARD_LIFE_FLYKIT:
  3108. case BTTV_BOARD_FLYVIDEO:
  3109. case BTTV_BOARD_TYPHOON_TVIEW:
  3110. case BTTV_BOARD_CHRONOS_VS2:
  3111. case BTTV_BOARD_FLYVIDEO_98FM:
  3112. case BTTV_BOARD_FLYVIDEO2000:
  3113. case BTTV_BOARD_FLYVIDEO98EZ:
  3114. case BTTV_BOARD_CONFERENCETV:
  3115. case BTTV_BOARD_LIFETEC_9415:
  3116. flyvideo_gpio(btv);
  3117. break;
  3118. case BTTV_BOARD_HAUPPAUGE:
  3119. case BTTV_BOARD_HAUPPAUGE878:
  3120. case BTTV_BOARD_HAUPPAUGEPVR:
  3121. /* pick up some config infos from the eeprom */
  3122. bttv_readee(btv,eeprom_data,0xa0);
  3123. hauppauge_eeprom(btv);
  3124. break;
  3125. case BTTV_BOARD_AVERMEDIA98:
  3126. case BTTV_BOARD_AVPHONE98:
  3127. bttv_readee(btv,eeprom_data,0xa0);
  3128. avermedia_eeprom(btv);
  3129. break;
  3130. case BTTV_BOARD_PXC200:
  3131. init_PXC200(btv);
  3132. break;
  3133. case BTTV_BOARD_PICOLO_TETRA_CHIP:
  3134. picolo_tetra_init(btv);
  3135. break;
  3136. case BTTV_BOARD_VHX:
  3137. btv->has_radio = 1;
  3138. btv->has_matchbox = 1;
  3139. btv->mbox_we = 0x20;
  3140. btv->mbox_most = 0;
  3141. btv->mbox_clk = 0x08;
  3142. btv->mbox_data = 0x10;
  3143. btv->mbox_mask = 0x38;
  3144. break;
  3145. case BTTV_BOARD_VOBIS_BOOSTAR:
  3146. case BTTV_BOARD_TERRATV:
  3147. terratec_active_radio_upgrade(btv);
  3148. break;
  3149. case BTTV_BOARD_MAGICTVIEW061:
  3150. if (btv->cardid == 0x3002144f) {
  3151. btv->has_radio=1;
  3152. printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
  3153. }
  3154. break;
  3155. case BTTV_BOARD_STB2:
  3156. if (btv->cardid == 0x3060121a) {
  3157. /* Fix up entry for 3DFX VoodooTV 100,
  3158. which is an OEM STB card variant. */
  3159. btv->has_radio=0;
  3160. btv->tuner_type=TUNER_TEMIC_NTSC;
  3161. }
  3162. break;
  3163. case BTTV_BOARD_OSPREY1x0:
  3164. case BTTV_BOARD_OSPREY1x0_848:
  3165. case BTTV_BOARD_OSPREY101_848:
  3166. case BTTV_BOARD_OSPREY1x1:
  3167. case BTTV_BOARD_OSPREY1x1_SVID:
  3168. case BTTV_BOARD_OSPREY2xx:
  3169. case BTTV_BOARD_OSPREY2x0_SVID:
  3170. case BTTV_BOARD_OSPREY2x0:
  3171. case BTTV_BOARD_OSPREY440:
  3172. case BTTV_BOARD_OSPREY500:
  3173. case BTTV_BOARD_OSPREY540:
  3174. case BTTV_BOARD_OSPREY2000:
  3175. bttv_readee(btv,eeprom_data,0xa0);
  3176. osprey_eeprom(btv, eeprom_data);
  3177. break;
  3178. case BTTV_BOARD_IDS_EAGLE:
  3179. init_ids_eagle(btv);
  3180. break;
  3181. case BTTV_BOARD_MODTEC_205:
  3182. bttv_readee(btv,eeprom_data,0xa0);
  3183. modtec_eeprom(btv);
  3184. break;
  3185. case BTTV_BOARD_LMLBT4:
  3186. init_lmlbt4x(btv);
  3187. break;
  3188. case BTTV_BOARD_TIBET_CS16:
  3189. tibetCS16_init(btv);
  3190. break;
  3191. case BTTV_BOARD_KODICOM_4400R:
  3192. kodicom4400r_init(btv);
  3193. break;
  3194. }
  3195. /* pll configuration */
  3196. if (!(btv->id==848 && btv->revision==0x11)) {
  3197. /* defaults from card list */
  3198. if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
  3199. btv->pll.pll_ifreq=28636363;
  3200. btv->pll.pll_crystal=BT848_IFORM_XT0;
  3201. }
  3202. if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
  3203. btv->pll.pll_ifreq=35468950;
  3204. btv->pll.pll_crystal=BT848_IFORM_XT1;
  3205. }
  3206. /* insmod options can override */
  3207. switch (pll[btv->c.nr]) {
  3208. case 0: /* none */
  3209. btv->pll.pll_crystal = 0;
  3210. btv->pll.pll_ifreq = 0;
  3211. btv->pll.pll_ofreq = 0;
  3212. break;
  3213. case 1: /* 28 MHz */
  3214. case 28:
  3215. btv->pll.pll_ifreq = 28636363;
  3216. btv->pll.pll_ofreq = 0;
  3217. btv->pll.pll_crystal = BT848_IFORM_XT0;
  3218. break;
  3219. case 2: /* 35 MHz */
  3220. case 35:
  3221. btv->pll.pll_ifreq = 35468950;
  3222. btv->pll.pll_ofreq = 0;
  3223. btv->pll.pll_crystal = BT848_IFORM_XT1;
  3224. break;
  3225. }
  3226. }
  3227. btv->pll.pll_current = -1;
  3228. /* tuner configuration (from card list / autodetect / insmod option) */
  3229. if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
  3230. addr = bttv_tvcards[btv->c.type].tuner_addr;
  3231. if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
  3232. if (UNSET == btv->tuner_type)
  3233. btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
  3234. if (UNSET != tuner[btv->c.nr])
  3235. btv->tuner_type = tuner[btv->c.nr];
  3236. if (btv->tuner_type == TUNER_ABSENT)
  3237. printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);
  3238. else if(btv->tuner_type == UNSET)
  3239. printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);
  3240. else
  3241. printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,
  3242. btv->tuner_type);
  3243. if (UNSET == btv->tuner_type)
  3244. btv->tuner_type = TUNER_ABSENT;
  3245. if (btv->tuner_type != TUNER_ABSENT) {
  3246. struct tuner_setup tun_setup;
  3247. /* Load tuner module before issuing tuner config call! */
  3248. if (autoload)
  3249. request_module("tuner");
  3250. tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
  3251. tun_setup.type = btv->tuner_type;
  3252. tun_setup.addr = addr;
  3253. if (bttv_tvcards[btv->c.type].has_radio)
  3254. tun_setup.mode_mask |= T_RADIO;
  3255. bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
  3256. }
  3257. if (btv->tda9887_conf) {
  3258. struct v4l2_priv_tun_config tda9887_cfg;
  3259. tda9887_cfg.tuner = TUNER_TDA9887;
  3260. tda9887_cfg.priv = &btv->tda9887_conf;
  3261. bttv_call_i2c_clients(btv, TUNER_SET_CONFIG, &tda9887_cfg);
  3262. }
  3263. btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
  3264. bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
  3265. btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
  3266. UNSET : bttv_tvcards[btv->c.type].svhs;
  3267. if (svhs[btv->c.nr] != UNSET)
  3268. btv->svhs = svhs[btv->c.nr];
  3269. if (remote[btv->c.nr] != UNSET)
  3270. btv->has_remote = remote[btv->c.nr];
  3271. if (bttv_tvcards[btv->c.type].has_radio)
  3272. btv->has_radio=1;
  3273. if (bttv_tvcards[btv->c.type].has_remote)
  3274. btv->has_remote=1;
  3275. if (!bttv_tvcards[btv->c.type].no_gpioirq)
  3276. btv->gpioirq=1;
  3277. if (bttv_tvcards[btv->c.type].volume_gpio)
  3278. btv->volume_gpio=bttv_tvcards[btv->c.type].volume_gpio;
  3279. if (bttv_tvcards[btv->c.type].audio_mode_gpio)
  3280. btv->audio_mode_gpio=bttv_tvcards[btv->c.type].audio_mode_gpio;
  3281. if (!autoload)
  3282. return;
  3283. if (btv->tuner_type == TUNER_ABSENT)
  3284. return; /* no tuner or related drivers to load */
  3285. /* try to detect audio/fader chips */
  3286. if (!bttv_tvcards[btv->c.type].no_msp34xx &&
  3287. bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
  3288. request_module("msp3400");
  3289. if (bttv_tvcards[btv->c.type].msp34xx_alt &&
  3290. bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
  3291. request_module("msp3400");
  3292. if (!bttv_tvcards[btv->c.type].no_tda9875 &&
  3293. bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
  3294. request_module("tda9875");
  3295. if (!bttv_tvcards[btv->c.type].no_tda7432 &&
  3296. bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
  3297. request_module("tda7432");
  3298. if (bttv_tvcards[btv->c.type].needs_tvaudio)
  3299. request_module("tvaudio");
  3300. }
  3301. /* ----------------------------------------------------------------------- */
  3302. static void modtec_eeprom(struct bttv *btv)
  3303. {
  3304. if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
  3305. btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
  3306. printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
  3307. btv->c.nr,&eeprom_data[0x1e]);
  3308. } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
  3309. btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
  3310. printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
  3311. btv->c.nr,&eeprom_data[0x1e]);
  3312. } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
  3313. btv->tuner_type=TUNER_PHILIPS_NTSC;
  3314. printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
  3315. btv->c.nr,&eeprom_data[0x1e]);
  3316. } else {
  3317. printk("bttv%d: Modtec: Unknown TunerString: %s\n",
  3318. btv->c.nr,&eeprom_data[0x1e]);
  3319. }
  3320. }
  3321. static void __devinit hauppauge_eeprom(struct bttv *btv)
  3322. {
  3323. struct tveeprom tv;
  3324. tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
  3325. btv->tuner_type = tv.tuner_type;
  3326. btv->has_radio = tv.has_radio;
  3327. printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
  3328. btv->c.nr, tv.model);
  3329. /*
  3330. * Some of the 878 boards have duplicate PCI IDs. Switch the board
  3331. * type based on model #.
  3332. */
  3333. if(tv.model == 64900) {
  3334. printk("bttv%d: Switching board type from %s to %s\n",
  3335. btv->c.nr,
  3336. bttv_tvcards[btv->c.type].name,
  3337. bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
  3338. btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
  3339. }
  3340. }
  3341. static int terratec_active_radio_upgrade(struct bttv *btv)
  3342. {
  3343. int freq;
  3344. btv->has_radio = 1;
  3345. btv->has_matchbox = 1;
  3346. btv->mbox_we = 0x10;
  3347. btv->mbox_most = 0x20;
  3348. btv->mbox_clk = 0x08;
  3349. btv->mbox_data = 0x04;
  3350. btv->mbox_mask = 0x3c;
  3351. btv->mbox_iow = 1 << 8;
  3352. btv->mbox_ior = 1 << 9;
  3353. btv->mbox_csel = 1 << 10;
  3354. freq=88000/62.5;
  3355. tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
  3356. if (0x1ed8 == tea5757_read(btv)) {
  3357. printk("bttv%d: Terratec Active Radio Upgrade found.\n",
  3358. btv->c.nr);
  3359. btv->has_radio = 1;
  3360. btv->has_matchbox = 1;
  3361. } else {
  3362. btv->has_radio = 0;
  3363. btv->has_matchbox = 0;
  3364. }
  3365. return 0;
  3366. }
  3367. /* ----------------------------------------------------------------------- */
  3368. /*
  3369. * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
  3370. *
  3371. * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
  3372. * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
  3373. * unpacked with unzip).
  3374. */
  3375. #define PVR_GPIO_DELAY 10
  3376. #define BTTV_ALT_DATA 0x000001
  3377. #define BTTV_ALT_DCLK 0x100000
  3378. #define BTTV_ALT_NCONFIG 0x800000
  3379. static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro,
  3380. u32 microlen)
  3381. {
  3382. u32 n;
  3383. u8 bits;
  3384. int i;
  3385. gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
  3386. gpio_write(0);
  3387. udelay(PVR_GPIO_DELAY);
  3388. gpio_write(BTTV_ALT_NCONFIG);
  3389. udelay(PVR_GPIO_DELAY);
  3390. for (n = 0; n < microlen; n++) {
  3391. bits = micro[n];
  3392. for (i = 0 ; i < 8 ; i++) {
  3393. gpio_bits(BTTV_ALT_DCLK,0);
  3394. if (bits & 0x01)
  3395. gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
  3396. else
  3397. gpio_bits(BTTV_ALT_DATA,0);
  3398. gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
  3399. bits >>= 1;
  3400. }
  3401. }
  3402. gpio_bits(BTTV_ALT_DCLK,0);
  3403. udelay(PVR_GPIO_DELAY);
  3404. /* begin Altera init loop (Not necessary,but doesn't hurt) */
  3405. for (i = 0 ; i < 30 ; i++) {
  3406. gpio_bits(BTTV_ALT_DCLK,0);
  3407. gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
  3408. }
  3409. gpio_bits(BTTV_ALT_DCLK,0);
  3410. return 0;
  3411. }
  3412. static int __devinit pvr_boot(struct bttv *btv)
  3413. {
  3414. const struct firmware *fw_entry;
  3415. int rc;
  3416. rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
  3417. if (rc != 0) {
  3418. printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
  3419. btv->c.nr);
  3420. return rc;
  3421. }
  3422. rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
  3423. printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
  3424. btv->c.nr, (rc < 0) ? "failed" : "ok");
  3425. release_firmware(fw_entry);
  3426. return rc;
  3427. }
  3428. /* ----------------------------------------------------------------------- */
  3429. /* some osprey specific stuff */
  3430. static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
  3431. {
  3432. int i;
  3433. u32 serial = 0;
  3434. int cardid = -1;
  3435. /* This code will nevery actually get called in this case.... */
  3436. if (btv->c.type == BTTV_BOARD_UNKNOWN) {
  3437. /* this might be an antique... check for MMAC label in eeprom */
  3438. if (!strncmp(ee, "MMAC", 4)) {
  3439. u8 checksum = 0;
  3440. for (i = 0; i < 21; i++)
  3441. checksum += ee[i];
  3442. if (checksum != ee[21])
  3443. return;
  3444. cardid = BTTV_BOARD_OSPREY1x0_848;
  3445. for (i = 12; i < 21; i++)
  3446. serial *= 10, serial += ee[i] - '0';
  3447. }
  3448. } else {
  3449. unsigned short type;
  3450. for (i = 4*16; i < 8*16; i += 16) {
  3451. u16 checksum = ip_compute_csum(ee + i, 16);
  3452. if ((checksum&0xff) + (checksum>>8) == 0xff)
  3453. break;
  3454. }
  3455. if (i >= 8*16)
  3456. return;
  3457. ee += i;
  3458. /* found a valid descriptor */
  3459. type = get_unaligned_be16((__be16 *)(ee+4));
  3460. switch(type) {
  3461. /* 848 based */
  3462. case 0x0004:
  3463. cardid = BTTV_BOARD_OSPREY1x0_848;
  3464. break;
  3465. case 0x0005:
  3466. cardid = BTTV_BOARD_OSPREY101_848;
  3467. break;
  3468. /* 878 based */
  3469. case 0x0012:
  3470. case 0x0013:
  3471. cardid = BTTV_BOARD_OSPREY1x0;
  3472. break;
  3473. case 0x0014:
  3474. case 0x0015:
  3475. cardid = BTTV_BOARD_OSPREY1x1;
  3476. break;
  3477. case 0x0016:
  3478. case 0x0017:
  3479. case 0x0020:
  3480. cardid = BTTV_BOARD_OSPREY1x1_SVID;
  3481. break;
  3482. case 0x0018:
  3483. case 0x0019:
  3484. case 0x001E:
  3485. case 0x001F:
  3486. cardid = BTTV_BOARD_OSPREY2xx;
  3487. break;
  3488. case 0x001A:
  3489. case 0x001B:
  3490. cardid = BTTV_BOARD_OSPREY2x0_SVID;
  3491. break;
  3492. case 0x0040:
  3493. cardid = BTTV_BOARD_OSPREY500;
  3494. break;
  3495. case 0x0050:
  3496. case 0x0056:
  3497. cardid = BTTV_BOARD_OSPREY540;
  3498. /* bttv_osprey_540_init(btv); */
  3499. break;
  3500. case 0x0060:
  3501. case 0x0070:
  3502. case 0x00A0:
  3503. cardid = BTTV_BOARD_OSPREY2x0;
  3504. /* enable output on select control lines */
  3505. gpio_inout(0xffffff,0x000303);
  3506. break;
  3507. case 0x00D8:
  3508. cardid = BTTV_BOARD_OSPREY440;
  3509. break;
  3510. default:
  3511. /* unknown...leave generic, but get serial # */
  3512. printk(KERN_INFO "bttv%d: "
  3513. "osprey eeprom: unknown card type 0x%04x\n",
  3514. btv->c.nr, type);
  3515. break;
  3516. }
  3517. serial = get_unaligned_be32((__be32 *)(ee+6));
  3518. }
  3519. printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n",
  3520. btv->c.nr, cardid,
  3521. cardid>0 ? bttv_tvcards[cardid].name : "Unknown", serial);
  3522. if (cardid<0 || btv->c.type == cardid)
  3523. return;
  3524. /* card type isn't set correctly */
  3525. if (card[btv->c.nr] < bttv_num_tvcards) {
  3526. printk(KERN_WARNING "bttv%d: osprey eeprom: "
  3527. "Not overriding user specified card type\n", btv->c.nr);
  3528. } else {
  3529. printk(KERN_INFO "bttv%d: osprey eeprom: "
  3530. "Changing card type from %d to %d\n", btv->c.nr,
  3531. btv->c.type, cardid);
  3532. btv->c.type = cardid;
  3533. }
  3534. }
  3535. /* ----------------------------------------------------------------------- */
  3536. /* AVermedia specific stuff, from bktr_card.c */
  3537. static int tuner_0_table[] = {
  3538. TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
  3539. TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
  3540. TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
  3541. TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
  3542. TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
  3543. TUNER_PHILIPS_FM1216ME_MK3 };
  3544. static int tuner_1_table[] = {
  3545. TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
  3546. TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
  3547. TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
  3548. TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
  3549. TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
  3550. static void __devinit avermedia_eeprom(struct bttv *btv)
  3551. {
  3552. int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
  3553. tuner_make = (eeprom_data[0x41] & 0x7);
  3554. tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
  3555. tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
  3556. btv->has_remote = (eeprom_data[0x42] & 0x01);
  3557. if (tuner_make == 0 || tuner_make == 2)
  3558. if (tuner_format <= 0x0a)
  3559. tuner_type = tuner_0_table[tuner_format];
  3560. if (tuner_make == 1)
  3561. if (tuner_format <= 9)
  3562. tuner_type = tuner_1_table[tuner_format];
  3563. if (tuner_make == 4)
  3564. if (tuner_format == 0x09)
  3565. tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
  3566. printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
  3567. btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
  3568. if (tuner_type) {
  3569. btv->tuner_type = tuner_type;
  3570. printk(KERN_CONT "%d", tuner_type);
  3571. } else
  3572. printk(KERN_CONT "Unknown type");
  3573. printk(KERN_CONT " radio:%s remote control:%s\n",
  3574. tuner_tv_fm ? "yes" : "no",
  3575. btv->has_remote ? "yes" : "no");
  3576. }
  3577. /*
  3578. * For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA9880
  3579. * analog demod, which is not I2C controlled like the newer and more common
  3580. * TDA9887 series. Instead is has two tri-state input pins, S0 and S1,
  3581. * that control the IF for the video and audio. Apparently, bttv GPIO
  3582. * 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I
  3583. * (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC).
  3584. */
  3585. u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
  3586. {
  3587. if (btv->audio == TVAUDIO_INPUT_TUNER) {
  3588. if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)
  3589. gpiobits |= 0x10000;
  3590. else
  3591. gpiobits &= ~0x10000;
  3592. }
  3593. gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);
  3594. return gpiobits;
  3595. }
  3596. /*
  3597. * reset/enable the MSP on some Hauppauge cards
  3598. * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
  3599. *
  3600. * Hauppauge: pin 5
  3601. * Voodoo: pin 20
  3602. */
  3603. static void __devinit boot_msp34xx(struct bttv *btv, int pin)
  3604. {
  3605. int mask = (1 << pin);
  3606. gpio_inout(mask,mask);
  3607. gpio_bits(mask,0);
  3608. mdelay(2);
  3609. udelay(500);
  3610. gpio_bits(mask,mask);
  3611. if (bttv_gpio)
  3612. bttv_gpio_tracking(btv,"msp34xx");
  3613. if (bttv_verbose)
  3614. printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
  3615. "init [%d]\n", btv->c.nr, pin);
  3616. }
  3617. /* ----------------------------------------------------------------------- */
  3618. /* Imagenation L-Model PXC200 Framegrabber */
  3619. /* This is basically the same procedure as
  3620. * used by Alessandro Rubini in his pxc200
  3621. * driver, but using BTTV functions */
  3622. static void __devinit init_PXC200(struct bttv *btv)
  3623. {
  3624. static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
  3625. 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
  3626. 0x00 };
  3627. unsigned int i;
  3628. int tmp;
  3629. u32 val;
  3630. /* Initialise GPIO-connevted stuff */
  3631. gpio_inout(0xffffff, (1<<13));
  3632. gpio_write(0);
  3633. udelay(3);
  3634. gpio_write(1<<13);
  3635. /* GPIO inputs are pulled up, so no need to drive
  3636. * reset pin any longer */
  3637. gpio_bits(0xffffff, 0);
  3638. if (bttv_gpio)
  3639. bttv_gpio_tracking(btv,"pxc200");
  3640. /* we could/should try and reset/control the AD pots? but
  3641. right now we simply turned off the crushing. Without
  3642. this the AGC drifts drifts
  3643. remember the EN is reverse logic -->
  3644. setting BT848_ADC_AGC_EN disable the AGC
  3645. tboult@eecs.lehigh.edu
  3646. */
  3647. btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
  3648. /* Initialise MAX517 DAC */
  3649. printk(KERN_INFO "Setting DAC reference voltage level ...\n");
  3650. bttv_I2CWrite(btv,0x5E,0,0x80,1);
  3651. /* Initialise 12C508 PIC */
  3652. /* The I2CWrite and I2CRead commmands are actually to the
  3653. * same chips - but the R/W bit is included in the address
  3654. * argument so the numbers are different */
  3655. printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
  3656. /* First of all, enable the clock line. This is used in the PXC200-F */
  3657. val = btread(BT848_GPIO_DMA_CTL);
  3658. val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
  3659. btwrite(val, BT848_GPIO_DMA_CTL);
  3660. /* Then, push to 0 the reset pin long enough to reset the *
  3661. * device same as above for the reset line, but not the same
  3662. * value sent to the GPIO-connected stuff
  3663. * which one is the good one? */
  3664. gpio_inout(0xffffff,(1<<2));
  3665. gpio_write(0);
  3666. udelay(10);
  3667. gpio_write(1<<2);
  3668. for (i = 0; i < ARRAY_SIZE(vals); i++) {
  3669. tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
  3670. if (tmp != -1) {
  3671. printk(KERN_INFO
  3672. "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
  3673. vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
  3674. }
  3675. }
  3676. printk(KERN_INFO "PXC200 Initialised.\n");
  3677. }
  3678. /* ----------------------------------------------------------------------- */
  3679. /*
  3680. * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
  3681. * it. This apparently involves the following procedure for each 878 chip:
  3682. *
  3683. * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
  3684. *
  3685. * 2) write to GPIO_DATA
  3686. * - 0x0E
  3687. * - sleep 1ms
  3688. * - 0x10 + 0x0E
  3689. * - sleep 10ms
  3690. * - 0x0E
  3691. * read from GPIO_DATA into buf (uint_32)
  3692. * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
  3693. * error. ERROR_CPLD_Check_Failed stop.
  3694. *
  3695. * 3) write to GPIO_DATA
  3696. * - write 0x4400 + 0x0E
  3697. * - sleep 10ms
  3698. * - write 0x4410 + 0x0E
  3699. * - sleep 1ms
  3700. * - write 0x0E
  3701. * read from GPIO_DATA into buf (uint_32)
  3702. * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
  3703. * error. ERROR_CPLD_Check_Failed.
  3704. */
  3705. /* ----------------------------------------------------------------------- */
  3706. static void
  3707. init_RTV24 (struct bttv *btv)
  3708. {
  3709. uint32_t dataRead = 0;
  3710. long watchdog_value = 0x0E;
  3711. printk (KERN_INFO
  3712. "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
  3713. btv->c.nr);
  3714. btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
  3715. btwrite (0 + watchdog_value, BT848_GPIO_DATA);
  3716. msleep (1);
  3717. btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
  3718. msleep (10);
  3719. btwrite (0 + watchdog_value, BT848_GPIO_DATA);
  3720. dataRead = btread (BT848_GPIO_DATA);
  3721. if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
  3722. printk (KERN_INFO
  3723. "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
  3724. btv->c.nr, dataRead);
  3725. }
  3726. btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
  3727. msleep (10);
  3728. btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
  3729. msleep (1);
  3730. btwrite (watchdog_value, BT848_GPIO_DATA);
  3731. msleep (1);
  3732. dataRead = btread (BT848_GPIO_DATA);
  3733. if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
  3734. printk (KERN_INFO
  3735. "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
  3736. btv->c.nr, dataRead);
  3737. return;
  3738. }
  3739. printk (KERN_INFO
  3740. "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
  3741. }
  3742. /* ----------------------------------------------------------------------- */
  3743. /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
  3744. /*
  3745. * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
  3746. * This code is placed under the terms of the GNU General Public License
  3747. *
  3748. * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
  3749. */
  3750. static void bus_low(struct bttv *btv, int bit)
  3751. {
  3752. if (btv->mbox_ior) {
  3753. gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
  3754. btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
  3755. udelay(5);
  3756. }
  3757. gpio_bits(bit,0);
  3758. udelay(5);
  3759. if (btv->mbox_ior) {
  3760. gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
  3761. udelay(5);
  3762. }
  3763. }
  3764. static void bus_high(struct bttv *btv, int bit)
  3765. {
  3766. if (btv->mbox_ior) {
  3767. gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
  3768. btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
  3769. udelay(5);
  3770. }
  3771. gpio_bits(bit,bit);
  3772. udelay(5);
  3773. if (btv->mbox_ior) {
  3774. gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
  3775. udelay(5);
  3776. }
  3777. }
  3778. static int bus_in(struct bttv *btv, int bit)
  3779. {
  3780. if (btv->mbox_ior) {
  3781. gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
  3782. btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
  3783. udelay(5);
  3784. gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
  3785. udelay(5);
  3786. }
  3787. return gpio_read() & (bit);
  3788. }
  3789. /* TEA5757 register bits */
  3790. #define TEA_FREQ 0:14
  3791. #define TEA_BUFFER 15:15
  3792. #define TEA_SIGNAL_STRENGTH 16:17
  3793. #define TEA_PORT1 18:18
  3794. #define TEA_PORT0 19:19
  3795. #define TEA_BAND 20:21
  3796. #define TEA_BAND_FM 0
  3797. #define TEA_BAND_MW 1
  3798. #define TEA_BAND_LW 2
  3799. #define TEA_BAND_SW 3
  3800. #define TEA_MONO 22:22
  3801. #define TEA_ALLOW_STEREO 0
  3802. #define TEA_FORCE_MONO 1
  3803. #define TEA_SEARCH_DIRECTION 23:23
  3804. #define TEA_SEARCH_DOWN 0
  3805. #define TEA_SEARCH_UP 1
  3806. #define TEA_STATUS 24:24
  3807. #define TEA_STATUS_TUNED 0
  3808. #define TEA_STATUS_SEARCHING 1
  3809. /* Low-level stuff */
  3810. static int tea5757_read(struct bttv *btv)
  3811. {
  3812. unsigned long timeout;
  3813. int value = 0;
  3814. int i;
  3815. /* better safe than sorry */
  3816. gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
  3817. if (btv->mbox_ior) {
  3818. gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
  3819. btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
  3820. udelay(5);
  3821. }
  3822. if (bttv_gpio)
  3823. bttv_gpio_tracking(btv,"tea5757 read");
  3824. bus_low(btv,btv->mbox_we);
  3825. bus_low(btv,btv->mbox_clk);
  3826. udelay(10);
  3827. timeout= jiffies + msecs_to_jiffies(1000);
  3828. /* wait for DATA line to go low; error if it doesn't */
  3829. while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
  3830. schedule();
  3831. if (bus_in(btv,btv->mbox_data)) {
  3832. printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
  3833. return -1;
  3834. }
  3835. dprintk("bttv%d: tea5757:",btv->c.nr);
  3836. for (i = 0; i < 24; i++) {
  3837. udelay(5);
  3838. bus_high(btv,btv->mbox_clk);
  3839. udelay(5);
  3840. dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
  3841. bus_low(btv,btv->mbox_clk);
  3842. value <<= 1;
  3843. value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
  3844. dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
  3845. }
  3846. dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
  3847. return value;
  3848. }
  3849. static int tea5757_write(struct bttv *btv, int value)
  3850. {
  3851. int i;
  3852. int reg = value;
  3853. gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
  3854. if (btv->mbox_ior) {
  3855. gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
  3856. btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
  3857. udelay(5);
  3858. }
  3859. if (bttv_gpio)
  3860. bttv_gpio_tracking(btv,"tea5757 write");
  3861. dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
  3862. bus_low(btv,btv->mbox_clk);
  3863. bus_high(btv,btv->mbox_we);
  3864. for (i = 0; i < 25; i++) {
  3865. if (reg & 0x1000000)
  3866. bus_high(btv,btv->mbox_data);
  3867. else
  3868. bus_low(btv,btv->mbox_data);
  3869. reg <<= 1;
  3870. bus_high(btv,btv->mbox_clk);
  3871. udelay(10);
  3872. bus_low(btv,btv->mbox_clk);
  3873. udelay(10);
  3874. }
  3875. bus_low(btv,btv->mbox_we); /* unmute !!! */
  3876. return 0;
  3877. }
  3878. void tea5757_set_freq(struct bttv *btv, unsigned short freq)
  3879. {
  3880. dprintk("tea5757_set_freq %d\n",freq);
  3881. tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
  3882. }
  3883. /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
  3884. *
  3885. * This is needed because rv605 don't use a normal multiplex, but a crosspoint
  3886. * switch instead (CD22M3494E). This IC can have multiple active connections
  3887. * between Xn (input) and Yn (output) pins. We need to clear any existing
  3888. * connection prior to establish a new one, pulsing the STROBE pin.
  3889. *
  3890. * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
  3891. * GPIO pins are wired as:
  3892. * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)
  3893. * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)
  3894. * GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)
  3895. * GPIO[8] - - P3[5] (microcontroller)
  3896. * GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)
  3897. * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)
  3898. * GPINTR - - P3[4] (microcontroller)
  3899. *
  3900. * The microcontroller is a 80C32 like. It should be possible to change xpoint
  3901. * configuration either directly (as we are doing) or using the microcontroller
  3902. * which is also wired to I2C interface. I have no further info on the
  3903. * microcontroller features, one would need to disassembly the firmware.
  3904. * note: the vendor refused to give any information on this product, all
  3905. * that stuff was found using a multimeter! :)
  3906. */
  3907. static void rv605_muxsel(struct bttv *btv, unsigned int input)
  3908. {
  3909. static const u8 muxgpio[] = { 0x3, 0x1, 0x2, 0x4, 0xf, 0x7, 0xe, 0x0,
  3910. 0xd, 0xb, 0xc, 0x6, 0x9, 0x5, 0x8, 0xa };
  3911. gpio_bits(0x07f, muxgpio[input]);
  3912. /* reset all conections */
  3913. gpio_bits(0x200,0x200);
  3914. mdelay(1);
  3915. gpio_bits(0x200,0x000);
  3916. mdelay(1);
  3917. /* create a new connection */
  3918. gpio_bits(0x480,0x480);
  3919. mdelay(1);
  3920. gpio_bits(0x480,0x080);
  3921. mdelay(1);
  3922. }
  3923. /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
  3924. *
  3925. * The CS16 (available on eBay cheap) is a PCI board with four Fusion
  3926. * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
  3927. * chips, ten eight input analog multiplexors, a not chip and a few
  3928. * other components.
  3929. *
  3930. * 16 inputs on a secondary bracket are provided and can be selected
  3931. * from each of the four capture chips. Two of the eight input
  3932. * multiplexors are used to select from any of the 16 input signals.
  3933. *
  3934. * Unsupported hardware capabilities:
  3935. * . A video output monitor on the secondary bracket can be selected from
  3936. * one of the 878A chips.
  3937. * . Another passthrough but I haven't spent any time investigating it.
  3938. * . Digital I/O (logic level connected to GPIO) is available from an
  3939. * onboard header.
  3940. *
  3941. * The on chip input mux should always be set to 2.
  3942. * GPIO[16:19] - Video input selection
  3943. * GPIO[0:3] - Video output monitor select (only available from one 878A)
  3944. * GPIO[?:?] - Digital I/O.
  3945. *
  3946. * There is an ATMEL microcontroller with an 8031 core on board. I have not
  3947. * determined what function (if any) it provides. With the microcontroller
  3948. * and sync seperator chips a guess is that it might have to do with video
  3949. * switching and maybe some digital I/O.
  3950. */
  3951. static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
  3952. {
  3953. /* video mux */
  3954. gpio_bits(0x0f0000, input << 16);
  3955. }
  3956. static void tibetCS16_init(struct bttv *btv)
  3957. {
  3958. /* enable gpio bits, mask obtained via btSpy */
  3959. gpio_inout(0xffffff, 0x0f7fff);
  3960. gpio_write(0x0f7fff);
  3961. }
  3962. /*
  3963. * The following routines for the Kodicom-4400r get a little mind-twisting.
  3964. * There is a "master" controller and three "slave" controllers, together
  3965. * an analog switch which connects any of 16 cameras to any of the BT87A's.
  3966. * The analog switch is controlled by the "master", but the detection order
  3967. * of the four BT878A chips is in an order which I just don't understand.
  3968. * The "master" is actually the second controller to be detected. The
  3969. * logic on the board uses logical numbers for the 4 controllers, but
  3970. * those numbers are different from the detection sequence. When working
  3971. * with the analog switch, we need to "map" from the detection sequence
  3972. * over to the board's logical controller number. This mapping sequence
  3973. * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
  3974. * unit 3, the second (which is the master) is logical unit 0, etc.
  3975. * We need to maintain the status of the analog switch (which of the 16
  3976. * cameras is connected to which of the 4 controllers). Rather than
  3977. * add to the bttv structure for this, we use the data reserved for
  3978. * the mbox (unused for this card type).
  3979. */
  3980. /*
  3981. * First a routine to set the analog switch, which controls which camera
  3982. * is routed to which controller. The switch comprises an X-address
  3983. * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
  3984. * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
  3985. * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
  3986. * the switch. A STROBE bit (gpio bit 8) latches the data value into the
  3987. * specified address. The idea is to set the address and data, then bring
  3988. * STROBE high, and finally bring STROBE back to low.
  3989. */
  3990. static void kodicom4400r_write(struct bttv *btv,
  3991. unsigned char xaddr,
  3992. unsigned char yaddr,
  3993. unsigned char data) {
  3994. unsigned int udata;
  3995. udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
  3996. gpio_bits(0x1ff, udata); /* write ADDR and DAT */
  3997. gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
  3998. gpio_bits(0x1ff, udata); /* strobe low */
  3999. }
  4000. /*
  4001. * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
  4002. * use this routine. The routine finds the "master" for the card, maps
  4003. * the controller number from the detected position over to the logical
  4004. * number, writes the appropriate data to the analog switch, and housekeeps
  4005. * the local copy of the switch information. The parameter 'input' is the
  4006. * requested camera number (0 - 15).
  4007. */
  4008. static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
  4009. {
  4010. char *sw_status;
  4011. int xaddr, yaddr;
  4012. struct bttv *mctlr;
  4013. static unsigned char map[4] = {3, 0, 2, 1};
  4014. mctlr = master[btv->c.nr];
  4015. if (mctlr == NULL) { /* ignore if master not yet detected */
  4016. return;
  4017. }
  4018. yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
  4019. yaddr = map[yaddr];
  4020. sw_status = (char *)(&mctlr->mbox_we);
  4021. xaddr = input & 0xf;
  4022. /* Check if the controller/camera pair has changed, else ignore */
  4023. if (sw_status[yaddr] != xaddr)
  4024. {
  4025. /* "open" the old switch, "close" the new one, save the new */
  4026. kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
  4027. sw_status[yaddr] = xaddr;
  4028. kodicom4400r_write(mctlr, xaddr, yaddr, 1);
  4029. }
  4030. }
  4031. /*
  4032. * During initialisation, we need to reset the analog switch. We
  4033. * also preset the switch to map the 4 connectors on the card to the
  4034. * *user's* (see above description of kodicom4400r_muxsel) channels
  4035. * 0 through 3
  4036. */
  4037. static void kodicom4400r_init(struct bttv *btv)
  4038. {
  4039. char *sw_status = (char *)(&btv->mbox_we);
  4040. int ix;
  4041. gpio_inout(0x0003ff, 0x0003ff);
  4042. gpio_write(1 << 9); /* reset MUX */
  4043. gpio_write(0);
  4044. /* Preset camera 0 to the 4 controllers */
  4045. for (ix = 0; ix < 4; ix++) {
  4046. sw_status[ix] = ix;
  4047. kodicom4400r_write(btv, ix, ix, 1);
  4048. }
  4049. /*
  4050. * Since this is the "master", we need to set up the
  4051. * other three controller chips' pointers to this structure
  4052. * for later use in the muxsel routine.
  4053. */
  4054. if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
  4055. return;
  4056. master[btv->c.nr-1] = btv;
  4057. master[btv->c.nr] = btv;
  4058. master[btv->c.nr+1] = btv;
  4059. master[btv->c.nr+2] = btv;
  4060. }
  4061. /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
  4062. * video multiplexers to provide up to 16 video inputs. These
  4063. * multiplexers are controlled by the lower 8 GPIO pins of the
  4064. * bt878. The multiplexers probably Pericom PI5V331Q or similar.
  4065. * xxx0 is pin xxx of multiplexer U5,
  4066. * yyy1 is pin yyy of multiplexer U2
  4067. */
  4068. #define ENA0 0x01
  4069. #define ENB0 0x02
  4070. #define ENA1 0x04
  4071. #define ENB1 0x08
  4072. #define IN10 0x10
  4073. #define IN00 0x20
  4074. #define IN11 0x40
  4075. #define IN01 0x80
  4076. static void xguard_muxsel(struct bttv *btv, unsigned int input)
  4077. {
  4078. static const int masks[] = {
  4079. ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
  4080. ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
  4081. ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
  4082. ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
  4083. };
  4084. gpio_write(masks[input%16]);
  4085. }
  4086. static void picolo_tetra_init(struct bttv *btv)
  4087. {
  4088. /*This is the video input redirection fonctionality : I DID NOT USED IT. */
  4089. btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
  4090. btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
  4091. }
  4092. static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
  4093. {
  4094. dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
  4095. /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
  4096. /*GPIO[20]&GPIO[21] used to choose the right input*/
  4097. btwrite (input<<20,BT848_GPIO_DATA);
  4098. }
  4099. /*
  4100. * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
  4101. *
  4102. * The IVC120G security card has 4 i2c controlled TDA8540 matrix
  4103. * swichers to provide 16 channels to MUX0. The TDA8540's have
  4104. * 4 independent outputs and as such the IVC120G also has the
  4105. * optional "Monitor Out" bus. This allows the card to be looking
  4106. * at one input while the monitor is looking at another.
  4107. *
  4108. * Since I've couldn't be bothered figuring out how to add an
  4109. * independant muxsel for the monitor bus, I've just set it to
  4110. * whatever the card is looking at.
  4111. *
  4112. * OUT0 of the TDA8540's is connected to MUX0 (0x03)
  4113. * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
  4114. *
  4115. * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
  4116. * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
  4117. * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
  4118. * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
  4119. *
  4120. */
  4121. /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
  4122. #define I2C_TDA8540 0x90
  4123. #define I2C_TDA8540_ALT1 0x92
  4124. #define I2C_TDA8540_ALT2 0x94
  4125. #define I2C_TDA8540_ALT3 0x96
  4126. #define I2C_TDA8540_ALT4 0x98
  4127. #define I2C_TDA8540_ALT5 0x9a
  4128. #define I2C_TDA8540_ALT6 0x9c
  4129. static void ivc120_muxsel(struct bttv *btv, unsigned int input)
  4130. {
  4131. /* Simple maths */
  4132. int key = input % 4;
  4133. int matrix = input / 4;
  4134. dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
  4135. btv->c.nr, input, matrix, key);
  4136. /* Handles the input selection on the TDA8540's */
  4137. bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
  4138. ((matrix == 3) ? (key | key << 2) : 0x00), 1);
  4139. bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
  4140. ((matrix == 0) ? (key | key << 2) : 0x00), 1);
  4141. bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
  4142. ((matrix == 1) ? (key | key << 2) : 0x00), 1);
  4143. bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
  4144. ((matrix == 2) ? (key | key << 2) : 0x00), 1);
  4145. /* Handles the output enables on the TDA8540's */
  4146. bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
  4147. ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
  4148. bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
  4149. ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
  4150. bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
  4151. ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
  4152. bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
  4153. ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
  4154. /* 878's MUX0 is already selected for input via muxsel values */
  4155. }
  4156. /* PXC200 muxsel helper
  4157. * luke@syseng.anu.edu.au
  4158. * another transplant
  4159. * from Alessandro Rubini (rubini@linux.it)
  4160. *
  4161. * There are 4 kinds of cards:
  4162. * PXC200L which is bt848
  4163. * PXC200F which is bt848 with PIC controlling mux
  4164. * PXC200AL which is bt878
  4165. * PXC200AF which is bt878 with PIC controlling mux
  4166. */
  4167. #define PX_CFG_PXC200F 0x01
  4168. #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
  4169. #define PX_I2C_PIC 0x0f
  4170. #define PX_PXC200A_CARDID 0x200a1295
  4171. #define PX_I2C_CMD_CFG 0x00
  4172. static void PXC200_muxsel(struct bttv *btv, unsigned int input)
  4173. {
  4174. int rc;
  4175. long mux;
  4176. int bitmask;
  4177. unsigned char buf[2];
  4178. /* Read PIC config to determine if this is a PXC200F */
  4179. /* PX_I2C_CMD_CFG*/
  4180. buf[0]=0;
  4181. buf[1]=0;
  4182. rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
  4183. if (rc) {
  4184. printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
  4185. /* not PXC ? do nothing */
  4186. return;
  4187. }
  4188. rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
  4189. if (!(rc & PX_CFG_PXC200F)) {
  4190. printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
  4191. return;
  4192. }
  4193. /* The multiplexer in the 200F is handled by the GPIO port */
  4194. /* get correct mapping between inputs */
  4195. /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
  4196. /* ** not needed!? */
  4197. mux = input;
  4198. /* make sure output pins are enabled */
  4199. /* bitmask=0x30f; */
  4200. bitmask=0x302;
  4201. /* check whether we have a PXC200A */
  4202. if (btv->cardid == PX_PXC200A_CARDID) {
  4203. bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
  4204. bitmask |= 7<<4; /* the DAC */
  4205. }
  4206. btwrite(bitmask, BT848_GPIO_OUT_EN);
  4207. bitmask = btread(BT848_GPIO_DATA);
  4208. if (btv->cardid == PX_PXC200A_CARDID)
  4209. bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
  4210. else /* older device */
  4211. bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
  4212. btwrite(bitmask,BT848_GPIO_DATA);
  4213. /*
  4214. * Was "to be safe, set the bt848 to input 0"
  4215. * Actually, since it's ok at load time, better not messing
  4216. * with these bits (on PXC200AF you need to set mux 2 here)
  4217. *
  4218. * needed because bttv-driver sets mux before calling this function
  4219. */
  4220. if (btv->cardid == PX_PXC200A_CARDID)
  4221. btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
  4222. else /* older device */
  4223. btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
  4224. printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
  4225. }
  4226. static void phytec_muxsel(struct bttv *btv, unsigned int input)
  4227. {
  4228. unsigned int mux = input % 4;
  4229. if (input == btv->svhs)
  4230. mux = 0;
  4231. gpio_bits(0x3, mux);
  4232. }
  4233. /* ----------------------------------------------------------------------- */
  4234. /* motherboard chipset specific stuff */
  4235. void __init bttv_check_chipset(void)
  4236. {
  4237. int pcipci_fail = 0;
  4238. struct pci_dev *dev = NULL;
  4239. if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
  4240. pcipci_fail = 1;
  4241. if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
  4242. triton1 = 1;
  4243. if (pci_pci_problems & PCIPCI_VSFX)
  4244. vsfx = 1;
  4245. #ifdef PCIPCI_ALIMAGIK
  4246. if (pci_pci_problems & PCIPCI_ALIMAGIK)
  4247. latency = 0x0A;
  4248. #endif
  4249. /* print warnings about any quirks found */
  4250. if (triton1)
  4251. printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
  4252. if (vsfx)
  4253. printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
  4254. if (pcipci_fail) {
  4255. printk(KERN_INFO "bttv: bttv and your chipset may not work "
  4256. "together.\n");
  4257. if (!no_overlay) {
  4258. printk(KERN_INFO "bttv: overlay will be disabled.\n");
  4259. no_overlay = 1;
  4260. } else {
  4261. printk(KERN_INFO "bttv: overlay forced. Use this "
  4262. "option at your own risk.\n");
  4263. }
  4264. }
  4265. if (UNSET != latency)
  4266. printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
  4267. while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
  4268. PCI_DEVICE_ID_INTEL_82441, dev))) {
  4269. unsigned char b;
  4270. pci_read_config_byte(dev, 0x53, &b);
  4271. if (bttv_debug)
  4272. printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
  4273. "bufcon=0x%02x\n",b);
  4274. }
  4275. }
  4276. int __devinit bttv_handle_chipset(struct bttv *btv)
  4277. {
  4278. unsigned char command;
  4279. if (!triton1 && !vsfx && UNSET == latency)
  4280. return 0;
  4281. if (bttv_verbose) {
  4282. if (triton1)
  4283. printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
  4284. if (vsfx && btv->id >= 878)
  4285. printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
  4286. if (UNSET != latency)
  4287. printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
  4288. btv->c.nr,latency);
  4289. }
  4290. if (btv->id < 878) {
  4291. /* bt848 (mis)uses a bit in the irq mask for etbf */
  4292. if (triton1)
  4293. btv->triton1 = BT848_INT_ETBF;
  4294. } else {
  4295. /* bt878 has a bit in the pci config space for it */
  4296. pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
  4297. if (triton1)
  4298. command |= BT878_EN_TBFX;
  4299. if (vsfx)
  4300. command |= BT878_EN_VSFX;
  4301. pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
  4302. }
  4303. if (UNSET != latency)
  4304. pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
  4305. return 0;
  4306. }
  4307. /*
  4308. * Local variables:
  4309. * c-basic-offset: 8
  4310. * End:
  4311. */