bttv-cards.c 146 KB

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