bttv-cards.c 148 KB

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