bttv-cards.c 149 KB

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