bttv-cards.c 144 KB

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