blob: 146341aeb7823458a8e019342a2d67f5796030b3 [file] [log] [blame]
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001/*
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002 em28xx-cards.c - driver for Empia EM2800/EM2820/2840 USB
3 video capture devices
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08004
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -08005 Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
6 Markus Rechberger <mrechberger@gmail.com>
Mauro Carvalho Chehab2e7c6dc2006-04-03 07:53:40 -03007 Mauro Carvalho Chehab <mchehab@infradead.org>
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -08008 Sascha Sommer <saschasommer@freenet.de>
Frank Schaeferc647a912012-11-08 14:11:52 -03009 Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080010
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
Mauro Carvalho Chehab8314d402016-10-12 07:26:47 -030026#include "em28xx.h"
27
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080028#include <linux/init.h>
29#include <linux/module.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090030#include <linux/slab.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080031#include <linux/delay.h>
32#include <linux/i2c.h>
33#include <linux/usb.h>
34#include <media/tuner.h>
Mauro Carvalho Chehabd647f0b2015-11-13 19:40:07 -020035#include <media/drv-intf/msp3400.h>
Mauro Carvalho Chehabb5dcee22015-11-10 12:01:44 -020036#include <media/i2c/saa7115.h>
Javier Martinez Canillasb802fb92016-02-05 17:09:56 -020037#include <dt-bindings/media/tvp5150.h>
Mauro Carvalho Chehabb5dcee22015-11-10 12:01:44 -020038#include <media/i2c/tvaudio.h>
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -030039#include <media/i2c-addr.h>
Mauro Carvalho Chehab1f6173e2005-11-08 21:37:16 -080040#include <media/tveeprom.h>
Mauro Carvalho Chehab9bb13a62006-01-09 15:25:37 -020041#include <media/v4l2-common.h>
Matthieu Rogez0899f622016-03-04 18:33:08 -030042#include <sound/ac97_codec.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080043
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080044
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030045#define DRIVER_NAME "em28xx"
46
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030047static int tuner = -1;
48module_param(tuner, int, 0444);
49MODULE_PARM_DESC(tuner, "tuner type");
50
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -030051static unsigned int disable_ir;
52module_param(disable_ir, int, 0444);
53MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
54
Devin Heitmuellere2a1b792009-05-27 23:44:10 -030055static unsigned int disable_usb_speed_check;
56module_param(disable_usb_speed_check, int, 0444);
57MODULE_PARM_DESC(disable_usb_speed_check,
58 "override min bandwidth requirement of 480M bps");
59
Devin Heitmuellerd3829fa2013-01-04 16:16:24 -030060static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = -1U };
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030061module_param_array(card, int, NULL, 0444);
62MODULE_PARM_DESC(card, "card type");
63
Frank Schaefer7e5d74e2012-12-26 15:12:37 -030064static int usb_xfer_mode = -1;
65module_param(usb_xfer_mode, int, 0444);
66MODULE_PARM_DESC(usb_xfer_mode,
67 "USB transfer mode for frame data (-1 = auto, 0 = prefer isoc, 1 = prefer bulk)");
Frank Schaefer454fe922012-11-08 14:11:53 -030068
Chris Rankin38b61eb2011-08-20 08:21:03 -030069/* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS - 1 */
Fengguang Wu9e8ca382014-01-15 18:50:26 -030070static DECLARE_BITMAP(em28xx_devused, EM28XX_MAXBOARDS);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030071
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030072struct em28xx_hash_table {
73 unsigned long hash;
74 unsigned int model;
75 unsigned int tuner;
76};
77
Ezequiel Garcia60332f02012-04-28 09:57:01 -030078static void em28xx_pre_card_setup(struct em28xx *dev);
79
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -030080/*
81 * Reset sequences for analog/digital modes
82 */
83
84/* Reset for the most [analog] boards */
85static struct em28xx_reg_seq default_analog[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -030086 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -030087 { -1, -1, -1, -1},
88};
89
90/* Reset for the most [digital] boards */
91static struct em28xx_reg_seq default_digital[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -030092 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -030093 { -1, -1, -1, -1},
94};
95
96/* Board Hauppauge WinTV HVR 900 analog */
97static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -030098 {EM2820_R08_GPIO_CTRL, 0x2d, ~EM_GPIO_4, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -030099 { 0x05, 0xff, 0x10, 10},
100 { -1, -1, -1, -1},
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300101};
102
103/* Board Hauppauge WinTV HVR 900 digital */
104static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300105 {EM2820_R08_GPIO_CTRL, 0x2e, ~EM_GPIO_4, 10},
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300106 {EM2880_R04_GPO, 0x04, 0x0f, 10},
107 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300108 { -1, -1, -1, -1},
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300109};
110
Devin Heitmueller7030f522011-03-13 02:04:53 -0300111/* Board Hauppauge WinTV HVR 900 (R2) digital */
112static struct em28xx_reg_seq hauppauge_wintv_hvr_900R2_digital[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300113 {EM2820_R08_GPIO_CTRL, 0x2e, ~EM_GPIO_4, 10},
Devin Heitmueller7030f522011-03-13 02:04:53 -0300114 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300115 { -1, -1, -1, -1},
Devin Heitmueller7030f522011-03-13 02:04:53 -0300116};
117
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300118/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
119static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300120 {EM2820_R08_GPIO_CTRL, 0x69, ~EM_GPIO_4, 10},
121 { -1, -1, -1, -1},
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300122};
123
124/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300125
126/* Board - EM2870 Kworld 355u
127 Analog - No input analog */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300128
Franklin Mengd7de5d82009-06-06 17:05:02 -0300129/* Board - EM2882 Kworld 315U digital */
130static struct em28xx_reg_seq em2882_kworld_315u_digital[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300131 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
132 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10},
Franklin Mengd7de5d82009-06-06 17:05:02 -0300133 {EM2880_R04_GPO, 0x04, 0xff, 10},
134 {EM2880_R04_GPO, 0x0c, 0xff, 10},
Frank Schaeferc074fc42013-06-03 14:12:03 -0300135 {EM2820_R08_GPIO_CTRL, 0x7e, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300136 { -1, -1, -1, -1},
Franklin Mengd7de5d82009-06-06 17:05:02 -0300137};
138
139static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio[] = {
140 {EM2880_R04_GPO, 0x08, 0xff, 10},
141 {EM2880_R04_GPO, 0x0c, 0xff, 10},
142 {EM2880_R04_GPO, 0x08, 0xff, 10},
143 {EM2880_R04_GPO, 0x0c, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300144 { -1, -1, -1, -1},
Franklin Mengd7de5d82009-06-06 17:05:02 -0300145};
146
Robert Krakora6e7b9ea2009-01-18 21:59:34 -0300147static struct em28xx_reg_seq kworld_330u_analog[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300148 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
Robert Krakora6e7b9ea2009-01-18 21:59:34 -0300149 {EM2880_R04_GPO, 0x00, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300150 { -1, -1, -1, -1},
Robert Krakora6e7b9ea2009-01-18 21:59:34 -0300151};
152
153static struct em28xx_reg_seq kworld_330u_digital[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300154 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
Robert Krakora6e7b9ea2009-01-18 21:59:34 -0300155 {EM2880_R04_GPO, 0x08, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300156 { -1, -1, -1, -1},
Robert Krakora6e7b9ea2009-01-18 21:59:34 -0300157};
158
Devin Heitmueller19859222009-06-19 00:33:54 -0300159/* Evga inDtube
160 GPIO0 - Enable digital power (s5h1409) - low to enable
161 GPIO1 - Enable analog power (tvp5150/emp202) - low to enable
162 GPIO4 - xc3028 reset
163 GOP3 - s5h1409 reset
164 */
165static struct em28xx_reg_seq evga_indtube_analog[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300166 {EM2820_R08_GPIO_CTRL, 0x79, 0xff, 60},
Devin Heitmueller19859222009-06-19 00:33:54 -0300167 { -1, -1, -1, -1},
168};
169
170static struct em28xx_reg_seq evga_indtube_digital[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300171 {EM2820_R08_GPIO_CTRL, 0x7a, 0xff, 1},
Devin Heitmueller19859222009-06-19 00:33:54 -0300172 {EM2880_R04_GPO, 0x04, 0xff, 10},
173 {EM2880_R04_GPO, 0x0c, 0xff, 1},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300174 { -1, -1, -1, -1},
Devin Heitmueller19859222009-06-19 00:33:54 -0300175};
176
Jarod Wilson7e48b302010-03-07 17:55:43 -0300177/*
Jean-Francois Thibert6dbea9f2013-10-09 11:18:05 -0300178 * KWorld PlusTV 340U, UB435-Q and UB435-Q V2 (ATSC) GPIOs map:
Jarod Wilson7e48b302010-03-07 17:55:43 -0300179 * EM_GPIO_0 - currently unknown
180 * EM_GPIO_1 - LED disable/enable (1 = off, 0 = on)
181 * EM_GPIO_2 - currently unknown
182 * EM_GPIO_3 - currently unknown
183 * EM_GPIO_4 - TDA18271HD/C1 tuner (1 = active, 0 = in reset)
184 * EM_GPIO_5 - LGDT3304 ATSC/QAM demod (1 = active, 0 = in reset)
185 * EM_GPIO_6 - currently unknown
186 * EM_GPIO_7 - currently unknown
187 */
188static struct em28xx_reg_seq kworld_a340_digital[] = {
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300189 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
190 { -1, -1, -1, -1},
Jarod Wilson7e48b302010-03-07 17:55:43 -0300191};
192
Mauro Carvalho Chehab02bc1f52014-03-03 16:28:39 -0300193static struct em28xx_reg_seq kworld_ub435q_v3_digital[] = {
Mauro Carvalho Chehabfdf1bc92014-11-28 08:34:15 -0300194 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 100},
195 {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 100},
Mauro Carvalho Chehab02bc1f52014-03-03 16:28:39 -0300196 {EM2874_R80_GPIO_P0_CTRL, 0xbe, 0xff, 100},
197 {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 100},
198 { -1, -1, -1, -1},
199};
200
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300201/* Pinnacle Hybrid Pro eb1a:2881 */
202static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300203 {EM2820_R08_GPIO_CTRL, 0xfd, ~EM_GPIO_4, 10},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300204 { -1, -1, -1, -1},
205};
206
207static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300208 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300209 {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */
210 {EM2880_R04_GPO, 0x0c, 0xff, 1},
211 { -1, -1, -1, -1},
212};
213
Michel Garniercec4e6c2010-10-16 14:42:01 -0300214static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_analog[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300215 {EM2820_R08_GPIO_CTRL, 0x6d, ~EM_GPIO_4, 10},
Michel Garniercec4e6c2010-10-16 14:42:01 -0300216 {EM2880_R04_GPO, 0x00, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300217 { -1, -1, -1, -1},
Michel Garniercec4e6c2010-10-16 14:42:01 -0300218};
219
220static struct em28xx_reg_seq terratec_cinergy_USB_XS_FR_digital[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300221 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
Michel Garniercec4e6c2010-10-16 14:42:01 -0300222 {EM2880_R04_GPO, 0x08, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300223 { -1, -1, -1, -1},
Michel Garniercec4e6c2010-10-16 14:42:01 -0300224};
225
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300226/* PCTV HD Mini (80e) GPIOs
227 0-5: not used
228 6: demod reset, active low
229 7: LED on, active high */
230static struct em28xx_reg_seq em2874_pctv_80e_digital[] = {
231 {EM28XX_R06_I2C_CLK, 0x45, 0xff, 10}, /*400 KHz*/
Mauro Carvalho Chehab88e4fcd2014-03-04 20:49:07 -0300232 {EM2874_R80_GPIO_P0_CTRL, 0x00, 0xff, 100},/*Demod reset*/
233 {EM2874_R80_GPIO_P0_CTRL, 0x40, 0xff, 10},
Devin Heitmueller38b2df92012-08-13 21:18:02 -0300234 { -1, -1, -1, -1},
235};
236
Antti Palosaari285eb1a2009-09-15 14:42:13 -0300237/* eb1a:2868 Reddo DVB-C USB TV Box
238 GPIO4 - CU1216L NIM
239 Other GPIOs seems to be don't care. */
240static struct em28xx_reg_seq reddo_dvb_c_usb_box[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300241 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10},
242 {EM2820_R08_GPIO_CTRL, 0xde, 0xff, 10},
243 {EM2820_R08_GPIO_CTRL, 0xfe, 0xff, 10},
244 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
245 {EM2820_R08_GPIO_CTRL, 0x7f, 0xff, 10},
246 {EM2820_R08_GPIO_CTRL, 0x6f, 0xff, 10},
247 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300248 { -1, -1, -1, -1},
Antti Palosaari285eb1a2009-09-15 14:42:13 -0300249};
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300250
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300251/* Callback for the most boards */
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300252static struct em28xx_reg_seq default_tuner_gpio[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300253 {EM2820_R08_GPIO_CTRL, EM_GPIO_4, EM_GPIO_4, 10},
254 {EM2820_R08_GPIO_CTRL, 0, EM_GPIO_4, 10},
255 {EM2820_R08_GPIO_CTRL, EM_GPIO_4, EM_GPIO_4, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300256 { -1, -1, -1, -1},
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300257};
258
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -0300259/* Mute/unmute */
260static struct em28xx_reg_seq compro_unmute_tv_gpio[] = {
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300261 {EM2820_R08_GPIO_CTRL, 5, 7, 10},
262 { -1, -1, -1, -1},
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -0300263};
264
265static struct em28xx_reg_seq compro_unmute_svid_gpio[] = {
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300266 {EM2820_R08_GPIO_CTRL, 4, 7, 10},
267 { -1, -1, -1, -1},
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -0300268};
269
270static struct em28xx_reg_seq compro_mute_gpio[] = {
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300271 {EM2820_R08_GPIO_CTRL, 6, 7, 10},
272 { -1, -1, -1, -1},
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -0300273};
274
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -0300275/* Terratec AV350 */
276static struct em28xx_reg_seq terratec_av350_mute_gpio[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300277 {EM2820_R08_GPIO_CTRL, 0xff, 0x7f, 10},
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -0300278 { -1, -1, -1, -1},
279};
280
281static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300282 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -0300283 { -1, -1, -1, -1},
284};
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300285
286static struct em28xx_reg_seq silvercrest_reg_seq[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300287 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
288 {EM2820_R08_GPIO_CTRL, 0x01, 0xf7, 10},
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300289 { -1, -1, -1, -1},
290};
291
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -0300292static struct em28xx_reg_seq vc211a_enable[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300293 {EM2820_R08_GPIO_CTRL, 0xff, 0x07, 10},
294 {EM2820_R08_GPIO_CTRL, 0xff, 0x0f, 10},
295 {EM2820_R08_GPIO_CTRL, 0xff, 0x0b, 10},
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -0300296 { -1, -1, -1, -1},
297};
298
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -0300299static struct em28xx_reg_seq dikom_dk300_digital[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300300 {EM2820_R08_GPIO_CTRL, 0x6e, ~EM_GPIO_4, 10},
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -0300301 {EM2880_R04_GPO, 0x08, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300302 { -1, -1, -1, -1},
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -0300303};
304
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -0300305/* Reset for the most [digital] boards */
306static struct em28xx_reg_seq leadership_digital[] = {
Frank Schaefer907d1092013-06-03 14:12:02 -0300307 {EM2874_R80_GPIO_P0_CTRL, 0x70, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300308 { -1, -1, -1, -1},
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -0300309};
310
311static struct em28xx_reg_seq leadership_reset[] = {
Frank Schaefer907d1092013-06-03 14:12:02 -0300312 {EM2874_R80_GPIO_P0_CTRL, 0xf0, 0xff, 10},
313 {EM2874_R80_GPIO_P0_CTRL, 0xb0, 0xff, 10},
314 {EM2874_R80_GPIO_P0_CTRL, 0xf0, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300315 { -1, -1, -1, -1},
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -0300316};
317
Antti Palosaari460312e2011-05-25 17:03:50 -0300318/* 2013:024f PCTV nanoStick T2 290e
Antti Palosaarid6a5f922011-04-07 16:34:44 -0300319 * GPIO_6 - demod reset
320 * GPIO_7 - LED
321 */
322static struct em28xx_reg_seq pctv_290e[] = {
Frank Schaefer907d1092013-06-03 14:12:02 -0300323 {EM2874_R80_GPIO_P0_CTRL, 0x00, 0xff, 80},
324 {EM2874_R80_GPIO_P0_CTRL, 0x40, 0xff, 80}, /* GPIO_6 = 1 */
325 {EM2874_R80_GPIO_P0_CTRL, 0xc0, 0xff, 80}, /* GPIO_7 = 1 */
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300326 { -1, -1, -1, -1},
Antti Palosaarid6a5f922011-04-07 16:34:44 -0300327};
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -0300328
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300329#if 0
330static struct em28xx_reg_seq terratec_h5_gpio[] = {
Frank Schaeferc074fc42013-06-03 14:12:03 -0300331 {EM2820_R08_GPIO_CTRL, 0xff, 0xff, 10},
Frank Schaefer907d1092013-06-03 14:12:02 -0300332 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 100},
333 {EM2874_R80_GPIO_P0_CTRL, 0xf2, 0xff, 50},
334 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 50},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300335 { -1, -1, -1, -1},
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300336};
337
338static struct em28xx_reg_seq terratec_h5_digital[] = {
Frank Schaefer907d1092013-06-03 14:12:02 -0300339 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 10},
340 {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100},
341 {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300342 { -1, -1, -1, -1},
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -0300343};
344#endif
345
Antti Palosaari36588712011-08-01 01:15:30 -0300346/* 2013:024f PCTV DVB-S2 Stick 460e
347 * GPIO_0 - POWER_ON
348 * GPIO_1 - BOOST
349 * GPIO_2 - VUV_LNB (red LED)
350 * GPIO_3 - EXT_12V
351 * GPIO_4 - INT_DEM (DEMOD GPIO_0)
352 * GPIO_5 - INT_LNB
353 * GPIO_6 - RESET_DEM
354 * GPIO_7 - LED (green LED)
355 */
356static struct em28xx_reg_seq pctv_460e[] = {
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300357 {EM2874_R80_GPIO_P0_CTRL, 0x01, 0xff, 50},
358 { 0x0d, 0xff, 0xff, 50},
359 {EM2874_R80_GPIO_P0_CTRL, 0x41, 0xff, 50}, /* GPIO_6=1 */
360 { 0x0d, 0x42, 0xff, 50},
361 {EM2874_R80_GPIO_P0_CTRL, 0x61, 0xff, 50}, /* GPIO_5=1 */
362 { -1, -1, -1, -1},
Antti Palosaari36588712011-08-01 01:15:30 -0300363};
364
Mauro Carvalho Chehab4159d012013-02-28 10:35:56 -0300365static struct em28xx_reg_seq c3tech_digital_duo_digital[] = {
Frank Schaefer907d1092013-06-03 14:12:02 -0300366 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 10},
367 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 10}, /* xc5000 reset */
368 {EM2874_R80_GPIO_P0_CTRL, 0xf9, 0xff, 35},
369 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 10},
370 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 10},
371 {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 10},
372 {EM2874_R80_GPIO_P0_CTRL, 0xbe, 0xff, 10},
373 {EM2874_R80_GPIO_P0_CTRL, 0xfe, 0xff, 20},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300374 { -1, -1, -1, -1},
Mauro Carvalho Chehab4159d012013-02-28 10:35:56 -0300375};
376
Antti Palosaariec573362013-02-25 09:01:13 -0300377/*
378 * 2013:0258 PCTV DVB-S2 Stick (461e)
379 * GPIO 0 = POWER_ON
380 * GPIO 1 = BOOST
381 * GPIO 2 = VUV_LNB (red LED)
382 * GPIO 3 = #EXT_12V
383 * GPIO 4 = INT_DEM
384 * GPIO 5 = INT_LNB
385 * GPIO 6 = #RESET_DEM
386 * GPIO 7 = P07_LED (green LED)
387 */
388static struct em28xx_reg_seq pctv_461e[] = {
389 {EM2874_R80_GPIO_P0_CTRL, 0x7f, 0xff, 0},
390 {0x0d, 0xff, 0xff, 0},
391 {EM2874_R80_GPIO_P0_CTRL, 0x3f, 0xff, 100}, /* reset demod */
392 {EM2874_R80_GPIO_P0_CTRL, 0x7f, 0xff, 200}, /* reset demod */
393 {0x0d, 0x42, 0xff, 0},
394 {EM2874_R80_GPIO_P0_CTRL, 0xeb, 0xff, 0},
395 {EM2874_R5F_TS_ENABLE, 0x84, 0x84, 0}, /* parallel? | null discard */
396 { -1, -1, -1, -1},
397};
398
Mauro Carvalho Chehab85032322011-11-24 15:01:45 -0200399#if 0
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300400static struct em28xx_reg_seq hauppauge_930c_gpio[] = {
Frank Schaefer907d1092013-06-03 14:12:02 -0300401 {EM2874_R80_GPIO_P0_CTRL, 0x6f, 0xff, 10},
402 {EM2874_R80_GPIO_P0_CTRL, 0x4f, 0xff, 10}, /* xc5000 reset */
403 {EM2874_R80_GPIO_P0_CTRL, 0x6f, 0xff, 10},
404 {EM2874_R80_GPIO_P0_CTRL, 0x4f, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300405 { -1, -1, -1, -1},
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300406};
407
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300408static struct em28xx_reg_seq hauppauge_930c_digital[] = {
Frank Schaefer907d1092013-06-03 14:12:02 -0300409 {EM2874_R80_GPIO_P0_CTRL, 0xf6, 0xff, 10},
410 {EM2874_R80_GPIO_P0_CTRL, 0xe6, 0xff, 100},
411 {EM2874_R80_GPIO_P0_CTRL, 0xa6, 0xff, 10},
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300412 { -1, -1, -1, -1},
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -0300413};
414#endif
415
Antti Palosaari35530852012-03-18 18:09:01 -0300416/* 1b80:e425 MaxMedia UB425-TC
Jakob Haufe7c1dfdb2013-04-13 11:03:37 -0300417 * 1b80:e1cc Delock 61959
Antti Palosaari35530852012-03-18 18:09:01 -0300418 * GPIO_6 - demod reset, 0=active
419 * GPIO_7 - LED, 0=active
420 */
421static struct em28xx_reg_seq maxmedia_ub425_tc[] = {
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300422 {EM2874_R80_GPIO_P0_CTRL, 0x83, 0xff, 100},
423 {EM2874_R80_GPIO_P0_CTRL, 0xc3, 0xff, 100}, /* GPIO_6 = 1 */
424 {EM2874_R80_GPIO_P0_CTRL, 0x43, 0xff, 000}, /* GPIO_7 = 0 */
425 { -1, -1, -1, -1},
Antti Palosaari35530852012-03-18 18:09:01 -0300426};
427
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -0300428/* 2304:0242 PCTV QuatroStick (510e)
429 * GPIO_2: decoder reset, 0=active
430 * GPIO_4: decoder suspend, 0=active
431 * GPIO_6: demod reset, 0=active
432 * GPIO_7: LED, 1=active
433 */
434static struct em28xx_reg_seq pctv_510e[] = {
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300435 {EM2874_R80_GPIO_P0_CTRL, 0x10, 0xff, 100},
436 {EM2874_R80_GPIO_P0_CTRL, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
437 {EM2874_R80_GPIO_P0_CTRL, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
438 { -1, -1, -1, -1},
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -0300439};
440
Antti Palosaaric247d7b2012-03-19 11:48:19 -0300441/* 2013:0251 PCTV QuatroStick nano (520e)
442 * GPIO_2: decoder reset, 0=active
443 * GPIO_4: decoder suspend, 0=active
444 * GPIO_6: demod reset, 0=active
445 * GPIO_7: LED, 1=active
446 */
447static struct em28xx_reg_seq pctv_520e[] = {
Frank Schaeferb68cafc2013-10-10 14:36:30 -0300448 {EM2874_R80_GPIO_P0_CTRL, 0x10, 0xff, 100},
449 {EM2874_R80_GPIO_P0_CTRL, 0x14, 0xff, 100}, /* GPIO_2 = 1 */
450 {EM2874_R80_GPIO_P0_CTRL, 0x54, 0xff, 050}, /* GPIO_6 = 1 */
451 {EM2874_R80_GPIO_P0_CTRL, 0xd4, 0xff, 000}, /* GPIO_7 = 1 */
452 { -1, -1, -1, -1},
Antti Palosaaric247d7b2012-03-19 11:48:19 -0300453};
454
Frank Schaefer0c37e732013-12-01 18:06:57 -0300455/* 1ae7:9003/9004 SpeedLink Vicious And Devine Laplace webcam
456 * reg 0x80/0x84:
457 * GPIO_0: capturing LED, 0=on, 1=off
458 * GPIO_2: AV mute button, 0=pressed, 1=unpressed
459 * GPIO 3: illumination button, 0=pressed, 1=unpressed
460 * GPIO_6: illumination/flash LED, 0=on, 1=off
461 * reg 0x81/0x85:
462 * GPIO_7: snapshot button, 0=pressed, 1=unpressed
463 */
464static struct em28xx_reg_seq speedlink_vad_laplace_reg_seq[] = {
465 {EM2820_R08_GPIO_CTRL, 0xf7, 0xff, 10},
466 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xb2, 10},
467 { -1, -1, -1, -1},
468};
469
Antti Palosaari19229242014-04-10 22:11:27 -0300470static struct em28xx_reg_seq pctv_292e[] = {
471 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0},
472 {0x0d, 0xff, 0xff, 950},
473 {EM2874_R80_GPIO_P0_CTRL, 0xbd, 0xff, 100},
474 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 410},
475 {EM2874_R80_GPIO_P0_CTRL, 0x7d, 0xff, 300},
476 {EM2874_R80_GPIO_P0_CTRL, 0x7c, 0xff, 60},
477 {0x0d, 0x42, 0xff, 50},
478 {EM2874_R5F_TS_ENABLE, 0x85, 0xff, 0},
479 {-1, -1, -1, -1},
480};
481
Olli Salonenfc30dd762014-11-24 03:57:34 -0300482static struct em28xx_reg_seq terratec_t2_stick_hd[] = {
483 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0},
484 {0x0d, 0xff, 0xff, 600},
485 {EM2874_R80_GPIO_P0_CTRL, 0xfc, 0xff, 10},
486 {EM2874_R80_GPIO_P0_CTRL, 0xbc, 0xff, 100},
487 {EM2874_R80_GPIO_P0_CTRL, 0xfc, 0xff, 100},
488 {EM2874_R80_GPIO_P0_CTRL, 0x00, 0xff, 300},
489 {EM2874_R80_GPIO_P0_CTRL, 0xf8, 0xff, 100},
490 {EM2874_R80_GPIO_P0_CTRL, 0xfc, 0xff, 300},
491 {0x0d, 0x42, 0xff, 1000},
492 {EM2874_R5F_TS_ENABLE, 0x85, 0xff, 0},
493 {-1, -1, -1, -1},
494};
495
Satoshi Nagahamaab4d1452016-05-06 16:35:05 -0300496static struct em28xx_reg_seq plex_px_bcud[] = {
497 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0},
498 {0x0d, 0xff, 0xff, 0},
499 {EM2874_R50_IR_CONFIG, 0x01, 0xff, 0},
500 {EM28XX_R06_I2C_CLK, 0x40, 0xff, 0},
501 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 100},
502 {EM28XX_R12_VINENABLE, 0x20, 0x20, 0},
503 {0x0d, 0x42, 0xff, 1000},
504 {EM2874_R80_GPIO_P0_CTRL, 0xfc, 0xff, 10},
505 {EM2874_R80_GPIO_P0_CTRL, 0xfd, 0xff, 10},
506 {0x73, 0xfd, 0xff, 100},
507 {-1, -1, -1, -1},
508};
509
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300510/*
Olli Salonen11a2a942016-04-04 12:12:52 -0300511 * 2040:0265 Hauppauge WinTV-dualHD DVB
Kevin Cheng15863422017-01-10 01:14:29 -0200512 * 2040:026d Hauppauge WinTV-dualHD ATSC/QAM
Olli Salonen11a2a942016-04-04 12:12:52 -0300513 * reg 0x80/0x84:
514 * GPIO_0: Yellow LED tuner 1, 0=on, 1=off
515 * GPIO_1: Green LED tuner 1, 0=on, 1=off
516 * GPIO_2: Yellow LED tuner 2, 0=on, 1=off
517 * GPIO_3: Green LED tuner 2, 0=on, 1=off
518 * GPIO_5: Reset #2, 0=active
519 * GPIO_6: Reset #1, 0=active
520 */
521static struct em28xx_reg_seq hauppauge_dualhd_dvb[] = {
522 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 0},
523 {0x0d, 0xff, 0xff, 200},
524 {0x50, 0x04, 0xff, 300},
525 {EM2874_R80_GPIO_P0_CTRL, 0xbf, 0xff, 100}, /* demod 1 reset */
526 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 100},
527 {EM2874_R80_GPIO_P0_CTRL, 0xdf, 0xff, 100}, /* demod 2 reset */
528 {EM2874_R80_GPIO_P0_CTRL, 0xff, 0xff, 100},
529 {EM2874_R5F_TS_ENABLE, 0x44, 0xff, 50},
530 {EM2874_R5D_TS1_PKT_SIZE, 0x05, 0xff, 50},
531 {EM2874_R5E_TS2_PKT_SIZE, 0x05, 0xff, 50},
532 {-1, -1, -1, -1},
533};
534
535/*
Frank Schaeferf52226092013-12-01 18:06:52 -0300536 * Button definitions
537 */
538static struct em28xx_button std_snapshot_button[] = {
539 {
540 .role = EM28XX_BUTTON_SNAPSHOT,
541 .reg_r = EM28XX_R0C_USBSUSP,
542 .reg_clearing = EM28XX_R0C_USBSUSP,
543 .mask = EM28XX_R0C_USBSUSP_SNAPSHOT,
544 .inverted = 0,
545 },
546 {-1, 0, 0, 0, 0},
547};
548
Frank Schaefer0c37e732013-12-01 18:06:57 -0300549static struct em28xx_button speedlink_vad_laplace_buttons[] = {
550 {
551 .role = EM28XX_BUTTON_SNAPSHOT,
552 .reg_r = EM2874_R85_GPIO_P1_STATE,
553 .mask = 0x80,
554 .inverted = 1,
555 },
556 {
557 .role = EM28XX_BUTTON_ILLUMINATION,
558 .reg_r = EM2874_R84_GPIO_P0_STATE,
559 .mask = 0x08,
560 .inverted = 1,
561 },
562 {-1, 0, 0, 0, 0},
563};
564
565/*
566 * LED definitions
567 */
568static struct em28xx_led speedlink_vad_laplace_leds[] = {
569 {
570 .role = EM28XX_LED_ANALOG_CAPTURING,
571 .gpio_reg = EM2874_R80_GPIO_P0_CTRL,
572 .gpio_mask = 0x01,
573 .inverted = 1,
574 },
575 {
576 .role = EM28XX_LED_ILLUMINATION,
577 .gpio_reg = EM2874_R80_GPIO_P0_CTRL,
578 .gpio_mask = 0x40,
579 .inverted = 1,
580 },
581 {-1, 0, 0, 0},
582};
583
Mauro Carvalho Chehab59432be2014-03-04 12:34:34 -0300584static struct em28xx_led kworld_ub435q_v3_leds[] = {
585 {
586 .role = EM28XX_LED_DIGITAL_CAPTURING,
587 .gpio_reg = EM2874_R80_GPIO_P0_CTRL,
588 .gpio_mask = 0x80,
589 .inverted = 1,
590 },
591 {-1, 0, 0, 0},
592};
593
Mauro Carvalho Chehab88e4fcd2014-03-04 20:49:07 -0300594static struct em28xx_led pctv_80e_leds[] = {
595 {
596 .role = EM28XX_LED_DIGITAL_CAPTURING,
597 .gpio_reg = EM2874_R80_GPIO_P0_CTRL,
598 .gpio_mask = 0x80,
599 .inverted = 0,
600 },
601 {-1, 0, 0, 0},
602};
603
Matthieu Rogez565e37d2016-02-28 08:26:22 -0300604static struct em28xx_led terratec_grabby_leds[] = {
605 {
606 .role = EM28XX_LED_ANALOG_CAPTURING,
607 .gpio_reg = EM2820_R08_GPIO_CTRL,
608 .gpio_mask = EM_GPIO_3,
609 .inverted = 1,
610 },
611 {-1, 0, 0, 0},
612};
613
Olli Salonen11a2a942016-04-04 12:12:52 -0300614static struct em28xx_led hauppauge_dualhd_leds[] = {
615 {
616 .role = EM28XX_LED_DIGITAL_CAPTURING,
617 .gpio_reg = EM2874_R80_GPIO_P0_CTRL,
618 .gpio_mask = EM_GPIO_1,
619 .inverted = 1,
620 },
621 {
622 .role = EM28XX_LED_DIGITAL_CAPTURING_TS2,
623 .gpio_reg = EM2874_R80_GPIO_P0_CTRL,
624 .gpio_mask = EM_GPIO_3,
625 .inverted = 1,
626 },
627 {-1, 0, 0, 0},
628};
629
Frank Schaeferf52226092013-12-01 18:06:52 -0300630/*
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300631 * Board definitions
632 */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800633struct em28xx_board em28xx_boards[] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300634 [EM2750_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -0300635 .name = "EM2710/EM2750/EM2751 webcam grabber",
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -0300636 .xclk = EM28XX_XCLK_FREQUENCY_20MHZ,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300637 .tuner_type = TUNER_ABSENT,
638 .is_webcam = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300639 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200640 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300641 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300642 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -0300643 .gpio = silvercrest_reg_seq,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300644 } },
645 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800646 [EM2800_BOARD_UNKNOWN] = {
647 .name = "Unknown EM2800 video grabber",
648 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800649 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300650 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300651 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300652 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200653 .type = EM28XX_VMUX_COMPOSITE,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300654 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300655 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300656 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800657 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300658 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300659 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300660 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800661 },
662 [EM2820_BOARD_UNKNOWN] = {
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300663 .name = "Unknown EM2750/28xx video grabber",
664 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -0300665 .is_webcam = 1, /* To enable sensor probe */
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800666 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300667 [EM2750_BOARD_DLCW_130] = {
668 /* Beijing Huaqi Information Digital Technology Co., Ltd */
669 .name = "Huaqi DLCW-130",
670 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300671 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300672 .tuner_type = TUNER_ABSENT,
673 .is_webcam = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300674 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200675 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300676 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300677 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300678 } },
679 },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200680 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
Markus Rechberger33ccaa32006-02-07 06:25:41 -0200681 .name = "Kworld PVR TV 2800 RF",
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300682 .tuner_type = TUNER_TEMIC_PAL,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200683 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300684 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300685 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200686 .type = EM28XX_VMUX_COMPOSITE,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300687 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300688 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300689 }, {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200690 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300691 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300692 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300693 } },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200694 },
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -0300695 [EM2820_BOARD_GADMEI_TVR200] = {
696 .name = "Gadmei TVR200",
697 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
698 .tda9887_conf = TDA9887_PRESENT,
699 .decoder = EM28XX_SAA711X,
700 .input = { {
701 .type = EM28XX_VMUX_TELEVISION,
702 .vmux = SAA7115_COMPOSITE2,
703 .amux = EM28XX_AMUX_LINE_IN,
704 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200705 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -0300706 .vmux = SAA7115_COMPOSITE0,
707 .amux = EM28XX_AMUX_LINE_IN,
708 }, {
709 .type = EM28XX_VMUX_SVIDEO,
710 .vmux = SAA7115_SVIDEO3,
711 .amux = EM28XX_AMUX_LINE_IN,
712 } },
713 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800714 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
715 .name = "Terratec Cinergy 250 USB",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800716 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300717 .has_ir_i2c = 1,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800718 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300719 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300720 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800721 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300722 .vmux = SAA7115_COMPOSITE2,
Frank Schaefer5e8d02b2013-01-05 08:44:09 -0300723 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300724 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200725 .type = EM28XX_VMUX_COMPOSITE,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300726 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300727 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300728 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800729 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300730 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300731 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300732 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800733 },
734 [EM2820_BOARD_PINNACLE_USB_2] = {
735 .name = "Pinnacle PCTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800736 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300737 .has_ir_i2c = 1,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800738 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300739 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300740 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800741 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300742 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300743 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300744 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200745 .type = EM28XX_VMUX_COMPOSITE,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300746 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300747 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300748 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800749 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300750 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300751 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300752 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800753 },
754 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
755 .name = "Hauppauge WinTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800756 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300757 .tda9887_conf = TDA9887_PRESENT |
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300758 TDA9887_PORT1_ACTIVE |
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300759 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800760 .decoder = EM28XX_TVP5150,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800761 .has_msp34xx = 1,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -0300762 .has_ir_i2c = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300763 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800764 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300765 .vmux = TVP5150_COMPOSITE0,
Hans Verkuil2474ed42006-03-19 12:35:57 -0300766 .amux = MSP_INPUT_DEFAULT,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300767 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800768 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300769 .vmux = TVP5150_SVIDEO,
Hans Verkuil07151722006-04-01 18:03:23 -0300770 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
771 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300772 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800773 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300774 [EM2820_BOARD_DLINK_USB_TV] = {
775 .name = "D-Link DUB-T210 TV Tuner",
776 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300777 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
778 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300779 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300780 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300781 .type = EM28XX_VMUX_TELEVISION,
782 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300783 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300784 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200785 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300786 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300787 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300788 }, {
789 .type = EM28XX_VMUX_SVIDEO,
790 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300791 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300792 } },
793 },
794 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
795 .name = "Hercules Smart TV USB 2.0",
796 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300797 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
798 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300799 .decoder = EM28XX_SAA711X,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300800 .input = { {
801 .type = EM28XX_VMUX_TELEVISION,
802 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300803 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300804 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200805 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300806 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300807 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300808 }, {
809 .type = EM28XX_VMUX_SVIDEO,
810 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300811 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300812 } },
813 },
814 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
815 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
816 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300817 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
818 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300819 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300820 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300821 .type = EM28XX_VMUX_TELEVISION,
822 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300823 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300824 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200825 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300826 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300827 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300828 }, {
829 .type = EM28XX_VMUX_SVIDEO,
830 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300831 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300832 } },
833 },
834 [EM2820_BOARD_GADMEI_UTV310] = {
835 .name = "Gadmei UTV310",
836 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300837 .tuner_type = TUNER_TNF_5335MF,
838 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300839 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300840 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300841 .type = EM28XX_VMUX_TELEVISION,
842 .vmux = SAA7115_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300843 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300844 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200845 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300846 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300847 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300848 }, {
849 .type = EM28XX_VMUX_SVIDEO,
850 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300851 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300852 } },
853 },
854 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
855 .name = "Leadtek Winfast USB II Deluxe",
856 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300857 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
Magnus Almca39d842009-11-13 05:48:24 -0300858 .has_ir_i2c = 1,
859 .tvaudio_addr = 0x58,
860 .tda9887_conf = TDA9887_PRESENT |
861 TDA9887_PORT2_ACTIVE |
862 TDA9887_QSS,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300863 .decoder = EM28XX_SAA711X,
Magnus Almca39d842009-11-13 05:48:24 -0300864 .adecoder = EM28XX_TVAUDIO,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300865 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300866 .type = EM28XX_VMUX_TELEVISION,
Magnus Almca39d842009-11-13 05:48:24 -0300867 .vmux = SAA7115_COMPOSITE4,
868 .amux = EM28XX_AMUX_AUX,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300869 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200870 .type = EM28XX_VMUX_COMPOSITE,
Magnus Almca39d842009-11-13 05:48:24 -0300871 .vmux = SAA7115_COMPOSITE5,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300872 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300873 }, {
874 .type = EM28XX_VMUX_SVIDEO,
Magnus Almca39d842009-11-13 05:48:24 -0300875 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300876 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300877 } },
Magnus Almca39d842009-11-13 05:48:24 -0300878 .radio = {
879 .type = EM28XX_RADIO,
880 .amux = EM28XX_AMUX_AUX,
881 }
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300882 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300883 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300884 .name = "Videology 20K14XUSB USB2.0",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300885 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300886 .tuner_type = TUNER_ABSENT,
887 .is_webcam = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300888 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200889 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300890 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300891 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300892 } },
893 },
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300894 [EM2820_BOARD_SILVERCREST_WEBCAM] = {
895 .name = "Silvercrest Webcam 1.3mpix",
896 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabc43221d2009-07-12 10:23:23 -0300897 .is_webcam = 1,
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300898 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200899 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300900 .vmux = 0,
901 .amux = EM28XX_AMUX_VIDEO,
902 .gpio = silvercrest_reg_seq,
903 } },
904 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300905 [EM2821_BOARD_SUPERCOMP_USB_2] = {
906 .name = "Supercomp USB 2.0 TV",
907 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300908 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
909 .tda9887_conf = TDA9887_PRESENT |
910 TDA9887_PORT1_ACTIVE |
911 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300912 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300913 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300914 .type = EM28XX_VMUX_TELEVISION,
915 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300916 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300917 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200918 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300919 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300920 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300921 }, {
922 .type = EM28XX_VMUX_SVIDEO,
923 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300924 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300925 } },
926 },
927 [EM2821_BOARD_USBGEAR_VD204] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300928 .name = "Usbgear VD204v9",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300929 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300930 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300931 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300932 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200933 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300934 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300935 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300936 }, {
937 .type = EM28XX_VMUX_SVIDEO,
938 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300939 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300940 } },
941 },
942 [EM2860_BOARD_NETGMBH_CAM] = {
943 /* Beijing Huaqi Information Digital Technology Co., Ltd */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300944 .name = "NetGMBH Cam",
945 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300946 .tuner_type = TUNER_ABSENT,
947 .is_webcam = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300948 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200949 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300950 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300951 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300952 } },
953 },
954 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300955 .name = "Typhoon DVD Maker",
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300956 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300957 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300958 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200959 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300960 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300961 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300962 }, {
963 .type = EM28XX_VMUX_SVIDEO,
964 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300965 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300966 } },
967 },
968 [EM2860_BOARD_GADMEI_UTV330] = {
969 .name = "Gadmei UTV330",
970 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300971 .tuner_type = TUNER_TNF_5335MF,
972 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300973 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300974 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300975 .type = EM28XX_VMUX_TELEVISION,
976 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300977 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300978 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -0200979 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300980 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300981 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300982 }, {
983 .type = EM28XX_VMUX_SVIDEO,
984 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300985 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300986 } },
987 },
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -0300988 [EM2861_BOARD_GADMEI_UTV330PLUS] = {
989 .name = "Gadmei UTV330+",
990 .tuner_type = TUNER_TNF_5335MF,
991 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -0300992 .ir_codes = RC_MAP_GADMEI_RM008Z,
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -0300993 .decoder = EM28XX_SAA711X,
994 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
995 .input = { {
996 .type = EM28XX_VMUX_TELEVISION,
997 .vmux = SAA7115_COMPOSITE2,
998 .amux = EM28XX_AMUX_VIDEO,
999 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001000 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -03001001 .vmux = SAA7115_COMPOSITE0,
1002 .amux = EM28XX_AMUX_LINE_IN,
1003 }, {
1004 .type = EM28XX_VMUX_SVIDEO,
1005 .vmux = SAA7115_SVIDEO3,
1006 .amux = EM28XX_AMUX_LINE_IN,
1007 } },
1008 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001009 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
1010 .name = "Terratec Cinergy A Hybrid XS",
1011 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001012 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001013 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001014 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001015
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001016 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001017 .type = EM28XX_VMUX_TELEVISION,
1018 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001019 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001020 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001021 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001022 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001023 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001024 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001025 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001026 }, {
1027 .type = EM28XX_VMUX_SVIDEO,
1028 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001029 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001030 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001031 } },
1032 },
1033 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
1034 .name = "KWorld PVRTV 300U",
1035 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001036 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001037 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001038 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001039 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001040 .type = EM28XX_VMUX_TELEVISION,
1041 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001042 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001043 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001044 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001045 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001046 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001047 }, {
1048 .type = EM28XX_VMUX_SVIDEO,
1049 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001050 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001051 } },
1052 },
1053 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
1054 .name = "Yakumo MovieMixer",
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001055 .tuner_type = TUNER_ABSENT, /* Capture only device */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001056 .decoder = EM28XX_TVP5150,
1057 .input = { {
1058 .type = EM28XX_VMUX_TELEVISION,
1059 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001060 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001061 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001062 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001063 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001064 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001065 }, {
1066 .type = EM28XX_VMUX_SVIDEO,
1067 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001068 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001069 } },
1070 },
Devin Heitmueller443fed92010-03-19 23:53:12 -03001071 [EM2860_BOARD_TVP5150_REFERENCE_DESIGN] = {
1072 .name = "EM2860/TVP5150 Reference Design",
1073 .tuner_type = TUNER_ABSENT, /* Capture only device */
1074 .decoder = EM28XX_TVP5150,
1075 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001076 .type = EM28XX_VMUX_COMPOSITE,
Devin Heitmueller443fed92010-03-19 23:53:12 -03001077 .vmux = TVP5150_COMPOSITE1,
1078 .amux = EM28XX_AMUX_LINE_IN,
1079 }, {
1080 .type = EM28XX_VMUX_SVIDEO,
1081 .vmux = TVP5150_SVIDEO,
1082 .amux = EM28XX_AMUX_LINE_IN,
1083 } },
1084 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001085 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
1086 .name = "Plextor ConvertX PX-TV100U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001087 .tuner_type = TUNER_TNF_5335MF,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03001088 .xclk = EM28XX_XCLK_I2S_MSB_TIMING |
1089 EM28XX_XCLK_FREQUENCY_12MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001090 .tda9887_conf = TDA9887_PRESENT,
1091 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03001092 .has_msp34xx = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001093 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001094 .type = EM28XX_VMUX_TELEVISION,
1095 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001096 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03001097 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001098 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001099 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001100 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001101 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03001102 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001103 }, {
1104 .type = EM28XX_VMUX_SVIDEO,
1105 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001106 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03001107 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001108 } },
1109 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -03001110
1111 /* Those boards with em2870 are DVB Only*/
1112
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001113 [EM2870_BOARD_TERRATEC_XS] = {
1114 .name = "Terratec Cinergy T XS",
1115 .valid = EM28XX_BOARD_NOT_VALIDATED,
1116 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001117 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001118 },
1119 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
1120 .name = "Terratec Cinergy T XS (MT2060)",
Alberto Mardegan8c473112015-10-27 17:24:14 -02001121 .xclk = EM28XX_XCLK_IR_RC5_MODE |
1122 EM28XX_XCLK_FREQUENCY_12MHZ,
1123 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001124 .tuner_type = TUNER_ABSENT, /* MT2060 */
Alberto Mardegan8c473112015-10-27 17:24:14 -02001125 .has_dvb = 1,
1126 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001127 },
1128 [EM2870_BOARD_KWORLD_350U] = {
1129 .name = "Kworld 350 U DVB-T",
1130 .valid = EM28XX_BOARD_NOT_VALIDATED,
1131 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001132 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001133 },
1134 [EM2870_BOARD_KWORLD_355U] = {
1135 .name = "Kworld 355 U DVB-T",
1136 .valid = EM28XX_BOARD_NOT_VALIDATED,
Aivar Päkk1985f6f2011-12-11 18:15:00 -03001137 .tuner_type = TUNER_ABSENT,
1138 .tuner_gpio = default_tuner_gpio,
1139 .has_dvb = 1,
1140 .dvb_gpio = default_digital,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001141 },
1142 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
1143 .name = "Pinnacle PCTV DVB-T",
1144 .valid = EM28XX_BOARD_NOT_VALIDATED,
1145 .tuner_type = TUNER_ABSENT, /* MT2060 */
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001146 /* djh - I have serious doubts this is right... */
1147 .xclk = EM28XX_XCLK_IR_RC5_MODE |
1148 EM28XX_XCLK_FREQUENCY_10MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001149 },
1150 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
1151 .name = "Compro, VideoMate U3",
1152 .valid = EM28XX_BOARD_NOT_VALIDATED,
1153 .tuner_type = TUNER_ABSENT, /* MT2060 */
1154 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -03001155
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001156 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
1157 .name = "Terratec Hybrid XS Secam",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001158 .has_msp34xx = 1,
1159 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001160 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001161 .decoder = EM28XX_TVP5150,
Catimimi65638012010-02-18 18:06:32 -03001162 .has_dvb = 1,
Michel Garniercec4e6c2010-10-16 14:42:01 -03001163 .dvb_gpio = terratec_cinergy_USB_XS_FR_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001164 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001165 .type = EM28XX_VMUX_TELEVISION,
1166 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001167 .amux = EM28XX_AMUX_VIDEO,
Michel Garniercec4e6c2010-10-16 14:42:01 -03001168 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001169 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001170 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001171 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001172 .amux = EM28XX_AMUX_LINE_IN,
Michel Garniercec4e6c2010-10-16 14:42:01 -03001173 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001174 }, {
1175 .type = EM28XX_VMUX_SVIDEO,
1176 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001177 .amux = EM28XX_AMUX_LINE_IN,
Michel Garniercec4e6c2010-10-16 14:42:01 -03001178 .gpio = terratec_cinergy_USB_XS_FR_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001179 } },
1180 },
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03001181 [EM2884_BOARD_TERRATEC_H5] = {
1182 .name = "Terratec Cinergy H5",
1183 .has_dvb = 1,
1184#if 0
1185 .tuner_type = TUNER_PHILIPS_TDA8290,
1186 .tuner_addr = 0x41,
1187 .dvb_gpio = terratec_h5_digital, /* FIXME: probably wrong */
1188 .tuner_gpio = terratec_h5_gpio,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -02001189#else
1190 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03001191#endif
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001192 .def_i2c_bus = 1,
1193 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03001194 EM28XX_I2C_FREQ_400_KHZ,
1195 },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03001196 [EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C] = {
1197 .name = "Hauppauge WinTV HVR 930C",
1198 .has_dvb = 1,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -02001199#if 0 /* FIXME: Add analog support */
1200 .tuner_type = TUNER_XC5000,
1201 .tuner_addr = 0x41,
1202 .dvb_gpio = hauppauge_930c_digital,
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03001203 .tuner_gpio = hauppauge_930c_gpio,
Mauro Carvalho Chehabde724052011-11-20 11:23:24 -02001204#else
1205 .tuner_type = TUNER_ABSENT,
1206#endif
Mauro Carvalho Chehabdfbbf5d2011-11-20 12:16:25 -02001207 .ir_codes = RC_MAP_HAUPPAUGE,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001208 .def_i2c_bus = 1,
1209 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03001210 EM28XX_I2C_FREQ_400_KHZ,
1211 },
Mauro Carvalho Chehab4159d012013-02-28 10:35:56 -03001212 [EM2884_BOARD_C3TECH_DIGITAL_DUO] = {
1213 .name = "C3 Tech Digital Duo HDTV/SDTV USB",
1214 .has_dvb = 1,
1215 /* FIXME: Add analog support - need a saa7136 driver */
1216 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
1217 .ir_codes = RC_MAP_EMPTY,
1218 .def_i2c_bus = 1,
1219 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1220 .dvb_gpio = c3tech_digital_duo_digital,
1221 },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -03001222 [EM2884_BOARD_CINERGY_HTC_STICK] = {
1223 .name = "Terratec Cinergy HTC Stick",
1224 .has_dvb = 1,
Martin Blumenstinglc8dce002012-06-12 18:19:28 -03001225 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
1226 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001227 .def_i2c_bus = 1,
1228 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001229 EM28XX_I2C_FREQ_400_KHZ,
1230 },
Gilles Risch1fe0fbd2015-03-01 17:11:05 -03001231 [EM2884_BOARD_ELGATO_EYETV_HYBRID_2008] = {
1232 .name = "Elgato EyeTV Hybrid 2008 INT",
1233 .has_dvb = 1,
1234 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
1235 .tuner_type = TUNER_ABSENT,
1236 .def_i2c_bus = 1,
1237 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1238 EM28XX_I2C_FREQ_400_KHZ,
1239 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001240 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -03001241 .name = "Hauppauge WinTV HVR 900",
Aidan Thornton122d1582007-11-20 15:25:08 -03001242 .tda9887_conf = TDA9887_PRESENT,
1243 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001244 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -03001245 .mts_firmware = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001246 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001247 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001248 .ir_codes = RC_MAP_HAUPPAUGE,
Aidan Thornton122d1582007-11-20 15:25:08 -03001249 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001250 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -03001251 .type = EM28XX_VMUX_TELEVISION,
1252 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001253 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001254 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001255 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001256 .type = EM28XX_VMUX_COMPOSITE,
Aidan Thornton122d1582007-11-20 15:25:08 -03001257 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001258 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001259 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001260 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -03001261 .type = EM28XX_VMUX_SVIDEO,
1262 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001263 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001264 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001265 } },
Aidan Thornton122d1582007-11-20 15:25:08 -03001266 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001267 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
1268 .name = "Hauppauge WinTV HVR 900 (R2)",
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001269 .tda9887_conf = TDA9887_PRESENT,
1270 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001271 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001272 .mts_firmware = 1,
Devin Heitmueller75e2b862011-03-13 02:01:02 -03001273 .has_dvb = 1,
Devin Heitmueller7030f522011-03-13 02:04:53 -03001274 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001275 .ir_codes = RC_MAP_HAUPPAUGE,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001276 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001277 .input = { {
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001278 .type = EM28XX_VMUX_TELEVISION,
1279 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001280 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001281 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001282 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001283 .type = EM28XX_VMUX_COMPOSITE,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001284 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -03001285 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001286 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001287 }, {
1288 .type = EM28XX_VMUX_SVIDEO,
1289 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001290 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001291 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001292 } },
1293 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001294 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = {
1295 .name = "Hauppauge WinTV HVR 850",
1296 .tuner_type = TUNER_XC2028,
1297 .tuner_gpio = default_tuner_gpio,
1298 .mts_firmware = 1,
1299 .has_dvb = 1,
1300 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehabaf86ce72011-01-24 12:18:48 -03001301 .ir_codes = RC_MAP_HAUPPAUGE,
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001302 .decoder = EM28XX_TVP5150,
1303 .input = { {
1304 .type = EM28XX_VMUX_TELEVISION,
1305 .vmux = TVP5150_COMPOSITE0,
1306 .amux = EM28XX_AMUX_VIDEO,
1307 .gpio = hauppauge_wintv_hvr_900_analog,
1308 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001309 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001310 .vmux = TVP5150_COMPOSITE1,
1311 .amux = EM28XX_AMUX_LINE_IN,
1312 .gpio = hauppauge_wintv_hvr_900_analog,
1313 }, {
1314 .type = EM28XX_VMUX_SVIDEO,
1315 .vmux = TVP5150_SVIDEO,
1316 .amux = EM28XX_AMUX_LINE_IN,
1317 .gpio = hauppauge_wintv_hvr_900_analog,
1318 } },
1319 },
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001320 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001321 .name = "Hauppauge WinTV HVR 950",
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001322 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001323 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001324 .mts_firmware = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -03001325 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001326 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab15195d32011-01-24 12:18:47 -03001327 .ir_codes = RC_MAP_HAUPPAUGE,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -03001328 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001329 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001330 .type = EM28XX_VMUX_TELEVISION,
1331 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001332 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001333 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001334 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001335 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -03001336 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001337 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001338 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001339 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001340 .type = EM28XX_VMUX_SVIDEO,
1341 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001342 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001343 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001344 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001345 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001346 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
1347 .name = "Pinnacle PCTV HD Pro Stick",
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001348 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001349 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001350 .mts_firmware = 1,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001351 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001352 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001353 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001354 .decoder = EM28XX_TVP5150,
1355 .input = { {
1356 .type = EM28XX_VMUX_TELEVISION,
1357 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001358 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001359 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001360 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001361 .type = EM28XX_VMUX_COMPOSITE,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001362 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001363 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001364 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001365 }, {
1366 .type = EM28XX_VMUX_SVIDEO,
1367 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001368 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001369 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001370 } },
1371 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001372 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
1373 .name = "AMD ATI TV Wonder HD 600",
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001374 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001375 .tuner_gpio = default_tuner_gpio,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001376 .mts_firmware = 1,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001377 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001378 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001379 .ir_codes = RC_MAP_ATI_TV_WONDER_HD_600,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001380 .decoder = EM28XX_TVP5150,
1381 .input = { {
1382 .type = EM28XX_VMUX_TELEVISION,
1383 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001384 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001385 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001386 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001387 .type = EM28XX_VMUX_COMPOSITE,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001388 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001389 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001390 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001391 }, {
1392 .type = EM28XX_VMUX_SVIDEO,
1393 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001394 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001395 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001396 } },
1397 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001398 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001399 .name = "Terratec Hybrid XS",
1400 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001401 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001402 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -03001403 .has_dvb = 1,
Devin Heitmuellerf7976082009-06-22 22:32:32 -03001404 .dvb_gpio = default_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001405 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
Devin Heitmueller8cd9aae2009-08-03 23:56:51 -03001406 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001407 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001408 .type = EM28XX_VMUX_TELEVISION,
1409 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001410 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001411 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001412 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001413 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001414 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001415 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001416 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001417 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001418 .type = EM28XX_VMUX_SVIDEO,
1419 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001420 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001421 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001422 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001423 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001424 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
1425 as Prodigy XS with a different PID, let's keep it separated for now
1426 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001427 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
1428 .name = "Terratec Prodigy XS",
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001429 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001430 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001431 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001432 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001433 .type = EM28XX_VMUX_TELEVISION,
1434 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001435 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001436 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001437 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001438 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001439 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001440 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001441 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001442 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001443 .type = EM28XX_VMUX_SVIDEO,
1444 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001445 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001446 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001447 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -03001448 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001449 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001450 .name = "MSI VOX USB 2.0",
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001451 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1452 .tda9887_conf = TDA9887_PRESENT |
1453 TDA9887_PORT1_ACTIVE |
1454 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001455 .max_range_640_480 = 1,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001456 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001457 .input = { {
1458 .type = EM28XX_VMUX_TELEVISION,
1459 .vmux = SAA7115_COMPOSITE4,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001460 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001461 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001462 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001463 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001464 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001465 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001466 .type = EM28XX_VMUX_SVIDEO,
1467 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001468 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001469 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001470 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001471 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
1472 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001473 .is_em2800 = 1,
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03001474 .has_ir_i2c = 1,
Sascha Sommer53b667e2012-01-08 16:41:22 -03001475 .tuner_type = TUNER_LG_TALN,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001476 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001477 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001478 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001479 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001480 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001481 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001482 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001483 .type = EM28XX_VMUX_COMPOSITE,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001484 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001485 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001486 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001487 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001488 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001489 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001490 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001491 },
Aron Szabo59d07f12008-07-27 13:47:52 -03001492 [EM2800_BOARD_GRABBEEX_USB2800] = {
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001493 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
1494 .is_em2800 = 1,
1495 .decoder = EM28XX_SAA711X,
1496 .tuner_type = TUNER_ABSENT, /* capture only board */
1497 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001498 .type = EM28XX_VMUX_COMPOSITE,
Aron Szabo59d07f12008-07-27 13:47:52 -03001499 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001500 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -03001501 }, {
1502 .type = EM28XX_VMUX_SVIDEO,
1503 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001504 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -03001505 } },
1506 },
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -03001507 [EM2800_BOARD_VC211A] = {
1508 .name = "Actionmaster/LinXcel/Digitus VC211A",
1509 .is_em2800 = 1,
1510 .tuner_type = TUNER_ABSENT, /* Capture-only board */
1511 .decoder = EM28XX_SAA711X,
1512 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001513 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehab694a1012009-11-26 21:26:13 -03001514 .vmux = SAA7115_COMPOSITE0,
1515 .amux = EM28XX_AMUX_LINE_IN,
1516 .gpio = vc211a_enable,
1517 }, {
1518 .type = EM28XX_VMUX_SVIDEO,
1519 .vmux = SAA7115_SVIDEO3,
1520 .amux = EM28XX_AMUX_LINE_IN,
1521 .gpio = vc211a_enable,
1522 } },
1523 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001524 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
1525 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001526 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001527 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1528 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001529 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001530 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001531 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001532 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001533 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001534 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001535 .type = EM28XX_VMUX_COMPOSITE,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001536 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001537 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001538 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001539 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001540 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001541 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001542 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001543 },
1544 [EM2800_BOARD_KWORLD_USB2800] = {
1545 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001546 .is_em2800 = 1,
Michael Krufkyab8b8702008-04-22 14:46:05 -03001547 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001548 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001549 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001550 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001551 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001552 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001553 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001554 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001555 .type = EM28XX_VMUX_COMPOSITE,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001556 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001557 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001558 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001559 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001560 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001561 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001562 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001563 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001564 [EM2820_BOARD_PINNACLE_DVC_90] = {
Mauro Carvalho Chehabc558d132016-10-18 17:44:15 -02001565 .name = "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker / Kworld DVD Maker 2 / Plextor ConvertX PX-AV100U",
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -03001566 .tuner_type = TUNER_ABSENT, /* capture only board */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001567 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001568 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001569 .type = EM28XX_VMUX_COMPOSITE,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001570 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001571 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001572 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001573 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001574 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001575 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001576 } },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001577 },
Sascha Sommer43625592007-11-03 15:05:07 -03001578 [EM2800_BOARD_VGEAR_POCKETTV] = {
1579 .name = "V-Gear PocketTV",
1580 .is_em2800 = 1,
Sascha Sommer43625592007-11-03 15:05:07 -03001581 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1582 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001583 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001584 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -03001585 .type = EM28XX_VMUX_TELEVISION,
1586 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001587 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001588 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001589 .type = EM28XX_VMUX_COMPOSITE,
Sascha Sommer43625592007-11-03 15:05:07 -03001590 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001591 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001592 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001593 .type = EM28XX_VMUX_SVIDEO,
1594 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001595 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001596 } },
Sascha Sommer43625592007-11-03 15:05:07 -03001597 },
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001598 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = {
1599 .name = "Pixelview PlayTV Box 4 USB 2.0",
1600 .tda9887_conf = TDA9887_PRESENT,
1601 .tuner_type = TUNER_YMEC_TVF_5533MF,
1602 .decoder = EM28XX_SAA711X,
1603 .input = { {
1604 .type = EM28XX_VMUX_TELEVISION,
1605 .vmux = SAA7115_COMPOSITE2,
1606 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabfdf1bc92014-11-28 08:34:15 -03001607 .aout = EM28XX_AOUT_MONO | /* I2S */
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001608 EM28XX_AOUT_MASTER, /* Line out pin */
1609 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001610 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001611 .vmux = SAA7115_COMPOSITE0,
1612 .amux = EM28XX_AMUX_LINE_IN,
1613 }, {
1614 .type = EM28XX_VMUX_SVIDEO,
1615 .vmux = SAA7115_SVIDEO3,
1616 .amux = EM28XX_AMUX_LINE_IN,
1617 } },
1618 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001619 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
Douglas Schilling Landgraf1f372a92009-02-25 16:54:31 -03001620 .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
Frank Schaeferf52226092013-12-01 18:06:52 -03001621 .buttons = std_snapshot_button,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001622 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001623 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehab41a5e7e2016-01-29 10:11:57 -02001624 .tuner_addr = 0x60,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001625 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001626 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001627 .type = EM28XX_VMUX_TELEVISION,
1628 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab30e4ac72008-11-20 13:43:05 -03001629 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabfdf1bc92014-11-28 08:34:15 -03001630 .aout = EM28XX_AOUT_MONO | /* I2S */
Mauro Carvalho Chehab30e4ac72008-11-20 13:43:05 -03001631 EM28XX_AOUT_MASTER, /* Line out pin */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001632 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001633 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001634 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001635 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001636 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001637 .type = EM28XX_VMUX_SVIDEO,
1638 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001639 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001640 } },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001641 },
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001642 [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = {
1643 .name = "EM2860/SAA711X Reference Design",
Frank Schaeferf52226092013-12-01 18:06:52 -03001644 .buttons = std_snapshot_button,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001645 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001646 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001647 .input = { {
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001648 .type = EM28XX_VMUX_SVIDEO,
1649 .vmux = SAA7115_SVIDEO3,
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001650 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001651 .type = EM28XX_VMUX_COMPOSITE,
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001652 .vmux = SAA7115_COMPOSITE0,
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001653 } },
1654 },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001655
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03001656 [EM2874_BOARD_LEADERSHIP_ISDBT] = {
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03001657 .def_i2c_bus = 1,
1658 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03001659 EM28XX_I2C_FREQ_100_KHZ,
1660 .xclk = EM28XX_XCLK_FREQUENCY_10MHZ,
1661 .name = "EM2874 Leadership ISDBT",
1662 .tuner_type = TUNER_ABSENT,
1663 .tuner_gpio = leadership_reset,
1664 .dvb_gpio = leadership_digital,
1665 .has_dvb = 1,
1666 },
1667
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001668 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
1669 .name = "MSI DigiVox A/D",
1670 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001671 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001672 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001673 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001674 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001675 .type = EM28XX_VMUX_TELEVISION,
1676 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001677 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001678 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001679 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001680 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001681 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001682 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001683 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001684 }, {
1685 .type = EM28XX_VMUX_SVIDEO,
1686 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001687 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001688 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001689 } },
1690 },
1691 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
1692 .name = "MSI DigiVox A/D II",
1693 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001694 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001695 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001696 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001697 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001698 .type = EM28XX_VMUX_TELEVISION,
1699 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001700 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001701 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001702 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001703 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001704 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001705 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001706 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001707 }, {
1708 .type = EM28XX_VMUX_SVIDEO,
1709 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001710 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001711 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001712 } },
1713 },
1714 [EM2880_BOARD_KWORLD_DVB_305U] = {
1715 .name = "KWorld DVB-T 305U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001716 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001717 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001718 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001719 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001720 .type = EM28XX_VMUX_TELEVISION,
1721 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001722 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001723 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001724 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001725 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001726 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001727 }, {
1728 .type = EM28XX_VMUX_SVIDEO,
1729 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001730 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001731 } },
1732 },
1733 [EM2880_BOARD_KWORLD_DVB_310U] = {
1734 .name = "KWorld DVB-T 310U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001735 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001736 .tuner_gpio = default_tuner_gpio,
Darron Broadda3808e2008-09-30 02:46:41 -03001737 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001738 .dvb_gpio = default_digital,
Darron Broadda3808e2008-09-30 02:46:41 -03001739 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001740 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001741 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001742 .type = EM28XX_VMUX_TELEVISION,
1743 .vmux = TVP5150_COMPOSITE0,
Darron Broadda3808e2008-09-30 02:46:41 -03001744 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001745 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001746 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001747 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001748 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001749 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001750 .gpio = default_analog,
Darron Broadda3808e2008-09-30 02:46:41 -03001751 }, { /* S-video has not been tested yet */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001752 .type = EM28XX_VMUX_SVIDEO,
1753 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001754 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001755 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001756 } },
1757 },
Franklin Mengd7de5d82009-06-06 17:05:02 -03001758 [EM2882_BOARD_KWORLD_ATSC_315U] = {
1759 .name = "KWorld ATSC 315U HDTV TV Box",
1760 .valid = EM28XX_BOARD_NOT_VALIDATED,
1761 .tuner_type = TUNER_THOMSON_DTT761X,
1762 .tuner_gpio = em2882_kworld_315u_tuner_gpio,
1763 .tda9887_conf = TDA9887_PRESENT,
1764 .decoder = EM28XX_SAA711X,
1765 .has_dvb = 1,
1766 .dvb_gpio = em2882_kworld_315u_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001767 .ir_codes = RC_MAP_KWORLD_315U,
Franklin Mengd7de5d82009-06-06 17:05:02 -03001768 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1769 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1770 /* Analog mode - still not ready */
1771 /*.input = { {
1772 .type = EM28XX_VMUX_TELEVISION,
1773 .vmux = SAA7115_COMPOSITE2,
1774 .amux = EM28XX_AMUX_VIDEO,
1775 .gpio = em2882_kworld_315u_analog,
1776 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1777 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001778 .type = EM28XX_VMUX_COMPOSITE,
Franklin Mengd7de5d82009-06-06 17:05:02 -03001779 .vmux = SAA7115_COMPOSITE0,
1780 .amux = EM28XX_AMUX_LINE_IN,
1781 .gpio = em2882_kworld_315u_analog1,
1782 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1783 }, {
1784 .type = EM28XX_VMUX_SVIDEO,
1785 .vmux = SAA7115_SVIDEO3,
1786 .amux = EM28XX_AMUX_LINE_IN,
1787 .gpio = em2882_kworld_315u_analog1,
1788 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1789 } }, */
1790 },
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001791 [EM2880_BOARD_EMPIRE_DUAL_TV] = {
1792 .name = "Empire dual TV",
1793 .tuner_type = TUNER_XC2028,
1794 .tuner_gpio = default_tuner_gpio,
1795 .has_dvb = 1,
1796 .dvb_gpio = default_digital,
1797 .mts_firmware = 1,
1798 .decoder = EM28XX_TVP5150,
1799 .input = { {
1800 .type = EM28XX_VMUX_TELEVISION,
1801 .vmux = TVP5150_COMPOSITE0,
1802 .amux = EM28XX_AMUX_VIDEO,
1803 .gpio = default_analog,
1804 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001805 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001806 .vmux = TVP5150_COMPOSITE1,
1807 .amux = EM28XX_AMUX_LINE_IN,
1808 .gpio = default_analog,
1809 }, {
1810 .type = EM28XX_VMUX_SVIDEO,
1811 .vmux = TVP5150_SVIDEO,
1812 .amux = EM28XX_AMUX_LINE_IN,
1813 .gpio = default_analog,
1814 } },
1815 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001816 [EM2881_BOARD_DNT_DA2_HYBRID] = {
1817 .name = "DNT DA2 Hybrid",
1818 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001819 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001820 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001821 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001822 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001823 .type = EM28XX_VMUX_TELEVISION,
1824 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001825 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001826 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001827 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001828 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001829 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001830 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001831 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001832 }, {
1833 .type = EM28XX_VMUX_SVIDEO,
1834 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001835 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001836 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001837 } },
1838 },
1839 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1840 .name = "Pinnacle Hybrid Pro",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001841 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001842 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001843 .decoder = EM28XX_TVP5150,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001844 .has_dvb = 1,
1845 .dvb_gpio = pinnacle_hybrid_pro_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001846 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001847 .type = EM28XX_VMUX_TELEVISION,
1848 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001849 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001850 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001851 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001852 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001853 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001854 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001855 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001856 }, {
1857 .type = EM28XX_VMUX_SVIDEO,
1858 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001859 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001860 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001861 } },
1862 },
Devin Heitmueller09bc1942011-03-13 02:07:54 -03001863 [EM2882_BOARD_PINNACLE_HYBRID_PRO_330E] = {
1864 .name = "Pinnacle Hybrid Pro (330e)",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001865 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001866 .tuner_gpio = default_tuner_gpio,
Eugeniy Meshcheryakova674a3b2008-08-01 08:23:41 -03001867 .mts_firmware = 1,
Devin Heitmuellerad9b4bb2011-03-13 02:09:59 -03001868 .has_dvb = 1,
1869 .dvb_gpio = hauppauge_wintv_hvr_900R2_digital,
Devin Heitmueller9b316d62011-03-13 02:18:34 -03001870 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001871 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001872 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001873 .type = EM28XX_VMUX_TELEVISION,
1874 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001875 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001876 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001877 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001878 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001879 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001880 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001881 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001882 }, {
1883 .type = EM28XX_VMUX_SVIDEO,
1884 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001885 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001886 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001887 } },
1888 },
1889 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1890 .name = "Kworld VS-DVB-T 323UR",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001891 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001892 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001893 .decoder = EM28XX_TVP5150,
Antonio Larrosa811fab62010-03-04 22:19:48 -03001894 .mts_firmware = 1,
1895 .has_dvb = 1,
1896 .dvb_gpio = kworld_330u_digital,
1897 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001898 .ir_codes = RC_MAP_KWORLD_315U,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001899 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001900 .type = EM28XX_VMUX_TELEVISION,
1901 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001902 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001903 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001904 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001905 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001906 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001907 }, {
1908 .type = EM28XX_VMUX_SVIDEO,
1909 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001910 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001911 } },
1912 },
1913 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
Philippe Bourdin91245442010-10-31 09:57:58 -03001914 .name = "Terratec Cinnergy Hybrid T USB XS (em2882)",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001915 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001916 .tuner_gpio = default_tuner_gpio,
Uroš Vamplec994d02009-09-30 22:53:37 -03001917 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001918 .decoder = EM28XX_TVP5150,
Uroš Vamplec994d02009-09-30 22:53:37 -03001919 .has_dvb = 1,
1920 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03001921 .ir_codes = RC_MAP_TERRATEC_CINERGY_XS,
Uroš Vamplec994d02009-09-30 22:53:37 -03001922 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001923 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001924 .type = EM28XX_VMUX_TELEVISION,
1925 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001926 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001927 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001928 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001929 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001930 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001931 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001932 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001933 }, {
1934 .type = EM28XX_VMUX_SVIDEO,
1935 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001936 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001937 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001938 } },
1939 },
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03001940 [EM2882_BOARD_DIKOM_DK300] = {
1941 .name = "Dikom DK300",
1942 .tuner_type = TUNER_XC2028,
1943 .tuner_gpio = default_tuner_gpio,
1944 .decoder = EM28XX_TVP5150,
1945 .mts_firmware = 1,
1946 .has_dvb = 1,
1947 .dvb_gpio = dikom_dk300_digital,
1948 .input = { {
1949 .type = EM28XX_VMUX_TELEVISION,
1950 .vmux = TVP5150_COMPOSITE0,
1951 .amux = EM28XX_AMUX_VIDEO,
1952 .gpio = default_analog,
1953 } },
1954 },
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001955 [EM2883_BOARD_KWORLD_HYBRID_330U] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001956 .name = "Kworld PlusTV HD Hybrid 330",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001957 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001958 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001959 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabbe2c6db2008-12-09 15:43:10 -03001960 .mts_firmware = 1,
1961 .has_dvb = 1,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001962 .dvb_gpio = kworld_330u_digital,
1963 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001964 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1965 EM28XX_I2C_EEPROM_ON_BOARD |
1966 EM28XX_I2C_EEPROM_KEY_VALID,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001967 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001968 .type = EM28XX_VMUX_TELEVISION,
1969 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001970 .amux = EM28XX_AMUX_VIDEO,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001971 .gpio = kworld_330u_analog,
1972 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001973 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02001974 .type = EM28XX_VMUX_COMPOSITE,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001975 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001976 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001977 .gpio = kworld_330u_analog,
1978 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001979 }, {
1980 .type = EM28XX_VMUX_SVIDEO,
1981 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001982 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001983 .gpio = kworld_330u_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001984 } },
1985 },
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001986 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
Vitaly Woold3603342008-07-27 14:10:11 -03001987 .name = "Compro VideoMate ForYou/Stereo",
Vitaly Woold3603342008-07-27 14:10:11 -03001988 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001989 .tvaudio_addr = 0xb0,
Vitaly Woold3603342008-07-27 14:10:11 -03001990 .tda9887_conf = TDA9887_PRESENT,
1991 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03001992 .adecoder = EM28XX_TVAUDIO,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001993 .mute_gpio = compro_mute_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001994 .input = { {
Vitaly Woold3603342008-07-27 14:10:11 -03001995 .type = EM28XX_VMUX_TELEVISION,
1996 .vmux = TVP5150_COMPOSITE0,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001997 .amux = EM28XX_AMUX_VIDEO,
1998 .gpio = compro_unmute_tv_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001999 }, {
2000 .type = EM28XX_VMUX_SVIDEO,
2001 .vmux = TVP5150_SVIDEO,
2002 .amux = EM28XX_AMUX_LINE_IN,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03002003 .gpio = compro_unmute_svid_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03002004 } },
2005 },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002006 [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
2007 .name = "Kaiomy TVnPC U2",
2008 .vchannels = 3,
2009 .tuner_type = TUNER_XC2028,
2010 .tuner_addr = 0x61,
2011 .mts_firmware = 1,
2012 .decoder = EM28XX_TVP5150,
2013 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03002014 .ir_codes = RC_MAP_KAIOMY,
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002015 .input = { {
2016 .type = EM28XX_VMUX_TELEVISION,
2017 .vmux = TVP5150_COMPOSITE0,
2018 .amux = EM28XX_AMUX_VIDEO,
2019
2020 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02002021 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002022 .vmux = TVP5150_COMPOSITE1,
2023 .amux = EM28XX_AMUX_LINE_IN,
2024 }, {
2025 .type = EM28XX_VMUX_SVIDEO,
2026 .vmux = TVP5150_SVIDEO,
2027 .amux = EM28XX_AMUX_LINE_IN,
2028 } },
2029 .radio = {
2030 .type = EM28XX_RADIO,
2031 .amux = EM28XX_AMUX_LINE_IN,
2032 }
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03002033 },
2034 [EM2860_BOARD_EASYCAP] = {
2035 .name = "Easy Cap Capture DC-60",
2036 .vchannels = 2,
2037 .tuner_type = TUNER_ABSENT,
2038 .decoder = EM28XX_SAA711X,
2039 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02002040 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03002041 .vmux = SAA7115_COMPOSITE0,
2042 .amux = EM28XX_AMUX_LINE_IN,
2043 }, {
2044 .type = EM28XX_VMUX_SVIDEO,
2045 .vmux = SAA7115_SVIDEO3,
2046 .amux = EM28XX_AMUX_LINE_IN,
2047 } },
2048 },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002049 [EM2820_BOARD_IODATA_GVMVP_SZ] = {
2050 .name = "IO-DATA GV-MVP/SZ",
2051 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
2052 .tuner_gpio = default_tuner_gpio,
2053 .tda9887_conf = TDA9887_PRESENT,
2054 .decoder = EM28XX_TVP5150,
2055 .input = { {
2056 .type = EM28XX_VMUX_TELEVISION,
2057 .vmux = TVP5150_COMPOSITE0,
2058 .amux = EM28XX_AMUX_VIDEO,
2059 }, { /* Composite has not been tested yet */
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02002060 .type = EM28XX_VMUX_COMPOSITE,
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002061 .vmux = TVP5150_COMPOSITE1,
2062 .amux = EM28XX_AMUX_VIDEO,
2063 }, { /* S-video has not been tested yet */
2064 .type = EM28XX_VMUX_SVIDEO,
2065 .vmux = TVP5150_SVIDEO,
2066 .amux = EM28XX_AMUX_VIDEO,
2067 } },
2068 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002069 [EM2860_BOARD_TERRATEC_GRABBY] = {
2070 .name = "Terratec Grabby",
2071 .vchannels = 2,
2072 .tuner_type = TUNER_ABSENT,
2073 .decoder = EM28XX_SAA711X,
2074 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
2075 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02002076 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002077 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehaba3fa9042010-10-25 17:51:15 -03002078 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002079 }, {
2080 .type = EM28XX_VMUX_SVIDEO,
2081 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehaba3fa9042010-10-25 17:51:15 -03002082 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002083 } },
Matthieu Rogezdd837fb2016-02-28 08:26:21 -03002084 .buttons = std_snapshot_button,
Matthieu Rogez565e37d2016-02-28 08:26:22 -03002085 .leds = terratec_grabby_leds,
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002086 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002087 [EM2860_BOARD_TERRATEC_AV350] = {
2088 .name = "Terratec AV350",
2089 .vchannels = 2,
2090 .tuner_type = TUNER_ABSENT,
2091 .decoder = EM28XX_TVP5150,
2092 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
2093 .mute_gpio = terratec_av350_mute_gpio,
2094 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02002095 .type = EM28XX_VMUX_COMPOSITE,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002096 .vmux = TVP5150_COMPOSITE1,
2097 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03002098 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002099
2100 }, {
2101 .type = EM28XX_VMUX_SVIDEO,
2102 .vmux = TVP5150_SVIDEO,
2103 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03002104 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002105 } },
2106 },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03002107
2108 [EM2860_BOARD_ELGATO_VIDEO_CAPTURE] = {
2109 .name = "Elgato Video Capture",
2110 .decoder = EM28XX_SAA711X,
2111 .tuner_type = TUNER_ABSENT, /* Capture only device */
2112 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02002113 .type = EM28XX_VMUX_COMPOSITE,
Adrian Taylor8298f2f2010-10-20 07:55:33 -03002114 .vmux = SAA7115_COMPOSITE0,
2115 .amux = EM28XX_AMUX_LINE_IN,
2116 }, {
2117 .type = EM28XX_VMUX_SVIDEO,
2118 .vmux = SAA7115_SVIDEO3,
2119 .amux = EM28XX_AMUX_LINE_IN,
2120 } },
2121 },
2122
Devin Heitmueller19859222009-06-19 00:33:54 -03002123 [EM2882_BOARD_EVGA_INDTUBE] = {
2124 .name = "Evga inDtube",
2125 .tuner_type = TUNER_XC2028,
2126 .tuner_gpio = default_tuner_gpio,
2127 .decoder = EM28XX_TVP5150,
Devin Heitmuellera4c47302009-06-20 21:34:42 -03002128 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Devin Heitmueller19859222009-06-19 00:33:54 -03002129 .mts_firmware = 1,
2130 .has_dvb = 1,
2131 .dvb_gpio = evga_indtube_digital,
Mauro Carvalho Chehab02858ee2010-04-02 20:01:00 -03002132 .ir_codes = RC_MAP_EVGA_INDTUBE,
Devin Heitmueller19859222009-06-19 00:33:54 -03002133 .input = { {
2134 .type = EM28XX_VMUX_TELEVISION,
2135 .vmux = TVP5150_COMPOSITE0,
2136 .amux = EM28XX_AMUX_VIDEO,
2137 .gpio = evga_indtube_analog,
2138 }, {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02002139 .type = EM28XX_VMUX_COMPOSITE,
Devin Heitmueller19859222009-06-19 00:33:54 -03002140 .vmux = TVP5150_COMPOSITE1,
2141 .amux = EM28XX_AMUX_LINE_IN,
2142 .gpio = evga_indtube_analog,
2143 }, {
2144 .type = EM28XX_VMUX_SVIDEO,
2145 .vmux = TVP5150_SVIDEO,
2146 .amux = EM28XX_AMUX_LINE_IN,
2147 .gpio = evga_indtube_analog,
2148 } },
2149 },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002150 /* eb1a:2868 Empia EM2870 + Philips CU1216L NIM (Philips TDA10023 +
2151 Infineon TUA6034) */
2152 [EM2870_BOARD_REDDO_DVB_C_USB_BOX] = {
2153 .name = "Reddo DVB-C USB TV Box",
2154 .tuner_type = TUNER_ABSENT,
Antti Palosaari28f4ddd12009-10-04 12:59:35 -03002155 .tuner_gpio = reddo_dvb_c_usb_box,
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002156 .has_dvb = 1,
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002157 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03002158 /* 1b80:a340 - Empia EM2870, NXP TDA18271HD and LG DT3304, sold
2159 * initially as the KWorld PlusTV 340U, then as the UB435-Q.
2160 * Early variants have a TDA18271HD/C1, later ones a TDA18271HD/C2 */
2161 [EM2870_BOARD_KWORLD_A340] = {
2162 .name = "KWorld PlusTV 340U or UB435-Q (ATSC)",
2163 .tuner_type = TUNER_ABSENT, /* Digital-only TDA18271HD */
2164 .has_dvb = 1,
2165 .dvb_gpio = kworld_a340_digital,
2166 .tuner_gpio = default_tuner_gpio,
2167 },
Antti Palosaari460312e2011-05-25 17:03:50 -03002168 /* 2013:024f PCTV nanoStick T2 290e.
Antti Palosaarid6a5f922011-04-07 16:34:44 -03002169 * Empia EM28174, Sony CXD2820R and NXP TDA18271HD/C2 */
2170 [EM28174_BOARD_PCTV_290E] = {
Antti Palosaari460312e2011-05-25 17:03:50 -03002171 .name = "PCTV nanoStick T2 290e",
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002172 .def_i2c_bus = 1,
2173 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_100_KHZ,
Antti Palosaarid6a5f922011-04-07 16:34:44 -03002174 .tuner_type = TUNER_ABSENT,
2175 .tuner_gpio = pctv_290e,
2176 .has_dvb = 1,
Antti Palosaariff7b9292011-05-25 17:00:35 -03002177 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Antti Palosaarid6a5f922011-04-07 16:34:44 -03002178 },
Antti Palosaari36588712011-08-01 01:15:30 -03002179 /* 2013:024f PCTV DVB-S2 Stick 460e
2180 * Empia EM28174, NXP TDA10071, Conexant CX24118A and Allegro A8293 */
2181 [EM28174_BOARD_PCTV_460E] = {
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002182 .def_i2c_bus = 1,
2183 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
Antti Palosaari36588712011-08-01 01:15:30 -03002184 .name = "PCTV DVB-S2 Stick (460e)",
2185 .tuner_type = TUNER_ABSENT,
2186 .tuner_gpio = pctv_460e,
2187 .has_dvb = 1,
2188 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
2189 },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03002190 /* eb1a:5006 Honestech VIDBOX NW03
2191 * Empia EM2860, Philips SAA7113, Empia EMP202, No Tuner */
2192 [EM2860_BOARD_HT_VIDBOX_NW03] = {
2193 .name = "Honestech Vidbox NW03",
2194 .tuner_type = TUNER_ABSENT,
2195 .decoder = EM28XX_SAA711X,
2196 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02002197 .type = EM28XX_VMUX_COMPOSITE,
Gareth Williams4d28d3d2011-12-24 05:47:29 -03002198 .vmux = SAA7115_COMPOSITE0,
2199 .amux = EM28XX_AMUX_LINE_IN,
2200 }, {
2201 .type = EM28XX_VMUX_SVIDEO,
2202 .vmux = SAA7115_SVIDEO3, /* S-VIDEO needs confirming */
2203 .amux = EM28XX_AMUX_LINE_IN,
2204 } },
2205 },
Antti Palosaari35530852012-03-18 18:09:01 -03002206 /* 1b80:e425 MaxMedia UB425-TC
2207 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2 */
2208 [EM2874_BOARD_MAXMEDIA_UB425_TC] = {
2209 .name = "MaxMedia UB425-TC",
2210 .tuner_type = TUNER_ABSENT,
2211 .tuner_gpio = maxmedia_ub425_tc,
2212 .has_dvb = 1,
Antti Palosaari831378d2013-04-12 13:59:03 -03002213 .ir_codes = RC_MAP_REDDO,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002214 .def_i2c_bus = 1,
2215 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Antti Palosaari35530852012-03-18 18:09:01 -03002216 EM28XX_I2C_FREQ_400_KHZ,
2217 },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03002218 /* 2304:0242 PCTV QuatroStick (510e)
2219 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
2220 [EM2884_BOARD_PCTV_510E] = {
2221 .name = "PCTV QuatroStick (510e)",
2222 .tuner_type = TUNER_ABSENT,
2223 .tuner_gpio = pctv_510e,
2224 .has_dvb = 1,
2225 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002226 .def_i2c_bus = 1,
2227 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03002228 EM28XX_I2C_FREQ_400_KHZ,
2229 },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03002230 /* 2013:0251 PCTV QuatroStick nano (520e)
2231 * Empia EM2884 + Micronas DRX 3926K + NXP TDA18271HDC2 */
2232 [EM2884_BOARD_PCTV_520E] = {
2233 .name = "PCTV QuatroStick nano (520e)",
2234 .tuner_type = TUNER_ABSENT,
2235 .tuner_gpio = pctv_520e,
2236 .has_dvb = 1,
2237 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002238 .def_i2c_bus = 1,
2239 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Antti Palosaaric247d7b2012-03-19 11:48:19 -03002240 EM28XX_I2C_FREQ_400_KHZ,
2241 },
Martin Blumenstingl89040132012-10-04 14:22:54 -03002242 [EM2884_BOARD_TERRATEC_HTC_USB_XS] = {
2243 .name = "Terratec Cinergy HTC USB XS",
2244 .has_dvb = 1,
2245 .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
2246 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002247 .def_i2c_bus = 1,
2248 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
Martin Blumenstingl89040132012-10-04 14:22:54 -03002249 EM28XX_I2C_FREQ_400_KHZ,
2250 },
Jakob Haufe7c1dfdb2013-04-13 11:03:37 -03002251 /* 1b80:e1cc Delock 61959
2252 * Empia EM2874B + Micronas DRX 3913KA2 + NXP TDA18271HDC2
Mauro Carvalho Chehabce679432013-12-22 13:13:41 -03002253 * mostly the same as MaxMedia UB-425-TC but different remote */
Jakob Haufe7c1dfdb2013-04-13 11:03:37 -03002254 [EM2874_BOARD_DELOCK_61959] = {
2255 .name = "Delock 61959",
2256 .tuner_type = TUNER_ABSENT,
2257 .tuner_gpio = maxmedia_ub425_tc,
2258 .has_dvb = 1,
2259 .ir_codes = RC_MAP_DELOCK_61959,
2260 .def_i2c_bus = 1,
2261 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2262 EM28XX_I2C_FREQ_400_KHZ,
2263 },
Jean-Francois Thibert6dbea9f2013-10-09 11:18:05 -03002264 /*
2265 * 1b80:e346 KWorld USB ATSC TV Stick UB435-Q V2
2266 * Empia EM2874B + LG DT3305 + NXP TDA18271HDC2
2267 */
2268 [EM2874_BOARD_KWORLD_UB435Q_V2] = {
2269 .name = "KWorld USB ATSC TV Stick UB435-Q V2",
2270 .tuner_type = TUNER_ABSENT,
2271 .has_dvb = 1,
2272 .dvb_gpio = kworld_a340_digital,
2273 .tuner_gpio = default_tuner_gpio,
2274 .def_i2c_bus = 1,
2275 },
Mauro Carvalho Chehab02bc1f52014-03-03 16:28:39 -03002276 /*
2277 * 1b80:e34c KWorld USB ATSC TV Stick UB435-Q V3
2278 * Empia EM2874B + LG DT3305 + NXP TDA18271HDC2
2279 */
2280 [EM2874_BOARD_KWORLD_UB435Q_V3] = {
2281 .name = "KWorld USB ATSC TV Stick UB435-Q V3",
2282 .tuner_type = TUNER_ABSENT,
2283 .has_dvb = 1,
2284 .tuner_gpio = kworld_ub435q_v3_digital,
2285 .def_i2c_bus = 1,
2286 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2287 EM28XX_I2C_FREQ_100_KHZ,
Mauro Carvalho Chehab59432be2014-03-04 12:34:34 -03002288 .leds = kworld_ub435q_v3_leds,
Mauro Carvalho Chehab02bc1f52014-03-03 16:28:39 -03002289 },
Devin Heitmueller38b2df92012-08-13 21:18:02 -03002290 [EM2874_BOARD_PCTV_HD_MINI_80E] = {
2291 .name = "Pinnacle PCTV HD Mini",
2292 .tuner_type = TUNER_ABSENT,
2293 .has_dvb = 1,
2294 .dvb_gpio = em2874_pctv_80e_digital,
2295 .decoder = EM28XX_NODECODER,
Mauro Carvalho Chehab959505b2014-01-19 07:15:11 -03002296 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
Mauro Carvalho Chehab88e4fcd2014-03-04 20:49:07 -03002297 .leds = pctv_80e_leds,
Devin Heitmueller38b2df92012-08-13 21:18:02 -03002298 },
Frank Schaefer0c37e732013-12-01 18:06:57 -03002299 /* 1ae7:9003/9004 SpeedLink Vicious And Devine Laplace webcam
2300 * Empia EM2765 + OmniVision OV2640 */
2301 [EM2765_BOARD_SPEEDLINK_VAD_LAPLACE] = {
2302 .name = "SpeedLink Vicious And Devine Laplace webcam",
2303 .xclk = EM28XX_XCLK_FREQUENCY_24MHZ,
2304 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2305 EM28XX_I2C_FREQ_100_KHZ,
2306 .def_i2c_bus = 1,
2307 .tuner_type = TUNER_ABSENT,
2308 .is_webcam = 1,
2309 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02002310 .type = EM28XX_VMUX_COMPOSITE,
Frank Schaefer0c37e732013-12-01 18:06:57 -03002311 .amux = EM28XX_AMUX_VIDEO,
2312 .gpio = speedlink_vad_laplace_reg_seq,
2313 } },
2314 .buttons = speedlink_vad_laplace_buttons,
2315 .leds = speedlink_vad_laplace_leds,
2316 },
Antti Palosaariec573362013-02-25 09:01:13 -03002317 /* 2013:0258 PCTV DVB-S2 Stick (461e)
2318 * Empia EM28178, Montage M88DS3103, Montage M88TS2022, Allegro A8293 */
2319 [EM28178_BOARD_PCTV_461E] = {
2320 .def_i2c_bus = 1,
2321 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
2322 .name = "PCTV DVB-S2 Stick (461e)",
2323 .tuner_type = TUNER_ABSENT,
2324 .tuner_gpio = pctv_461e,
2325 .has_dvb = 1,
2326 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
2327 },
Antti Palosaari19229242014-04-10 22:11:27 -03002328 /* 2013:025f PCTV tripleStick (292e).
2329 * Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2157 */
2330 [EM28178_BOARD_PCTV_292E] = {
2331 .name = "PCTV tripleStick (292e)",
2332 .def_i2c_bus = 1,
2333 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
2334 .tuner_type = TUNER_ABSENT,
2335 .tuner_gpio = pctv_292e,
2336 .has_dvb = 1,
2337 .ir_codes = RC_MAP_PINNACLE_PCTV_HD,
2338 },
Witold Krecickieace9722014-10-19 19:25:59 -03002339 [EM2861_BOARD_LEADTEK_VC100] = {
2340 .name = "Leadtek VC100",
2341 .tuner_type = TUNER_ABSENT, /* Capture only device */
2342 .decoder = EM28XX_TVP5150,
2343 .input = { {
Mauro Carvalho Chehabd83a96a2016-01-27 09:24:29 -02002344 .type = EM28XX_VMUX_COMPOSITE,
Witold Krecickieace9722014-10-19 19:25:59 -03002345 .vmux = TVP5150_COMPOSITE1,
2346 .amux = EM28XX_AMUX_LINE_IN,
2347 }, {
2348 .type = EM28XX_VMUX_SVIDEO,
2349 .vmux = TVP5150_SVIDEO,
2350 .amux = EM28XX_AMUX_LINE_IN,
2351 } },
2352 },
Olli Salonenfc30dd762014-11-24 03:57:34 -03002353 /* eb1a:8179 Terratec Cinergy T2 Stick HD.
2354 * Empia EM28178, Silicon Labs Si2168, Silicon Labs Si2146 */
2355 [EM28178_BOARD_TERRATEC_T2_STICK_HD] = {
2356 .name = "Terratec Cinergy T2 Stick HD",
2357 .def_i2c_bus = 1,
2358 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_FREQ_400_KHZ,
2359 .tuner_type = TUNER_ABSENT,
2360 .tuner_gpio = terratec_t2_stick_hd,
2361 .has_dvb = 1,
2362 .ir_codes = RC_MAP_TERRATEC_SLIM_2,
2363 },
Satoshi Nagahamaab4d1452016-05-06 16:35:05 -03002364
2365 /*
2366 * 3275:0085 PLEX PX-BCUD.
2367 * Empia EM28178, TOSHIBA TC90532XBG, Sharp QM1D1C0042
2368 */
2369 [EM28178_BOARD_PLEX_PX_BCUD] = {
2370 .name = "PLEX PX-BCUD",
2371 .xclk = EM28XX_XCLK_FREQUENCY_4_3MHZ,
2372 .def_i2c_bus = 1,
2373 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
2374 .tuner_type = TUNER_ABSENT,
2375 .tuner_gpio = plex_px_bcud,
2376 .has_dvb = 1,
2377 },
Olli Salonen11a2a942016-04-04 12:12:52 -03002378 /*
2379 * 2040:0265 Hauppauge WinTV-dualHD (DVB version).
2380 * Empia EM28274, 2x Silicon Labs Si2168, 2x Silicon Labs Si2157
2381 */
2382 [EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB] = {
2383 .name = "Hauppauge WinTV-dualHD DVB",
2384 .def_i2c_bus = 1,
2385 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2386 EM28XX_I2C_FREQ_400_KHZ,
2387 .tuner_type = TUNER_ABSENT,
2388 .tuner_gpio = hauppauge_dualhd_dvb,
2389 .has_dvb = 1,
2390 .ir_codes = RC_MAP_HAUPPAUGE,
2391 .leds = hauppauge_dualhd_leds,
2392 },
Kevin Cheng15863422017-01-10 01:14:29 -02002393 /*
2394 * 2040:026d Hauppauge WinTV-dualHD (model 01595 - ATSC/QAM).
2395 * Empia EM28274, 2x LG LGDT3306A, 2x Silicon Labs Si2157
2396 */
2397 [EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595] = {
2398 .name = "Hauppauge WinTV-dualHD 01595 ATSC/QAM",
2399 .def_i2c_bus = 1,
2400 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2401 EM28XX_I2C_FREQ_400_KHZ,
2402 .tuner_type = TUNER_ABSENT,
2403 .tuner_gpio = hauppauge_dualhd_dvb,
2404 .has_dvb = 1,
2405 .ir_codes = RC_MAP_HAUPPAUGE,
2406 .leds = hauppauge_dualhd_leds,
2407 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002408};
Mauro Carvalho Chehab01c28192013-12-22 13:27:02 -03002409EXPORT_SYMBOL_GPL(em28xx_boards);
2410
Hans Verkuil4a9e5122014-08-21 16:43:03 -03002411static const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002412
2413/* table of devices that work with this driver */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002414struct usb_device_id em28xx_id_table[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002415 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002416 .driver_info = EM2750_BOARD_UNKNOWN },
2417 { USB_DEVICE(0xeb1a, 0x2751),
2418 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002419 { USB_DEVICE(0xeb1a, 0x2800),
2420 .driver_info = EM2800_BOARD_UNKNOWN },
Mauro Carvalho Chehab9b4e8452009-08-07 12:08:02 -03002421 { USB_DEVICE(0xeb1a, 0x2710),
2422 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002423 { USB_DEVICE(0xeb1a, 0x2820),
2424 .driver_info = EM2820_BOARD_UNKNOWN },
2425 { USB_DEVICE(0xeb1a, 0x2821),
Devin Heitmuellerc665f4d2008-12-16 23:35:23 -03002426 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002427 { USB_DEVICE(0xeb1a, 0x2860),
2428 .driver_info = EM2820_BOARD_UNKNOWN },
2429 { USB_DEVICE(0xeb1a, 0x2861),
2430 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmuellerf91cb652009-09-30 22:44:19 -03002431 { USB_DEVICE(0xeb1a, 0x2862),
2432 .driver_info = EM2820_BOARD_UNKNOWN },
Devin Heitmueller443fed92010-03-19 23:53:12 -03002433 { USB_DEVICE(0xeb1a, 0x2863),
2434 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002435 { USB_DEVICE(0xeb1a, 0x2870),
2436 .driver_info = EM2820_BOARD_UNKNOWN },
2437 { USB_DEVICE(0xeb1a, 0x2881),
2438 .driver_info = EM2820_BOARD_UNKNOWN },
2439 { USB_DEVICE(0xeb1a, 0x2883),
2440 .driver_info = EM2820_BOARD_UNKNOWN },
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002441 { USB_DEVICE(0xeb1a, 0x2868),
2442 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002443 { USB_DEVICE(0xeb1a, 0x2875),
2444 .driver_info = EM2820_BOARD_UNKNOWN },
Hans Verkuile22eca72014-05-27 04:12:19 -03002445 { USB_DEVICE(0xeb1a, 0x2885), /* MSI Digivox Trio */
2446 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002447 { USB_DEVICE(0xeb1a, 0xe300),
2448 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002449 { USB_DEVICE(0xeb1a, 0xe303),
2450 .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002451 { USB_DEVICE(0xeb1a, 0xe305),
2452 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
2453 { USB_DEVICE(0xeb1a, 0xe310),
2454 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
Franklin Mengd7de5d82009-06-06 17:05:02 -03002455 { USB_DEVICE(0xeb1a, 0xa313),
2456 .driver_info = EM2882_BOARD_KWORLD_ATSC_315U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002457 { USB_DEVICE(0xeb1a, 0xa316),
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002458 .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002459 { USB_DEVICE(0xeb1a, 0xe320),
2460 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
2461 { USB_DEVICE(0xeb1a, 0xe323),
2462 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
2463 { USB_DEVICE(0xeb1a, 0xe350),
2464 .driver_info = EM2870_BOARD_KWORLD_350U },
2465 { USB_DEVICE(0xeb1a, 0xe355),
2466 .driver_info = EM2870_BOARD_KWORLD_355U },
2467 { USB_DEVICE(0xeb1a, 0x2801),
2468 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
2469 { USB_DEVICE(0xeb1a, 0xe357),
2470 .driver_info = EM2870_BOARD_KWORLD_355U },
Aivar Päkk1985f6f2011-12-11 18:15:00 -03002471 { USB_DEVICE(0xeb1a, 0xe359),
2472 .driver_info = EM2870_BOARD_KWORLD_355U },
Douglas Schilling Landgrafac40d9e2009-02-25 16:55:48 -03002473 { USB_DEVICE(0x1b80, 0xe302),
2474 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */
Douglas Schilling Landgrafea476892009-09-06 18:41:59 -03002475 { USB_DEVICE(0x1b80, 0xe304),
2476 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kworld DVD Maker 2 */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002477 { USB_DEVICE(0x0ccd, 0x0036),
2478 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002479 { USB_DEVICE(0x0ccd, 0x004c),
2480 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
2481 { USB_DEVICE(0x0ccd, 0x004f),
2482 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
2483 { USB_DEVICE(0x0ccd, 0x005e),
2484 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
2485 { USB_DEVICE(0x0ccd, 0x0042),
Philippe Bourdin91245442010-10-31 09:57:58 -03002486 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002487 { USB_DEVICE(0x0ccd, 0x0043),
Alberto Mardegan8c473112015-10-27 17:24:14 -02002488 .driver_info = EM2870_BOARD_TERRATEC_XS_MT2060 },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002489 { USB_DEVICE(0x0ccd, 0x008e), /* Cinergy HTC USB XS Rev. 1 */
Martin Blumenstingl89040132012-10-04 14:22:54 -03002490 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
Holger Nelson6c3b9062011-12-23 23:15:32 -03002491 { USB_DEVICE(0x0ccd, 0x00ac), /* Cinergy HTC USB XS Rev. 2 */
Martin Blumenstingl89040132012-10-04 14:22:54 -03002492 .driver_info = EM2884_BOARD_TERRATEC_HTC_USB_XS },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002493 { USB_DEVICE(0x0ccd, 0x10a2), /* H5 Rev. 1 */
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03002494 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab4e145342011-11-16 14:38:28 -02002495 { USB_DEVICE(0x0ccd, 0x10ad), /* H5 Rev. 2 */
Mauro Carvalho Chehab33ba28e2011-07-14 21:48:00 -03002496 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Roland Scheidegger676fa7d2013-02-08 21:08:55 -03002497 { USB_DEVICE(0x0ccd, 0x10b6), /* H5 Rev. 3 */
2498 .driver_info = EM2884_BOARD_TERRATEC_H5 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03002499 { USB_DEVICE(0x0ccd, 0x0084),
2500 .driver_info = EM2860_BOARD_TERRATEC_AV350 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03002501 { USB_DEVICE(0x0ccd, 0x0096),
2502 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Tekaefabaaf2011-10-14 05:40:29 -03002503 { USB_DEVICE(0x0ccd, 0x10AF),
2504 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Andreas Oberrittera1ed02e2011-11-16 11:06:50 -03002505 { USB_DEVICE(0x0ccd, 0x00b2),
2506 .driver_info = EM2884_BOARD_CINERGY_HTC_STICK },
Gilles Risch1fe0fbd2015-03-01 17:11:05 -03002507 { USB_DEVICE(0x0fd9, 0x0018),
2508 .driver_info = EM2884_BOARD_ELGATO_EYETV_HYBRID_2008 },
Adrian Taylor8298f2f2010-10-20 07:55:33 -03002509 { USB_DEVICE(0x0fd9, 0x0033),
Gilles Risch1fe0fbd2015-03-01 17:11:05 -03002510 .driver_info = EM2860_BOARD_ELGATO_VIDEO_CAPTURE },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002511 { USB_DEVICE(0x185b, 0x2870),
2512 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03002513 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03002514 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002515 { USB_DEVICE(0x2040, 0x4200),
2516 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03002517 { USB_DEVICE(0x2040, 0x4201),
2518 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002519 { USB_DEVICE(0x2040, 0x6500),
2520 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03002521 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002522 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002523 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002524 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002525 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002526 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03002527 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002528 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002529 { USB_DEVICE(0x2040, 0x651f),
2530 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
Olli Salonen11a2a942016-04-04 12:12:52 -03002531 { USB_DEVICE(0x2040, 0x0265),
2532 .driver_info = EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB },
Kevin Cheng15863422017-01-10 01:14:29 -02002533 { USB_DEVICE(0x2040, 0x026d),
2534 .driver_info = EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03002535 { USB_DEVICE(0x0438, 0xb002),
2536 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002537 { USB_DEVICE(0x2001, 0xf112),
2538 .driver_info = EM2820_BOARD_DLINK_USB_TV },
2539 { USB_DEVICE(0x2304, 0x0207),
2540 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2541 { USB_DEVICE(0x2304, 0x0208),
2542 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
2543 { USB_DEVICE(0x2304, 0x021a),
2544 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
2545 { USB_DEVICE(0x2304, 0x0226),
Devin Heitmueller09bc1942011-03-13 02:07:54 -03002546 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO_330E },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002547 { USB_DEVICE(0x2304, 0x0227),
2548 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
Devin Heitmueller38b2df92012-08-13 21:18:02 -03002549 { USB_DEVICE(0x2304, 0x023f),
2550 .driver_info = EM2874_BOARD_PCTV_HD_MINI_80E },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002551 { USB_DEVICE(0x0413, 0x6023),
2552 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
Don Kramer74e07f32012-01-02 16:15:44 -03002553 { USB_DEVICE(0x093b, 0xa003),
2554 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002555 { USB_DEVICE(0x093b, 0xa005),
2556 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002557 { USB_DEVICE(0x04bb, 0x0515),
2558 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
Zhenyu Wang7c8b5672009-07-05 10:51:21 -03002559 { USB_DEVICE(0xeb1a, 0x50a6),
2560 .driver_info = EM2860_BOARD_GADMEI_UTV330 },
Jarod Wilson7e48b302010-03-07 17:55:43 -03002561 { USB_DEVICE(0x1b80, 0xa340),
2562 .driver_info = EM2870_BOARD_KWORLD_A340 },
Jean-Francois Thibert6dbea9f2013-10-09 11:18:05 -03002563 { USB_DEVICE(0x1b80, 0xe346),
2564 .driver_info = EM2874_BOARD_KWORLD_UB435Q_V2 },
Mauro Carvalho Chehab02bc1f52014-03-03 16:28:39 -03002565 { USB_DEVICE(0x1b80, 0xe34c),
2566 .driver_info = EM2874_BOARD_KWORLD_UB435Q_V3 },
Antti Palosaarid6a5f922011-04-07 16:34:44 -03002567 { USB_DEVICE(0x2013, 0x024f),
2568 .driver_info = EM28174_BOARD_PCTV_290E },
Antti Palosaari36588712011-08-01 01:15:30 -03002569 { USB_DEVICE(0x2013, 0x024c),
2570 .driver_info = EM28174_BOARD_PCTV_460E },
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002571 { USB_DEVICE(0x2040, 0x1605),
2572 .driver_info = EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C },
Mauro Carvalho Chehab4159d012013-02-28 10:35:56 -03002573 { USB_DEVICE(0x1b80, 0xe755),
2574 .driver_info = EM2884_BOARD_C3TECH_DIGITAL_DUO },
Gareth Williams4d28d3d2011-12-24 05:47:29 -03002575 { USB_DEVICE(0xeb1a, 0x5006),
2576 .driver_info = EM2860_BOARD_HT_VIDBOX_NW03 },
Mario Ceresa2f786042012-01-06 16:00:12 -03002577 { USB_DEVICE(0x1b80, 0xe309), /* Sveon STV40 */
2578 .driver_info = EM2860_BOARD_EASYCAP },
Antti Palosaari35530852012-03-18 18:09:01 -03002579 { USB_DEVICE(0x1b80, 0xe425),
2580 .driver_info = EM2874_BOARD_MAXMEDIA_UB425_TC },
Ivan Kalvachevfa5527c2012-03-19 20:09:55 -03002581 { USB_DEVICE(0x2304, 0x0242),
2582 .driver_info = EM2884_BOARD_PCTV_510E },
Antti Palosaaric247d7b2012-03-19 11:48:19 -03002583 { USB_DEVICE(0x2013, 0x0251),
2584 .driver_info = EM2884_BOARD_PCTV_520E },
Jakob Haufe7c1dfdb2013-04-13 11:03:37 -03002585 { USB_DEVICE(0x1b80, 0xe1cc),
2586 .driver_info = EM2874_BOARD_DELOCK_61959 },
Frank Schaefer0c37e732013-12-01 18:06:57 -03002587 { USB_DEVICE(0x1ae7, 0x9003),
2588 .driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE },
2589 { USB_DEVICE(0x1ae7, 0x9004),
2590 .driver_info = EM2765_BOARD_SPEEDLINK_VAD_LAPLACE },
Antti Palosaariec573362013-02-25 09:01:13 -03002591 { USB_DEVICE(0x2013, 0x0258),
2592 .driver_info = EM28178_BOARD_PCTV_461E },
Antti Palosaari19229242014-04-10 22:11:27 -03002593 { USB_DEVICE(0x2013, 0x025f),
2594 .driver_info = EM28178_BOARD_PCTV_292E },
Arno Bauernöppel1efc2172015-11-15 19:24:10 -02002595 { USB_DEVICE(0x2040, 0x0264), /* Hauppauge WinTV-soloHD */
2596 .driver_info = EM28178_BOARD_PCTV_292E },
Witold Krecickieace9722014-10-19 19:25:59 -03002597 { USB_DEVICE(0x0413, 0x6f07),
2598 .driver_info = EM2861_BOARD_LEADTEK_VC100 },
Olli Salonenfc30dd762014-11-24 03:57:34 -03002599 { USB_DEVICE(0xeb1a, 0x8179),
2600 .driver_info = EM28178_BOARD_TERRATEC_T2_STICK_HD },
Satoshi Nagahamaab4d1452016-05-06 16:35:05 -03002601 { USB_DEVICE(0x3275, 0x0085),
2602 .driver_info = EM28178_BOARD_PLEX_PX_BCUD },
Alexandre-Xavier Labonté-Lamoureux1c13f7a2017-02-25 05:03:38 -03002603 { USB_DEVICE(0xeb1a, 0x5051), /* Ion Video 2 PC MKII / Startech svid2usb23 / Raygo R12-41373 */
2604 .driver_info = EM2860_BOARD_TVP5150_REFERENCE_DESIGN },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002605 { },
2606};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002607MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002608
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002609/*
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002610 * EEPROM hash table for devices with generic USB IDs
2611 */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002612static struct em28xx_hash_table em28xx_eeprom_hash[] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03002613 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002614 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03002615 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03002616 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Douglas Schilling Landgrafa35c87c2009-08-06 12:52:11 -03002617 {0x166a0441, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
Devin Heitmueller19859222009-06-19 00:33:54 -03002618 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03002619 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
Antti Palosaari285eb1a2009-09-15 14:42:13 -03002620 {0x63f653bd, EM2870_BOARD_REDDO_DVB_C_USB_BOX, TUNER_ABSENT},
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03002621 {0x4e913442, EM2882_BOARD_DIKOM_DK300, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002622};
2623
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002624/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03002625static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002626 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
2627 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03002628 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT},
Devin Heitmueller443fed92010-03-19 23:53:12 -03002629 {0x77800080, EM2860_BOARD_TVP5150_REFERENCE_DESIGN, TUNER_ABSENT},
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -03002630 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
Mauro Carvalho Chehab6d888a62009-08-30 13:05:56 -03002631 {0x4ba50080, EM2861_BOARD_GADMEI_UTV330PLUS, TUNER_TNF_5335MF},
Mauro Carvalho Chehabebaefdb2011-06-01 10:16:25 -03002632 {0x6b800080, EM2874_BOARD_LEADERSHIP_ISDBT, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03002633};
Mauro Carvalho Chehabfdf1bc92014-11-28 08:34:15 -03002634
Frank Schaefer87b52432013-03-03 15:37:40 -03002635/* NOTE: introduce a separate hash table for devices with 16 bit eeproms */
Sascha Sommerfad7b952007-11-04 08:06:48 -03002636
Michael Krufkyd7cba042008-09-12 13:31:45 -03002637int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002638{
Hans Verkuilbc3d2922013-03-22 09:54:00 -03002639 struct em28xx_i2c_bus *i2c_bus = ptr;
2640 struct em28xx *dev = i2c_bus->dev;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002641 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002642
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002643 if (dev->tuner_type != TUNER_XC2028 && dev->tuner_type != TUNER_XC5000)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002644 return 0;
2645
Eddi De Pieri82e7dbb2011-11-19 11:37:14 -03002646 if (command != XC2028_TUNER_RESET && command != XC5000_TUNER_RESET)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002647 return 0;
2648
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002649 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002650
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002651 return rc;
2652}
2653EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
2654
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03002655static inline void em28xx_set_model(struct em28xx *dev)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002656{
Ezequiel Garciae0f6e4d2012-09-26 06:25:12 -03002657 dev->board = em28xx_boards[dev->model];
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002658
2659 /* Those are the default values for the majority of boards
2660 Use those values if not specified otherwise at boards entry
2661 */
2662 if (!dev->board.xclk)
2663 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
2664 EM28XX_XCLK_FREQUENCY_12MHZ;
2665
2666 if (!dev->board.i2c_speed)
2667 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
2668 EM28XX_I2C_FREQ_100_KHZ;
Mauro Carvalho Chehab3aa2b3b2013-03-05 06:55:27 -03002669
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03002670 /* Should be initialized early, for I2C to work */
2671 dev->def_i2c_bus = dev->board.def_i2c_bus;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03002672}
2673
Matthieu Rogez0899f622016-03-04 18:33:08 -03002674/* Wait until AC97_RESET reports the expected value reliably before proceeding.
2675 * We also check that two unrelated registers accesses don't return the same
2676 * value to avoid premature return.
2677 * This procedure helps ensuring AC97 register accesses are reliable.
2678 */
2679static int em28xx_wait_until_ac97_features_equals(struct em28xx *dev,
2680 int expected_feat)
2681{
2682 unsigned long timeout = jiffies + msecs_to_jiffies(2000);
2683 int feat, powerdown;
2684
2685 while (time_is_after_jiffies(timeout)) {
2686 feat = em28xx_read_ac97(dev, AC97_RESET);
2687 if (feat < 0)
2688 return feat;
2689
2690 powerdown = em28xx_read_ac97(dev, AC97_POWERDOWN);
2691 if (powerdown < 0)
2692 return powerdown;
2693
2694 if (feat == expected_feat && feat != powerdown)
2695 return 0;
2696
2697 msleep(50);
2698 }
2699
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02002700 dev_warn(&dev->intf->dev, "AC97 registers access is not reliable !\n");
Matthieu Rogez0899f622016-03-04 18:33:08 -03002701 return -ETIMEDOUT;
2702}
2703
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002704/* Since em28xx_pre_card_setup() requires a proper dev->model,
2705 * this won't work for boards with generic PCI IDs
2706 */
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002707static void em28xx_pre_card_setup(struct em28xx *dev)
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002708{
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03002709 /* Set the initial XCLK and I2C clock values based on the board
2710 definition */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002711 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
Sascha Sommerca80cf62012-01-08 16:32:09 -03002712 if (!dev->board.is_em2800)
2713 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002714 msleep(50);
2715
Markus Rechbergera94e95b2006-01-23 17:11:10 -02002716 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03002717 switch (dev->model) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002718 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03002719 /* Sets the msp34xx I2S speed */
2720 dev->i2s_speed = 2048000;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002721 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002722 case EM2861_BOARD_KWORLD_PVRTV_300U:
2723 case EM2880_BOARD_KWORLD_DVB_305U:
Frank Schaeferc074fc42013-06-03 14:12:03 -03002724 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002725 msleep(10);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002726 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002727 msleep(10);
2728 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002729 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002730 /* TODO: someone can do some cleanup here...
2731 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002732 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002733 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002734 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002735 msleep(10);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002736 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002737 mdelay(70);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002738 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002739 mdelay(70);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002740 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002741 mdelay(70);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002742 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002743 mdelay(70);
2744 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002745 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002746 /* this device needs some gpio writes to get the DVB-T
2747 demod work */
Frank Schaeferc074fc42013-06-03 14:12:03 -03002748 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002749 mdelay(70);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002750 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002751 mdelay(70);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002752 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002753 mdelay(70);
2754 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002755 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002756 /* this device needs some gpio writes to get the
2757 DVB-T demod work */
Frank Schaeferc074fc42013-06-03 14:12:03 -03002758 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002759 mdelay(70);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002760 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002761 mdelay(70);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002762 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002763 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002764 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002765 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002766 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03002767 /* enables audio for that devices */
Frank Schaeferc074fc42013-06-03 14:12:03 -03002768 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002769 break;
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002770
Franklin Mengd7de5d82009-06-06 17:05:02 -03002771 case EM2882_BOARD_KWORLD_ATSC_315U:
Frank Schaeferc074fc42013-06-03 14:12:03 -03002772 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff);
Franklin Mengd7de5d82009-06-06 17:05:02 -03002773 msleep(10);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002774 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
Franklin Mengd7de5d82009-06-06 17:05:02 -03002775 msleep(10);
2776 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
2777 msleep(10);
2778 em28xx_write_reg(dev, EM2880_R04_GPO, 0x08);
2779 msleep(10);
2780 break;
2781
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03002782 case EM2860_BOARD_KAIOMY_TVNPC_U2:
2783 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
2784 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
2785 em28xx_write_regs(dev, 0x0d, "\x42", 1);
2786 em28xx_write_regs(dev, 0x08, "\xfd", 1);
2787 msleep(10);
2788 em28xx_write_regs(dev, 0x08, "\xff", 1);
2789 msleep(10);
2790 em28xx_write_regs(dev, 0x08, "\x7f", 1);
2791 msleep(10);
2792 em28xx_write_regs(dev, 0x08, "\x6b", 1);
2793
2794 break;
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03002795 case EM2860_BOARD_EASYCAP:
2796 em28xx_write_regs(dev, 0x08, "\xf8", 1);
2797 break;
2798
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002799 case EM2820_BOARD_IODATA_GVMVP_SZ:
Frank Schaeferc074fc42013-06-03 14:12:03 -03002800 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff);
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002801 msleep(70);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002802 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7);
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002803 msleep(10);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002804 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfe);
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002805 msleep(70);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002806 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03002807 msleep(70);
2808 break;
Matthieu Rogez0899f622016-03-04 18:33:08 -03002809
2810 case EM2860_BOARD_TERRATEC_GRABBY:
2811 /* HACK?: Ensure AC97 register reading is reliable before
2812 * proceeding. In practice, this will wait about 1.6 seconds.
2813 */
2814 em28xx_wait_until_ac97_features_equals(dev, 0x6a90);
2815 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03002816 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002817
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03002818 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03002819 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
2820
2821 /* Unlock device */
Mauro Carvalho Chehab2fe3e2e2008-11-27 09:10:40 -03002822 em28xx_set_mode(dev, EM28XX_SUSPEND);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002823}
2824
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002825static int em28xx_hint_board(struct em28xx *dev)
2826{
2827 int i;
2828
Frank Schaefer2d466e12013-03-27 17:06:28 -03002829 if (dev->board.is_webcam) {
2830 if (dev->em28xx_sensor == EM28XX_MT9V011) {
2831 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
2832 } else if (dev->em28xx_sensor == EM28XX_MT9M001 ||
2833 dev->em28xx_sensor == EM28XX_MT9M111) {
2834 dev->model = EM2750_BOARD_UNKNOWN;
2835 }
2836 /* FIXME: IMPROVE ! */
2837
2838 return 0;
2839 }
2840
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002841 /* HINT method: EEPROM
2842 *
2843 * This method works only for boards with eeprom.
2844 * Uses a hash of all eeprom bytes. The hash should be
2845 * unique for a vendor/tuner pair.
2846 * There are a high chance that tuners for different
2847 * video standards produce different hashes.
2848 */
2849 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
2850 if (dev->hash == em28xx_eeprom_hash[i].hash) {
2851 dev->model = em28xx_eeprom_hash[i].model;
2852 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002853
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02002854 dev_err(&dev->intf->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02002855 "Your board has no unique USB ID.\n"
2856 "A hint were successfully done, based on eeprom hash.\n"
2857 "This method is not 100%% failproof.\n"
Colin Ian King1656df32017-05-22 05:13:25 -03002858 "If the board were misdetected, please email this log to:\n"
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02002859 "\tV4L Mailing List <linux-media@vger.kernel.org>\n"
2860 "Board detected as %s\n",
Mauro Carvalho Chehab2a96f602016-10-12 07:32:23 -03002861 em28xx_boards[dev->model].name);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002862
2863 return 0;
2864 }
2865 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03002866
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002867 /* HINT method: I2C attached devices
2868 *
2869 * This method works for all boards.
2870 * Uses a hash of i2c scanned devices.
2871 * Devices with the same i2c attached chips will
2872 * be considered equal.
2873 * This method is less precise than the eeprom one.
2874 */
2875
Sascha Sommerfad7b952007-11-04 08:06:48 -03002876 /* user did not request i2c scanning => do it now */
2877 if (!dev->i2c_hash)
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03002878 em28xx_do_i2c_scan(dev, dev->def_i2c_bus);
Sascha Sommerfad7b952007-11-04 08:06:48 -03002879
2880 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
2881 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
2882 dev->model = em28xx_i2c_hash[i].model;
2883 dev->tuner_type = em28xx_i2c_hash[i].tuner;
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02002884 dev_err(&dev->intf->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02002885 "Your board has no unique USB ID.\n"
2886 "A hint were successfully done, based on i2c devicelist hash.\n"
2887 "This method is not 100%% failproof.\n"
Colin Ian King1656df32017-05-22 05:13:25 -03002888 "If the board were misdetected, please email this log to:\n"
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02002889 "\tV4L Mailing List <linux-media@vger.kernel.org>\n"
2890 "Board detected as %s\n",
2891 em28xx_boards[dev->model].name);
Sascha Sommerfad7b952007-11-04 08:06:48 -03002892
2893 return 0;
2894 }
2895 }
2896
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02002897 dev_err(&dev->intf->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02002898 "Your board has no unique USB ID and thus need a hint to be detected.\n"
2899 "You may try to use card=<n> insmod option to workaround that.\n"
2900 "Please send an email with this log to:\n"
2901 "\tV4L Mailing List <linux-media@vger.kernel.org>\n"
2902 "Board eeprom hash is 0x%08lx\n"
2903 "Board i2c devicelist hash is 0x%08lx\n",
2904 dev->hash, dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002905
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02002906 dev_err(&dev->intf->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02002907 "Here is a list of valid choices for the card=<n> insmod option:\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002908 for (i = 0; i < em28xx_bcount; i++) {
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02002909 dev_err(&dev->intf->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02002910 " card=%d -> %s\n", i, em28xx_boards[i].name);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002911 }
2912 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002913}
2914
Ezequiel Garcia60332f02012-04-28 09:57:01 -03002915static void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002916{
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002917 /*
2918 * If the device can be a webcam, seek for a sensor.
2919 * If sensor is not found, then it isn't a webcam.
2920 */
2921 if (dev->board.is_webcam) {
Frank Schaefer85316cf2017-04-15 07:05:02 -03002922 em28xx_detect_sensor(dev);
2923 if (dev->em28xx_sensor == EM28XX_NOSENSOR)
2924 /* NOTE: error/unknown sensor/no sensor */
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002925 dev->board.is_webcam = 0;
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002926 }
2927
Frank Schaefer2d466e12013-03-27 17:06:28 -03002928 switch (dev->model) {
2929 case EM2750_BOARD_UNKNOWN:
2930 case EM2820_BOARD_UNKNOWN:
2931 case EM2800_BOARD_UNKNOWN:
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002932 /*
2933 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2934 *
2935 * This occurs because they share identical USB vendor and
2936 * product IDs.
2937 *
2938 * What we do here is look up the EEPROM hash of the K-WORLD
2939 * and if it is found then we decide that we do not have
2940 * a DIGIVOX and reset the device to the K-WORLD instead.
2941 *
2942 * This solution is only valid if they do not share eeprom
2943 * hash identities which has not been determined as yet.
2944 */
2945 if (em28xx_hint_board(dev) < 0)
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02002946 dev_err(&dev->intf->dev, "Board not discovered\n");
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002947 else {
2948 em28xx_set_model(dev);
2949 em28xx_pre_card_setup(dev);
2950 }
2951 break;
Frank Schaefer2d466e12013-03-27 17:06:28 -03002952 default:
2953 em28xx_set_model(dev);
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03002954 }
Mauro Carvalho Chehab3d3215c2009-08-10 10:29:27 -03002955
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02002956 dev_info(&dev->intf->dev, "Identified as %s (card=%d)\n",
Mauro Carvalho Chehab2a96f602016-10-12 07:32:23 -03002957 dev->board.name, dev->model);
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002958
2959 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
2960
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002961 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002962 switch (dev->model) {
2963 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03002964 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002965 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002966 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002967 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Frank Schaefera6166012013-03-03 15:37:44 -03002968 case EM2884_BOARD_HAUPPAUGE_WINTV_HVR_930C:
Olli Salonen11a2a942016-04-04 12:12:52 -03002969 case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_DVB:
Kevin Cheng15863422017-01-10 01:14:29 -02002970 case EM28174_BOARD_HAUPPAUGE_WINTV_DUALHD_01595:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002971 {
2972 struct tveeprom tv;
Frank Schaefera2179682013-03-03 15:37:42 -03002973
2974 if (dev->eedata == NULL)
2975 break;
Mauro Carvalho Chehabac07bb72009-09-08 14:04:41 -03002976#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002977 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002978#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002979 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002980
Mauro Carvalho Chehab446aba62017-03-03 07:28:29 -03002981 tveeprom_hauppauge_analog(&tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002982
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002983 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002984
Hans Verkuil33001012013-05-29 06:59:45 -03002985 if (tv.audio_processor == TVEEPROM_AUDPROC_MSP) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002986 dev->i2s_speed = 2048000;
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002987 dev->board.has_msp34xx = 1;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002988 }
2989 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002990 }
Franklin Mengd7de5d82009-06-06 17:05:02 -03002991 case EM2882_BOARD_KWORLD_ATSC_315U:
2992 em28xx_write_reg(dev, 0x0d, 0x42);
2993 msleep(10);
Frank Schaeferc074fc42013-06-03 14:12:03 -03002994 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xfd);
Franklin Mengd7de5d82009-06-06 17:05:02 -03002995 msleep(10);
2996 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002997 case EM2820_BOARD_KWORLD_PVRTV2800RF:
2998 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Frank Schaeferc074fc42013-06-03 14:12:03 -03002999 em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03003000 break;
3001 case EM2820_BOARD_UNKNOWN:
3002 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03003003 /*
3004 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
3005 *
3006 * This occurs because they share identical USB vendor and
3007 * product IDs.
3008 *
3009 * What we do here is look up the EEPROM hash of the K-WORLD
3010 * and if it is found then we decide that we do not have
3011 * a DIGIVOX and reset the device to the K-WORLD instead.
3012 *
3013 * This solution is only valid if they do not share eeprom
3014 * hash identities which has not been determined as yet.
3015 */
3016 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03003017 if (!em28xx_hint_board(dev))
3018 em28xx_set_model(dev);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03003019
3020 /* In cases where we had to use a board hint, the call to
3021 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
3022 so make the call now so the analog GPIOs are set properly
3023 before probing the i2c bus. */
Devin Heitmueller5343e442009-07-15 00:35:47 -03003024 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03003025 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03003026 break;
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03003027
Frank Schaefera2179682013-03-03 15:37:42 -03003028 /*
Andrea.Amorosi76@gmail.com7ca7ef62010-02-09 17:53:38 -03003029 * The Dikom DK300 is detected as an Kworld VS-DVB-T 323UR.
3030 *
3031 * This occurs because they share identical USB vendor and
3032 * product IDs.
3033 *
3034 * What we do here is look up the EEPROM hash of the Dikom
3035 * and if it is found then we decide that we do not have
3036 * a Kworld and reset the device to the Dikom instead.
3037 *
3038 * This solution is only valid if they do not share eeprom
3039 * hash identities which has not been determined as yet.
3040 */
3041 case EM2882_BOARD_KWORLD_VS_DVBT:
3042 if (!em28xx_hint_board(dev))
3043 em28xx_set_model(dev);
3044
3045 /* In cases where we had to use a board hint, the call to
3046 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
3047 so make the call now so the analog GPIOs are set properly
3048 before probing the i2c bus. */
3049 em28xx_gpio_set(dev, dev->board.tuner_gpio);
3050 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
3051 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03003052 }
3053
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03003054 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003055 dev_err(&dev->intf->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003056 "\n\n"
3057 "The support for this board weren't valid yet.\n"
3058 "Please send a report of having this working\n"
3059 "not to V4L mailing list (and/or to other addresses)\n\n");
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03003060 }
3061
Frank Schaefera2179682013-03-03 15:37:42 -03003062 /* Free eeprom data memory */
3063 kfree(dev->eedata);
3064 dev->eedata = NULL;
3065
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03003066 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03003067 if (tuner >= 0)
3068 dev->tuner_type = tuner;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08003069}
Mauro Carvalho Chehabc8644052008-11-25 13:10:14 -03003070
Mauro Carvalho Chehabee972072014-01-12 11:08:22 -03003071void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
3072{
3073 memset(ctl, 0, sizeof(*ctl));
3074
3075 ctl->fname = XC2028_DEFAULT_FIRMWARE;
3076 ctl->max_len = 64;
3077 ctl->mts = em28xx_boards[dev->model].mts_firmware;
3078
3079 switch (dev->model) {
3080 case EM2880_BOARD_EMPIRE_DUAL_TV:
3081 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
3082 case EM2882_BOARD_TERRATEC_HYBRID_XS:
3083 ctl->demod = XC3028_FE_ZARLINK456;
3084 break;
3085 case EM2880_BOARD_TERRATEC_HYBRID_XS:
3086 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
3087 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
3088 ctl->demod = XC3028_FE_ZARLINK456;
3089 break;
3090 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
3091 case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
3092 ctl->demod = XC3028_FE_DEFAULT;
3093 break;
3094 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
3095 ctl->demod = XC3028_FE_DEFAULT;
3096 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
3097 break;
3098 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
3099 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
3100 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
3101 /* FIXME: Better to specify the needed IF */
3102 ctl->demod = XC3028_FE_DEFAULT;
3103 break;
3104 case EM2883_BOARD_KWORLD_HYBRID_330U:
3105 case EM2882_BOARD_DIKOM_DK300:
3106 case EM2882_BOARD_KWORLD_VS_DVBT:
3107 ctl->demod = XC3028_FE_CHINA;
3108 ctl->fname = XC2028_DEFAULT_FIRMWARE;
3109 break;
3110 case EM2882_BOARD_EVGA_INDTUBE:
3111 ctl->demod = XC3028_FE_CHINA;
3112 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
3113 break;
3114 default:
3115 ctl->demod = XC3028_FE_OREN538;
3116 }
3117}
3118EXPORT_SYMBOL_GPL(em28xx_setup_xc3028);
3119
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003120static void request_module_async(struct work_struct *work)
3121{
3122 struct em28xx *dev = container_of(work,
3123 struct em28xx, request_module_wk);
3124
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03003125 /*
3126 * The em28xx extensions can be modules or builtin. If the
3127 * modules are already loaded or are built in, those extensions
3128 * can be initialised right now. Otherwise, the module init
3129 * code will do it.
3130 */
Mauro Carvalho Chehabe63fa182014-01-06 05:50:07 -03003131
3132 /*
3133 * Devicdes with an audio-only interface also have a V4L/DVB/RC
3134 * interface. Don't register extensions twice on those devices.
3135 */
3136 if (dev->is_audio_only) {
3137#if defined(CONFIG_MODULES) && defined(MODULE)
3138 request_module("em28xx-alsa");
3139#endif
3140 return;
3141 }
3142
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03003143 em28xx_init_extension(dev);
3144
3145#if defined(CONFIG_MODULES) && defined(MODULE)
Mauro Carvalho Chehab01c28192013-12-22 13:27:02 -03003146 if (dev->has_video)
3147 request_module("em28xx-v4l");
Frank Schaeferc5874202014-09-13 05:52:20 -03003148 if (dev->usb_audio_type == EM28XX_USB_AUDIO_CLASS)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003149 request_module("snd-usb-audio");
Frank Schaeferc5874202014-09-13 05:52:20 -03003150 else if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003151 request_module("em28xx-alsa");
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003152 if (dev->board.has_dvb)
3153 request_module("em28xx-dvb");
Frank Schaeferf52226092013-12-01 18:06:52 -03003154 if (dev->board.buttons ||
Frank Schaefer2b64cbd2013-04-11 15:56:01 -03003155 ((dev->board.ir_codes || dev->board.has_ir_i2c) && !disable_ir))
Ezequiel Garcíaf4d4e762012-03-26 09:13:35 -03003156 request_module("em28xx-rc");
Mauro Carvalho Chehab6ae5e062012-10-02 15:35:27 -03003157#endif /* CONFIG_MODULES */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003158}
3159
3160static void request_modules(struct em28xx *dev)
3161{
3162 INIT_WORK(&dev->request_module_wk, request_module_async);
3163 schedule_work(&dev->request_module_wk);
3164}
Tejun Heo707bcf32010-12-24 16:14:20 +01003165
3166static void flush_request_modules(struct em28xx *dev)
3167{
Linus Torvalds0b8e74c2012-10-07 17:49:05 +09003168 flush_work(&dev->request_module_wk);
Tejun Heo707bcf32010-12-24 16:14:20 +01003169}
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003170
Mauro Carvalho Chehab37ecc7b2016-01-27 07:07:24 -02003171static int em28xx_media_device_init(struct em28xx *dev,
3172 struct usb_device *udev)
3173{
3174#ifdef CONFIG_MEDIA_CONTROLLER
3175 struct media_device *mdev;
3176
Mauro Carvalho Chehab6cf5dad2016-02-22 12:10:49 -03003177 mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
Mauro Carvalho Chehab37ecc7b2016-01-27 07:07:24 -02003178 if (!mdev)
3179 return -ENOMEM;
3180
Mauro Carvalho Chehab6cf5dad2016-02-22 12:10:49 -03003181 if (udev->product)
3182 media_device_usb_init(mdev, udev, udev->product);
3183 else if (udev->manufacturer)
3184 media_device_usb_init(mdev, udev, udev->manufacturer);
3185 else
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003186 media_device_usb_init(mdev, udev, dev_name(&dev->intf->dev));
Mauro Carvalho Chehab6cf5dad2016-02-22 12:10:49 -03003187
Mauro Carvalho Chehab37ecc7b2016-01-27 07:07:24 -02003188 dev->media_dev = mdev;
3189#endif
3190 return 0;
3191}
3192
3193static void em28xx_unregister_media_device(struct em28xx *dev)
3194{
3195
3196#ifdef CONFIG_MEDIA_CONTROLLER
3197 if (dev->media_dev) {
3198 media_device_unregister(dev->media_dev);
3199 media_device_cleanup(dev->media_dev);
3200 kfree(dev->media_dev);
3201 dev->media_dev = NULL;
3202 }
3203#endif
3204}
3205
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003206/*
Chris Rankind7222e72011-09-24 11:02:32 -03003207 * em28xx_release_resources()
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003208 * unregisters the v4l2,i2c and usb devices
Chris Rankind7222e72011-09-24 11:02:32 -03003209 * called when the device gets disconnected or at module unload
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003210*/
Mauro Carvalho Chehab47677e52014-03-05 11:21:07 -03003211static void em28xx_release_resources(struct em28xx *dev)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003212{
Mauro Carvalho Chehabc6d48132016-12-07 14:34:22 -02003213 struct usb_device *udev = interface_to_usbdev(dev->intf);
3214
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003215 /*FIXME: I2C IR should be disconnected */
3216
Frank Schaefer5a620c72014-01-12 13:24:24 -03003217 mutex_lock(&dev->lock);
3218
Mauro Carvalho Chehab37ecc7b2016-01-27 07:07:24 -02003219 em28xx_unregister_media_device(dev);
3220
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03003221 if (dev->def_i2c_bus)
3222 em28xx_i2c_unregister(dev, 1);
3223 em28xx_i2c_unregister(dev, 0);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003224
Mauro Carvalho Chehabc6d48132016-12-07 14:34:22 -02003225 usb_put_dev(udev);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003226
3227 /* Mark device as unused */
Mauro Carvalho Chehabc3aed262014-01-14 17:35:15 -03003228 clear_bit(dev->devno, em28xx_devused);
Frank Schaefer5a620c72014-01-12 13:24:24 -03003229
3230 mutex_unlock(&dev->lock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003231};
Mauro Carvalho Chehab47677e52014-03-05 11:21:07 -03003232
3233/**
3234 * em28xx_free_device() - Free em28xx device
3235 *
3236 * @ref: struct kref for em28xx device
3237 *
3238 * This is called when all extensions and em28xx core unregisters a device
3239 */
3240void em28xx_free_device(struct kref *ref)
3241{
3242 struct em28xx *dev = kref_to_dev(ref);
3243
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003244 dev_info(&dev->intf->dev, "Freeing device\n");
Mauro Carvalho Chehab47677e52014-03-05 11:21:07 -03003245
3246 if (!dev->disconnected)
3247 em28xx_release_resources(dev);
3248
3249 kfree(dev->alt_max_pkt_size_isoc);
3250 kfree(dev);
3251}
3252EXPORT_SYMBOL_GPL(em28xx_free_device);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003253
3254/*
3255 * em28xx_init_dev()
3256 * allocates and inits the device structs, registers i2c bus and v4l device
3257 */
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03003258static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03003259 struct usb_interface *interface,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003260 int minor)
3261{
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003262 int retval;
Mauro Carvalho Chehabea48c362016-12-07 14:53:26 -02003263 const char *chip_name = NULL;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003264
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003265 dev->intf = interface;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003266 mutex_init(&dev->ctrl_urb_lock);
3267 spin_lock_init(&dev->slock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003268
3269 dev->em28xx_write_regs = em28xx_write_regs;
3270 dev->em28xx_read_reg = em28xx_read_reg;
3271 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
3272 dev->em28xx_write_regs_req = em28xx_write_regs_req;
3273 dev->em28xx_read_reg_req = em28xx_read_reg_req;
3274 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
3275
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003276 em28xx_set_model(dev);
3277
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003278 dev->wait_after_write = 5;
3279
3280 /* Based on the Chip ID, set the device configuration */
3281 retval = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
3282 if (retval > 0) {
3283 dev->chip_id = retval;
3284
3285 switch (dev->chip_id) {
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03003286 case CHIP_ID_EM2800:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003287 chip_name = "em2800";
Mauro Carvalho Chehabf57b17c32009-11-12 11:21:05 -03003288 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003289 case CHIP_ID_EM2710:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003290 chip_name = "em2710";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003291 break;
3292 case CHIP_ID_EM2750:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003293 chip_name = "em2750";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003294 break;
Frank Schaefer736a3202013-03-26 13:38:37 -03003295 case CHIP_ID_EM2765:
3296 chip_name = "em2765";
3297 dev->wait_after_write = 0;
3298 dev->is_em25xx = 1;
3299 dev->eeprom_addrwidth_16bit = 1;
3300 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003301 case CHIP_ID_EM2820:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003302 chip_name = "em2710/2820";
Mauro Carvalho Chehabc6d48132016-12-07 14:34:22 -02003303 if (le16_to_cpu(udev->descriptor.idVendor) == 0xeb1a) {
3304 __le16 idProd = udev->descriptor.idProduct;
Mauro Carvalho Chehabfdf1bc92014-11-28 08:34:15 -03003305
Frank Schaefer61ff5d62013-04-11 15:56:47 -03003306 if (le16_to_cpu(idProd) == 0x2710)
3307 chip_name = "em2710";
3308 else if (le16_to_cpu(idProd) == 0x2820)
3309 chip_name = "em2820";
3310 }
3311 /* NOTE: the em2820 is used in webcams, too ! */
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003312 break;
3313 case CHIP_ID_EM2840:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003314 chip_name = "em2840";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003315 break;
3316 case CHIP_ID_EM2860:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003317 chip_name = "em2860";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003318 break;
3319 case CHIP_ID_EM2870:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003320 chip_name = "em2870";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003321 dev->wait_after_write = 0;
3322 break;
3323 case CHIP_ID_EM2874:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003324 chip_name = "em2874";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003325 dev->wait_after_write = 0;
Frank Schaefer87b52432013-03-03 15:37:40 -03003326 dev->eeprom_addrwidth_16bit = 1;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003327 break;
Antti Palosaaribc022692011-04-07 16:04:48 -03003328 case CHIP_ID_EM28174:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003329 chip_name = "em28174";
Antti Palosaaribc022692011-04-07 16:04:48 -03003330 dev->wait_after_write = 0;
Frank Schaefer87b52432013-03-03 15:37:40 -03003331 dev->eeprom_addrwidth_16bit = 1;
Antti Palosaaribc022692011-04-07 16:04:48 -03003332 break;
Antti Palosaari9f1d0bd2013-02-25 08:19:04 -03003333 case CHIP_ID_EM28178:
3334 chip_name = "em28178";
3335 dev->wait_after_write = 0;
3336 dev->eeprom_addrwidth_16bit = 1;
3337 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003338 case CHIP_ID_EM2883:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003339 chip_name = "em2882/3";
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003340 dev->wait_after_write = 0;
3341 break;
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003342 case CHIP_ID_EM2884:
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003343 chip_name = "em2884";
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003344 dev->wait_after_write = 0;
Frank Schaefer87b52432013-03-03 15:37:40 -03003345 dev->eeprom_addrwidth_16bit = 1;
Mauro Carvalho Chehabfec528b2011-07-03 21:05:06 -03003346 break;
Mauro Carvalho Chehabfcd20e32009-08-10 02:57:57 -03003347 }
3348 }
Mauro Carvalho Chehabea48c362016-12-07 14:53:26 -02003349 if (!chip_name)
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003350 dev_info(&dev->intf->dev,
Mauro Carvalho Chehabea48c362016-12-07 14:53:26 -02003351 "unknown em28xx chip ID (%d)\n", dev->chip_id);
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003352 else
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003353 dev_info(&dev->intf->dev, "chip ID is %s\n", chip_name);
Mauro Carvalho Chehaba3efa1c2012-12-23 16:32:03 -02003354
Mauro Carvalho Chehab37ecc7b2016-01-27 07:07:24 -02003355 em28xx_media_device_init(dev, udev);
3356
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003357 if (dev->is_audio_only) {
Chris Rankin6c03e382011-08-20 08:28:17 -03003358 retval = em28xx_audio_setup(dev);
3359 if (retval)
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003360 return -ENODEV;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003361 em28xx_init_extension(dev);
3362
3363 return 0;
3364 }
3365
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003366 em28xx_pre_card_setup(dev);
3367
3368 if (!dev->board.is_em2800) {
Mauro Carvalho Chehabca3dfd62010-09-10 17:29:14 -03003369 /* Resets I2C speed */
Sascha Sommer0903bb52012-01-08 16:19:30 -03003370 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003371 if (retval < 0) {
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003372 dev_err(&dev->intf->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003373 "%s: em28xx_write_reg failed! retval [%d]\n",
Mauro Carvalho Chehab2a96f602016-10-12 07:32:23 -03003374 __func__, retval);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003375 return retval;
3376 }
3377 }
3378
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03003379 rt_mutex_init(&dev->i2c_bus_lock);
3380
3381 /* register i2c bus 0 */
Frank Schaefera3ea4bf2013-03-26 13:38:36 -03003382 if (dev->board.is_em2800)
3383 retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM2800);
3384 else
3385 retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
Chris Rankin6c03e382011-08-20 08:28:17 -03003386 if (retval < 0) {
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003387 dev_err(&dev->intf->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003388 "%s: em28xx_i2c_register bus 0 - error [%d]!\n",
Mauro Carvalho Chehab2a96f602016-10-12 07:32:23 -03003389 __func__, retval);
Mauro Carvalho Chehabb64f8e92013-12-22 13:16:49 -03003390 return retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003391 }
3392
Frank Schaefera3ea4bf2013-03-26 13:38:36 -03003393 /* register i2c bus 1 */
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03003394 if (dev->def_i2c_bus) {
Frank Schaefer736a3202013-03-26 13:38:37 -03003395 if (dev->is_em25xx)
3396 retval = em28xx_i2c_register(dev, 1,
Mauro Carvalho Chehabfdf1bc92014-11-28 08:34:15 -03003397 EM28XX_I2C_ALGO_EM25XX_BUS_B);
Frank Schaefer736a3202013-03-26 13:38:37 -03003398 else
3399 retval = em28xx_i2c_register(dev, 1,
Mauro Carvalho Chehabfdf1bc92014-11-28 08:34:15 -03003400 EM28XX_I2C_ALGO_EM28XX);
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03003401 if (retval < 0) {
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003402 dev_err(&dev->intf->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003403 "%s: em28xx_i2c_register bus 1 - error [%d]!\n",
Mauro Carvalho Chehab2a96f602016-10-12 07:32:23 -03003404 __func__, retval);
Mauro Carvalho Chehab1f0ee652014-01-05 08:43:40 -03003405
3406 em28xx_i2c_unregister(dev, 0);
3407
Mauro Carvalho Chehabb64f8e92013-12-22 13:16:49 -03003408 return retval;
Mauro Carvalho Chehabaab31252013-03-05 06:55:28 -03003409 }
3410 }
3411
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003412 /* Do board specific init and eeprom reading */
3413 em28xx_card_setup(dev);
3414
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003415 return 0;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003416}
3417
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003418/* high bandwidth multiplier, as encoded in highspeed endpoint descriptors */
3419#define hb_mult(wMaxPacketSize) (1 + (((wMaxPacketSize) >> 11) & 0x03))
3420
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003421/*
3422 * em28xx_usb_probe()
3423 * checks for supported devices
3424 */
3425static int em28xx_usb_probe(struct usb_interface *interface,
3426 const struct usb_device_id *id)
3427{
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003428 struct usb_device *udev;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003429 struct em28xx *dev = NULL;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003430 int retval;
Frank Schaeferc5874202014-09-13 05:52:20 -03003431 bool has_vendor_audio = false, has_video = false, has_dvb = false;
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003432 int i, nr, try_bulk;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003433 const int ifnum = interface->altsetting[0].desc.bInterfaceNumber;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003434 char *speed;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003435
3436 udev = usb_get_dev(interface_to_usbdev(interface));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003437
3438 /* Check to see next free device and mark as used */
Chris Rankin38b61eb2011-08-20 08:21:03 -03003439 do {
Mauro Carvalho Chehabc3aed262014-01-14 17:35:15 -03003440 nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS);
Chris Rankin38b61eb2011-08-20 08:21:03 -03003441 if (nr >= EM28XX_MAXBOARDS) {
3442 /* No free device slots */
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003443 dev_err(&interface->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003444 "Driver supports up to %i em28xx boards.\n",
Mauro Carvalho Chehabfdf1bc92014-11-28 08:34:15 -03003445 EM28XX_MAXBOARDS);
Chris Rankin38b61eb2011-08-20 08:21:03 -03003446 retval = -ENOMEM;
3447 goto err_no_slot;
3448 }
Mauro Carvalho Chehabc3aed262014-01-14 17:35:15 -03003449 } while (test_and_set_bit(nr, em28xx_devused));
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003450
3451 /* Don't register audio interfaces */
3452 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003453 dev_err(&interface->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003454 "audio device (%04x:%04x): interface %i, class %i\n",
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003455 le16_to_cpu(udev->descriptor.idVendor),
3456 le16_to_cpu(udev->descriptor.idProduct),
3457 ifnum,
3458 interface->altsetting[0].desc.bInterfaceClass);
3459
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003460 retval = -ENODEV;
3461 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003462 }
3463
Holger Nelson8ab33622011-12-28 18:55:41 -03003464 /* allocate memory for our device state and initialize it */
3465 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
3466 if (dev == NULL) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003467 retval = -ENOMEM;
3468 goto err;
3469 }
3470
3471 /* compute alternate max packet sizes */
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003472 dev->alt_max_pkt_size_isoc =
3473 kmalloc(sizeof(dev->alt_max_pkt_size_isoc[0]) *
Holger Nelson8ab33622011-12-28 18:55:41 -03003474 interface->num_altsetting, GFP_KERNEL);
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003475 if (dev->alt_max_pkt_size_isoc == NULL) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003476 kfree(dev);
3477 retval = -ENOMEM;
3478 goto err;
3479 }
3480
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003481 /* Get endpoints */
3482 for (i = 0; i < interface->num_altsetting; i++) {
3483 int ep;
3484
3485 for (ep = 0; ep < interface->altsetting[i].desc.bNumEndpoints; ep++) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003486 const struct usb_endpoint_descriptor *e;
3487 int sizedescr, size;
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003488
Holger Nelson8ab33622011-12-28 18:55:41 -03003489 e = &interface->altsetting[i].endpoint[ep].desc;
3490
3491 sizedescr = le16_to_cpu(e->wMaxPacketSize);
3492 size = sizedescr & 0x7ff;
3493
3494 if (udev->speed == USB_SPEED_HIGH)
3495 size = size * hb_mult(sizedescr);
3496
Frank Schaeferc647a912012-11-08 14:11:52 -03003497 if (usb_endpoint_dir_in(e)) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003498 switch (e->bEndpointAddress) {
Frank Schaeferc647a912012-11-08 14:11:52 -03003499 case 0x82:
Holger Nelson8ab33622011-12-28 18:55:41 -03003500 has_video = true;
Frank Schaeferc647a912012-11-08 14:11:52 -03003501 if (usb_endpoint_xfer_isoc(e)) {
3502 dev->analog_ep_isoc =
3503 e->bEndpointAddress;
3504 dev->alt_max_pkt_size_isoc[i] = size;
3505 } else if (usb_endpoint_xfer_bulk(e)) {
3506 dev->analog_ep_bulk =
3507 e->bEndpointAddress;
3508 }
Holger Nelson8ab33622011-12-28 18:55:41 -03003509 break;
Frank Schaeferc647a912012-11-08 14:11:52 -03003510 case 0x83:
3511 if (usb_endpoint_xfer_isoc(e)) {
Frank Schaeferc5874202014-09-13 05:52:20 -03003512 has_vendor_audio = true;
Frank Schaeferc647a912012-11-08 14:11:52 -03003513 } else {
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003514 dev_err(&interface->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003515 "error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
Frank Schaeferc647a912012-11-08 14:11:52 -03003516 }
3517 break;
3518 case 0x84:
3519 if (has_video &&
3520 (usb_endpoint_xfer_bulk(e))) {
3521 dev->analog_ep_bulk =
3522 e->bEndpointAddress;
3523 } else {
Frank Schaeferc647a912012-11-08 14:11:52 -03003524 if (usb_endpoint_xfer_isoc(e)) {
Frank Schaeferc647a912012-11-08 14:11:52 -03003525 if (size > dev->dvb_max_pkt_size_isoc) {
Frank Schaefer72cc9ba2013-03-27 16:07:41 -03003526 has_dvb = true; /* see NOTE (~) */
Frank Schaeferb3404a82013-04-08 13:06:59 -03003527 dev->dvb_ep_isoc = e->bEndpointAddress;
Frank Schaeferc647a912012-11-08 14:11:52 -03003528 dev->dvb_max_pkt_size_isoc = size;
3529 dev->dvb_alt_isoc = i;
3530 }
3531 } else {
Frank Schaefer72cc9ba2013-03-27 16:07:41 -03003532 has_dvb = true;
Frank Schaeferc647a912012-11-08 14:11:52 -03003533 dev->dvb_ep_bulk = e->bEndpointAddress;
3534 }
Holger Nelson8ab33622011-12-28 18:55:41 -03003535 }
3536 break;
3537 }
3538 }
Frank Schaeferc647a912012-11-08 14:11:52 -03003539 /* NOTE:
3540 * Old logic with support for isoc transfers only was:
3541 * 0x82 isoc => analog
3542 * 0x83 isoc => audio
3543 * 0x84 isoc => digital
3544 *
3545 * New logic with support for bulk transfers
3546 * 0x82 isoc => analog
3547 * 0x82 bulk => analog
3548 * 0x83 isoc* => audio
3549 * 0x84 isoc => digital
3550 * 0x84 bulk => analog or digital**
3551 * (*: audio should always be isoc)
3552 * (**: analog, if ep 0x82 is isoc, otherwise digital)
3553 *
3554 * The new logic preserves backwards compatibility and
3555 * reflects the endpoint configurations we have seen
3556 * so far. But there might be devices for which this
3557 * logic is not sufficient...
3558 */
Frank Schaefer72cc9ba2013-03-27 16:07:41 -03003559 /*
3560 * NOTE (~): some manufacturers (e.g. Terratec) disable
3561 * endpoints by setting wMaxPacketSize to 0 bytes for
3562 * all alt settings. So far, we've seen this for
3563 * DVB isoc endpoints only.
3564 */
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003565 }
3566 }
3567
Frank Schaeferc5874202014-09-13 05:52:20 -03003568 if (!(has_vendor_audio || has_video || has_dvb)) {
Holger Nelson8ab33622011-12-28 18:55:41 -03003569 retval = -ENODEV;
3570 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003571 }
3572
3573 switch (udev->speed) {
3574 case USB_SPEED_LOW:
3575 speed = "1.5";
3576 break;
3577 case USB_SPEED_UNKNOWN:
3578 case USB_SPEED_FULL:
3579 speed = "12";
3580 break;
3581 case USB_SPEED_HIGH:
3582 speed = "480";
3583 break;
3584 default:
3585 speed = "unknown";
3586 }
3587
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003588 dev_err(&interface->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003589 "New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n",
Ezequiel García401a5822012-03-13 10:27:09 -03003590 udev->manufacturer ? udev->manufacturer : "",
3591 udev->product ? udev->product : "",
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003592 speed,
3593 le16_to_cpu(udev->descriptor.idVendor),
3594 le16_to_cpu(udev->descriptor.idProduct),
3595 ifnum,
3596 interface->altsetting->desc.bInterfaceNumber);
3597
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003598 /*
3599 * Make sure we have 480 Mbps of bandwidth, otherwise things like
3600 * video stream wouldn't likely work, since 12 Mbps is generally
3601 * not enough even for most Digital TV streams.
3602 */
Devin Heitmuellere2a1b792009-05-27 23:44:10 -03003603 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003604 dev_err(&interface->dev, "Device initialization failed.\n");
3605 dev_err(&interface->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003606 "Device must be connected to a high-speed USB 2.0 port.\n");
Devin Heitmueller64a00b42009-05-27 23:23:37 -03003607 retval = -ENODEV;
Holger Nelson8ab33622011-12-28 18:55:41 -03003608 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003609 }
3610
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003611 dev->devno = nr;
3612 dev->model = id->driver_info;
3613 dev->alt = -1;
Frank Schaeferc5874202014-09-13 05:52:20 -03003614 dev->is_audio_only = has_vendor_audio && !(has_video || has_dvb);
Mauro Carvalho Chehab01c28192013-12-22 13:27:02 -03003615 dev->has_video = has_video;
Frank Schaefer961717b2014-01-13 19:02:06 -03003616 dev->ifnum = ifnum;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003617
Frank Schaeferc5874202014-09-13 05:52:20 -03003618 if (has_vendor_audio) {
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003619 dev_err(&interface->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003620 "Audio interface %i found (Vendor Class)\n", ifnum);
Frank Schaeferc5874202014-09-13 05:52:20 -03003621 dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR;
3622 }
3623 /* Checks if audio is provided by a USB Audio Class interface */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003624 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003625 struct usb_interface *uif = udev->config->interface[i];
Mauro Carvalho Chehabfdf1bc92014-11-28 08:34:15 -03003626
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003627 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
Frank Schaeferc5874202014-09-13 05:52:20 -03003628 if (has_vendor_audio)
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003629 dev_err(&interface->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003630 "em28xx: device seems to have vendor AND usb audio class interfaces !\n"
Mauro Carvalho Chehab2a96f602016-10-12 07:32:23 -03003631 "\t\tThe vendor interface will be ignored. Please contact the developers <linux-media@vger.kernel.org>\n");
Frank Schaeferc5874202014-09-13 05:52:20 -03003632 dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003633 break;
3634 }
3635 }
3636
Mauro Carvalho Chehabaa514962012-12-23 13:15:47 -02003637 if (has_video)
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003638 dev_err(&interface->dev, "Video interface %i found:%s%s\n",
Mauro Carvalho Chehab2a96f602016-10-12 07:32:23 -03003639 ifnum,
3640 dev->analog_ep_bulk ? " bulk" : "",
3641 dev->analog_ep_isoc ? " isoc" : "");
Mauro Carvalho Chehabaa514962012-12-23 13:15:47 -02003642 if (has_dvb)
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003643 dev_err(&interface->dev, "DVB interface %i found:%s%s\n",
Mauro Carvalho Chehab2a96f602016-10-12 07:32:23 -03003644 ifnum,
3645 dev->dvb_ep_bulk ? " bulk" : "",
3646 dev->dvb_ep_isoc ? " isoc" : "");
Mauro Carvalho Chehabaa514962012-12-23 13:15:47 -02003647
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003648 dev->num_alt = interface->num_altsetting;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003649
Mauro Carvalho Chehabd3e4ea02012-10-27 16:29:20 -03003650 if ((unsigned)card[nr] < em28xx_bcount)
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003651 dev->model = card[nr];
3652
Mauro Carvalho Chehab4f83e7b2011-06-17 15:15:12 -03003653 /* save our data pointer in this interface device */
3654 usb_set_intfdata(interface, dev);
3655
Mauro Carvalho Chehab22580f72016-01-29 12:53:56 -02003656 /* allocate device struct and check if the device is a webcam */
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003657 mutex_init(&dev->lock);
Thomas Petazzoni622c2fc2012-01-07 10:18:45 -03003658 retval = em28xx_init_dev(dev, udev, interface, nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003659 if (retval) {
Mauro Carvalho Chehab01c28192013-12-22 13:27:02 -03003660 goto err_free;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003661 }
3662
Frank Schaefer7e5d74e2012-12-26 15:12:37 -03003663 if (usb_xfer_mode < 0) {
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003664 if (dev->board.is_webcam)
3665 try_bulk = 1;
3666 else
3667 try_bulk = 0;
3668 } else {
Frank Schaefer7e5d74e2012-12-26 15:12:37 -03003669 try_bulk = usb_xfer_mode > 0;
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003670 }
3671
Frank Schaefer85316cf2017-04-15 07:05:02 -03003672 /* Disable V4L2 if the device doesn't have a decoder or image sensor */
Mauro Carvalho Chehab22580f72016-01-29 12:53:56 -02003673 if (has_video &&
Frank Schaefer85316cf2017-04-15 07:05:02 -03003674 dev->board.decoder == EM28XX_NODECODER &&
3675 dev->em28xx_sensor == EM28XX_NOSENSOR) {
3676
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003677 dev_err(&interface->dev,
Mauro Carvalho Chehabce8591f2016-10-20 08:42:03 -02003678 "Currently, V4L2 is not supported on this model\n");
Mauro Carvalho Chehab22580f72016-01-29 12:53:56 -02003679 has_video = false;
3680 dev->has_video = false;
3681 }
3682
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003683 /* Select USB transfer types to use */
3684 if (has_video) {
Frank Schaefer58697782014-03-22 10:00:59 -03003685 if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
3686 dev->analog_xfer_bulk = 1;
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003687 dev_err(&interface->dev, "analog set to %s mode.\n",
Mauro Carvalho Chehab2a96f602016-10-12 07:32:23 -03003688 dev->analog_xfer_bulk ? "bulk" : "isoc");
Mauro Carvalho Chehab8b2aea72012-12-23 13:25:38 -02003689 }
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003690 if (has_dvb) {
Frank Schaefer58697782014-03-22 10:00:59 -03003691 if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
3692 dev->dvb_xfer_bulk = 1;
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003693 dev_err(&interface->dev, "dvb set to %s mode.\n",
Mauro Carvalho Chehab2a96f602016-10-12 07:32:23 -03003694 dev->dvb_xfer_bulk ? "bulk" : "isoc");
Gianluca Gennari86d38d12012-02-13 13:59:22 -03003695 }
3696
Mauro Carvalho Chehab47677e52014-03-05 11:21:07 -03003697 kref_init(&dev->ref);
3698
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003699 request_modules(dev);
3700
Mauro Carvalho Chehab37ecc7b2016-01-27 07:07:24 -02003701 /*
3702 * Do it at the end, to reduce dynamic configuration changes during
3703 * the device init. Yet, as request_modules() can be async, the
3704 * topology will likely change after the load of the em28xx subdrivers.
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003705 */
Mauro Carvalho Chehab37ecc7b2016-01-27 07:07:24 -02003706#ifdef CONFIG_MEDIA_CONTROLLER
3707 retval = media_device_register(dev->media_dev);
3708#endif
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003709
3710 return 0;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003711
Holger Nelson8ab33622011-12-28 18:55:41 -03003712err_free:
Frank Schaefer0cf544a2012-11-08 14:11:49 -03003713 kfree(dev->alt_max_pkt_size_isoc);
Holger Nelson8ab33622011-12-28 18:55:41 -03003714 kfree(dev);
3715
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003716err:
Mauro Carvalho Chehabc3aed262014-01-14 17:35:15 -03003717 clear_bit(nr, em28xx_devused);
Chris Rankin38b61eb2011-08-20 08:21:03 -03003718
3719err_no_slot:
3720 usb_put_dev(udev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03003721 return retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003722}
3723
3724/*
3725 * em28xx_usb_disconnect()
Chris Rankind7222e72011-09-24 11:02:32 -03003726 * called when the device gets disconnected
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003727 * video device will be unregistered on v4l2_close in case it is still open
3728 */
3729static void em28xx_usb_disconnect(struct usb_interface *interface)
3730{
3731 struct em28xx *dev;
3732
3733 dev = usb_get_intfdata(interface);
3734 usb_set_intfdata(interface, NULL);
3735
3736 if (!dev)
3737 return;
3738
Frank Schaefer05fe2172012-12-27 19:02:44 -03003739 dev->disconnected = 1;
3740
Mauro Carvalho Chehab29b05e22016-12-07 13:48:10 -02003741 dev_err(&dev->intf->dev, "Disconnecting\n");
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003742
Tejun Heo707bcf32010-12-24 16:14:20 +01003743 flush_request_modules(dev);
3744
Frank Schaefer05fe2172012-12-27 19:02:44 -03003745 em28xx_close_extension(dev);
Mauro Carvalho Chehab54a2a842013-12-27 13:01:04 -03003746
Frank Schaefer5a620c72014-01-12 13:24:24 -03003747 em28xx_release_resources(dev);
Mauro Carvalho Chehab47677e52014-03-05 11:21:07 -03003748 kref_put(&dev->ref, em28xx_free_device);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003749}
3750
Shuah Khancd701c82014-02-21 21:50:18 -03003751static int em28xx_usb_suspend(struct usb_interface *interface,
Mauro Carvalho Chehabfdf1bc92014-11-28 08:34:15 -03003752 pm_message_t message)
Shuah Khancd701c82014-02-21 21:50:18 -03003753{
3754 struct em28xx *dev;
3755
3756 dev = usb_get_intfdata(interface);
3757 if (!dev)
3758 return 0;
3759 em28xx_suspend_extension(dev);
3760 return 0;
3761}
3762
3763static int em28xx_usb_resume(struct usb_interface *interface)
3764{
3765 struct em28xx *dev;
3766
3767 dev = usb_get_intfdata(interface);
3768 if (!dev)
3769 return 0;
3770 em28xx_resume_extension(dev);
3771 return 0;
3772}
3773
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003774static struct usb_driver em28xx_usb_driver = {
3775 .name = "em28xx",
3776 .probe = em28xx_usb_probe,
3777 .disconnect = em28xx_usb_disconnect,
Shuah Khancd701c82014-02-21 21:50:18 -03003778 .suspend = em28xx_usb_suspend,
3779 .resume = em28xx_usb_resume,
Mauro Carvalho Chehab214635f2014-09-26 06:53:15 -03003780 .reset_resume = em28xx_usb_resume,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03003781 .id_table = em28xx_id_table,
3782};
3783
Greg Kroah-Hartmanecb3b2b2011-11-18 09:46:12 -08003784module_usb_driver(em28xx_usb_driver);