bttv-cards.c 130 KB

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