bttv-cards.c 146 KB

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