bttv-cards.c 129 KB

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