bttv-cards.c 137 KB

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