bttv-cards.c 148 KB

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