bttv-cards.c 148 KB

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