bttv-cards.c 144 KB

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