bttv-cards.c 148 KB

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