bttv-cards.c 144 KB

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