bttv-cards.c 145 KB

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