bttv-cards.c 147 KB

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