bttv-cards.c 126 KB

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