em28xx-cards.c 102 KB

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