em28xx-cards.c 107 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576
  1. /*
  2. em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB
  3. video capture devices
  4. Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
  5. Markus Rechberger <mrechberger@gmail.com>
  6. Mauro Carvalho Chehab <mchehab@infradead.org>
  7. Sascha Sommer <saschasommer@freenet.de>
  8. Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com>
  9. This program is free software; you can redistribute it and/or modify
  10. it under the terms of the GNU General Public License as published by
  11. the Free Software Foundation; either version 2 of the License, or
  12. (at your option) any later version.
  13. This program is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. GNU General Public License for more details.
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #include <linux/init.h>
  22. #include <linux/module.h>
  23. #include <linux/slab.h>
  24. #include <linux/delay.h>
  25. #include <linux/i2c.h>
  26. #include <linux/usb.h>
  27. #include <media/tuner.h>
  28. #include <media/msp3400.h>
  29. #include <media/saa7115.h>
  30. #include <media/tvp5150.h>
  31. #include <media/tvaudio.h>
  32. #include <media/i2c-addr.h>
  33. #include <media/tveeprom.h>
  34. #include <media/v4l2-common.h>
  35. #include "em28xx.h"
  36. #define DRIVER_NAME "em28xx"
  37. static int tuner = -1;
  38. module_param(tuner, int, 0444);
  39. MODULE_PARM_DESC(tuner, "tuner type");
  40. static unsigned int disable_ir;
  41. module_param(disable_ir, int, 0444);
  42. MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
  43. static unsigned int disable_usb_speed_check;
  44. module_param(disable_usb_speed_check, int, 0444);
  45. MODULE_PARM_DESC(disable_usb_speed_check,
  46. "override min bandwidth requirement of 480M bps");
  47. static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = -1U };
  48. module_param_array(card, int, NULL, 0444);
  49. MODULE_PARM_DESC(card, "card type");
  50. static int usb_xfer_mode = -1;
  51. module_param(usb_xfer_mode, int, 0444);
  52. MODULE_PARM_DESC(usb_xfer_mode,
  53. "USB transfer mode for frame data (-1 = auto, 0 = prefer isoc, 1 = prefer bulk)");
  54. /* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS - 1 */
  55. static DECLARE_BITMAP(em28xx_devused, EM28XX_MAXBOARDS);
  56. struct em28xx_hash_table {
  57. unsigned long hash;
  58. unsigned int model;
  59. unsigned int tuner;
  60. };
  61. static void em28xx_pre_card_setup(struct em28xx *dev);
  62. /*
  63. * Reset sequences for analog/digital modes
  64. */
  65. /* Reset for the most [analog] boards */
  66. static struct em28xx_reg_seq default_analog[] = {
  67. {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
  68. { -1, -1, -1, -1},
  69. };
  70. /* Reset for the most [digital] boards */
  71. static struct em28xx_reg_seq default_digital[] = {
  72. {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
  73. { -1, -1, -1, -1},
  74. };
  75. /* Board Hauppauge WinTV HVR 900 analog */
  76. static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
  77. {EM2820_R08_GPIO_CTRL, 0x2d, ~EM_GPIO_4, 10},
  78. { 0x05, 0xff, 0x10, 10},
  79. { -1, -1, -1, -1},
  80. };
  81. /* Board Hauppauge WinTV HVR 900 digital */
  82. static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
  83. {EM2820_R08_GPIO_CTRL, 0x2e, ~EM_GPIO_4, 10},
  84. {EM2880_R04_GPO, 0x04, 0x0f, 10},
  85. {EM2880_R04_GPO, 0x0c, 0x0f, 10},
  86. { -1, -1, -1, -1},
  87. };
  88. /* Board Hauppauge WinTV HVR 900 (R2) digital */
  89. static struct em28xx_reg_seq hauppauge_wintv_hvr_900R2_digital[] = {
  90. {EM2820_R08_GPIO_CTRL, 0x2e, ~EM_GPIO_4, 10},
  91. {EM2880_R04_GPO, 0x0c, 0x0f, 10},
  92. { -1, -1, -1, -1},
  93. };
  94. /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
  95. static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
  96. {EM2820_R08_GPIO_CTRL, 0x69, ~EM_GPIO_4, 10},
  97. { -1, -1, -1, -1},
  98. };
  99. /* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
  100. /* Board - EM2870 Kworld 355u
  101. Analog - No input analog */
  102. /* Board - EM2882 Kworld 315U digital */
  103. static struct em28xx_reg_seq em2882_kworld_315u_digital[] = {
  104. {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
  105. {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10},
  106. {EM2880_R04_GPO, 0x04, 0xff, 10},
  107. {EM2880_R04_GPO, 0x0c, 0xff, 10},
  108. {EM2820_R08_GPIO_CTRL, 0x7e, 0xff, 10},
  109. { -1, -1, -1, -1},
  110. };
  111. static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio[] = {
  112. {EM2880_R04_GPO, 0x08, 0xff, 10},
  113. {EM2880_R04_GPO, 0x0c, 0xff, 10},
  114. {EM2880_R04_GPO, 0x08, 0xff, 10},
  115. {EM2880_R04_GPO, 0x0c, 0xff, 10},
  116. { -1, -1, -1, -1},
  117. };
  118. static struct em28xx_reg_seq kworld_330u_analog[] = {
  119. {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
  120. {EM2880_R04_GPO, 0x00, 0xff, 10},
  121. { -1, -1, -1, -1},
  122. };
  123. static struct em28xx_reg_seq kworld_330u_digital[] = {
  124. {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
  125. {EM2880_R04_GPO, 0x08, 0xff, 10},
  126. { -1, -1, -1, -1},
  127. };
  128. /* Evga inDtube
  129. GPIO0 - Enable digital power (s5h1409) - low to enable
  130. GPIO1 - Enable analog power (tvp5150/emp202) - low to enable
  131. GPIO4 - xc3028 reset
  132. GOP3 - s5h1409 reset
  133. */
  134. static struct em28xx_reg_seq evga_indtube_analog[] = {
  135. {EM2820_R08_GPIO_CTRL, 0x79, 0xff, 60},
  136. { -1, -1, -1, -1},
  137. };
  138. static struct em28xx_reg_seq evga_indtube_digital[] = {
  139. {EM2820_R08_GPIO_CTRL, 0x7a, 0xff, 1},
  140. {EM2880_R04_GPO, 0x04, 0xff, 10},
  141. {EM2880_R04_GPO, 0x0c, 0xff, 1},
  142. { -1, -1, -1, -1},
  143. };
  144. /*
  145. * KWorld PlusTV 340U, UB435-Q and UB435-Q V2 (ATSC) GPIOs map:
  146. * EM_GPIO_0 - currently unknown
  147. * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on)
  148. * EM_GPIO_2 - currently unknown
  149. * EM_GPIO_3 - currently unknown
  150. * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset)
  151. * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset)
  152. * EM_GPIO_6 - currently unknown
  153. * EM_GPIO_7 - currently unknown
  154. */
  155. static struct em28xx_reg_seq kworld_a340_digital[] = {
  156. {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
  157. { -1, -1, -1, -1},
  158. };
  159. static struct em28xx_reg_seq kworld_ub435q_v3_digital[] = {
  160. {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 100},
  161. {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 100},
  162. {EM2874_R80_GPIO_P0_CTRL, 0xbe, 0xff, 100},
  163. {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 100},
  164. { -1, -1, -1, -1},
  165. };
  166. /* Pinnacle Hybrid Pro eb1a:2881 */
  167. static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
  168. {EM2820_R08_GPIO_CTRL, 0xfd, ~EM_GPIO_4, 10},
  169. { -1, -1, -1, -1},
  170. };
  171. static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = {
  172. {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
  173. {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */
  174. {EM2880_R04_GPO, 0x0c, 0xff, 1},
  175. { -1, -1, -1, -1},
  176. };
  177. static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog[] = {
  178. {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
  179. {EM2880_R04_GPO, 0x00, 0xff, 10},
  180. { -1, -1, -1, -1},
  181. };
  182. static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital[] = {
  183. {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
  184. {EM2880_R04_GPO, 0x08, 0xff, 10},
  185. { -1, -1, -1, -1},
  186. };
  187. /* PCTV HD Mini (80e) GPIOs
  188. 0-5: not used
  189. 6: demod reset, active low
  190. 7: LED on, active high */
  191. static struct em28xx_reg_seq em2874_pctv_80e_digital[] = {
  192. {EM28XX_R06_I2C_CLK, 0x45, 0xff, 10}, /*400 KHz*/
  193. {EM2874_R80_GPIO_P0_CTRL, 0x00, 0xff, 100},/*Demod reset*/
  194. {EM2874_R80_GPIO_P0_CTRL, 0x40, 0xff, 10},
  195. { -1, -1, -1, -1},
  196. };
  197. /* eb1a:2868 Reddo DVB-C USB TV Box
  198. GPIO4 - CU1216L NIM
  199. Other GPIOs seems to be don't care. */
  200. static struct em28xx_reg_seq reddo_dvb_c_usb_box[] = {
  201. {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10},
  202. {EM2820_R08_GPIO_CTRL, 0xde, 0xff, 10},
  203. {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10},
  204. {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
  205. {EM2820_R08_GPIO_CTRL, 0x7f, 0xff, 10},
  206. {EM2820_R08_GPIO_CTRL, 0x6f, 0xff, 10},
  207. {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
  208. { -1, -1, -1, -1},
  209. };
  210. /* Callback for the most boards */
  211. static struct em28xx_reg_seq default_tuner_gpio[] = {
  212. {EM2820_R08_GPIO_CTRL, EM_GPIO_4, EM_GPIO_4, 10},
  213. {EM2820_R08_GPIO_CTRL, 0, EM_GPIO_4, 10},
  214. {EM2820_R08_GPIO_CTRL, EM_GPIO_4, EM_GPIO_4, 10},
  215. { -1, -1, -1, -1},
  216. };
  217. /* Mute/unmute */
  218. static struct em28xx_reg_seq compro_unmute_tv_gpio[] = {
  219. {EM2820_R08_GPIO_CTRL, 5, 7, 10},
  220. { -1, -1, -1, -1},
  221. };
  222. static struct em28xx_reg_seq compro_unmute_svid_gpio[] = {
  223. {EM2820_R08_GPIO_CTRL, 4, 7, 10},
  224. { -1, -1, -1, -1},
  225. };
  226. static struct em28xx_reg_seq compro_mute_gpio[] = {
  227. {EM2820_R08_GPIO_CTRL, 6, 7, 10},
  228. { -1, -1, -1, -1},
  229. };
  230. /* Terratec AV350 */
  231. static struct em28xx_reg_seq terratec_av350_mute_gpio[] = {
  232. {EM2820_R08_GPIO_CTRL, 0xff, 0x7f, 10},
  233. { -1, -1, -1, -1},
  234. };
  235. static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = {
  236. {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
  237. { -1, -1, -1, -1},
  238. };
  239. static struct em28xx_reg_seq silvercrest_reg_seq[] = {
  240. {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
  241. {EM2820_R08_GPIO_CTRL, 0x01, 0xf7, 10},
  242. { -1, -1, -1, -1},
  243. };
  244. static struct em28xx_reg_seq vc211a_enable[] = {
  245. {EM2820_R08_GPIO_CTRL, 0xff, 0x07, 10},
  246. {EM2820_R08_GPIO_CTRL, 0xff, 0x0f, 10},
  247. {EM2820_R08_GPIO_CTRL, 0xff, 0x0b, 10},
  248. { -1, -1, -1, -1},
  249. };
  250. static struct em28xx_reg_seq dikom_dk300_digital[] = {
  251. {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
  252. {EM2880_R04_GPO, 0x08, 0xff, 10},
  253. { -1, -1, -1, -1},
  254. };
  255. /* Reset for the most [digital] boards */
  256. static struct em28xx_reg_seq leadership_digital[] = {
  257. {EM2874_R80_GPIO_P0_CTRL, 0x70, 0xff, 10},
  258. { -1, -1, -1, -1},
  259. };
  260. static struct em28xx_reg_seq leadership_reset[] = {
  261. {EM2874_R80_GPIO_P0_CTRL, 0xf0, 0xff, 10},
  262. {EM2874_R80_GPIO_P0_CTRL, 0xb0, 0xff, 10},
  263. {EM2874_R80_GPIO_P0_CTRL, 0xf0, 0xff, 10},
  264. { -1, -1, -1, -1},
  265. };
  266. /* 2013:024f PCTV nanoStick T2 290e
  267. * GPIO_6 - demod reset
  268. * GPIO_7 - LED
  269. */
  270. static struct em28xx_reg_seq pctv_290e[] = {
  271. {EM2874_R80_GPIO_P0_CTRL, 0x00, 0xff, 80},
  272. {EM2874_R80_GPIO_P0_CTRL, 0x40, 0xff, 80}, /* GPIO_6 = 1 */
  273. {EM2874_R80_GPIO_P0_CTRL, 0xc0, 0xff, 80}, /* GPIO_7 = 1 */
  274. { -1, -1, -1, -1},
  275. };
  276. #if 0
  277. static struct em28xx_reg_seq terratec_h5_gpio[] = {
  278. {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
  279. {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 100},
  280. {EM2874_R80_GPIO_P0_CTRL, 0xf2, 0xff, 50},
  281. {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 50},
  282. { -1, -1, -1, -1},
  283. };
  284. static struct em28xx_reg_seq terratec_h5_digital[] = {
  285. {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 10},
  286. {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100},
  287. {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 10},
  288. { -1, -1, -1, -1},
  289. };
  290. #endif
  291. /* 2013:024f PCTV DVB-S2 Stick 460e
  292. * GPIO_0 - POWER_ON
  293. * GPIO_1 - BOOST
  294. * GPIO_2 - VUV_LNB (red LED)
  295. * GPIO_3 - EXT_12V
  296. * GPIO_4 - INT_DEM (DEMOD GPIO_0)
  297. * GPIO_5 - INT_LNB
  298. * GPIO_6 - RESET_DEM
  299. * GPIO_7 - LED (green LED)
  300. */
  301. static struct em28xx_reg_seq pctv_460e[] = {
  302. {EM2874_R80_GPIO_P0_CTRL, 0x01, 0xff, 50},
  303. { 0x0d, 0xff, 0xff, 50},
  304. {EM2874_R80_GPIO_P0_CTRL, 0x41, 0xff, 50}, /* GPIO_6=1 */
  305. { 0x0d, 0x42, 0xff, 50},
  306. {EM2874_R80_GPIO_P0_CTRL, 0x61, 0xff, 50}, /* GPIO_5=1 */
  307. { -1, -1, -1, -1},
  308. };
  309. static struct em28xx_reg_seq c3tech_digital_duo_digital[] = {
  310. {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 10},
  311. {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 10}, /* xc5000 reset */
  312. {EM2874_R80_GPIO_P0_CTRL, 0xf9, 0xff, 35},
  313. {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 10},
  314. {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 10},
  315. {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 10},
  316. {EM2874_R80_GPIO_P0_CTRL, 0xbe, 0xff, 10},
  317. {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 20},
  318. { -1, -1, -1, -1},
  319. };
  320. /*
  321. * 2013:0258 PCTV DVB-S2 Stick (461e)
  322. * GPIO 0 = POWER_ON
  323. * GPIO 1 = BOOST
  324. * GPIO 2 = VUV_LNB (red LED)
  325. * GPIO 3 = #EXT_12V
  326. * GPIO 4 = INT_DEM
  327. * GPIO 5 = INT_LNB
  328. * GPIO 6 = #RESET_DEM
  329. * GPIO 7 = P07_LED (green LED)
  330. */
  331. static struct em28xx_reg_seq pctv_461e[] = {
  332. {EM2874_R80_GPIO_P0_CTRL, 0x7f, 0xff, 0},
  333. {0x0d, 0xff, 0xff, 0},
  334. {EM2874_R80_GPIO_P0_CTRL, 0x3f, 0xff, 100}, /* reset demod */
  335. {EM2874_R80_GPIO_P0_CTRL, 0x7f, 0xff, 200}, /* reset demod */
  336. {0x0d, 0x42, 0xff, 0},
  337. {EM2874_R80_GPIO_P0_CTRL, 0xeb, 0xff, 0},
  338. {EM2874_R5F_TS_ENABLE, 0x84, 0x84, 0}, /* parallel? | null discard */
  339. { -1, -1, -1, -1},
  340. };
  341. #if 0
  342. static struct em28xx_reg_seq hauppauge_930c_gpio[] = {
  343. {EM2874_R80_GPIO_P0_CTRL, 0x6f, 0xff, 10},
  344. {EM2874_R80_GPIO_P0_CTRL, 0x4f, 0xff, 10}, /* xc5000 reset */
  345. {EM2874_R80_GPIO_P0_CTRL, 0x6f, 0xff, 10},
  346. {EM2874_R80_GPIO_P0_CTRL, 0x4f, 0xff, 10},
  347. { -1, -1, -1, -1},
  348. };
  349. static struct em28xx_reg_seq hauppauge_930c_digital[] = {
  350. {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 10},
  351. {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100},
  352. {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 10},
  353. { -1, -1, -1, -1},
  354. };
  355. #endif
  356. /* 1b80:e425 MaxMedia UB425-TC
  357. * 1b80:e1cc Delock 61959
  358. * GPIO_6 - demod reset, 0=active
  359. * GPIO_7 - LED, 0=active
  360. */
  361. static struct em28xx_reg_seq maxmedia_ub425_tc[] = {
  362. {EM2874_R80_GPIO_P0_CTRL, 0x83, 0xff, 100},
  363. {EM2874_R80_GPIO_P0_CTRL, 0xc3, 0xff, 100}, /* GPIO_6 = 1 */
  364. {EM2874_R80_GPIO_P0_CTRL, 0x43, 0xff, 000}, /* GPIO_7 = 0 */
  365. { -1, -1, -1, -1},
  366. };
  367. /* 2304:0242 PCTV QuatroStick (510e)
  368. * GPIO_2: decoder reset, 0=active
  369. * GPIO_4: decoder suspend, 0=active
  370. * GPIO_6: demod reset, 0=active
  371. * GPIO_7: LED, 1=active
  372. */
  373. static struct em28xx_reg_seq pctv_510e[] = {
  374. {EM2874_R80_GPIO_P0_CTRL, 0x10, 0xff, 100},
  375. {EM2874_R80_GPIO_P0_CTRL, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
  376. {EM2874_R80_GPIO_P0_CTRL, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
  377. { -1, -1, -1, -1},
  378. };
  379. /* 2013:0251 PCTV QuatroStick nano (520e)
  380. * GPIO_2: decoder reset, 0=active
  381. * GPIO_4: decoder suspend, 0=active
  382. * GPIO_6: demod reset, 0=active
  383. * GPIO_7: LED, 1=active
  384. */
  385. static struct em28xx_reg_seq pctv_520e[] = {
  386. {EM2874_R80_GPIO_P0_CTRL, 0x10, 0xff, 100},
  387. {EM2874_R80_GPIO_P0_CTRL, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
  388. {EM2874_R80_GPIO_P0_CTRL, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
  389. {EM2874_R80_GPIO_P0_CTRL, 0xd4, 0xff, 000}, /* GPIO_7 = 1 */
  390. { -1, -1, -1, -1},
  391. };
  392. /* 1ae7:9003/9004 SpeedLink Vicious And Devine Laplace webcam
  393. * reg 0x80/0x84:
  394. * GPIO_0: capturing LED, 0=on, 1=off
  395. * GPIO_2: AV mute button, 0=pressed, 1=unpressed
  396. * GPIO 3: illumination button, 0=pressed, 1=unpressed
  397. * GPIO_6: illumination/flash LED, 0=on, 1=off
  398. * reg 0x81/0x85:
  399. * GPIO_7: snapshot button, 0=pressed, 1=unpressed
  400. */
  401. static struct em28xx_reg_seq speedlink_vad_laplace_reg_seq[] = {
  402. {EM2820_R08_GPIO_CTRL, 0xf7, 0xff, 10},
  403. {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xb2, 10},
  404. { -1, -1, -1, -1},
  405. };
  406. static struct em28xx_reg_seq pctv_292e[] = {
  407. {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0},
  408. {0x0d, 0xff, 0xff, 950},
  409. {EM2874_R80_GPIO_P0_CTRL, 0xbd, 0xff, 100},
  410. {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 410},
  411. {EM2874_R80_GPIO_P0_CTRL, 0x7d, 0xff, 300},
  412. {EM2874_R80_GPIO_P0_CTRL, 0x7c, 0xff, 60},
  413. {0x0d, 0x42, 0xff, 50},
  414. {EM2874_R5F_TS_ENABLE, 0x85, 0xff, 0},
  415. {-1, -1, -1, -1},
  416. };
  417. static struct em28xx_reg_seq terratec_t2_stick_hd[] = {
  418. {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0},
  419. {0x0d, 0xff, 0xff, 600},
  420. {EM2874_R80_GPIO_P0_CTRL, 0xfc, 0xff, 10},
  421. {EM2874_R80_GPIO_P0_CTRL, 0xbc, 0xff, 100},
  422. {EM2874_R80_GPIO_P0_CTRL, 0xfc, 0xff, 100},
  423. {EM2874_R80_GPIO_P0_CTRL, 0x00, 0xff, 300},
  424. {EM2874_R80_GPIO_P0_CTRL, 0xf8, 0xff, 100},
  425. {EM2874_R80_GPIO_P0_CTRL, 0xfc, 0xff, 300},
  426. {0x0d, 0x42, 0xff, 1000},
  427. {EM2874_R5F_TS_ENABLE, 0x85, 0xff, 0},
  428. {-1, -1, -1, -1},
  429. };
  430. /*
  431. * Button definitions
  432. */
  433. static struct em28xx_button std_snapshot_button[] = {
  434. {
  435. .role = EM28XX_BUTTON_SNAPSHOT,
  436. .reg_r = EM28XX_R0C_USBSUSP,
  437. .reg_clearing = EM28XX_R0C_USBSUSP,
  438. .mask = EM28XX_R0C_USBSUSP_SNAPSHOT,
  439. .inverted = 0,
  440. },
  441. {-1, 0, 0, 0, 0},
  442. };
  443. static struct em28xx_button speedlink_vad_laplace_buttons[] = {
  444. {
  445. .role = EM28XX_BUTTON_SNAPSHOT,
  446. .reg_r = EM2874_R85_GPIO_P1_STATE,
  447. .mask = 0x80,
  448. .inverted = 1,
  449. },
  450. {
  451. .role = EM28XX_BUTTON_ILLUMINATION,
  452. .reg_r = EM2874_R84_GPIO_P0_STATE,
  453. .mask = 0x08,
  454. .inverted = 1,
  455. },
  456. {-1, 0, 0, 0, 0},
  457. };
  458. /*
  459. * LED definitions
  460. */
  461. static struct em28xx_led speedlink_vad_laplace_leds[] = {
  462. {
  463. .role = EM28XX_LED_ANALOG_CAPTURING,
  464. .gpio_reg = EM2874_R80_GPIO_P0_CTRL,
  465. .gpio_mask = 0x01,
  466. .inverted = 1,
  467. },
  468. {
  469. .role = EM28XX_LED_ILLUMINATION,
  470. .gpio_reg = EM2874_R80_GPIO_P0_CTRL,
  471. .gpio_mask = 0x40,
  472. .inverted = 1,
  473. },
  474. {-1, 0, 0, 0},
  475. };
  476. static struct em28xx_led kworld_ub435q_v3_leds[] = {
  477. {
  478. .role = EM28XX_LED_DIGITAL_CAPTURING,
  479. .gpio_reg = EM2874_R80_GPIO_P0_CTRL,
  480. .gpio_mask = 0x80,
  481. .inverted = 1,
  482. },
  483. {-1, 0, 0, 0},
  484. };
  485. static struct em28xx_led pctv_80e_leds[] = {
  486. {
  487. .role = EM28XX_LED_DIGITAL_CAPTURING,
  488. .gpio_reg = EM2874_R80_GPIO_P0_CTRL,
  489. .gpio_mask = 0x80,
  490. .inverted = 0,
  491. },
  492. {-1, 0, 0, 0},
  493. };
  494. /*
  495. * Board definitions
  496. */
  497. struct em28xx_board em28xx_boards[] = {
  498. [EM2750_BOARD_UNKNOWN] = {
  499. .name = "EM2710/EM2750/EM2751 webcam grabber",
  500. .xclk = EM28XX_XCLK_FREQUENCY_20MHZ,
  501. .tuner_type = TUNER_ABSENT,
  502. .is_webcam = 1,
  503. .input = { {
  504. .type = EM28XX_VMUX_COMPOSITE1,
  505. .vmux = 0,
  506. .amux = EM28XX_AMUX_VIDEO,
  507. .gpio = silvercrest_reg_seq,
  508. } },
  509. },
  510. [EM2800_BOARD_UNKNOWN] = {
  511. .name = "Unknown EM2800 video grabber",
  512. .is_em2800 = 1,
  513. .tda9887_conf = TDA9887_PRESENT,
  514. .decoder = EM28XX_SAA711X,
  515. .tuner_type = TUNER_ABSENT,
  516. .input = { {
  517. .type = EM28XX_VMUX_COMPOSITE1,
  518. .vmux = SAA7115_COMPOSITE0,
  519. .amux = EM28XX_AMUX_LINE_IN,
  520. }, {
  521. .type = EM28XX_VMUX_SVIDEO,
  522. .vmux = SAA7115_SVIDEO3,
  523. .amux = EM28XX_AMUX_LINE_IN,
  524. } },
  525. },
  526. [EM2820_BOARD_UNKNOWN] = {
  527. .name = "Unknown EM2750/28xx video grabber",
  528. .tuner_type = TUNER_ABSENT,
  529. .is_webcam = 1, /* To enable sensor probe */
  530. },
  531. [EM2750_BOARD_DLCW_130] = {
  532. /* Beijing Huaqi Information Digital Technology Co., Ltd */
  533. .name = "Huaqi DLCW-130",
  534. .valid = EM28XX_BOARD_NOT_VALIDATED,
  535. .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
  536. .tuner_type = TUNER_ABSENT,
  537. .is_webcam = 1,
  538. .input = { {
  539. .type = EM28XX_VMUX_COMPOSITE1,
  540. .vmux = 0,
  541. .amux = EM28XX_AMUX_VIDEO,
  542. } },
  543. },
  544. [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
  545. .name = "Kworld PVR TV 2800 RF",
  546. .tuner_type = TUNER_TEMIC_PAL,
  547. .tda9887_conf = TDA9887_PRESENT,
  548. .decoder = EM28XX_SAA711X,
  549. .input = { {
  550. .type = EM28XX_VMUX_COMPOSITE1,
  551. .vmux = SAA7115_COMPOSITE0,
  552. .amux = EM28XX_AMUX_LINE_IN,
  553. }, {
  554. .type = EM28XX_VMUX_SVIDEO,
  555. .vmux = SAA7115_SVIDEO3,
  556. .amux = EM28XX_AMUX_LINE_IN,
  557. } },
  558. },
  559. [EM2820_BOARD_GADMEI_TVR200] = {
  560. .name = "Gadmei TVR200",
  561. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  562. .tda9887_conf = TDA9887_PRESENT,
  563. .decoder = EM28XX_SAA711X,
  564. .input = { {
  565. .type = EM28XX_VMUX_TELEVISION,
  566. .vmux = SAA7115_COMPOSITE2,
  567. .amux = EM28XX_AMUX_LINE_IN,
  568. }, {
  569. .type = EM28XX_VMUX_COMPOSITE1,
  570. .vmux = SAA7115_COMPOSITE0,
  571. .amux = EM28XX_AMUX_LINE_IN,
  572. }, {
  573. .type = EM28XX_VMUX_SVIDEO,
  574. .vmux = SAA7115_SVIDEO3,
  575. .amux = EM28XX_AMUX_LINE_IN,
  576. } },
  577. },
  578. [EM2820_BOARD_TERRATEC_CINERGY_250] = {
  579. .name = "Terratec Cinergy 250 USB",
  580. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  581. .has_ir_i2c = 1,
  582. .tda9887_conf = TDA9887_PRESENT,
  583. .decoder = EM28XX_SAA711X,
  584. .input = { {
  585. .type = EM28XX_VMUX_TELEVISION,
  586. .vmux = SAA7115_COMPOSITE2,
  587. .amux = EM28XX_AMUX_VIDEO,
  588. }, {
  589. .type = EM28XX_VMUX_COMPOSITE1,
  590. .vmux = SAA7115_COMPOSITE0,
  591. .amux = EM28XX_AMUX_LINE_IN,
  592. }, {
  593. .type = EM28XX_VMUX_SVIDEO,
  594. .vmux = SAA7115_SVIDEO3,
  595. .amux = EM28XX_AMUX_LINE_IN,
  596. } },
  597. },
  598. [EM2820_BOARD_PINNACLE_USB_2] = {
  599. .name = "Pinnacle PCTV USB 2",
  600. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  601. .has_ir_i2c = 1,
  602. .tda9887_conf = TDA9887_PRESENT,
  603. .decoder = EM28XX_SAA711X,
  604. .input = { {
  605. .type = EM28XX_VMUX_TELEVISION,
  606. .vmux = SAA7115_COMPOSITE2,
  607. .amux = EM28XX_AMUX_VIDEO,
  608. }, {
  609. .type = EM28XX_VMUX_COMPOSITE1,
  610. .vmux = SAA7115_COMPOSITE0,
  611. .amux = EM28XX_AMUX_LINE_IN,
  612. }, {
  613. .type = EM28XX_VMUX_SVIDEO,
  614. .vmux = SAA7115_SVIDEO3,
  615. .amux = EM28XX_AMUX_LINE_IN,
  616. } },
  617. },
  618. [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
  619. .name = "Hauppauge WinTV USB 2",
  620. .tuner_type = TUNER_PHILIPS_FM1236_MK3,
  621. .tda9887_conf = TDA9887_PRESENT |
  622. TDA9887_PORT1_ACTIVE |
  623. TDA9887_PORT2_ACTIVE,
  624. .decoder = EM28XX_TVP5150,
  625. .has_msp34xx = 1,
  626. .has_ir_i2c = 1,
  627. .input = { {
  628. .type = EM28XX_VMUX_TELEVISION,
  629. .vmux = TVP5150_COMPOSITE0,
  630. .amux = MSP_INPUT_DEFAULT,
  631. }, {
  632. .type = EM28XX_VMUX_SVIDEO,
  633. .vmux = TVP5150_SVIDEO,
  634. .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
  635. MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
  636. } },
  637. },
  638. [EM2820_BOARD_DLINK_USB_TV] = {
  639. .name = "D-Link DUB-T210 TV Tuner",
  640. .valid = EM28XX_BOARD_NOT_VALIDATED,
  641. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  642. .tda9887_conf = TDA9887_PRESENT,
  643. .decoder = EM28XX_SAA711X,
  644. .input = { {
  645. .type = EM28XX_VMUX_TELEVISION,
  646. .vmux = SAA7115_COMPOSITE2,
  647. .amux = EM28XX_AMUX_LINE_IN,
  648. }, {
  649. .type = EM28XX_VMUX_COMPOSITE1,
  650. .vmux = SAA7115_COMPOSITE0,
  651. .amux = EM28XX_AMUX_LINE_IN,
  652. }, {
  653. .type = EM28XX_VMUX_SVIDEO,
  654. .vmux = SAA7115_SVIDEO3,
  655. .amux = EM28XX_AMUX_LINE_IN,
  656. } },
  657. },
  658. [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
  659. .name = "Hercules Smart TV USB 2.0",
  660. .valid = EM28XX_BOARD_NOT_VALIDATED,
  661. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  662. .tda9887_conf = TDA9887_PRESENT,
  663. .decoder = EM28XX_SAA711X,
  664. .input = { {
  665. .type = EM28XX_VMUX_TELEVISION,
  666. .vmux = SAA7115_COMPOSITE2,
  667. .amux = EM28XX_AMUX_LINE_IN,
  668. }, {
  669. .type = EM28XX_VMUX_COMPOSITE1,
  670. .vmux = SAA7115_COMPOSITE0,
  671. .amux = EM28XX_AMUX_LINE_IN,
  672. }, {
  673. .type = EM28XX_VMUX_SVIDEO,
  674. .vmux = SAA7115_SVIDEO3,
  675. .amux = EM28XX_AMUX_LINE_IN,
  676. } },
  677. },
  678. [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
  679. .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
  680. .valid = EM28XX_BOARD_NOT_VALIDATED,
  681. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  682. .tda9887_conf = TDA9887_PRESENT,
  683. .decoder = EM28XX_SAA711X,
  684. .input = { {
  685. .type = EM28XX_VMUX_TELEVISION,
  686. .vmux = SAA7115_COMPOSITE2,
  687. .amux = EM28XX_AMUX_VIDEO,
  688. }, {
  689. .type = EM28XX_VMUX_COMPOSITE1,
  690. .vmux = SAA7115_COMPOSITE0,
  691. .amux = EM28XX_AMUX_LINE_IN,
  692. }, {
  693. .type = EM28XX_VMUX_SVIDEO,
  694. .vmux = SAA7115_SVIDEO3,
  695. .amux = EM28XX_AMUX_LINE_IN,
  696. } },
  697. },
  698. [EM2820_BOARD_GADMEI_UTV310] = {
  699. .name = "Gadmei UTV310",
  700. .valid = EM28XX_BOARD_NOT_VALIDATED,
  701. .tuner_type = TUNER_TNF_5335MF,
  702. .tda9887_conf = TDA9887_PRESENT,
  703. .decoder = EM28XX_SAA711X,
  704. .input = { {
  705. .type = EM28XX_VMUX_TELEVISION,
  706. .vmux = SAA7115_COMPOSITE1,
  707. .amux = EM28XX_AMUX_LINE_IN,
  708. }, {
  709. .type = EM28XX_VMUX_COMPOSITE1,
  710. .vmux = SAA7115_COMPOSITE0,
  711. .amux = EM28XX_AMUX_LINE_IN,
  712. }, {
  713. .type = EM28XX_VMUX_SVIDEO,
  714. .vmux = SAA7115_SVIDEO3,
  715. .amux = EM28XX_AMUX_LINE_IN,
  716. } },
  717. },
  718. [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
  719. .name = "Leadtek Winfast USB II Deluxe",
  720. .valid = EM28XX_BOARD_NOT_VALIDATED,
  721. .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
  722. .has_ir_i2c = 1,
  723. .tvaudio_addr = 0x58,
  724. .tda9887_conf = TDA9887_PRESENT |
  725. TDA9887_PORT2_ACTIVE |
  726. TDA9887_QSS,
  727. .decoder = EM28XX_SAA711X,
  728. .adecoder = EM28XX_TVAUDIO,
  729. .input = { {
  730. .type = EM28XX_VMUX_TELEVISION,
  731. .vmux = SAA7115_COMPOSITE4,
  732. .amux = EM28XX_AMUX_AUX,
  733. }, {
  734. .type = EM28XX_VMUX_COMPOSITE1,
  735. .vmux = SAA7115_COMPOSITE5,
  736. .amux = EM28XX_AMUX_LINE_IN,
  737. }, {
  738. .type = EM28XX_VMUX_SVIDEO,
  739. .vmux = SAA7115_SVIDEO3,
  740. .amux = EM28XX_AMUX_LINE_IN,
  741. } },
  742. .radio = {
  743. .type = EM28XX_RADIO,
  744. .amux = EM28XX_AMUX_AUX,
  745. }
  746. },
  747. [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
  748. .name = "Videology 20K14XUSB USB2.0",
  749. .valid = EM28XX_BOARD_NOT_VALIDATED,
  750. .tuner_type = TUNER_ABSENT,
  751. .is_webcam = 1,
  752. .input = { {
  753. .type = EM28XX_VMUX_COMPOSITE1,
  754. .vmux = 0,
  755. .amux = EM28XX_AMUX_VIDEO,
  756. } },
  757. },
  758. [EM2820_BOARD_SILVERCREST_WEBCAM] = {
  759. .name = "Silvercrest Webcam 1.3mpix",
  760. .tuner_type = TUNER_ABSENT,
  761. .is_webcam = 1,
  762. .input = { {
  763. .type = EM28XX_VMUX_COMPOSITE1,
  764. .vmux = 0,
  765. .amux = EM28XX_AMUX_VIDEO,
  766. .gpio = silvercrest_reg_seq,
  767. } },
  768. },
  769. [EM2821_BOARD_SUPERCOMP_USB_2] = {
  770. .name = "Supercomp USB 2.0 TV",
  771. .valid = EM28XX_BOARD_NOT_VALIDATED,
  772. .tuner_type = TUNER_PHILIPS_FM1236_MK3,
  773. .tda9887_conf = TDA9887_PRESENT |
  774. TDA9887_PORT1_ACTIVE |
  775. TDA9887_PORT2_ACTIVE,
  776. .decoder = EM28XX_SAA711X,
  777. .input = { {
  778. .type = EM28XX_VMUX_TELEVISION,
  779. .vmux = SAA7115_COMPOSITE2,
  780. .amux = EM28XX_AMUX_LINE_IN,
  781. }, {
  782. .type = EM28XX_VMUX_COMPOSITE1,
  783. .vmux = SAA7115_COMPOSITE0,
  784. .amux = EM28XX_AMUX_VIDEO,
  785. }, {
  786. .type = EM28XX_VMUX_SVIDEO,
  787. .vmux = SAA7115_SVIDEO3,
  788. .amux = EM28XX_AMUX_LINE_IN,
  789. } },
  790. },
  791. [EM2821_BOARD_USBGEAR_VD204] = {
  792. .name = "Usbgear VD204v9",
  793. .valid = EM28XX_BOARD_NOT_VALIDATED,
  794. .tuner_type = TUNER_ABSENT, /* Capture only device */
  795. .decoder = EM28XX_SAA711X,
  796. .input = { {
  797. .type = EM28XX_VMUX_COMPOSITE1,
  798. .vmux = SAA7115_COMPOSITE0,
  799. .amux = EM28XX_AMUX_LINE_IN,
  800. }, {
  801. .type = EM28XX_VMUX_SVIDEO,
  802. .vmux = SAA7115_SVIDEO3,
  803. .amux = EM28XX_AMUX_LINE_IN,
  804. } },
  805. },
  806. [EM2860_BOARD_NETGMBH_CAM] = {
  807. /* Beijing Huaqi Information Digital Technology Co., Ltd */
  808. .name = "NetGMBH Cam",
  809. .valid = EM28XX_BOARD_NOT_VALIDATED,
  810. .tuner_type = TUNER_ABSENT,
  811. .is_webcam = 1,
  812. .input = { {
  813. .type = EM28XX_VMUX_COMPOSITE1,
  814. .vmux = 0,
  815. .amux = EM28XX_AMUX_VIDEO,
  816. } },
  817. },
  818. [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
  819. .name = "Typhoon DVD Maker",
  820. .decoder = EM28XX_SAA711X,
  821. .tuner_type = TUNER_ABSENT, /* Capture only device */
  822. .input = { {
  823. .type = EM28XX_VMUX_COMPOSITE1,
  824. .vmux = SAA7115_COMPOSITE0,
  825. .amux = EM28XX_AMUX_LINE_IN,
  826. }, {
  827. .type = EM28XX_VMUX_SVIDEO,
  828. .vmux = SAA7115_SVIDEO3,
  829. .amux = EM28XX_AMUX_LINE_IN,
  830. } },
  831. },
  832. [EM2860_BOARD_GADMEI_UTV330] = {
  833. .name = "Gadmei UTV330",
  834. .valid = EM28XX_BOARD_NOT_VALIDATED,
  835. .tuner_type = TUNER_TNF_5335MF,
  836. .tda9887_conf = TDA9887_PRESENT,
  837. .decoder = EM28XX_SAA711X,
  838. .input = { {
  839. .type = EM28XX_VMUX_TELEVISION,
  840. .vmux = SAA7115_COMPOSITE2,
  841. .amux = EM28XX_AMUX_VIDEO,
  842. }, {
  843. .type = EM28XX_VMUX_COMPOSITE1,
  844. .vmux = SAA7115_COMPOSITE0,
  845. .amux = EM28XX_AMUX_LINE_IN,
  846. }, {
  847. .type = EM28XX_VMUX_SVIDEO,
  848. .vmux = SAA7115_SVIDEO3,
  849. .amux = EM28XX_AMUX_LINE_IN,
  850. } },
  851. },
  852. [EM2861_BOARD_GADMEI_UTV330PLUS] = {
  853. .name = "Gadmei UTV330+",
  854. .tuner_type = TUNER_TNF_5335MF,
  855. .tda9887_conf = TDA9887_PRESENT,
  856. .ir_codes = RC_MAP_GADMEI_RM008Z,
  857. .decoder = EM28XX_SAA711X,
  858. .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
  859. .input = { {
  860. .type = EM28XX_VMUX_TELEVISION,
  861. .vmux = SAA7115_COMPOSITE2,
  862. .amux = EM28XX_AMUX_VIDEO,
  863. }, {
  864. .type = EM28XX_VMUX_COMPOSITE1,
  865. .vmux = SAA7115_COMPOSITE0,
  866. .amux = EM28XX_AMUX_LINE_IN,
  867. }, {
  868. .type = EM28XX_VMUX_SVIDEO,
  869. .vmux = SAA7115_SVIDEO3,
  870. .amux = EM28XX_AMUX_LINE_IN,
  871. } },
  872. },
  873. [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
  874. .name = "Terratec Cinergy A Hybrid XS",
  875. .valid = EM28XX_BOARD_NOT_VALIDATED,
  876. .tuner_type = TUNER_XC2028,
  877. .tuner_gpio = default_tuner_gpio,
  878. .decoder = EM28XX_TVP5150,
  879. .input = { {
  880. .type = EM28XX_VMUX_TELEVISION,
  881. .vmux = TVP5150_COMPOSITE0,
  882. .amux = EM28XX_AMUX_VIDEO,
  883. .gpio = hauppauge_wintv_hvr_900_analog,
  884. }, {
  885. .type = EM28XX_VMUX_COMPOSITE1,
  886. .vmux = TVP5150_COMPOSITE1,
  887. .amux = EM28XX_AMUX_LINE_IN,
  888. .gpio = hauppauge_wintv_hvr_900_analog,
  889. }, {
  890. .type = EM28XX_VMUX_SVIDEO,
  891. .vmux = TVP5150_SVIDEO,
  892. .amux = EM28XX_AMUX_LINE_IN,
  893. .gpio = hauppauge_wintv_hvr_900_analog,
  894. } },
  895. },
  896. [EM2861_BOARD_KWORLD_PVRTV_300U] = {
  897. .name = "KWorld PVRTV 300U",
  898. .valid = EM28XX_BOARD_NOT_VALIDATED,
  899. .tuner_type = TUNER_XC2028,
  900. .tuner_gpio = default_tuner_gpio,
  901. .decoder = EM28XX_TVP5150,
  902. .input = { {
  903. .type = EM28XX_VMUX_TELEVISION,
  904. .vmux = TVP5150_COMPOSITE0,
  905. .amux = EM28XX_AMUX_VIDEO,
  906. }, {
  907. .type = EM28XX_VMUX_COMPOSITE1,
  908. .vmux = TVP5150_COMPOSITE1,
  909. .amux = EM28XX_AMUX_LINE_IN,
  910. }, {
  911. .type = EM28XX_VMUX_SVIDEO,
  912. .vmux = TVP5150_SVIDEO,
  913. .amux = EM28XX_AMUX_LINE_IN,
  914. } },
  915. },
  916. [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
  917. .name = "Yakumo MovieMixer",
  918. .tuner_type = TUNER_ABSENT, /* Capture only device */
  919. .decoder = EM28XX_TVP5150,
  920. .input = { {
  921. .type = EM28XX_VMUX_TELEVISION,
  922. .vmux = TVP5150_COMPOSITE0,
  923. .amux = EM28XX_AMUX_VIDEO,
  924. }, {
  925. .type = EM28XX_VMUX_COMPOSITE1,
  926. .vmux = TVP5150_COMPOSITE1,
  927. .amux = EM28XX_AMUX_LINE_IN,
  928. }, {
  929. .type = EM28XX_VMUX_SVIDEO,
  930. .vmux = TVP5150_SVIDEO,
  931. .amux = EM28XX_AMUX_LINE_IN,
  932. } },
  933. },
  934. [EM2860_BOARD_TVP5150_REFERENCE_DESIGN] = {
  935. .name = "EM2860/TVP5150 Reference Design",
  936. .tuner_type = TUNER_ABSENT, /* Capture only device */
  937. .decoder = EM28XX_TVP5150,
  938. .input = { {
  939. .type = EM28XX_VMUX_COMPOSITE1,
  940. .vmux = TVP5150_COMPOSITE1,
  941. .amux = EM28XX_AMUX_LINE_IN,
  942. }, {
  943. .type = EM28XX_VMUX_SVIDEO,
  944. .vmux = TVP5150_SVIDEO,
  945. .amux = EM28XX_AMUX_LINE_IN,
  946. } },
  947. },
  948. [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
  949. .name = "Plextor ConvertX PX-TV100U",
  950. .tuner_type = TUNER_TNF_5335MF,
  951. .xclk = EM28XX_XCLK_I2S_MSB_TIMING |
  952. EM28XX_XCLK_FREQUENCY_12MHZ,
  953. .tda9887_conf = TDA9887_PRESENT,
  954. .decoder = EM28XX_TVP5150,
  955. .has_msp34xx = 1,
  956. .input = { {
  957. .type = EM28XX_VMUX_TELEVISION,
  958. .vmux = TVP5150_COMPOSITE0,
  959. .amux = EM28XX_AMUX_LINE_IN,
  960. .gpio = pinnacle_hybrid_pro_analog,
  961. }, {
  962. .type = EM28XX_VMUX_COMPOSITE1,
  963. .vmux = TVP5150_COMPOSITE1,
  964. .amux = EM28XX_AMUX_LINE_IN,
  965. .gpio = pinnacle_hybrid_pro_analog,
  966. }, {
  967. .type = EM28XX_VMUX_SVIDEO,
  968. .vmux = TVP5150_SVIDEO,
  969. .amux = EM28XX_AMUX_LINE_IN,
  970. .gpio = pinnacle_hybrid_pro_analog,
  971. } },
  972. },
  973. /* Those boards with em2870 are DVB Only*/
  974. [EM2870_BOARD_TERRATEC_XS] = {
  975. .name = "Terratec Cinergy T XS",
  976. .valid = EM28XX_BOARD_NOT_VALIDATED,
  977. .tuner_type = TUNER_XC2028,
  978. .tuner_gpio = default_tuner_gpio,
  979. },
  980. [EM2870_BOARD_TERRATEC_XS_MT2060] = {
  981. .name = "Terratec Cinergy T XS (MT2060)",
  982. .valid = EM28XX_BOARD_NOT_VALIDATED,
  983. .tuner_type = TUNER_ABSENT, /* MT2060 */
  984. },
  985. [EM2870_BOARD_KWORLD_350U] = {
  986. .name = "Kworld 350 U DVB-T",
  987. .valid = EM28XX_BOARD_NOT_VALIDATED,
  988. .tuner_type = TUNER_XC2028,
  989. .tuner_gpio = default_tuner_gpio,
  990. },
  991. [EM2870_BOARD_KWORLD_355U] = {
  992. .name = "Kworld 355 U DVB-T",
  993. .valid = EM28XX_BOARD_NOT_VALIDATED,
  994. .tuner_type = TUNER_ABSENT,
  995. .tuner_gpio = default_tuner_gpio,
  996. .has_dvb = 1,
  997. .dvb_gpio = default_digital,
  998. },
  999. [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
  1000. .name = "Pinnacle PCTV DVB-T",
  1001. .valid = EM28XX_BOARD_NOT_VALIDATED,
  1002. .tuner_type = TUNER_ABSENT, /* MT2060 */
  1003. /* djh - I have serious doubts this is right... */
  1004. .xclk = EM28XX_XCLK_IR_RC5_MODE |
  1005. EM28XX_XCLK_FREQUENCY_10MHZ,
  1006. },
  1007. [EM2870_BOARD_COMPRO_VIDEOMATE] = {
  1008. .name = "Compro, VideoMate U3",
  1009. .valid = EM28XX_BOARD_NOT_VALIDATED,
  1010. .tuner_type = TUNER_ABSENT, /* MT2060 */
  1011. },
  1012. [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
  1013. .name = "Terratec Hybrid XS Secam",
  1014. .has_msp34xx = 1,
  1015. .tuner_type = TUNER_XC2028,
  1016. .tuner_gpio = default_tuner_gpio,
  1017. .decoder = EM28XX_TVP5150,
  1018. .has_dvb = 1,
  1019. .dvb_gpio = terratec_cinergy_USB_XS_FR_digital,
  1020. .input = { {
  1021. .type = EM28XX_VMUX_TELEVISION,
  1022. .vmux = TVP5150_COMPOSITE0,
  1023. .amux = EM28XX_AMUX_VIDEO,
  1024. .gpio = terratec_cinergy_USB_XS_FR_analog,
  1025. }, {
  1026. .type = EM28XX_VMUX_COMPOSITE1,
  1027. .vmux = TVP5150_COMPOSITE1,
  1028. .amux = EM28XX_AMUX_LINE_IN,
  1029. .gpio = terratec_cinergy_USB_XS_FR_analog,
  1030. }, {
  1031. .type = EM28XX_VMUX_SVIDEO,
  1032. .vmux = TVP5150_SVIDEO,
  1033. .amux = EM28XX_AMUX_LINE_IN,
  1034. .gpio = terratec_cinergy_USB_XS_FR_analog,
  1035. } },
  1036. },
  1037. [EM2884_BOARD_TERRATEC_H5] = {
  1038. .name = "Terratec Cinergy H5",
  1039. .has_dvb = 1,
  1040. #if 0
  1041. .tuner_type = TUNER_PHILIPS_TDA8290,
  1042. .tuner_addr = 0x41,
  1043. .dvb_gpio = terratec_h5_digital, /* FIXME: probably wrong */
  1044. .tuner_gpio = terratec_h5_gpio,
  1045. #else
  1046. .tuner_type = TUNER_ABSENT,
  1047. #endif
  1048. .def_i2c_bus = 1,
  1049. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  1050. EM28XX_I2C_FREQ_400_KHZ,
  1051. },
  1052. [EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C] = {
  1053. .name = "Hauppauge WinTV HVR 930C",
  1054. .has_dvb = 1,
  1055. #if 0 /* FIXME: Add analog support */
  1056. .tuner_type = TUNER_XC5000,
  1057. .tuner_addr = 0x41,
  1058. .dvb_gpio = hauppauge_930c_digital,
  1059. .tuner_gpio = hauppauge_930c_gpio,
  1060. #else
  1061. .tuner_type = TUNER_ABSENT,
  1062. #endif
  1063. .ir_codes = RC_MAP_HAUPPAUGE,
  1064. .def_i2c_bus = 1,
  1065. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  1066. EM28XX_I2C_FREQ_400_KHZ,
  1067. },
  1068. [EM2884_BOARD_C3TECH_DIGITAL_DUO] = {
  1069. .name = "C3 Tech Digital Duo HDTV/SDTV USB",
  1070. .has_dvb = 1,
  1071. /* FIXME: Add analog support - need a saa7136 driver */
  1072. .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
  1073. .ir_codes = RC_MAP_EMPTY,
  1074. .def_i2c_bus = 1,
  1075. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
  1076. .dvb_gpio = c3tech_digital_duo_digital,
  1077. },
  1078. [EM2884_BOARD_CINERGY_HTC_STICK] = {
  1079. .name = "Terratec Cinergy HTC Stick",
  1080. .has_dvb = 1,
  1081. .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
  1082. .tuner_type = TUNER_ABSENT,
  1083. .def_i2c_bus = 1,
  1084. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  1085. EM28XX_I2C_FREQ_400_KHZ,
  1086. },
  1087. [EM2884_BOARD_ELGATO_EYETV_HYBRID_2008] = {
  1088. .name = "Elgato EyeTV Hybrid 2008 INT",
  1089. .has_dvb = 1,
  1090. .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
  1091. .tuner_type = TUNER_ABSENT,
  1092. .def_i2c_bus = 1,
  1093. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  1094. EM28XX_I2C_FREQ_400_KHZ,
  1095. },
  1096. [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
  1097. .name = "Hauppauge WinTV HVR 900",
  1098. .tda9887_conf = TDA9887_PRESENT,
  1099. .tuner_type = TUNER_XC2028,
  1100. .tuner_gpio = default_tuner_gpio,
  1101. .mts_firmware = 1,
  1102. .has_dvb = 1,
  1103. .dvb_gpio = hauppauge_wintv_hvr_900_digital,
  1104. .ir_codes = RC_MAP_HAUPPAUGE,
  1105. .decoder = EM28XX_TVP5150,
  1106. .input = { {
  1107. .type = EM28XX_VMUX_TELEVISION,
  1108. .vmux = TVP5150_COMPOSITE0,
  1109. .amux = EM28XX_AMUX_VIDEO,
  1110. .gpio = hauppauge_wintv_hvr_900_analog,
  1111. }, {
  1112. .type = EM28XX_VMUX_COMPOSITE1,
  1113. .vmux = TVP5150_COMPOSITE1,
  1114. .amux = EM28XX_AMUX_LINE_IN,
  1115. .gpio = hauppauge_wintv_hvr_900_analog,
  1116. }, {
  1117. .type = EM28XX_VMUX_SVIDEO,
  1118. .vmux = TVP5150_SVIDEO,
  1119. .amux = EM28XX_AMUX_LINE_IN,
  1120. .gpio = hauppauge_wintv_hvr_900_analog,
  1121. } },
  1122. },
  1123. [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
  1124. .name = "Hauppauge WinTV HVR 900 (R2)",
  1125. .tda9887_conf = TDA9887_PRESENT,
  1126. .tuner_type = TUNER_XC2028,
  1127. .tuner_gpio = default_tuner_gpio,
  1128. .mts_firmware = 1,
  1129. .has_dvb = 1,
  1130. .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
  1131. .ir_codes = RC_MAP_HAUPPAUGE,
  1132. .decoder = EM28XX_TVP5150,
  1133. .input = { {
  1134. .type = EM28XX_VMUX_TELEVISION,
  1135. .vmux = TVP5150_COMPOSITE0,
  1136. .amux = EM28XX_AMUX_VIDEO,
  1137. .gpio = hauppauge_wintv_hvr_900_analog,
  1138. }, {
  1139. .type = EM28XX_VMUX_COMPOSITE1,
  1140. .vmux = TVP5150_COMPOSITE1,
  1141. .amux = EM28XX_AMUX_LINE_IN,
  1142. .gpio = hauppauge_wintv_hvr_900_analog,
  1143. }, {
  1144. .type = EM28XX_VMUX_SVIDEO,
  1145. .vmux = TVP5150_SVIDEO,
  1146. .amux = EM28XX_AMUX_LINE_IN,
  1147. .gpio = hauppauge_wintv_hvr_900_analog,
  1148. } },
  1149. },
  1150. [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = {
  1151. .name = "Hauppauge WinTV HVR 850",
  1152. .tuner_type = TUNER_XC2028,
  1153. .tuner_gpio = default_tuner_gpio,
  1154. .mts_firmware = 1,
  1155. .has_dvb = 1,
  1156. .dvb_gpio = hauppauge_wintv_hvr_900_digital,
  1157. .ir_codes = RC_MAP_HAUPPAUGE,
  1158. .decoder = EM28XX_TVP5150,
  1159. .input = { {
  1160. .type = EM28XX_VMUX_TELEVISION,
  1161. .vmux = TVP5150_COMPOSITE0,
  1162. .amux = EM28XX_AMUX_VIDEO,
  1163. .gpio = hauppauge_wintv_hvr_900_analog,
  1164. }, {
  1165. .type = EM28XX_VMUX_COMPOSITE1,
  1166. .vmux = TVP5150_COMPOSITE1,
  1167. .amux = EM28XX_AMUX_LINE_IN,
  1168. .gpio = hauppauge_wintv_hvr_900_analog,
  1169. }, {
  1170. .type = EM28XX_VMUX_SVIDEO,
  1171. .vmux = TVP5150_SVIDEO,
  1172. .amux = EM28XX_AMUX_LINE_IN,
  1173. .gpio = hauppauge_wintv_hvr_900_analog,
  1174. } },
  1175. },
  1176. [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
  1177. .name = "Hauppauge WinTV HVR 950",
  1178. .tuner_type = TUNER_XC2028,
  1179. .tuner_gpio = default_tuner_gpio,
  1180. .mts_firmware = 1,
  1181. .has_dvb = 1,
  1182. .dvb_gpio = hauppauge_wintv_hvr_900_digital,
  1183. .ir_codes = RC_MAP_HAUPPAUGE,
  1184. .decoder = EM28XX_TVP5150,
  1185. .input = { {
  1186. .type = EM28XX_VMUX_TELEVISION,
  1187. .vmux = TVP5150_COMPOSITE0,
  1188. .amux = EM28XX_AMUX_VIDEO,
  1189. .gpio = hauppauge_wintv_hvr_900_analog,
  1190. }, {
  1191. .type = EM28XX_VMUX_COMPOSITE1,
  1192. .vmux = TVP5150_COMPOSITE1,
  1193. .amux = EM28XX_AMUX_LINE_IN,
  1194. .gpio = hauppauge_wintv_hvr_900_analog,
  1195. }, {
  1196. .type = EM28XX_VMUX_SVIDEO,
  1197. .vmux = TVP5150_SVIDEO,
  1198. .amux = EM28XX_AMUX_LINE_IN,
  1199. .gpio = hauppauge_wintv_hvr_900_analog,
  1200. } },
  1201. },
  1202. [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
  1203. .name = "Pinnacle PCTV HD Pro Stick",
  1204. .tuner_type = TUNER_XC2028,
  1205. .tuner_gpio = default_tuner_gpio,
  1206. .mts_firmware = 1,
  1207. .has_dvb = 1,
  1208. .dvb_gpio = hauppauge_wintv_hvr_900_digital,
  1209. .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
  1210. .decoder = EM28XX_TVP5150,
  1211. .input = { {
  1212. .type = EM28XX_VMUX_TELEVISION,
  1213. .vmux = TVP5150_COMPOSITE0,
  1214. .amux = EM28XX_AMUX_VIDEO,
  1215. .gpio = hauppauge_wintv_hvr_900_analog,
  1216. }, {
  1217. .type = EM28XX_VMUX_COMPOSITE1,
  1218. .vmux = TVP5150_COMPOSITE1,
  1219. .amux = EM28XX_AMUX_LINE_IN,
  1220. .gpio = hauppauge_wintv_hvr_900_analog,
  1221. }, {
  1222. .type = EM28XX_VMUX_SVIDEO,
  1223. .vmux = TVP5150_SVIDEO,
  1224. .amux = EM28XX_AMUX_LINE_IN,
  1225. .gpio = hauppauge_wintv_hvr_900_analog,
  1226. } },
  1227. },
  1228. [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
  1229. .name = "AMD ATI TV Wonder HD 600",
  1230. .tuner_type = TUNER_XC2028,
  1231. .tuner_gpio = default_tuner_gpio,
  1232. .mts_firmware = 1,
  1233. .has_dvb = 1,
  1234. .dvb_gpio = hauppauge_wintv_hvr_900_digital,
  1235. .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600,
  1236. .decoder = EM28XX_TVP5150,
  1237. .input = { {
  1238. .type = EM28XX_VMUX_TELEVISION,
  1239. .vmux = TVP5150_COMPOSITE0,
  1240. .amux = EM28XX_AMUX_VIDEO,
  1241. .gpio = hauppauge_wintv_hvr_900_analog,
  1242. }, {
  1243. .type = EM28XX_VMUX_COMPOSITE1,
  1244. .vmux = TVP5150_COMPOSITE1,
  1245. .amux = EM28XX_AMUX_LINE_IN,
  1246. .gpio = hauppauge_wintv_hvr_900_analog,
  1247. }, {
  1248. .type = EM28XX_VMUX_SVIDEO,
  1249. .vmux = TVP5150_SVIDEO,
  1250. .amux = EM28XX_AMUX_LINE_IN,
  1251. .gpio = hauppauge_wintv_hvr_900_analog,
  1252. } },
  1253. },
  1254. [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
  1255. .name = "Terratec Hybrid XS",
  1256. .tuner_type = TUNER_XC2028,
  1257. .tuner_gpio = default_tuner_gpio,
  1258. .decoder = EM28XX_TVP5150,
  1259. .has_dvb = 1,
  1260. .dvb_gpio = default_digital,
  1261. .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
  1262. .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
  1263. .input = { {
  1264. .type = EM28XX_VMUX_TELEVISION,
  1265. .vmux = TVP5150_COMPOSITE0,
  1266. .amux = EM28XX_AMUX_VIDEO,
  1267. .gpio = default_analog,
  1268. }, {
  1269. .type = EM28XX_VMUX_COMPOSITE1,
  1270. .vmux = TVP5150_COMPOSITE1,
  1271. .amux = EM28XX_AMUX_LINE_IN,
  1272. .gpio = default_analog,
  1273. }, {
  1274. .type = EM28XX_VMUX_SVIDEO,
  1275. .vmux = TVP5150_SVIDEO,
  1276. .amux = EM28XX_AMUX_LINE_IN,
  1277. .gpio = default_analog,
  1278. } },
  1279. },
  1280. /* maybe there's a reason behind it why Terratec sells the Hybrid XS
  1281. as Prodigy XS with a different PID, let's keep it separated for now
  1282. maybe we'll need it lateron */
  1283. [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
  1284. .name = "Terratec Prodigy XS",
  1285. .tuner_type = TUNER_XC2028,
  1286. .tuner_gpio = default_tuner_gpio,
  1287. .decoder = EM28XX_TVP5150,
  1288. .input = { {
  1289. .type = EM28XX_VMUX_TELEVISION,
  1290. .vmux = TVP5150_COMPOSITE0,
  1291. .amux = EM28XX_AMUX_VIDEO,
  1292. .gpio = hauppauge_wintv_hvr_900_analog,
  1293. }, {
  1294. .type = EM28XX_VMUX_COMPOSITE1,
  1295. .vmux = TVP5150_COMPOSITE1,
  1296. .amux = EM28XX_AMUX_LINE_IN,
  1297. .gpio = hauppauge_wintv_hvr_900_analog,
  1298. }, {
  1299. .type = EM28XX_VMUX_SVIDEO,
  1300. .vmux = TVP5150_SVIDEO,
  1301. .amux = EM28XX_AMUX_LINE_IN,
  1302. .gpio = hauppauge_wintv_hvr_900_analog,
  1303. } },
  1304. },
  1305. [EM2820_BOARD_MSI_VOX_USB_2] = {
  1306. .name = "MSI VOX USB 2.0",
  1307. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  1308. .tda9887_conf = TDA9887_PRESENT |
  1309. TDA9887_PORT1_ACTIVE |
  1310. TDA9887_PORT2_ACTIVE,
  1311. .max_range_640_480 = 1,
  1312. .decoder = EM28XX_SAA711X,
  1313. .input = { {
  1314. .type = EM28XX_VMUX_TELEVISION,
  1315. .vmux = SAA7115_COMPOSITE4,
  1316. .amux = EM28XX_AMUX_VIDEO,
  1317. }, {
  1318. .type = EM28XX_VMUX_COMPOSITE1,
  1319. .vmux = SAA7115_COMPOSITE0,
  1320. .amux = EM28XX_AMUX_LINE_IN,
  1321. }, {
  1322. .type = EM28XX_VMUX_SVIDEO,
  1323. .vmux = SAA7115_SVIDEO3,
  1324. .amux = EM28XX_AMUX_LINE_IN,
  1325. } },
  1326. },
  1327. [EM2800_BOARD_TERRATEC_CINERGY_200] = {
  1328. .name = "Terratec Cinergy 200 USB",
  1329. .is_em2800 = 1,
  1330. .has_ir_i2c = 1,
  1331. .tuner_type = TUNER_LG_TALN,
  1332. .tda9887_conf = TDA9887_PRESENT,
  1333. .decoder = EM28XX_SAA711X,
  1334. .input = { {
  1335. .type = EM28XX_VMUX_TELEVISION,
  1336. .vmux = SAA7115_COMPOSITE2,
  1337. .amux = EM28XX_AMUX_VIDEO,
  1338. }, {
  1339. .type = EM28XX_VMUX_COMPOSITE1,
  1340. .vmux = SAA7115_COMPOSITE0,
  1341. .amux = EM28XX_AMUX_LINE_IN,
  1342. }, {
  1343. .type = EM28XX_VMUX_SVIDEO,
  1344. .vmux = SAA7115_SVIDEO3,
  1345. .amux = EM28XX_AMUX_LINE_IN,
  1346. } },
  1347. },
  1348. [EM2800_BOARD_GRABBEEX_USB2800] = {
  1349. .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
  1350. .is_em2800 = 1,
  1351. .decoder = EM28XX_SAA711X,
  1352. .tuner_type = TUNER_ABSENT, /* capture only board */
  1353. .input = { {
  1354. .type = EM28XX_VMUX_COMPOSITE1,
  1355. .vmux = SAA7115_COMPOSITE0,
  1356. .amux = EM28XX_AMUX_LINE_IN,
  1357. }, {
  1358. .type = EM28XX_VMUX_SVIDEO,
  1359. .vmux = SAA7115_SVIDEO3,
  1360. .amux = EM28XX_AMUX_LINE_IN,
  1361. } },
  1362. },
  1363. [EM2800_BOARD_VC211A] = {
  1364. .name = "Actionmaster/LinXcel/Digitus VC211A",
  1365. .is_em2800 = 1,
  1366. .tuner_type = TUNER_ABSENT, /* Capture-only board */
  1367. .decoder = EM28XX_SAA711X,
  1368. .input = { {
  1369. .type = EM28XX_VMUX_COMPOSITE1,
  1370. .vmux = SAA7115_COMPOSITE0,
  1371. .amux = EM28XX_AMUX_LINE_IN,
  1372. .gpio = vc211a_enable,
  1373. }, {
  1374. .type = EM28XX_VMUX_SVIDEO,
  1375. .vmux = SAA7115_SVIDEO3,
  1376. .amux = EM28XX_AMUX_LINE_IN,
  1377. .gpio = vc211a_enable,
  1378. } },
  1379. },
  1380. [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
  1381. .name = "Leadtek Winfast USB II",
  1382. .is_em2800 = 1,
  1383. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  1384. .tda9887_conf = TDA9887_PRESENT,
  1385. .decoder = EM28XX_SAA711X,
  1386. .input = { {
  1387. .type = EM28XX_VMUX_TELEVISION,
  1388. .vmux = SAA7115_COMPOSITE2,
  1389. .amux = EM28XX_AMUX_VIDEO,
  1390. }, {
  1391. .type = EM28XX_VMUX_COMPOSITE1,
  1392. .vmux = SAA7115_COMPOSITE0,
  1393. .amux = EM28XX_AMUX_LINE_IN,
  1394. }, {
  1395. .type = EM28XX_VMUX_SVIDEO,
  1396. .vmux = SAA7115_SVIDEO3,
  1397. .amux = EM28XX_AMUX_LINE_IN,
  1398. } },
  1399. },
  1400. [EM2800_BOARD_KWORLD_USB2800] = {
  1401. .name = "Kworld USB2800",
  1402. .is_em2800 = 1,
  1403. .tuner_type = TUNER_PHILIPS_FCV1236D,
  1404. .tda9887_conf = TDA9887_PRESENT,
  1405. .decoder = EM28XX_SAA711X,
  1406. .input = { {
  1407. .type = EM28XX_VMUX_TELEVISION,
  1408. .vmux = SAA7115_COMPOSITE2,
  1409. .amux = EM28XX_AMUX_VIDEO,
  1410. }, {
  1411. .type = EM28XX_VMUX_COMPOSITE1,
  1412. .vmux = SAA7115_COMPOSITE0,
  1413. .amux = EM28XX_AMUX_LINE_IN,
  1414. }, {
  1415. .type = EM28XX_VMUX_SVIDEO,
  1416. .vmux = SAA7115_SVIDEO3,
  1417. .amux = EM28XX_AMUX_LINE_IN,
  1418. } },
  1419. },
  1420. [EM2820_BOARD_PINNACLE_DVC_90] = {
  1421. .name = "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker "
  1422. "/ Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U",
  1423. .tuner_type = TUNER_ABSENT, /* capture only board */
  1424. .decoder = EM28XX_SAA711X,
  1425. .input = { {
  1426. .type = EM28XX_VMUX_COMPOSITE1,
  1427. .vmux = SAA7115_COMPOSITE0,
  1428. .amux = EM28XX_AMUX_LINE_IN,
  1429. }, {
  1430. .type = EM28XX_VMUX_SVIDEO,
  1431. .vmux = SAA7115_SVIDEO3,
  1432. .amux = EM28XX_AMUX_LINE_IN,
  1433. } },
  1434. },
  1435. [EM2800_BOARD_VGEAR_POCKETTV] = {
  1436. .name = "V-Gear PocketTV",
  1437. .is_em2800 = 1,
  1438. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  1439. .tda9887_conf = TDA9887_PRESENT,
  1440. .decoder = EM28XX_SAA711X,
  1441. .input = { {
  1442. .type = EM28XX_VMUX_TELEVISION,
  1443. .vmux = SAA7115_COMPOSITE2,
  1444. .amux = EM28XX_AMUX_VIDEO,
  1445. }, {
  1446. .type = EM28XX_VMUX_COMPOSITE1,
  1447. .vmux = SAA7115_COMPOSITE0,
  1448. .amux = EM28XX_AMUX_LINE_IN,
  1449. }, {
  1450. .type = EM28XX_VMUX_SVIDEO,
  1451. .vmux = SAA7115_SVIDEO3,
  1452. .amux = EM28XX_AMUX_LINE_IN,
  1453. } },
  1454. },
  1455. [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = {
  1456. .name = "Pixelview PlayTV Box 4 USB 2.0",
  1457. .tda9887_conf = TDA9887_PRESENT,
  1458. .tuner_type = TUNER_YMEC_TVF_5533MF,
  1459. .decoder = EM28XX_SAA711X,
  1460. .input = { {
  1461. .type = EM28XX_VMUX_TELEVISION,
  1462. .vmux = SAA7115_COMPOSITE2,
  1463. .amux = EM28XX_AMUX_VIDEO,
  1464. .aout = EM28XX_AOUT_MONO | /* I2S */
  1465. EM28XX_AOUT_MASTER, /* Line out pin */
  1466. }, {
  1467. .type = EM28XX_VMUX_COMPOSITE1,
  1468. .vmux = SAA7115_COMPOSITE0,
  1469. .amux = EM28XX_AMUX_LINE_IN,
  1470. }, {
  1471. .type = EM28XX_VMUX_SVIDEO,
  1472. .vmux = SAA7115_SVIDEO3,
  1473. .amux = EM28XX_AMUX_LINE_IN,
  1474. } },
  1475. },
  1476. [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
  1477. .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
  1478. .buttons = std_snapshot_button,
  1479. .tda9887_conf = TDA9887_PRESENT,
  1480. .tuner_type = TUNER_YMEC_TVF_5533MF,
  1481. .decoder = EM28XX_SAA711X,
  1482. .input = { {
  1483. .type = EM28XX_VMUX_TELEVISION,
  1484. .vmux = SAA7115_COMPOSITE2,
  1485. .amux = EM28XX_AMUX_VIDEO,
  1486. .aout = EM28XX_AOUT_MONO | /* I2S */
  1487. EM28XX_AOUT_MASTER, /* Line out pin */
  1488. }, {
  1489. .type = EM28XX_VMUX_COMPOSITE1,
  1490. .vmux = SAA7115_COMPOSITE0,
  1491. .amux = EM28XX_AMUX_LINE_IN,
  1492. }, {
  1493. .type = EM28XX_VMUX_SVIDEO,
  1494. .vmux = SAA7115_SVIDEO3,
  1495. .amux = EM28XX_AMUX_LINE_IN,
  1496. } },
  1497. },
  1498. [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = {
  1499. .name = "EM2860/SAA711X Reference Design",
  1500. .buttons = std_snapshot_button,
  1501. .tuner_type = TUNER_ABSENT,
  1502. .decoder = EM28XX_SAA711X,
  1503. .input = { {
  1504. .type = EM28XX_VMUX_SVIDEO,
  1505. .vmux = SAA7115_SVIDEO3,
  1506. }, {
  1507. .type = EM28XX_VMUX_COMPOSITE1,
  1508. .vmux = SAA7115_COMPOSITE0,
  1509. } },
  1510. },
  1511. [EM2874_BOARD_LEADERSHIP_ISDBT] = {
  1512. .def_i2c_bus = 1,
  1513. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  1514. EM28XX_I2C_FREQ_100_KHZ,
  1515. .xclk = EM28XX_XCLK_FREQUENCY_10MHZ,
  1516. .name = "EM2874 Leadership ISDBT",
  1517. .tuner_type = TUNER_ABSENT,
  1518. .tuner_gpio = leadership_reset,
  1519. .dvb_gpio = leadership_digital,
  1520. .has_dvb = 1,
  1521. },
  1522. [EM2880_BOARD_MSI_DIGIVOX_AD] = {
  1523. .name = "MSI DigiVox A/D",
  1524. .valid = EM28XX_BOARD_NOT_VALIDATED,
  1525. .tuner_type = TUNER_XC2028,
  1526. .tuner_gpio = default_tuner_gpio,
  1527. .decoder = EM28XX_TVP5150,
  1528. .input = { {
  1529. .type = EM28XX_VMUX_TELEVISION,
  1530. .vmux = TVP5150_COMPOSITE0,
  1531. .amux = EM28XX_AMUX_VIDEO,
  1532. .gpio = em2880_msi_digivox_ad_analog,
  1533. }, {
  1534. .type = EM28XX_VMUX_COMPOSITE1,
  1535. .vmux = TVP5150_COMPOSITE1,
  1536. .amux = EM28XX_AMUX_LINE_IN,
  1537. .gpio = em2880_msi_digivox_ad_analog,
  1538. }, {
  1539. .type = EM28XX_VMUX_SVIDEO,
  1540. .vmux = TVP5150_SVIDEO,
  1541. .amux = EM28XX_AMUX_LINE_IN,
  1542. .gpio = em2880_msi_digivox_ad_analog,
  1543. } },
  1544. },
  1545. [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
  1546. .name = "MSI DigiVox A/D II",
  1547. .valid = EM28XX_BOARD_NOT_VALIDATED,
  1548. .tuner_type = TUNER_XC2028,
  1549. .tuner_gpio = default_tuner_gpio,
  1550. .decoder = EM28XX_TVP5150,
  1551. .input = { {
  1552. .type = EM28XX_VMUX_TELEVISION,
  1553. .vmux = TVP5150_COMPOSITE0,
  1554. .amux = EM28XX_AMUX_VIDEO,
  1555. .gpio = em2880_msi_digivox_ad_analog,
  1556. }, {
  1557. .type = EM28XX_VMUX_COMPOSITE1,
  1558. .vmux = TVP5150_COMPOSITE1,
  1559. .amux = EM28XX_AMUX_LINE_IN,
  1560. .gpio = em2880_msi_digivox_ad_analog,
  1561. }, {
  1562. .type = EM28XX_VMUX_SVIDEO,
  1563. .vmux = TVP5150_SVIDEO,
  1564. .amux = EM28XX_AMUX_LINE_IN,
  1565. .gpio = em2880_msi_digivox_ad_analog,
  1566. } },
  1567. },
  1568. [EM2880_BOARD_KWORLD_DVB_305U] = {
  1569. .name = "KWorld DVB-T 305U",
  1570. .tuner_type = TUNER_XC2028,
  1571. .tuner_gpio = default_tuner_gpio,
  1572. .decoder = EM28XX_TVP5150,
  1573. .input = { {
  1574. .type = EM28XX_VMUX_TELEVISION,
  1575. .vmux = TVP5150_COMPOSITE0,
  1576. .amux = EM28XX_AMUX_VIDEO,
  1577. }, {
  1578. .type = EM28XX_VMUX_COMPOSITE1,
  1579. .vmux = TVP5150_COMPOSITE1,
  1580. .amux = EM28XX_AMUX_LINE_IN,
  1581. }, {
  1582. .type = EM28XX_VMUX_SVIDEO,
  1583. .vmux = TVP5150_SVIDEO,
  1584. .amux = EM28XX_AMUX_LINE_IN,
  1585. } },
  1586. },
  1587. [EM2880_BOARD_KWORLD_DVB_310U] = {
  1588. .name = "KWorld DVB-T 310U",
  1589. .tuner_type = TUNER_XC2028,
  1590. .tuner_gpio = default_tuner_gpio,
  1591. .has_dvb = 1,
  1592. .dvb_gpio = default_digital,
  1593. .mts_firmware = 1,
  1594. .decoder = EM28XX_TVP5150,
  1595. .input = { {
  1596. .type = EM28XX_VMUX_TELEVISION,
  1597. .vmux = TVP5150_COMPOSITE0,
  1598. .amux = EM28XX_AMUX_VIDEO,
  1599. .gpio = default_analog,
  1600. }, {
  1601. .type = EM28XX_VMUX_COMPOSITE1,
  1602. .vmux = TVP5150_COMPOSITE1,
  1603. .amux = EM28XX_AMUX_LINE_IN,
  1604. .gpio = default_analog,
  1605. }, { /* S-video has not been tested yet */
  1606. .type = EM28XX_VMUX_SVIDEO,
  1607. .vmux = TVP5150_SVIDEO,
  1608. .amux = EM28XX_AMUX_LINE_IN,
  1609. .gpio = default_analog,
  1610. } },
  1611. },
  1612. [EM2882_BOARD_KWORLD_ATSC_315U] = {
  1613. .name = "KWorld ATSC 315U HDTV TV Box",
  1614. .valid = EM28XX_BOARD_NOT_VALIDATED,
  1615. .tuner_type = TUNER_THOMSON_DTT761X,
  1616. .tuner_gpio = em2882_kworld_315u_tuner_gpio,
  1617. .tda9887_conf = TDA9887_PRESENT,
  1618. .decoder = EM28XX_SAA711X,
  1619. .has_dvb = 1,
  1620. .dvb_gpio = em2882_kworld_315u_digital,
  1621. .ir_codes = RC_MAP_KWORLD_315U,
  1622. .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
  1623. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
  1624. /* Analog mode - still not ready */
  1625. /*.input = { {
  1626. .type = EM28XX_VMUX_TELEVISION,
  1627. .vmux = SAA7115_COMPOSITE2,
  1628. .amux = EM28XX_AMUX_VIDEO,
  1629. .gpio = em2882_kworld_315u_analog,
  1630. .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
  1631. }, {
  1632. .type = EM28XX_VMUX_COMPOSITE1,
  1633. .vmux = SAA7115_COMPOSITE0,
  1634. .amux = EM28XX_AMUX_LINE_IN,
  1635. .gpio = em2882_kworld_315u_analog1,
  1636. .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
  1637. }, {
  1638. .type = EM28XX_VMUX_SVIDEO,
  1639. .vmux = SAA7115_SVIDEO3,
  1640. .amux = EM28XX_AMUX_LINE_IN,
  1641. .gpio = em2882_kworld_315u_analog1,
  1642. .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
  1643. } }, */
  1644. },
  1645. [EM2880_BOARD_EMPIRE_DUAL_TV] = {
  1646. .name = "Empire dual TV",
  1647. .tuner_type = TUNER_XC2028,
  1648. .tuner_gpio = default_tuner_gpio,
  1649. .has_dvb = 1,
  1650. .dvb_gpio = default_digital,
  1651. .mts_firmware = 1,
  1652. .decoder = EM28XX_TVP5150,
  1653. .input = { {
  1654. .type = EM28XX_VMUX_TELEVISION,
  1655. .vmux = TVP5150_COMPOSITE0,
  1656. .amux = EM28XX_AMUX_VIDEO,
  1657. .gpio = default_analog,
  1658. }, {
  1659. .type = EM28XX_VMUX_COMPOSITE1,
  1660. .vmux = TVP5150_COMPOSITE1,
  1661. .amux = EM28XX_AMUX_LINE_IN,
  1662. .gpio = default_analog,
  1663. }, {
  1664. .type = EM28XX_VMUX_SVIDEO,
  1665. .vmux = TVP5150_SVIDEO,
  1666. .amux = EM28XX_AMUX_LINE_IN,
  1667. .gpio = default_analog,
  1668. } },
  1669. },
  1670. [EM2881_BOARD_DNT_DA2_HYBRID] = {
  1671. .name = "DNT DA2 Hybrid",
  1672. .valid = EM28XX_BOARD_NOT_VALIDATED,
  1673. .tuner_type = TUNER_XC2028,
  1674. .tuner_gpio = default_tuner_gpio,
  1675. .decoder = EM28XX_TVP5150,
  1676. .input = { {
  1677. .type = EM28XX_VMUX_TELEVISION,
  1678. .vmux = TVP5150_COMPOSITE0,
  1679. .amux = EM28XX_AMUX_VIDEO,
  1680. .gpio = default_analog,
  1681. }, {
  1682. .type = EM28XX_VMUX_COMPOSITE1,
  1683. .vmux = TVP5150_COMPOSITE1,
  1684. .amux = EM28XX_AMUX_LINE_IN,
  1685. .gpio = default_analog,
  1686. }, {
  1687. .type = EM28XX_VMUX_SVIDEO,
  1688. .vmux = TVP5150_SVIDEO,
  1689. .amux = EM28XX_AMUX_LINE_IN,
  1690. .gpio = default_analog,
  1691. } },
  1692. },
  1693. [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
  1694. .name = "Pinnacle Hybrid Pro",
  1695. .tuner_type = TUNER_XC2028,
  1696. .tuner_gpio = default_tuner_gpio,
  1697. .decoder = EM28XX_TVP5150,
  1698. .has_dvb = 1,
  1699. .dvb_gpio = pinnacle_hybrid_pro_digital,
  1700. .input = { {
  1701. .type = EM28XX_VMUX_TELEVISION,
  1702. .vmux = TVP5150_COMPOSITE0,
  1703. .amux = EM28XX_AMUX_VIDEO,
  1704. .gpio = pinnacle_hybrid_pro_analog,
  1705. }, {
  1706. .type = EM28XX_VMUX_COMPOSITE1,
  1707. .vmux = TVP5150_COMPOSITE1,
  1708. .amux = EM28XX_AMUX_LINE_IN,
  1709. .gpio = pinnacle_hybrid_pro_analog,
  1710. }, {
  1711. .type = EM28XX_VMUX_SVIDEO,
  1712. .vmux = TVP5150_SVIDEO,
  1713. .amux = EM28XX_AMUX_LINE_IN,
  1714. .gpio = pinnacle_hybrid_pro_analog,
  1715. } },
  1716. },
  1717. [EM2882_BOARD_PINNACLE_HYBRID_PRO_330E] = {
  1718. .name = "Pinnacle Hybrid Pro (330e)",
  1719. .tuner_type = TUNER_XC2028,
  1720. .tuner_gpio = default_tuner_gpio,
  1721. .mts_firmware = 1,
  1722. .has_dvb = 1,
  1723. .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
  1724. .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
  1725. .decoder = EM28XX_TVP5150,
  1726. .input = { {
  1727. .type = EM28XX_VMUX_TELEVISION,
  1728. .vmux = TVP5150_COMPOSITE0,
  1729. .amux = EM28XX_AMUX_VIDEO,
  1730. .gpio = hauppauge_wintv_hvr_900_analog,
  1731. }, {
  1732. .type = EM28XX_VMUX_COMPOSITE1,
  1733. .vmux = TVP5150_COMPOSITE1,
  1734. .amux = EM28XX_AMUX_LINE_IN,
  1735. .gpio = hauppauge_wintv_hvr_900_analog,
  1736. }, {
  1737. .type = EM28XX_VMUX_SVIDEO,
  1738. .vmux = TVP5150_SVIDEO,
  1739. .amux = EM28XX_AMUX_LINE_IN,
  1740. .gpio = hauppauge_wintv_hvr_900_analog,
  1741. } },
  1742. },
  1743. [EM2882_BOARD_KWORLD_VS_DVBT] = {
  1744. .name = "Kworld VS-DVB-T 323UR",
  1745. .tuner_type = TUNER_XC2028,
  1746. .tuner_gpio = default_tuner_gpio,
  1747. .decoder = EM28XX_TVP5150,
  1748. .mts_firmware = 1,
  1749. .has_dvb = 1,
  1750. .dvb_gpio = kworld_330u_digital,
  1751. .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
  1752. .ir_codes = RC_MAP_KWORLD_315U,
  1753. .input = { {
  1754. .type = EM28XX_VMUX_TELEVISION,
  1755. .vmux = TVP5150_COMPOSITE0,
  1756. .amux = EM28XX_AMUX_VIDEO,
  1757. }, {
  1758. .type = EM28XX_VMUX_COMPOSITE1,
  1759. .vmux = TVP5150_COMPOSITE1,
  1760. .amux = EM28XX_AMUX_LINE_IN,
  1761. }, {
  1762. .type = EM28XX_VMUX_SVIDEO,
  1763. .vmux = TVP5150_SVIDEO,
  1764. .amux = EM28XX_AMUX_LINE_IN,
  1765. } },
  1766. },
  1767. [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
  1768. .name = "Terratec Cinnergy Hybrid T USB XS (em2882)",
  1769. .tuner_type = TUNER_XC2028,
  1770. .tuner_gpio = default_tuner_gpio,
  1771. .mts_firmware = 1,
  1772. .decoder = EM28XX_TVP5150,
  1773. .has_dvb = 1,
  1774. .dvb_gpio = hauppauge_wintv_hvr_900_digital,
  1775. .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
  1776. .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
  1777. .input = { {
  1778. .type = EM28XX_VMUX_TELEVISION,
  1779. .vmux = TVP5150_COMPOSITE0,
  1780. .amux = EM28XX_AMUX_VIDEO,
  1781. .gpio = hauppauge_wintv_hvr_900_analog,
  1782. }, {
  1783. .type = EM28XX_VMUX_COMPOSITE1,
  1784. .vmux = TVP5150_COMPOSITE1,
  1785. .amux = EM28XX_AMUX_LINE_IN,
  1786. .gpio = hauppauge_wintv_hvr_900_analog,
  1787. }, {
  1788. .type = EM28XX_VMUX_SVIDEO,
  1789. .vmux = TVP5150_SVIDEO,
  1790. .amux = EM28XX_AMUX_LINE_IN,
  1791. .gpio = hauppauge_wintv_hvr_900_analog,
  1792. } },
  1793. },
  1794. [EM2882_BOARD_DIKOM_DK300] = {
  1795. .name = "Dikom DK300",
  1796. .tuner_type = TUNER_XC2028,
  1797. .tuner_gpio = default_tuner_gpio,
  1798. .decoder = EM28XX_TVP5150,
  1799. .mts_firmware = 1,
  1800. .has_dvb = 1,
  1801. .dvb_gpio = dikom_dk300_digital,
  1802. .input = { {
  1803. .type = EM28XX_VMUX_TELEVISION,
  1804. .vmux = TVP5150_COMPOSITE0,
  1805. .amux = EM28XX_AMUX_VIDEO,
  1806. .gpio = default_analog,
  1807. } },
  1808. },
  1809. [EM2883_BOARD_KWORLD_HYBRID_330U] = {
  1810. .name = "Kworld PlusTV HD Hybrid 330",
  1811. .tuner_type = TUNER_XC2028,
  1812. .tuner_gpio = default_tuner_gpio,
  1813. .decoder = EM28XX_TVP5150,
  1814. .mts_firmware = 1,
  1815. .has_dvb = 1,
  1816. .dvb_gpio = kworld_330u_digital,
  1817. .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
  1818. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  1819. EM28XX_I2C_EEPROM_ON_BOARD |
  1820. EM28XX_I2C_EEPROM_KEY_VALID,
  1821. .input = { {
  1822. .type = EM28XX_VMUX_TELEVISION,
  1823. .vmux = TVP5150_COMPOSITE0,
  1824. .amux = EM28XX_AMUX_VIDEO,
  1825. .gpio = kworld_330u_analog,
  1826. .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
  1827. }, {
  1828. .type = EM28XX_VMUX_COMPOSITE1,
  1829. .vmux = TVP5150_COMPOSITE1,
  1830. .amux = EM28XX_AMUX_LINE_IN,
  1831. .gpio = kworld_330u_analog,
  1832. .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
  1833. }, {
  1834. .type = EM28XX_VMUX_SVIDEO,
  1835. .vmux = TVP5150_SVIDEO,
  1836. .amux = EM28XX_AMUX_LINE_IN,
  1837. .gpio = kworld_330u_analog,
  1838. } },
  1839. },
  1840. [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
  1841. .name = "Compro VideoMate ForYou/Stereo",
  1842. .tuner_type = TUNER_LG_PAL_NEW_TAPC,
  1843. .tvaudio_addr = 0xb0,
  1844. .tda9887_conf = TDA9887_PRESENT,
  1845. .decoder = EM28XX_TVP5150,
  1846. .adecoder = EM28XX_TVAUDIO,
  1847. .mute_gpio = compro_mute_gpio,
  1848. .input = { {
  1849. .type = EM28XX_VMUX_TELEVISION,
  1850. .vmux = TVP5150_COMPOSITE0,
  1851. .amux = EM28XX_AMUX_VIDEO,
  1852. .gpio = compro_unmute_tv_gpio,
  1853. }, {
  1854. .type = EM28XX_VMUX_SVIDEO,
  1855. .vmux = TVP5150_SVIDEO,
  1856. .amux = EM28XX_AMUX_LINE_IN,
  1857. .gpio = compro_unmute_svid_gpio,
  1858. } },
  1859. },
  1860. [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
  1861. .name = "Kaiomy TVnPC U2",
  1862. .vchannels = 3,
  1863. .tuner_type = TUNER_XC2028,
  1864. .tuner_addr = 0x61,
  1865. .mts_firmware = 1,
  1866. .decoder = EM28XX_TVP5150,
  1867. .tuner_gpio = default_tuner_gpio,
  1868. .ir_codes = RC_MAP_KAIOMY,
  1869. .input = { {
  1870. .type = EM28XX_VMUX_TELEVISION,
  1871. .vmux = TVP5150_COMPOSITE0,
  1872. .amux = EM28XX_AMUX_VIDEO,
  1873. }, {
  1874. .type = EM28XX_VMUX_COMPOSITE1,
  1875. .vmux = TVP5150_COMPOSITE1,
  1876. .amux = EM28XX_AMUX_LINE_IN,
  1877. }, {
  1878. .type = EM28XX_VMUX_SVIDEO,
  1879. .vmux = TVP5150_SVIDEO,
  1880. .amux = EM28XX_AMUX_LINE_IN,
  1881. } },
  1882. .radio = {
  1883. .type = EM28XX_RADIO,
  1884. .amux = EM28XX_AMUX_LINE_IN,
  1885. }
  1886. },
  1887. [EM2860_BOARD_EASYCAP] = {
  1888. .name = "Easy Cap Capture DC-60",
  1889. .vchannels = 2,
  1890. .tuner_type = TUNER_ABSENT,
  1891. .decoder = EM28XX_SAA711X,
  1892. .input = { {
  1893. .type = EM28XX_VMUX_COMPOSITE1,
  1894. .vmux = SAA7115_COMPOSITE0,
  1895. .amux = EM28XX_AMUX_LINE_IN,
  1896. }, {
  1897. .type = EM28XX_VMUX_SVIDEO,
  1898. .vmux = SAA7115_SVIDEO3,
  1899. .amux = EM28XX_AMUX_LINE_IN,
  1900. } },
  1901. },
  1902. [EM2820_BOARD_IODATA_GVMVP_SZ] = {
  1903. .name = "IO-DATA GV-MVP/SZ",
  1904. .tuner_type = TUNER_PHILIPS_FM1236_MK3,
  1905. .tuner_gpio = default_tuner_gpio,
  1906. .tda9887_conf = TDA9887_PRESENT,
  1907. .decoder = EM28XX_TVP5150,
  1908. .input = { {
  1909. .type = EM28XX_VMUX_TELEVISION,
  1910. .vmux = TVP5150_COMPOSITE0,
  1911. .amux = EM28XX_AMUX_VIDEO,
  1912. }, { /* Composite has not been tested yet */
  1913. .type = EM28XX_VMUX_COMPOSITE1,
  1914. .vmux = TVP5150_COMPOSITE1,
  1915. .amux = EM28XX_AMUX_VIDEO,
  1916. }, { /* S-video has not been tested yet */
  1917. .type = EM28XX_VMUX_SVIDEO,
  1918. .vmux = TVP5150_SVIDEO,
  1919. .amux = EM28XX_AMUX_VIDEO,
  1920. } },
  1921. },
  1922. [EM2860_BOARD_TERRATEC_GRABBY] = {
  1923. .name = "Terratec Grabby",
  1924. .vchannels = 2,
  1925. .tuner_type = TUNER_ABSENT,
  1926. .decoder = EM28XX_SAA711X,
  1927. .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
  1928. .input = { {
  1929. .type = EM28XX_VMUX_COMPOSITE1,
  1930. .vmux = SAA7115_COMPOSITE0,
  1931. .amux = EM28XX_AMUX_LINE_IN,
  1932. }, {
  1933. .type = EM28XX_VMUX_SVIDEO,
  1934. .vmux = SAA7115_SVIDEO3,
  1935. .amux = EM28XX_AMUX_LINE_IN,
  1936. } },
  1937. },
  1938. [EM2860_BOARD_TERRATEC_AV350] = {
  1939. .name = "Terratec AV350",
  1940. .vchannels = 2,
  1941. .tuner_type = TUNER_ABSENT,
  1942. .decoder = EM28XX_TVP5150,
  1943. .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
  1944. .mute_gpio = terratec_av350_mute_gpio,
  1945. .input = { {
  1946. .type = EM28XX_VMUX_COMPOSITE1,
  1947. .vmux = TVP5150_COMPOSITE1,
  1948. .amux = EM28XX_AMUX_LINE_IN,
  1949. .gpio = terratec_av350_unmute_gpio,
  1950. }, {
  1951. .type = EM28XX_VMUX_SVIDEO,
  1952. .vmux = TVP5150_SVIDEO,
  1953. .amux = EM28XX_AMUX_LINE_IN,
  1954. .gpio = terratec_av350_unmute_gpio,
  1955. } },
  1956. },
  1957. [EM2860_BOARD_ELGATO_VIDEO_CAPTURE] = {
  1958. .name = "Elgato Video Capture",
  1959. .decoder = EM28XX_SAA711X,
  1960. .tuner_type = TUNER_ABSENT, /* Capture only device */
  1961. .input = { {
  1962. .type = EM28XX_VMUX_COMPOSITE1,
  1963. .vmux = SAA7115_COMPOSITE0,
  1964. .amux = EM28XX_AMUX_LINE_IN,
  1965. }, {
  1966. .type = EM28XX_VMUX_SVIDEO,
  1967. .vmux = SAA7115_SVIDEO3,
  1968. .amux = EM28XX_AMUX_LINE_IN,
  1969. } },
  1970. },
  1971. [EM2882_BOARD_EVGA_INDTUBE] = {
  1972. .name = "Evga inDtube",
  1973. .tuner_type = TUNER_XC2028,
  1974. .tuner_gpio = default_tuner_gpio,
  1975. .decoder = EM28XX_TVP5150,
  1976. .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
  1977. .mts_firmware = 1,
  1978. .has_dvb = 1,
  1979. .dvb_gpio = evga_indtube_digital,
  1980. .ir_codes = RC_MAP_EVGA_INDTUBE,
  1981. .input = { {
  1982. .type = EM28XX_VMUX_TELEVISION,
  1983. .vmux = TVP5150_COMPOSITE0,
  1984. .amux = EM28XX_AMUX_VIDEO,
  1985. .gpio = evga_indtube_analog,
  1986. }, {
  1987. .type = EM28XX_VMUX_COMPOSITE1,
  1988. .vmux = TVP5150_COMPOSITE1,
  1989. .amux = EM28XX_AMUX_LINE_IN,
  1990. .gpio = evga_indtube_analog,
  1991. }, {
  1992. .type = EM28XX_VMUX_SVIDEO,
  1993. .vmux = TVP5150_SVIDEO,
  1994. .amux = EM28XX_AMUX_LINE_IN,
  1995. .gpio = evga_indtube_analog,
  1996. } },
  1997. },
  1998. /* eb1a:2868 Empia EM2870 + Philips CU1216L NIM (Philips TDA10023 +
  1999. Infineon TUA6034) */
  2000. [EM2870_BOARD_REDDO_DVB_C_USB_BOX] = {
  2001. .name = "Reddo DVB-C USB TV Box",
  2002. .tuner_type = TUNER_ABSENT,
  2003. .tuner_gpio = reddo_dvb_c_usb_box,
  2004. .has_dvb = 1,
  2005. },
  2006. /* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
  2007. * initially as the KWorld PlusTV 340U, then as the UB435-Q.
  2008. * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */
  2009. [EM2870_BOARD_KWORLD_A340] = {
  2010. .name = "KWorld PlusTV 340U or UB435-Q (ATSC)",
  2011. .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
  2012. .has_dvb = 1,
  2013. .dvb_gpio = kworld_a340_digital,
  2014. .tuner_gpio = default_tuner_gpio,
  2015. },
  2016. /* 2013:024f PCTV nanoStick T2 290e.
  2017. * Empia EM28174, Sony CXD2820R and NXP TDA18271HD/C2 */
  2018. [EM28174_BOARD_PCTV_290E] = {
  2019. .name = "PCTV nanoStick T2 290e",
  2020. .def_i2c_bus = 1,
  2021. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_100_KHZ,
  2022. .tuner_type = TUNER_ABSENT,
  2023. .tuner_gpio = pctv_290e,
  2024. .has_dvb = 1,
  2025. .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
  2026. },
  2027. /* 2013:024f PCTV DVB-S2 Stick 460e
  2028. * Empia EM28174, NXP TDA10071, Conexant CX24118A and Allegro A8293 */
  2029. [EM28174_BOARD_PCTV_460E] = {
  2030. .def_i2c_bus = 1,
  2031. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
  2032. .name = "PCTV DVB-S2 Stick (460e)",
  2033. .tuner_type = TUNER_ABSENT,
  2034. .tuner_gpio = pctv_460e,
  2035. .has_dvb = 1,
  2036. .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
  2037. },
  2038. /* eb1a:5006 Honestech VIDBOX NW03
  2039. * Empia EM2860, Philips SAA7113, Empia EMP202, No Tuner */
  2040. [EM2860_BOARD_HT_VIDBOX_NW03] = {
  2041. .name = "Honestech Vidbox NW03",
  2042. .tuner_type = TUNER_ABSENT,
  2043. .decoder = EM28XX_SAA711X,
  2044. .input = { {
  2045. .type = EM28XX_VMUX_COMPOSITE1,
  2046. .vmux = SAA7115_COMPOSITE0,
  2047. .amux = EM28XX_AMUX_LINE_IN,
  2048. }, {
  2049. .type = EM28XX_VMUX_SVIDEO,
  2050. .vmux = SAA7115_SVIDEO3, /* S-VIDEO needs confirming */
  2051. .amux = EM28XX_AMUX_LINE_IN,
  2052. } },
  2053. },
  2054. /* 1b80:e425 MaxMedia UB425-TC
  2055. * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2 */
  2056. [EM2874_BOARD_MAXMEDIA_UB425_TC] = {
  2057. .name = "MaxMedia UB425-TC",
  2058. .tuner_type = TUNER_ABSENT,
  2059. .tuner_gpio = maxmedia_ub425_tc,
  2060. .has_dvb = 1,
  2061. .ir_codes = RC_MAP_REDDO,
  2062. .def_i2c_bus = 1,
  2063. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  2064. EM28XX_I2C_FREQ_400_KHZ,
  2065. },
  2066. /* 2304:0242 PCTV QuatroStick (510e)
  2067. * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
  2068. [EM2884_BOARD_PCTV_510E] = {
  2069. .name = "PCTV QuatroStick (510e)",
  2070. .tuner_type = TUNER_ABSENT,
  2071. .tuner_gpio = pctv_510e,
  2072. .has_dvb = 1,
  2073. .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
  2074. .def_i2c_bus = 1,
  2075. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  2076. EM28XX_I2C_FREQ_400_KHZ,
  2077. },
  2078. /* 2013:0251 PCTV QuatroStick nano (520e)
  2079. * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
  2080. [EM2884_BOARD_PCTV_520E] = {
  2081. .name = "PCTV QuatroStick nano (520e)",
  2082. .tuner_type = TUNER_ABSENT,
  2083. .tuner_gpio = pctv_520e,
  2084. .has_dvb = 1,
  2085. .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
  2086. .def_i2c_bus = 1,
  2087. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  2088. EM28XX_I2C_FREQ_400_KHZ,
  2089. },
  2090. [EM2884_BOARD_TERRATEC_HTC_USB_XS] = {
  2091. .name = "Terratec Cinergy HTC USB XS",
  2092. .has_dvb = 1,
  2093. .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
  2094. .tuner_type = TUNER_ABSENT,
  2095. .def_i2c_bus = 1,
  2096. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  2097. EM28XX_I2C_FREQ_400_KHZ,
  2098. },
  2099. /* 1b80:e1cc Delock 61959
  2100. * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2
  2101. * mostly the same as MaxMedia UB-425-TC but different remote */
  2102. [EM2874_BOARD_DELOCK_61959] = {
  2103. .name = "Delock 61959",
  2104. .tuner_type = TUNER_ABSENT,
  2105. .tuner_gpio = maxmedia_ub425_tc,
  2106. .has_dvb = 1,
  2107. .ir_codes = RC_MAP_DELOCK_61959,
  2108. .def_i2c_bus = 1,
  2109. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  2110. EM28XX_I2C_FREQ_400_KHZ,
  2111. },
  2112. /*
  2113. * 1b80:e346 KWorld USB ATSC TV Stick UB435-Q V2
  2114. * Empia EM2874B + LG DT3305 + NXP TDA18271HDC2
  2115. */
  2116. [EM2874_BOARD_KWORLD_UB435Q_V2] = {
  2117. .name = "KWorld USB ATSC TV Stick UB435-Q V2",
  2118. .tuner_type = TUNER_ABSENT,
  2119. .has_dvb = 1,
  2120. .dvb_gpio = kworld_a340_digital,
  2121. .tuner_gpio = default_tuner_gpio,
  2122. .def_i2c_bus = 1,
  2123. },
  2124. /*
  2125. * 1b80:e34c KWorld USB ATSC TV Stick UB435-Q V3
  2126. * Empia EM2874B + LG DT3305 + NXP TDA18271HDC2
  2127. */
  2128. [EM2874_BOARD_KWORLD_UB435Q_V3] = {
  2129. .name = "KWorld USB ATSC TV Stick UB435-Q V3",
  2130. .tuner_type = TUNER_ABSENT,
  2131. .has_dvb = 1,
  2132. .tuner_gpio = kworld_ub435q_v3_digital,
  2133. .def_i2c_bus = 1,
  2134. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  2135. EM28XX_I2C_FREQ_100_KHZ,
  2136. .leds = kworld_ub435q_v3_leds,
  2137. },
  2138. [EM2874_BOARD_PCTV_HD_MINI_80E] = {
  2139. .name = "Pinnacle PCTV HD Mini",
  2140. .tuner_type = TUNER_ABSENT,
  2141. .has_dvb = 1,
  2142. .dvb_gpio = em2874_pctv_80e_digital,
  2143. .decoder = EM28XX_NODECODER,
  2144. .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
  2145. .leds = pctv_80e_leds,
  2146. },
  2147. /* 1ae7:9003/9004 SpeedLink Vicious And Devine Laplace webcam
  2148. * Empia EM2765 + OmniVision OV2640 */
  2149. [EM2765_BOARD_SPEEDLINK_VAD_LAPLACE] = {
  2150. .name = "SpeedLink Vicious And Devine Laplace webcam",
  2151. .xclk = EM28XX_XCLK_FREQUENCY_24MHZ,
  2152. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  2153. EM28XX_I2C_FREQ_100_KHZ,
  2154. .def_i2c_bus = 1,
  2155. .tuner_type = TUNER_ABSENT,
  2156. .is_webcam = 1,
  2157. .input = { {
  2158. .type = EM28XX_VMUX_COMPOSITE1,
  2159. .amux = EM28XX_AMUX_VIDEO,
  2160. .gpio = speedlink_vad_laplace_reg_seq,
  2161. } },
  2162. .buttons = speedlink_vad_laplace_buttons,
  2163. .leds = speedlink_vad_laplace_leds,
  2164. },
  2165. /* 2013:0258 PCTV DVB-S2 Stick (461e)
  2166. * Empia EM28178, Montage M88DS3103, Montage M88TS2022, Allegro A8293 */
  2167. [EM28178_BOARD_PCTV_461E] = {
  2168. .def_i2c_bus = 1,
  2169. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
  2170. .name = "PCTV DVB-S2 Stick (461e)",
  2171. .tuner_type = TUNER_ABSENT,
  2172. .tuner_gpio = pctv_461e,
  2173. .has_dvb = 1,
  2174. .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
  2175. },
  2176. /* 2013:025f PCTV tripleStick (292e).
  2177. * Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157 */
  2178. [EM28178_BOARD_PCTV_292E] = {
  2179. .name = "PCTV tripleStick (292e)",
  2180. .def_i2c_bus = 1,
  2181. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
  2182. .tuner_type = TUNER_ABSENT,
  2183. .tuner_gpio = pctv_292e,
  2184. .has_dvb = 1,
  2185. .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
  2186. },
  2187. [EM2861_BOARD_LEADTEK_VC100] = {
  2188. .name = "Leadtek VC100",
  2189. .tuner_type = TUNER_ABSENT, /* Capture only device */
  2190. .decoder = EM28XX_TVP5150,
  2191. .input = { {
  2192. .type = EM28XX_VMUX_COMPOSITE1,
  2193. .vmux = TVP5150_COMPOSITE1,
  2194. .amux = EM28XX_AMUX_LINE_IN,
  2195. }, {
  2196. .type = EM28XX_VMUX_SVIDEO,
  2197. .vmux = TVP5150_SVIDEO,
  2198. .amux = EM28XX_AMUX_LINE_IN,
  2199. } },
  2200. },
  2201. /* eb1a:8179 Terratec Cinergy T2 Stick HD.
  2202. * Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2146 */
  2203. [EM28178_BOARD_TERRATEC_T2_STICK_HD] = {
  2204. .name = "Terratec Cinergy T2 Stick HD",
  2205. .def_i2c_bus = 1,
  2206. .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
  2207. .tuner_type = TUNER_ABSENT,
  2208. .tuner_gpio = terratec_t2_stick_hd,
  2209. .has_dvb = 1,
  2210. .ir_codes = RC_MAP_TERRATEC_SLIM_2,
  2211. },
  2212. };
  2213. EXPORT_SYMBOL_GPL(em28xx_boards);
  2214. static const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
  2215. /* table of devices that work with this driver */
  2216. struct usb_device_id em28xx_id_table[] = {
  2217. { USB_DEVICE(0xeb1a, 0x2750),
  2218. .driver_info = EM2750_BOARD_UNKNOWN },
  2219. { USB_DEVICE(0xeb1a, 0x2751),
  2220. .driver_info = EM2750_BOARD_UNKNOWN },
  2221. { USB_DEVICE(0xeb1a, 0x2800),
  2222. .driver_info = EM2800_BOARD_UNKNOWN },
  2223. { USB_DEVICE(0xeb1a, 0x2710),
  2224. .driver_info = EM2820_BOARD_UNKNOWN },
  2225. { USB_DEVICE(0xeb1a, 0x2820),
  2226. .driver_info = EM2820_BOARD_UNKNOWN },
  2227. { USB_DEVICE(0xeb1a, 0x2821),
  2228. .driver_info = EM2820_BOARD_UNKNOWN },
  2229. { USB_DEVICE(0xeb1a, 0x2860),
  2230. .driver_info = EM2820_BOARD_UNKNOWN },
  2231. { USB_DEVICE(0xeb1a, 0x2861),
  2232. .driver_info = EM2820_BOARD_UNKNOWN },
  2233. { USB_DEVICE(0xeb1a, 0x2862),
  2234. .driver_info = EM2820_BOARD_UNKNOWN },
  2235. { USB_DEVICE(0xeb1a, 0x2863),
  2236. .driver_info = EM2820_BOARD_UNKNOWN },
  2237. { USB_DEVICE(0xeb1a, 0x2870),
  2238. .driver_info = EM2820_BOARD_UNKNOWN },
  2239. { USB_DEVICE(0xeb1a, 0x2881),
  2240. .driver_info = EM2820_BOARD_UNKNOWN },
  2241. { USB_DEVICE(0xeb1a, 0x2883),
  2242. .driver_info = EM2820_BOARD_UNKNOWN },
  2243. { USB_DEVICE(0xeb1a, 0x2868),
  2244. .driver_info = EM2820_BOARD_UNKNOWN },
  2245. { USB_DEVICE(0xeb1a, 0x2875),
  2246. .driver_info = EM2820_BOARD_UNKNOWN },
  2247. { USB_DEVICE(0xeb1a, 0x2885), /* MSI Digivox Trio */
  2248. .driver_info = EM2884_BOARD_TERRATEC_H5 },
  2249. { USB_DEVICE(0xeb1a, 0xe300),
  2250. .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
  2251. { USB_DEVICE(0xeb1a, 0xe303),
  2252. .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
  2253. { USB_DEVICE(0xeb1a, 0xe305),
  2254. .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
  2255. { USB_DEVICE(0xeb1a, 0xe310),
  2256. .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
  2257. { USB_DEVICE(0xeb1a, 0xa313),
  2258. .driver_info = EM2882_BOARD_KWORLD_ATSC_315U },
  2259. { USB_DEVICE(0xeb1a, 0xa316),
  2260. .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
  2261. { USB_DEVICE(0xeb1a, 0xe320),
  2262. .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
  2263. { USB_DEVICE(0xeb1a, 0xe323),
  2264. .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
  2265. { USB_DEVICE(0xeb1a, 0xe350),
  2266. .driver_info = EM2870_BOARD_KWORLD_350U },
  2267. { USB_DEVICE(0xeb1a, 0xe355),
  2268. .driver_info = EM2870_BOARD_KWORLD_355U },
  2269. { USB_DEVICE(0xeb1a, 0x2801),
  2270. .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
  2271. { USB_DEVICE(0xeb1a, 0xe357),
  2272. .driver_info = EM2870_BOARD_KWORLD_355U },
  2273. { USB_DEVICE(0xeb1a, 0xe359),
  2274. .driver_info = EM2870_BOARD_KWORLD_355U },
  2275. { USB_DEVICE(0x1b80, 0xe302),
  2276. .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */
  2277. { USB_DEVICE(0x1b80, 0xe304),
  2278. .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kworld DVD Maker 2 */
  2279. { USB_DEVICE(0x0ccd, 0x0036),
  2280. .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
  2281. { USB_DEVICE(0x0ccd, 0x004c),
  2282. .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
  2283. { USB_DEVICE(0x0ccd, 0x004f),
  2284. .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
  2285. { USB_DEVICE(0x0ccd, 0x005e),
  2286. .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
  2287. { USB_DEVICE(0x0ccd, 0x0042),
  2288. .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
  2289. { USB_DEVICE(0x0ccd, 0x0043),
  2290. .driver_info = EM2870_BOARD_TERRATEC_XS },
  2291. { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */
  2292. .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
  2293. { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */
  2294. .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
  2295. { USB_DEVICE(0x0ccd, 0x10a2), /* H5 Rev. 1 */
  2296. .driver_info = EM2884_BOARD_TERRATEC_H5 },
  2297. { USB_DEVICE(0x0ccd, 0x10ad), /* H5 Rev. 2 */
  2298. .driver_info = EM2884_BOARD_TERRATEC_H5 },
  2299. { USB_DEVICE(0x0ccd, 0x10b6), /* H5 Rev. 3 */
  2300. .driver_info = EM2884_BOARD_TERRATEC_H5 },
  2301. { USB_DEVICE(0x0ccd, 0x0084),
  2302. .driver_info = EM2860_BOARD_TERRATEC_AV350 },
  2303. { USB_DEVICE(0x0ccd, 0x0096),
  2304. .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
  2305. { USB_DEVICE(0x0ccd, 0x10AF),
  2306. .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
  2307. { USB_DEVICE(0x0ccd, 0x00b2),
  2308. .driver_info = EM2884_BOARD_CINERGY_HTC_STICK },
  2309. { USB_DEVICE(0x0fd9, 0x0018),
  2310. .driver_info = EM2884_BOARD_ELGATO_EYETV_HYBRID_2008 },
  2311. { USB_DEVICE(0x0fd9, 0x0033),
  2312. .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE },
  2313. { USB_DEVICE(0x185b, 0x2870),
  2314. .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
  2315. { USB_DEVICE(0x185b, 0x2041),
  2316. .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
  2317. { USB_DEVICE(0x2040, 0x4200),
  2318. .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
  2319. { USB_DEVICE(0x2040, 0x4201),
  2320. .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
  2321. { USB_DEVICE(0x2040, 0x6500),
  2322. .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
  2323. { USB_DEVICE(0x2040, 0x6502),
  2324. .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
  2325. { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
  2326. .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
  2327. { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
  2328. .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
  2329. { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
  2330. .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
  2331. { USB_DEVICE(0x2040, 0x651f),
  2332. .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
  2333. { USB_DEVICE(0x0438, 0xb002),
  2334. .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
  2335. { USB_DEVICE(0x2001, 0xf112),
  2336. .driver_info = EM2820_BOARD_DLINK_USB_TV },
  2337. { USB_DEVICE(0x2304, 0x0207),
  2338. .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
  2339. { USB_DEVICE(0x2304, 0x0208),
  2340. .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
  2341. { USB_DEVICE(0x2304, 0x021a),
  2342. .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
  2343. { USB_DEVICE(0x2304, 0x0226),
  2344. .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO_330E },
  2345. { USB_DEVICE(0x2304, 0x0227),
  2346. .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
  2347. { USB_DEVICE(0x2304, 0x023f),
  2348. .driver_info = EM2874_BOARD_PCTV_HD_MINI_80E },
  2349. { USB_DEVICE(0x0413, 0x6023),
  2350. .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
  2351. { USB_DEVICE(0x093b, 0xa003),
  2352. .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
  2353. { USB_DEVICE(0x093b, 0xa005),
  2354. .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
  2355. { USB_DEVICE(0x04bb, 0x0515),
  2356. .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
  2357. { USB_DEVICE(0xeb1a, 0x50a6),
  2358. .driver_info = EM2860_BOARD_GADMEI_UTV330 },
  2359. { USB_DEVICE(0x1b80, 0xa340),
  2360. .driver_info = EM2870_BOARD_KWORLD_A340 },
  2361. { USB_DEVICE(0x1b80, 0xe346),
  2362. .driver_info = EM2874_BOARD_KWORLD_UB435Q_V2 },
  2363. { USB_DEVICE(0x1b80, 0xe34c),
  2364. .driver_info = EM2874_BOARD_KWORLD_UB435Q_V3 },
  2365. { USB_DEVICE(0x2013, 0x024f),
  2366. .driver_info = EM28174_BOARD_PCTV_290E },
  2367. { USB_DEVICE(0x2013, 0x024c),
  2368. .driver_info = EM28174_BOARD_PCTV_460E },
  2369. { USB_DEVICE(0x2040, 0x1605),
  2370. .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
  2371. { USB_DEVICE(0x1b80, 0xe755),
  2372. .driver_info = EM2884_BOARD_C3TECH_DIGITAL_DUO },
  2373. { USB_DEVICE(0xeb1a, 0x5006),
  2374. .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
  2375. { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
  2376. .driver_info = EM2860_BOARD_EASYCAP },
  2377. { USB_DEVICE(0x1b80, 0xe425),
  2378. .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC },
  2379. { USB_DEVICE(0x2304, 0x0242),
  2380. .driver_info = EM2884_BOARD_PCTV_510E },
  2381. { USB_DEVICE(0x2013, 0x0251),
  2382. .driver_info = EM2884_BOARD_PCTV_520E },
  2383. { USB_DEVICE(0x1b80, 0xe1cc),
  2384. .driver_info = EM2874_BOARD_DELOCK_61959 },
  2385. { USB_DEVICE(0x1ae7, 0x9003),
  2386. .driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE },
  2387. { USB_DEVICE(0x1ae7, 0x9004),
  2388. .driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE },
  2389. { USB_DEVICE(0x2013, 0x0258),
  2390. .driver_info = EM28178_BOARD_PCTV_461E },
  2391. { USB_DEVICE(0x2013, 0x025f),
  2392. .driver_info = EM28178_BOARD_PCTV_292E },
  2393. { USB_DEVICE(0x0413, 0x6f07),
  2394. .driver_info = EM2861_BOARD_LEADTEK_VC100 },
  2395. { USB_DEVICE(0xeb1a, 0x8179),
  2396. .driver_info = EM28178_BOARD_TERRATEC_T2_STICK_HD },
  2397. { },
  2398. };
  2399. MODULE_DEVICE_TABLE(usb, em28xx_id_table);
  2400. /*
  2401. * EEPROM hash table for devices with generic USB IDs
  2402. */
  2403. static struct em28xx_hash_table em28xx_eeprom_hash[] = {
  2404. /* P/N: SA 60002070465 Tuner: TVF7533-MF */
  2405. {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
  2406. {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
  2407. {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
  2408. {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
  2409. {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
  2410. {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
  2411. {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
  2412. {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
  2413. };
  2414. /* I2C devicelist hash table for devices with generic USB IDs */
  2415. static struct em28xx_hash_table em28xx_i2c_hash[] = {
  2416. {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
  2417. {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
  2418. {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT},
  2419. {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT},
  2420. {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
  2421. {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF},
  2422. {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT},
  2423. };
  2424. /* NOTE: introduce a separate hash table for devices with 16 bit eeproms */
  2425. int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
  2426. {
  2427. struct em28xx_i2c_bus *i2c_bus = ptr;
  2428. struct em28xx *dev = i2c_bus->dev;
  2429. int rc = 0;
  2430. if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000)
  2431. return 0;
  2432. if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET)
  2433. return 0;
  2434. rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
  2435. return rc;
  2436. }
  2437. EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
  2438. static inline void em28xx_set_model(struct em28xx *dev)
  2439. {
  2440. dev->board = em28xx_boards[dev->model];
  2441. /* Those are the default values for the majority of boards
  2442. Use those values if not specified otherwise at boards entry
  2443. */
  2444. if (!dev->board.xclk)
  2445. dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
  2446. EM28XX_XCLK_FREQUENCY_12MHZ;
  2447. if (!dev->board.i2c_speed)
  2448. dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
  2449. EM28XX_I2C_FREQ_100_KHZ;
  2450. /* Should be initialized early, for I2C to work */
  2451. dev->def_i2c_bus = dev->board.def_i2c_bus;
  2452. }
  2453. /* Since em28xx_pre_card_setup() requires a proper dev->model,
  2454. * this won't work for boards with generic PCI IDs
  2455. */
  2456. static void em28xx_pre_card_setup(struct em28xx *dev)
  2457. {
  2458. /* Set the initial XCLK and I2C clock values based on the board
  2459. definition */
  2460. em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
  2461. if (!dev->board.is_em2800)
  2462. em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
  2463. msleep(50);
  2464. /* request some modules */
  2465. switch (dev->model) {
  2466. case EM2861_BOARD_PLEXTOR_PX_TV100U:
  2467. /* Sets the msp34xx I2S speed */
  2468. dev->i2s_speed = 2048000;
  2469. break;
  2470. case EM2861_BOARD_KWORLD_PVRTV_300U:
  2471. case EM2880_BOARD_KWORLD_DVB_305U:
  2472. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0x6d);
  2473. msleep(10);
  2474. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0x7d);
  2475. msleep(10);
  2476. break;
  2477. case EM2870_BOARD_COMPRO_VIDEOMATE:
  2478. /* TODO: someone can do some cleanup here...
  2479. not everything's needed */
  2480. em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
  2481. msleep(10);
  2482. em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
  2483. msleep(10);
  2484. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
  2485. mdelay(70);
  2486. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfc);
  2487. mdelay(70);
  2488. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xdc);
  2489. mdelay(70);
  2490. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfc);
  2491. mdelay(70);
  2492. break;
  2493. case EM2870_BOARD_TERRATEC_XS_MT2060:
  2494. /* this device needs some gpio writes to get the DVB-T
  2495. demod work */
  2496. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
  2497. mdelay(70);
  2498. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xde);
  2499. mdelay(70);
  2500. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
  2501. mdelay(70);
  2502. break;
  2503. case EM2870_BOARD_PINNACLE_PCTV_DVB:
  2504. /* this device needs some gpio writes to get the
  2505. DVB-T demod work */
  2506. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
  2507. mdelay(70);
  2508. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xde);
  2509. mdelay(70);
  2510. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
  2511. mdelay(70);
  2512. break;
  2513. case EM2820_BOARD_GADMEI_UTV310:
  2514. case EM2820_BOARD_MSI_VOX_USB_2:
  2515. /* enables audio for that devices */
  2516. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
  2517. break;
  2518. case EM2882_BOARD_KWORLD_ATSC_315U:
  2519. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff);
  2520. msleep(10);
  2521. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
  2522. msleep(10);
  2523. em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
  2524. msleep(10);
  2525. em28xx_write_reg(dev, EM2880_R04_GPO, 0x08);
  2526. msleep(10);
  2527. break;
  2528. case EM2860_BOARD_KAIOMY_TVNPC_U2:
  2529. em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
  2530. em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
  2531. em28xx_write_regs(dev, 0x0d, "\x42", 1);
  2532. em28xx_write_regs(dev, 0x08, "\xfd", 1);
  2533. msleep(10);
  2534. em28xx_write_regs(dev, 0x08, "\xff", 1);
  2535. msleep(10);
  2536. em28xx_write_regs(dev, 0x08, "\x7f", 1);
  2537. msleep(10);
  2538. em28xx_write_regs(dev, 0x08, "\x6b", 1);
  2539. break;
  2540. case EM2860_BOARD_EASYCAP:
  2541. em28xx_write_regs(dev, 0x08, "\xf8", 1);
  2542. break;
  2543. case EM2820_BOARD_IODATA_GVMVP_SZ:
  2544. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff);
  2545. msleep(70);
  2546. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7);
  2547. msleep(10);
  2548. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
  2549. msleep(70);
  2550. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
  2551. msleep(70);
  2552. break;
  2553. }
  2554. em28xx_gpio_set(dev, dev->board.tuner_gpio);
  2555. em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
  2556. /* Unlock device */
  2557. em28xx_set_mode(dev, EM28XX_SUSPEND);
  2558. }
  2559. static int em28xx_hint_board(struct em28xx *dev)
  2560. {
  2561. int i;
  2562. if (dev->board.is_webcam) {
  2563. if (dev->em28xx_sensor == EM28XX_MT9V011) {
  2564. dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
  2565. } else if (dev->em28xx_sensor == EM28XX_MT9M001 ||
  2566. dev->em28xx_sensor == EM28XX_MT9M111) {
  2567. dev->model = EM2750_BOARD_UNKNOWN;
  2568. }
  2569. /* FIXME: IMPROVE ! */
  2570. return 0;
  2571. }
  2572. /* HINT method: EEPROM
  2573. *
  2574. * This method works only for boards with eeprom.
  2575. * Uses a hash of all eeprom bytes. The hash should be
  2576. * unique for a vendor/tuner pair.
  2577. * There are a high chance that tuners for different
  2578. * video standards produce different hashes.
  2579. */
  2580. for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
  2581. if (dev->hash == em28xx_eeprom_hash[i].hash) {
  2582. dev->model = em28xx_eeprom_hash[i].model;
  2583. dev->tuner_type = em28xx_eeprom_hash[i].tuner;
  2584. em28xx_errdev("Your board has no unique USB ID.\n");
  2585. em28xx_errdev("A hint were successfully done, "
  2586. "based on eeprom hash.\n");
  2587. em28xx_errdev("This method is not 100%% failproof.\n");
  2588. em28xx_errdev("If the board were missdetected, "
  2589. "please email this log to:\n");
  2590. em28xx_errdev("\tV4L Mailing List "
  2591. " <linux-media@vger.kernel.org>\n");
  2592. em28xx_errdev("Board detected as %s\n",
  2593. em28xx_boards[dev->model].name);
  2594. return 0;
  2595. }
  2596. }
  2597. /* HINT method: I2C attached devices
  2598. *
  2599. * This method works for all boards.
  2600. * Uses a hash of i2c scanned devices.
  2601. * Devices with the same i2c attached chips will
  2602. * be considered equal.
  2603. * This method is less precise than the eeprom one.
  2604. */
  2605. /* user did not request i2c scanning => do it now */
  2606. if (!dev->i2c_hash)
  2607. em28xx_do_i2c_scan(dev, dev->def_i2c_bus);
  2608. for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
  2609. if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
  2610. dev->model = em28xx_i2c_hash[i].model;
  2611. dev->tuner_type = em28xx_i2c_hash[i].tuner;
  2612. em28xx_errdev("Your board has no unique USB ID.\n");
  2613. em28xx_errdev("A hint were successfully done, "
  2614. "based on i2c devicelist hash.\n");
  2615. em28xx_errdev("This method is not 100%% failproof.\n");
  2616. em28xx_errdev("If the board were missdetected, "
  2617. "please email this log to:\n");
  2618. em28xx_errdev("\tV4L Mailing List "
  2619. " <linux-media@vger.kernel.org>\n");
  2620. em28xx_errdev("Board detected as %s\n",
  2621. em28xx_boards[dev->model].name);
  2622. return 0;
  2623. }
  2624. }
  2625. em28xx_errdev("Your board has no unique USB ID and thus need a "
  2626. "hint to be detected.\n");
  2627. em28xx_errdev("You may try to use card=<n> insmod option to "
  2628. "workaround that.\n");
  2629. em28xx_errdev("Please send an email with this log to:\n");
  2630. em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
  2631. em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
  2632. em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
  2633. em28xx_errdev("Here is a list of valid choices for the card=<n>"
  2634. " insmod option:\n");
  2635. for (i = 0; i < em28xx_bcount; i++) {
  2636. em28xx_errdev(" card=%d -> %s\n",
  2637. i, em28xx_boards[i].name);
  2638. }
  2639. return -1;
  2640. }
  2641. static void em28xx_card_setup(struct em28xx *dev)
  2642. {
  2643. /*
  2644. * If the device can be a webcam, seek for a sensor.
  2645. * If sensor is not found, then it isn't a webcam.
  2646. */
  2647. if (dev->board.is_webcam) {
  2648. if (em28xx_detect_sensor(dev) < 0)
  2649. dev->board.is_webcam = 0;
  2650. }
  2651. switch (dev->model) {
  2652. case EM2750_BOARD_UNKNOWN:
  2653. case EM2820_BOARD_UNKNOWN:
  2654. case EM2800_BOARD_UNKNOWN:
  2655. /*
  2656. * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
  2657. *
  2658. * This occurs because they share identical USB vendor and
  2659. * product IDs.
  2660. *
  2661. * What we do here is look up the EEPROM hash of the K-WORLD
  2662. * and if it is found then we decide that we do not have
  2663. * a DIGIVOX and reset the device to the K-WORLD instead.
  2664. *
  2665. * This solution is only valid if they do not share eeprom
  2666. * hash identities which has not been determined as yet.
  2667. */
  2668. if (em28xx_hint_board(dev) < 0)
  2669. em28xx_errdev("Board not discovered\n");
  2670. else {
  2671. em28xx_set_model(dev);
  2672. em28xx_pre_card_setup(dev);
  2673. }
  2674. break;
  2675. default:
  2676. em28xx_set_model(dev);
  2677. }
  2678. em28xx_info("Identified as %s (card=%d)\n",
  2679. dev->board.name, dev->model);
  2680. dev->tuner_type = em28xx_boards[dev->model].tuner_type;
  2681. /* request some modules */
  2682. switch (dev->model) {
  2683. case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
  2684. case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
  2685. case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
  2686. case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
  2687. case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
  2688. case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C:
  2689. {
  2690. struct tveeprom tv;
  2691. if (dev->eedata == NULL)
  2692. break;
  2693. #if defined(CONFIG_MODULES) && defined(MODULE)
  2694. request_module("tveeprom");
  2695. #endif
  2696. /* Call first TVeeprom */
  2697. dev->i2c_client[dev->def_i2c_bus].addr = 0xa0 >> 1;
  2698. tveeprom_hauppauge_analog(&dev->i2c_client[dev->def_i2c_bus], &tv, dev->eedata);
  2699. dev->tuner_type = tv.tuner_type;
  2700. if (tv.audio_processor == TVEEPROM_AUDPROC_MSP) {
  2701. dev->i2s_speed = 2048000;
  2702. dev->board.has_msp34xx = 1;
  2703. }
  2704. break;
  2705. }
  2706. case EM2882_BOARD_KWORLD_ATSC_315U:
  2707. em28xx_write_reg(dev, 0x0d, 0x42);
  2708. msleep(10);
  2709. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
  2710. msleep(10);
  2711. break;
  2712. case EM2820_BOARD_KWORLD_PVRTV2800RF:
  2713. /* GPIO enables sound on KWORLD PVR TV 2800RF */
  2714. em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf9);
  2715. break;
  2716. case EM2820_BOARD_UNKNOWN:
  2717. case EM2800_BOARD_UNKNOWN:
  2718. /*
  2719. * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
  2720. *
  2721. * This occurs because they share identical USB vendor and
  2722. * product IDs.
  2723. *
  2724. * What we do here is look up the EEPROM hash of the K-WORLD
  2725. * and if it is found then we decide that we do not have
  2726. * a DIGIVOX and reset the device to the K-WORLD instead.
  2727. *
  2728. * This solution is only valid if they do not share eeprom
  2729. * hash identities which has not been determined as yet.
  2730. */
  2731. case EM2880_BOARD_MSI_DIGIVOX_AD:
  2732. if (!em28xx_hint_board(dev))
  2733. em28xx_set_model(dev);
  2734. /* In cases where we had to use a board hint, the call to
  2735. em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
  2736. so make the call now so the analog GPIOs are set properly
  2737. before probing the i2c bus. */
  2738. em28xx_gpio_set(dev, dev->board.tuner_gpio);
  2739. em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
  2740. break;
  2741. /*
  2742. * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
  2743. *
  2744. * This occurs because they share identical USB vendor and
  2745. * product IDs.
  2746. *
  2747. * What we do here is look up the EEPROM hash of the Dikom
  2748. * and if it is found then we decide that we do not have
  2749. * a Kworld and reset the device to the Dikom instead.
  2750. *
  2751. * This solution is only valid if they do not share eeprom
  2752. * hash identities which has not been determined as yet.
  2753. */
  2754. case EM2882_BOARD_KWORLD_VS_DVBT:
  2755. if (!em28xx_hint_board(dev))
  2756. em28xx_set_model(dev);
  2757. /* In cases where we had to use a board hint, the call to
  2758. em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
  2759. so make the call now so the analog GPIOs are set properly
  2760. before probing the i2c bus. */
  2761. em28xx_gpio_set(dev, dev->board.tuner_gpio);
  2762. em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
  2763. break;
  2764. }
  2765. if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
  2766. em28xx_errdev("\n\n");
  2767. em28xx_errdev("The support for this board weren't "
  2768. "valid yet.\n");
  2769. em28xx_errdev("Please send a report of having this working\n");
  2770. em28xx_errdev("not to V4L mailing list (and/or to other "
  2771. "addresses)\n\n");
  2772. }
  2773. /* Free eeprom data memory */
  2774. kfree(dev->eedata);
  2775. dev->eedata = NULL;
  2776. /* Allow override tuner type by a module parameter */
  2777. if (tuner >= 0)
  2778. dev->tuner_type = tuner;
  2779. }
  2780. void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
  2781. {
  2782. memset(ctl, 0, sizeof(*ctl));
  2783. ctl->fname = XC2028_DEFAULT_FIRMWARE;
  2784. ctl->max_len = 64;
  2785. ctl->mts = em28xx_boards[dev->model].mts_firmware;
  2786. switch (dev->model) {
  2787. case EM2880_BOARD_EMPIRE_DUAL_TV:
  2788. case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
  2789. case EM2882_BOARD_TERRATEC_HYBRID_XS:
  2790. ctl->demod = XC3028_FE_ZARLINK456;
  2791. break;
  2792. case EM2880_BOARD_TERRATEC_HYBRID_XS:
  2793. case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
  2794. case EM2881_BOARD_PINNACLE_HYBRID_PRO:
  2795. ctl->demod = XC3028_FE_ZARLINK456;
  2796. break;
  2797. case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
  2798. case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
  2799. ctl->demod = XC3028_FE_DEFAULT;
  2800. break;
  2801. case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
  2802. ctl->demod = XC3028_FE_DEFAULT;
  2803. ctl->fname = XC3028L_DEFAULT_FIRMWARE;
  2804. break;
  2805. case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
  2806. case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
  2807. case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
  2808. /* FIXME: Better to specify the needed IF */
  2809. ctl->demod = XC3028_FE_DEFAULT;
  2810. break;
  2811. case EM2883_BOARD_KWORLD_HYBRID_330U:
  2812. case EM2882_BOARD_DIKOM_DK300:
  2813. case EM2882_BOARD_KWORLD_VS_DVBT:
  2814. ctl->demod = XC3028_FE_CHINA;
  2815. ctl->fname = XC2028_DEFAULT_FIRMWARE;
  2816. break;
  2817. case EM2882_BOARD_EVGA_INDTUBE:
  2818. ctl->demod = XC3028_FE_CHINA;
  2819. ctl->fname = XC3028L_DEFAULT_FIRMWARE;
  2820. break;
  2821. default:
  2822. ctl->demod = XC3028_FE_OREN538;
  2823. }
  2824. }
  2825. EXPORT_SYMBOL_GPL(em28xx_setup_xc3028);
  2826. static void request_module_async(struct work_struct *work)
  2827. {
  2828. struct em28xx *dev = container_of(work,
  2829. struct em28xx, request_module_wk);
  2830. /*
  2831. * The em28xx extensions can be modules or builtin. If the
  2832. * modules are already loaded or are built in, those extensions
  2833. * can be initialised right now. Otherwise, the module init
  2834. * code will do it.
  2835. */
  2836. /*
  2837. * Devicdes with an audio-only interface also have a V4L/DVB/RC
  2838. * interface. Don't register extensions twice on those devices.
  2839. */
  2840. if (dev->is_audio_only) {
  2841. #if defined(CONFIG_MODULES) && defined(MODULE)
  2842. request_module("em28xx-alsa");
  2843. #endif
  2844. return;
  2845. }
  2846. em28xx_init_extension(dev);
  2847. #if defined(CONFIG_MODULES) && defined(MODULE)
  2848. if (dev->has_video)
  2849. request_module("em28xx-v4l");
  2850. if (dev->usb_audio_type == EM28XX_USB_AUDIO_CLASS)
  2851. request_module("snd-usb-audio");
  2852. else if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR)
  2853. request_module("em28xx-alsa");
  2854. if (dev->board.has_dvb)
  2855. request_module("em28xx-dvb");
  2856. if (dev->board.buttons ||
  2857. ((dev->board.ir_codes || dev->board.has_ir_i2c) && !disable_ir))
  2858. request_module("em28xx-rc");
  2859. #endif /* CONFIG_MODULES */
  2860. }
  2861. static void request_modules(struct em28xx *dev)
  2862. {
  2863. INIT_WORK(&dev->request_module_wk, request_module_async);
  2864. schedule_work(&dev->request_module_wk);
  2865. }
  2866. static void flush_request_modules(struct em28xx *dev)
  2867. {
  2868. flush_work(&dev->request_module_wk);
  2869. }
  2870. /*
  2871. * em28xx_release_resources()
  2872. * unregisters the v4l2,i2c and usb devices
  2873. * called when the device gets disconnected or at module unload
  2874. */
  2875. static void em28xx_release_resources(struct em28xx *dev)
  2876. {
  2877. /*FIXME: I2C IR should be disconnected */
  2878. mutex_lock(&dev->lock);
  2879. if (dev->def_i2c_bus)
  2880. em28xx_i2c_unregister(dev, 1);
  2881. em28xx_i2c_unregister(dev, 0);
  2882. usb_put_dev(dev->udev);
  2883. /* Mark device as unused */
  2884. clear_bit(dev->devno, em28xx_devused);
  2885. mutex_unlock(&dev->lock);
  2886. };
  2887. /**
  2888. * em28xx_free_device() - Free em28xx device
  2889. *
  2890. * @ref: struct kref for em28xx device
  2891. *
  2892. * This is called when all extensions and em28xx core unregisters a device
  2893. */
  2894. void em28xx_free_device(struct kref *ref)
  2895. {
  2896. struct em28xx *dev = kref_to_dev(ref);
  2897. em28xx_info("Freeing device\n");
  2898. if (!dev->disconnected)
  2899. em28xx_release_resources(dev);
  2900. kfree(dev->alt_max_pkt_size_isoc);
  2901. kfree(dev);
  2902. }
  2903. EXPORT_SYMBOL_GPL(em28xx_free_device);
  2904. /*
  2905. * em28xx_init_dev()
  2906. * allocates and inits the device structs, registers i2c bus and v4l device
  2907. */
  2908. static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
  2909. struct usb_interface *interface,
  2910. int minor)
  2911. {
  2912. int retval;
  2913. static const char *default_chip_name = "em28xx";
  2914. const char *chip_name = default_chip_name;
  2915. dev->udev = udev;
  2916. mutex_init(&dev->ctrl_urb_lock);
  2917. spin_lock_init(&dev->slock);
  2918. dev->em28xx_write_regs = em28xx_write_regs;
  2919. dev->em28xx_read_reg = em28xx_read_reg;
  2920. dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
  2921. dev->em28xx_write_regs_req = em28xx_write_regs_req;
  2922. dev->em28xx_read_reg_req = em28xx_read_reg_req;
  2923. dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
  2924. em28xx_set_model(dev);
  2925. dev->wait_after_write = 5;
  2926. /* Based on the Chip ID, set the device configuration */
  2927. retval = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
  2928. if (retval > 0) {
  2929. dev->chip_id = retval;
  2930. switch (dev->chip_id) {
  2931. case CHIP_ID_EM2800:
  2932. chip_name = "em2800";
  2933. break;
  2934. case CHIP_ID_EM2710:
  2935. chip_name = "em2710";
  2936. break;
  2937. case CHIP_ID_EM2750:
  2938. chip_name = "em2750";
  2939. break;
  2940. case CHIP_ID_EM2765:
  2941. chip_name = "em2765";
  2942. dev->wait_after_write = 0;
  2943. dev->is_em25xx = 1;
  2944. dev->eeprom_addrwidth_16bit = 1;
  2945. break;
  2946. case CHIP_ID_EM2820:
  2947. chip_name = "em2710/2820";
  2948. if (le16_to_cpu(dev->udev->descriptor.idVendor)
  2949. == 0xeb1a) {
  2950. __le16 idProd = dev->udev->descriptor.idProduct;
  2951. if (le16_to_cpu(idProd) == 0x2710)
  2952. chip_name = "em2710";
  2953. else if (le16_to_cpu(idProd) == 0x2820)
  2954. chip_name = "em2820";
  2955. }
  2956. /* NOTE: the em2820 is used in webcams, too ! */
  2957. break;
  2958. case CHIP_ID_EM2840:
  2959. chip_name = "em2840";
  2960. break;
  2961. case CHIP_ID_EM2860:
  2962. chip_name = "em2860";
  2963. break;
  2964. case CHIP_ID_EM2870:
  2965. chip_name = "em2870";
  2966. dev->wait_after_write = 0;
  2967. break;
  2968. case CHIP_ID_EM2874:
  2969. chip_name = "em2874";
  2970. dev->wait_after_write = 0;
  2971. dev->eeprom_addrwidth_16bit = 1;
  2972. break;
  2973. case CHIP_ID_EM28174:
  2974. chip_name = "em28174";
  2975. dev->wait_after_write = 0;
  2976. dev->eeprom_addrwidth_16bit = 1;
  2977. break;
  2978. case CHIP_ID_EM28178:
  2979. chip_name = "em28178";
  2980. dev->wait_after_write = 0;
  2981. dev->eeprom_addrwidth_16bit = 1;
  2982. break;
  2983. case CHIP_ID_EM2883:
  2984. chip_name = "em2882/3";
  2985. dev->wait_after_write = 0;
  2986. break;
  2987. case CHIP_ID_EM2884:
  2988. chip_name = "em2884";
  2989. dev->wait_after_write = 0;
  2990. dev->eeprom_addrwidth_16bit = 1;
  2991. break;
  2992. default:
  2993. printk(KERN_INFO DRIVER_NAME
  2994. ": unknown em28xx chip ID (%d)\n", dev->chip_id);
  2995. }
  2996. }
  2997. if (chip_name != default_chip_name)
  2998. printk(KERN_INFO DRIVER_NAME
  2999. ": chip ID is %s\n", chip_name);
  3000. /*
  3001. * For em2820/em2710, the name may change latter, after checking
  3002. * if the device has a sensor (so, it is em2710) or not.
  3003. */
  3004. snprintf(dev->name, sizeof(dev->name), "%s #%d", chip_name, dev->devno);
  3005. if (dev->is_audio_only) {
  3006. retval = em28xx_audio_setup(dev);
  3007. if (retval)
  3008. return -ENODEV;
  3009. em28xx_init_extension(dev);
  3010. return 0;
  3011. }
  3012. em28xx_pre_card_setup(dev);
  3013. if (!dev->board.is_em2800) {
  3014. /* Resets I2C speed */
  3015. retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
  3016. if (retval < 0) {
  3017. em28xx_errdev("%s: em28xx_write_reg failed!"
  3018. " retval [%d]\n",
  3019. __func__, retval);
  3020. return retval;
  3021. }
  3022. }
  3023. rt_mutex_init(&dev->i2c_bus_lock);
  3024. /* register i2c bus 0 */
  3025. if (dev->board.is_em2800)
  3026. retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM2800);
  3027. else
  3028. retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
  3029. if (retval < 0) {
  3030. em28xx_errdev("%s: em28xx_i2c_register bus 0 - error [%d]!\n",
  3031. __func__, retval);
  3032. return retval;
  3033. }
  3034. /* register i2c bus 1 */
  3035. if (dev->def_i2c_bus) {
  3036. if (dev->is_em25xx)
  3037. retval = em28xx_i2c_register(dev, 1,
  3038. EM28XX_I2C_ALGO_EM25XX_BUS_B);
  3039. else
  3040. retval = em28xx_i2c_register(dev, 1,
  3041. EM28XX_I2C_ALGO_EM28XX);
  3042. if (retval < 0) {
  3043. em28xx_errdev("%s: em28xx_i2c_register bus 1 - error [%d]!\n",
  3044. __func__, retval);
  3045. em28xx_i2c_unregister(dev, 0);
  3046. return retval;
  3047. }
  3048. }
  3049. /* Do board specific init and eeprom reading */
  3050. em28xx_card_setup(dev);
  3051. return 0;
  3052. }
  3053. /* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */
  3054. #define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
  3055. /*
  3056. * em28xx_usb_probe()
  3057. * checks for supported devices
  3058. */
  3059. static int em28xx_usb_probe(struct usb_interface *interface,
  3060. const struct usb_device_id *id)
  3061. {
  3062. struct usb_device *udev;
  3063. struct em28xx *dev = NULL;
  3064. int retval;
  3065. bool has_vendor_audio = false, has_video = false, has_dvb = false;
  3066. int i, nr, try_bulk;
  3067. const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
  3068. char *speed;
  3069. udev = usb_get_dev(interface_to_usbdev(interface));
  3070. /* Check to see next free device and mark as used */
  3071. do {
  3072. nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS);
  3073. if (nr >= EM28XX_MAXBOARDS) {
  3074. /* No free device slots */
  3075. printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
  3076. EM28XX_MAXBOARDS);
  3077. retval = -ENOMEM;
  3078. goto err_no_slot;
  3079. }
  3080. } while (test_and_set_bit(nr, em28xx_devused));
  3081. /* Don't register audio interfaces */
  3082. if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
  3083. em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
  3084. "interface %i, class %i\n",
  3085. le16_to_cpu(udev->descriptor.idVendor),
  3086. le16_to_cpu(udev->descriptor.idProduct),
  3087. ifnum,
  3088. interface->altsetting[0].desc.bInterfaceClass);
  3089. retval = -ENODEV;
  3090. goto err;
  3091. }
  3092. /* allocate memory for our device state and initialize it */
  3093. dev = kzalloc(sizeof(*dev), GFP_KERNEL);
  3094. if (dev == NULL) {
  3095. em28xx_err(DRIVER_NAME ": out of memory!\n");
  3096. retval = -ENOMEM;
  3097. goto err;
  3098. }
  3099. /* compute alternate max packet sizes */
  3100. dev->alt_max_pkt_size_isoc =
  3101. kmalloc(sizeof(dev->alt_max_pkt_size_isoc[0]) *
  3102. interface->num_altsetting, GFP_KERNEL);
  3103. if (dev->alt_max_pkt_size_isoc == NULL) {
  3104. em28xx_errdev("out of memory!\n");
  3105. kfree(dev);
  3106. retval = -ENOMEM;
  3107. goto err;
  3108. }
  3109. /* Get endpoints */
  3110. for (i = 0; i < interface->num_altsetting; i++) {
  3111. int ep;
  3112. for (ep = 0; ep < interface->altsetting[i].desc.bNumEndpoints; ep++) {
  3113. const struct usb_endpoint_descriptor *e;
  3114. int sizedescr, size;
  3115. e = &interface->altsetting[i].endpoint[ep].desc;
  3116. sizedescr = le16_to_cpu(e->wMaxPacketSize);
  3117. size = sizedescr & 0x7ff;
  3118. if (udev->speed == USB_SPEED_HIGH)
  3119. size = size * hb_mult(sizedescr);
  3120. if (usb_endpoint_dir_in(e)) {
  3121. switch (e->bEndpointAddress) {
  3122. case 0x82:
  3123. has_video = true;
  3124. if (usb_endpoint_xfer_isoc(e)) {
  3125. dev->analog_ep_isoc =
  3126. e->bEndpointAddress;
  3127. dev->alt_max_pkt_size_isoc[i] = size;
  3128. } else if (usb_endpoint_xfer_bulk(e)) {
  3129. dev->analog_ep_bulk =
  3130. e->bEndpointAddress;
  3131. }
  3132. break;
  3133. case 0x83:
  3134. if (usb_endpoint_xfer_isoc(e)) {
  3135. has_vendor_audio = true;
  3136. } else {
  3137. printk(KERN_INFO DRIVER_NAME
  3138. ": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
  3139. }
  3140. break;
  3141. case 0x84:
  3142. if (has_video &&
  3143. (usb_endpoint_xfer_bulk(e))) {
  3144. dev->analog_ep_bulk =
  3145. e->bEndpointAddress;
  3146. } else {
  3147. if (usb_endpoint_xfer_isoc(e)) {
  3148. if (size > dev->dvb_max_pkt_size_isoc) {
  3149. has_dvb = true; /* see NOTE (~) */
  3150. dev->dvb_ep_isoc = e->bEndpointAddress;
  3151. dev->dvb_max_pkt_size_isoc = size;
  3152. dev->dvb_alt_isoc = i;
  3153. }
  3154. } else {
  3155. has_dvb = true;
  3156. dev->dvb_ep_bulk = e->bEndpointAddress;
  3157. }
  3158. }
  3159. break;
  3160. }
  3161. }
  3162. /* NOTE:
  3163. * Old logic with support for isoc transfers only was:
  3164. * 0x82 isoc => analog
  3165. * 0x83 isoc => audio
  3166. * 0x84 isoc => digital
  3167. *
  3168. * New logic with support for bulk transfers
  3169. * 0x82 isoc => analog
  3170. * 0x82 bulk => analog
  3171. * 0x83 isoc* => audio
  3172. * 0x84 isoc => digital
  3173. * 0x84 bulk => analog or digital**
  3174. * (*: audio should always be isoc)
  3175. * (**: analog, if ep 0x82 is isoc, otherwise digital)
  3176. *
  3177. * The new logic preserves backwards compatibility and
  3178. * reflects the endpoint configurations we have seen
  3179. * so far. But there might be devices for which this
  3180. * logic is not sufficient...
  3181. */
  3182. /*
  3183. * NOTE (~): some manufacturers (e.g. Terratec) disable
  3184. * endpoints by setting wMaxPacketSize to 0 bytes for
  3185. * all alt settings. So far, we've seen this for
  3186. * DVB isoc endpoints only.
  3187. */
  3188. }
  3189. }
  3190. if (!(has_vendor_audio || has_video || has_dvb)) {
  3191. retval = -ENODEV;
  3192. goto err_free;
  3193. }
  3194. switch (udev->speed) {
  3195. case USB_SPEED_LOW:
  3196. speed = "1.5";
  3197. break;
  3198. case USB_SPEED_UNKNOWN:
  3199. case USB_SPEED_FULL:
  3200. speed = "12";
  3201. break;
  3202. case USB_SPEED_HIGH:
  3203. speed = "480";
  3204. break;
  3205. default:
  3206. speed = "unknown";
  3207. }
  3208. printk(KERN_INFO DRIVER_NAME
  3209. ": New device %s %s @ %s Mbps "
  3210. "(%04x:%04x, interface %d, class %d)\n",
  3211. udev->manufacturer ? udev->manufacturer : "",
  3212. udev->product ? udev->product : "",
  3213. speed,
  3214. le16_to_cpu(udev->descriptor.idVendor),
  3215. le16_to_cpu(udev->descriptor.idProduct),
  3216. ifnum,
  3217. interface->altsetting->desc.bInterfaceNumber);
  3218. /*
  3219. * Make sure we have 480 Mbps of bandwidth, otherwise things like
  3220. * video stream wouldn't likely work, since 12 Mbps is generally
  3221. * not enough even for most Digital TV streams.
  3222. */
  3223. if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
  3224. printk(DRIVER_NAME ": Device initialization failed.\n");
  3225. printk(DRIVER_NAME ": Device must be connected to a high-speed"
  3226. " USB 2.0 port.\n");
  3227. retval = -ENODEV;
  3228. goto err_free;
  3229. }
  3230. dev->devno = nr;
  3231. dev->model = id->driver_info;
  3232. dev->alt = -1;
  3233. dev->is_audio_only = has_vendor_audio && !(has_video || has_dvb);
  3234. dev->has_video = has_video;
  3235. dev->ifnum = ifnum;
  3236. if (has_vendor_audio) {
  3237. printk(KERN_INFO DRIVER_NAME ": Audio interface %i found %s\n",
  3238. ifnum, "(Vendor Class)");
  3239. dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR;
  3240. }
  3241. /* Checks if audio is provided by a USB Audio Class interface */
  3242. for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
  3243. struct usb_interface *uif = udev->config->interface[i];
  3244. if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
  3245. if (has_vendor_audio)
  3246. em28xx_err("em28xx: device seems to have vendor AND usb audio class interfaces !\n"
  3247. "\t\tThe vendor interface will be ignored. Please contact the developers <linux-media@vger.kernel.org>\n");
  3248. dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS;
  3249. break;
  3250. }
  3251. }
  3252. if (has_video)
  3253. printk(KERN_INFO DRIVER_NAME
  3254. ": Video interface %i found:%s%s\n",
  3255. ifnum,
  3256. dev->analog_ep_bulk ? " bulk" : "",
  3257. dev->analog_ep_isoc ? " isoc" : "");
  3258. if (has_dvb)
  3259. printk(KERN_INFO DRIVER_NAME
  3260. ": DVB interface %i found:%s%s\n",
  3261. ifnum,
  3262. dev->dvb_ep_bulk ? " bulk" : "",
  3263. dev->dvb_ep_isoc ? " isoc" : "");
  3264. dev->num_alt = interface->num_altsetting;
  3265. if ((unsigned)card[nr] < em28xx_bcount)
  3266. dev->model = card[nr];
  3267. /* save our data pointer in this interface device */
  3268. usb_set_intfdata(interface, dev);
  3269. /* allocate device struct */
  3270. mutex_init(&dev->lock);
  3271. retval = em28xx_init_dev(dev, udev, interface, nr);
  3272. if (retval) {
  3273. goto err_free;
  3274. }
  3275. if (usb_xfer_mode < 0) {
  3276. if (dev->board.is_webcam)
  3277. try_bulk = 1;
  3278. else
  3279. try_bulk = 0;
  3280. } else {
  3281. try_bulk = usb_xfer_mode > 0;
  3282. }
  3283. /* Select USB transfer types to use */
  3284. if (has_video) {
  3285. if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
  3286. dev->analog_xfer_bulk = 1;
  3287. em28xx_info("analog set to %s mode.\n",
  3288. dev->analog_xfer_bulk ? "bulk" : "isoc");
  3289. }
  3290. if (has_dvb) {
  3291. if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
  3292. dev->dvb_xfer_bulk = 1;
  3293. em28xx_info("dvb set to %s mode.\n",
  3294. dev->dvb_xfer_bulk ? "bulk" : "isoc");
  3295. }
  3296. kref_init(&dev->ref);
  3297. request_modules(dev);
  3298. /* Should be the last thing to do, to avoid newer udev's to
  3299. open the device before fully initializing it
  3300. */
  3301. return 0;
  3302. err_free:
  3303. kfree(dev->alt_max_pkt_size_isoc);
  3304. kfree(dev);
  3305. err:
  3306. clear_bit(nr, em28xx_devused);
  3307. err_no_slot:
  3308. usb_put_dev(udev);
  3309. return retval;
  3310. }
  3311. /*
  3312. * em28xx_usb_disconnect()
  3313. * called when the device gets disconnected
  3314. * video device will be unregistered on v4l2_close in case it is still open
  3315. */
  3316. static void em28xx_usb_disconnect(struct usb_interface *interface)
  3317. {
  3318. struct em28xx *dev;
  3319. dev = usb_get_intfdata(interface);
  3320. usb_set_intfdata(interface, NULL);
  3321. if (!dev)
  3322. return;
  3323. dev->disconnected = 1;
  3324. em28xx_info("Disconnecting %s\n", dev->name);
  3325. flush_request_modules(dev);
  3326. em28xx_close_extension(dev);
  3327. em28xx_release_resources(dev);
  3328. kref_put(&dev->ref, em28xx_free_device);
  3329. }
  3330. static int em28xx_usb_suspend(struct usb_interface *interface,
  3331. pm_message_t message)
  3332. {
  3333. struct em28xx *dev;
  3334. dev = usb_get_intfdata(interface);
  3335. if (!dev)
  3336. return 0;
  3337. em28xx_suspend_extension(dev);
  3338. return 0;
  3339. }
  3340. static int em28xx_usb_resume(struct usb_interface *interface)
  3341. {
  3342. struct em28xx *dev;
  3343. dev = usb_get_intfdata(interface);
  3344. if (!dev)
  3345. return 0;
  3346. em28xx_resume_extension(dev);
  3347. return 0;
  3348. }
  3349. static struct usb_driver em28xx_usb_driver = {
  3350. .name = "em28xx",
  3351. .probe = em28xx_usb_probe,
  3352. .disconnect = em28xx_usb_disconnect,
  3353. .suspend = em28xx_usb_suspend,
  3354. .resume = em28xx_usb_resume,
  3355. .reset_resume = em28xx_usb_resume,
  3356. .id_table = em28xx_id_table,
  3357. };
  3358. module_usb_driver(em28xx_usb_driver);