bttv-cards.c 145 KB

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