bttv-cards.c 149 KB

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