bttv-cards.c 146 KB

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