bttv-cards.c 145 KB

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