bttv-cards.c 146 KB

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