bttv-cards.c 148 KB

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