bttv-cards.c 148 KB

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