bttv-cards.c 144 KB

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