bttv-cards.c 150 KB

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