bttv-cards.c 146 KB

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