bttv-cards.c 130 KB

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