bttv-cards.c 144 KB

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