bttv-cards.c 145 KB

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