bttv-cards.c 151 KB

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