bttv-cards.c 146 KB

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