blob: 6c35d789cd7ed1f4e96545a41f2b1c8b80fd5bb0 [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>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08009
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25#include <linux/init.h>
26#include <linux/module.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080027#include <linux/delay.h>
28#include <linux/i2c.h>
29#include <linux/usb.h>
30#include <media/tuner.h>
Hans Verkuil2474ed42006-03-19 12:35:57 -030031#include <media/msp3400.h>
Hans Verkuilc7c0b342006-04-02 13:35:00 -030032#include <media/saa7115.h>
33#include <media/tvp5150.h>
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -030034#include <media/tvaudio.h>
35#include <media/i2c-addr.h>
Mauro Carvalho Chehab1f6173e2005-11-08 21:37:16 -080036#include <media/tveeprom.h>
Mauro Carvalho Chehab9bb13a62006-01-09 15:25:37 -020037#include <media/v4l2-common.h>
Hans Verkuil38f9d302008-07-23 05:09:15 -030038#include <media/v4l2-chip-ident.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080039
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -080040#include "em28xx.h"
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080041
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030042#define DRIVER_NAME "em28xx"
43
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030044static int tuner = -1;
45module_param(tuner, int, 0444);
46MODULE_PARM_DESC(tuner, "tuner type");
47
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -030048static unsigned int disable_ir;
49module_param(disable_ir, int, 0444);
50MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
51
Devin Heitmuellere2a1b792009-05-27 23:44:10 -030052static unsigned int disable_usb_speed_check;
53module_param(disable_usb_speed_check, int, 0444);
54MODULE_PARM_DESC(disable_usb_speed_check,
55 "override min bandwidth requirement of 480M bps");
56
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030057static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = UNSET };
58module_param_array(card, int, NULL, 0444);
59MODULE_PARM_DESC(card, "card type");
60
61/* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS */
62static unsigned long em28xx_devused;
63
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030064struct em28xx_hash_table {
65 unsigned long hash;
66 unsigned int model;
67 unsigned int tuner;
68};
69
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -030070/*
71 * Reset sequences for analog/digital modes
72 */
73
74/* Reset for the most [analog] boards */
75static struct em28xx_reg_seq default_analog[] = {
76 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
77 { -1, -1, -1, -1},
78};
79
80/* Reset for the most [digital] boards */
81static struct em28xx_reg_seq default_digital[] = {
82 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
83 { -1, -1, -1, -1},
84};
85
86/* Board Hauppauge WinTV HVR 900 analog */
87static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
88 {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10},
89 {0x05, 0xff, 0x10, 10},
90 { -1, -1, -1, -1},
91};
92
93/* Board Hauppauge WinTV HVR 900 digital */
94static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
95 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
96 {EM2880_R04_GPO, 0x04, 0x0f, 10},
97 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
98 { -1, -1, -1, -1},
99};
100
101/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
102static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
103 {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10},
104 { -1, -1, -1, -1},
105};
106
107/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300108
109/* Board - EM2870 Kworld 355u
110 Analog - No input analog */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300111
Franklin Mengd7de5d82009-06-06 17:05:02 -0300112/* Board - EM2882 Kworld 315U digital */
113static struct em28xx_reg_seq em2882_kworld_315u_digital[] = {
114 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
115 {EM28XX_R08_GPIO, 0xfe, 0xff, 10},
116 {EM2880_R04_GPO, 0x04, 0xff, 10},
117 {EM2880_R04_GPO, 0x0c, 0xff, 10},
118 {EM28XX_R08_GPIO, 0x7e, 0xff, 10},
119 { -1, -1, -1, -1},
120};
121
122static struct em28xx_reg_seq em2882_kworld_315u_tuner_gpio[] = {
123 {EM2880_R04_GPO, 0x08, 0xff, 10},
124 {EM2880_R04_GPO, 0x0c, 0xff, 10},
125 {EM2880_R04_GPO, 0x08, 0xff, 10},
126 {EM2880_R04_GPO, 0x0c, 0xff, 10},
127 { -1, -1, -1, -1},
128};
129
Robert Krakora6e7b9ea2009-01-18 21:59:34 -0300130static struct em28xx_reg_seq kworld_330u_analog[] = {
131 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
132 {EM2880_R04_GPO, 0x00, 0xff, 10},
133 { -1, -1, -1, -1},
134};
135
136static struct em28xx_reg_seq kworld_330u_digital[] = {
137 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
138 {EM2880_R04_GPO, 0x08, 0xff, 10},
139 { -1, -1, -1, -1},
140};
141
Devin Heitmueller19859222009-06-19 00:33:54 -0300142/* Evga inDtube
143 GPIO0 - Enable digital power (s5h1409) - low to enable
144 GPIO1 - Enable analog power (tvp5150/emp202) - low to enable
145 GPIO4 - xc3028 reset
146 GOP3 - s5h1409 reset
147 */
148static struct em28xx_reg_seq evga_indtube_analog[] = {
149 {EM28XX_R08_GPIO, 0x79, 0xff, 60},
150 { -1, -1, -1, -1},
151};
152
153static struct em28xx_reg_seq evga_indtube_digital[] = {
154 {EM28XX_R08_GPIO, 0x7a, 0xff, 1},
155 {EM2880_R04_GPO, 0x04, 0xff, 10},
156 {EM2880_R04_GPO, 0x0c, 0xff, 1},
157 { -1, -1, -1, -1},
158};
159
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300160/* Pinnacle Hybrid Pro eb1a:2881 */
161static struct em28xx_reg_seq pinnacle_hybrid_pro_analog[] = {
Devin Heitmueller44010442009-07-08 22:18:15 -0300162 {EM28XX_R08_GPIO, 0xfd, ~EM_GPIO_4, 10},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -0300163 { -1, -1, -1, -1},
164};
165
166static struct em28xx_reg_seq pinnacle_hybrid_pro_digital[] = {
167 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
168 {EM2880_R04_GPO, 0x04, 0xff, 100},/* zl10353 reset */
169 {EM2880_R04_GPO, 0x0c, 0xff, 1},
170 { -1, -1, -1, -1},
171};
172
173
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300174/* Callback for the most boards */
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300175static struct em28xx_reg_seq default_tuner_gpio[] = {
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300176 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
177 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10},
178 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
179 { -1, -1, -1, -1},
180};
181
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -0300182/* Mute/unmute */
183static struct em28xx_reg_seq compro_unmute_tv_gpio[] = {
184 {EM28XX_R08_GPIO, 5, 7, 10},
185 { -1, -1, -1, -1},
186};
187
188static struct em28xx_reg_seq compro_unmute_svid_gpio[] = {
189 {EM28XX_R08_GPIO, 4, 7, 10},
190 { -1, -1, -1, -1},
191};
192
193static struct em28xx_reg_seq compro_mute_gpio[] = {
194 {EM28XX_R08_GPIO, 6, 7, 10},
195 { -1, -1, -1, -1},
196};
197
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -0300198/* Terratec AV350 */
199static struct em28xx_reg_seq terratec_av350_mute_gpio[] = {
200 {EM28XX_R08_GPIO, 0xff, 0x7f, 10},
201 { -1, -1, -1, -1},
202};
203
204static struct em28xx_reg_seq terratec_av350_unmute_gpio[] = {
205 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
206 { -1, -1, -1, -1},
207};
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300208
209static struct em28xx_reg_seq silvercrest_reg_seq[] = {
210 {EM28XX_R08_GPIO, 0xff, 0xff, 10},
211 {EM28XX_R08_GPIO, 0x01, 0xf7, 10},
212 { -1, -1, -1, -1},
213};
214
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300215/*
216 * Board definitions
217 */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800218struct em28xx_board em28xx_boards[] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300219 [EM2750_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -0300220 .name = "EM2710/EM2750/EM2751 webcam grabber",
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300221 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300222 .tuner_type = TUNER_ABSENT,
223 .is_webcam = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300224 .input = { {
225 .type = EM28XX_VMUX_COMPOSITE1,
226 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300227 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -0300228 .gpio = silvercrest_reg_seq,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300229 } },
230 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800231 [EM2800_BOARD_UNKNOWN] = {
232 .name = "Unknown EM2800 video grabber",
233 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800234 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300235 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300236 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300237 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800238 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300239 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300240 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300241 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800242 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300243 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300244 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300245 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800246 },
247 [EM2820_BOARD_UNKNOWN] = {
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300248 .name = "Unknown EM2750/28xx video grabber",
249 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -0300250 .is_webcam = 1, /* To enable sensor probe */
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800251 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300252 [EM2750_BOARD_DLCW_130] = {
253 /* Beijing Huaqi Information Digital Technology Co., Ltd */
254 .name = "Huaqi DLCW-130",
255 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300256 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300257 .tuner_type = TUNER_ABSENT,
258 .is_webcam = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300259 .input = { {
260 .type = EM28XX_VMUX_COMPOSITE1,
261 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300262 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300263 } },
264 },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200265 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
Markus Rechberger33ccaa32006-02-07 06:25:41 -0200266 .name = "Kworld PVR TV 2800 RF",
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300267 .tuner_type = TUNER_TEMIC_PAL,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200268 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300269 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300270 .input = { {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200271 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300272 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300273 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300274 }, {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200275 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300276 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300277 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300278 } },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200279 },
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -0300280 [EM2820_BOARD_GADMEI_TVR200] = {
281 .name = "Gadmei TVR200",
282 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
283 .tda9887_conf = TDA9887_PRESENT,
284 .decoder = EM28XX_SAA711X,
285 .input = { {
286 .type = EM28XX_VMUX_TELEVISION,
287 .vmux = SAA7115_COMPOSITE2,
288 .amux = EM28XX_AMUX_LINE_IN,
289 }, {
290 .type = EM28XX_VMUX_COMPOSITE1,
291 .vmux = SAA7115_COMPOSITE0,
292 .amux = EM28XX_AMUX_LINE_IN,
293 }, {
294 .type = EM28XX_VMUX_SVIDEO,
295 .vmux = SAA7115_SVIDEO3,
296 .amux = EM28XX_AMUX_LINE_IN,
297 } },
298 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800299 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
300 .name = "Terratec Cinergy 250 USB",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800301 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
302 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300303 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300304 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800305 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300306 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300307 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300308 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800309 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300310 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300311 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300312 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800313 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300314 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300315 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300316 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800317 },
318 [EM2820_BOARD_PINNACLE_USB_2] = {
319 .name = "Pinnacle PCTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800320 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
321 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300322 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300323 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800324 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300325 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300326 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300327 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800328 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300329 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300330 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300331 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800332 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300333 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300334 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300335 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800336 },
337 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
338 .name = "Hauppauge WinTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800339 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300340 .tda9887_conf = TDA9887_PRESENT |
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300341 TDA9887_PORT1_ACTIVE |
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300342 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800343 .decoder = EM28XX_TVP5150,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800344 .has_msp34xx = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300345 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800346 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300347 .vmux = TVP5150_COMPOSITE0,
Hans Verkuil2474ed42006-03-19 12:35:57 -0300348 .amux = MSP_INPUT_DEFAULT,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300349 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800350 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300351 .vmux = TVP5150_SVIDEO,
Hans Verkuil07151722006-04-01 18:03:23 -0300352 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
353 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300354 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800355 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300356 [EM2820_BOARD_DLINK_USB_TV] = {
357 .name = "D-Link DUB-T210 TV Tuner",
358 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300359 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
360 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300361 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300362 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300363 .type = EM28XX_VMUX_TELEVISION,
364 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300365 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300366 }, {
367 .type = EM28XX_VMUX_COMPOSITE1,
368 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300369 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300370 }, {
371 .type = EM28XX_VMUX_SVIDEO,
372 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300373 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300374 } },
375 },
376 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
377 .name = "Hercules Smart TV USB 2.0",
378 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300379 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
380 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300381 .decoder = EM28XX_SAA711X,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300382 .input = { {
383 .type = EM28XX_VMUX_TELEVISION,
384 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300385 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300386 }, {
387 .type = EM28XX_VMUX_COMPOSITE1,
388 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300389 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300390 }, {
391 .type = EM28XX_VMUX_SVIDEO,
392 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300393 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300394 } },
395 },
396 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
397 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
398 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300399 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
400 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300401 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300402 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300403 .type = EM28XX_VMUX_TELEVISION,
404 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300405 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300406 }, {
407 .type = EM28XX_VMUX_COMPOSITE1,
408 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300409 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300410 }, {
411 .type = EM28XX_VMUX_SVIDEO,
412 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300413 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300414 } },
415 },
416 [EM2820_BOARD_GADMEI_UTV310] = {
417 .name = "Gadmei UTV310",
418 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300419 .tuner_type = TUNER_TNF_5335MF,
420 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300421 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300422 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300423 .type = EM28XX_VMUX_TELEVISION,
424 .vmux = SAA7115_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300425 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300426 }, {
427 .type = EM28XX_VMUX_COMPOSITE1,
428 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300429 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300430 }, {
431 .type = EM28XX_VMUX_SVIDEO,
432 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300433 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300434 } },
435 },
436 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
437 .name = "Leadtek Winfast USB II Deluxe",
438 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300439 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
440 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300441 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300442 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300443 .type = EM28XX_VMUX_TELEVISION,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300444 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300445 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300446 }, {
447 .type = EM28XX_VMUX_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300448 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300449 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300450 }, {
451 .type = EM28XX_VMUX_SVIDEO,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300452 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300453 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300454 } },
455 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300456 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300457 .name = "Videology 20K14XUSB USB2.0",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300458 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300459 .tuner_type = TUNER_ABSENT,
460 .is_webcam = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300461 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300462 .type = EM28XX_VMUX_COMPOSITE1,
463 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300464 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300465 } },
466 },
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300467 [EM2820_BOARD_SILVERCREST_WEBCAM] = {
468 .name = "Silvercrest Webcam 1.3mpix",
469 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabc43221d2009-07-12 10:23:23 -0300470 .is_webcam = 1,
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -0300471 .input = { {
472 .type = EM28XX_VMUX_COMPOSITE1,
473 .vmux = 0,
474 .amux = EM28XX_AMUX_VIDEO,
475 .gpio = silvercrest_reg_seq,
476 } },
477 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300478 [EM2821_BOARD_SUPERCOMP_USB_2] = {
479 .name = "Supercomp USB 2.0 TV",
480 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300481 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
482 .tda9887_conf = TDA9887_PRESENT |
483 TDA9887_PORT1_ACTIVE |
484 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300485 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300486 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300487 .type = EM28XX_VMUX_TELEVISION,
488 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300489 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300490 }, {
491 .type = EM28XX_VMUX_COMPOSITE1,
492 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300493 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300494 }, {
495 .type = EM28XX_VMUX_SVIDEO,
496 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300497 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300498 } },
499 },
500 [EM2821_BOARD_USBGEAR_VD204] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300501 .name = "Usbgear VD204v9",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300502 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300503 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300504 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300505 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300506 .type = EM28XX_VMUX_COMPOSITE1,
507 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300508 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300509 }, {
510 .type = EM28XX_VMUX_SVIDEO,
511 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300512 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300513 } },
514 },
515 [EM2860_BOARD_NETGMBH_CAM] = {
516 /* Beijing Huaqi Information Digital Technology Co., Ltd */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300517 .name = "NetGMBH Cam",
518 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab8a2e6992009-07-12 10:26:36 -0300519 .tuner_type = TUNER_ABSENT,
520 .is_webcam = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300521 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300522 .type = EM28XX_VMUX_COMPOSITE1,
523 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300524 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300525 } },
526 },
527 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300528 .name = "Typhoon DVD Maker",
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300529 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300530 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300531 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300532 .type = EM28XX_VMUX_COMPOSITE1,
533 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300534 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300535 }, {
536 .type = EM28XX_VMUX_SVIDEO,
537 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300538 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300539 } },
540 },
541 [EM2860_BOARD_GADMEI_UTV330] = {
542 .name = "Gadmei UTV330",
543 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300544 .tuner_type = TUNER_TNF_5335MF,
545 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300546 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300547 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300548 .type = EM28XX_VMUX_TELEVISION,
549 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300550 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300551 }, {
552 .type = EM28XX_VMUX_COMPOSITE1,
553 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300554 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300555 }, {
556 .type = EM28XX_VMUX_SVIDEO,
557 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300558 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300559 } },
560 },
561 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
562 .name = "Terratec Cinergy A Hybrid XS",
563 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300564 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300565 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300566 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300567
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300568 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300569 .type = EM28XX_VMUX_TELEVISION,
570 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300571 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300572 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300573 }, {
574 .type = EM28XX_VMUX_COMPOSITE1,
575 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300576 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300577 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300578 }, {
579 .type = EM28XX_VMUX_SVIDEO,
580 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300581 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300582 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300583 } },
584 },
585 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
586 .name = "KWorld PVRTV 300U",
587 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300588 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300589 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300590 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300591 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300592 .type = EM28XX_VMUX_TELEVISION,
593 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300594 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300595 }, {
596 .type = EM28XX_VMUX_COMPOSITE1,
597 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300598 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300599 }, {
600 .type = EM28XX_VMUX_SVIDEO,
601 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300602 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300603 } },
604 },
605 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
606 .name = "Yakumo MovieMixer",
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300607 .tuner_type = TUNER_ABSENT, /* Capture only device */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300608 .decoder = EM28XX_TVP5150,
609 .input = { {
610 .type = EM28XX_VMUX_TELEVISION,
611 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300612 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300613 }, {
614 .type = EM28XX_VMUX_COMPOSITE1,
615 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300616 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300617 }, {
618 .type = EM28XX_VMUX_SVIDEO,
619 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300620 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300621 } },
622 },
623 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
624 .name = "Plextor ConvertX PX-TV100U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300625 .tuner_type = TUNER_TNF_5335MF,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300626 .xclk = EM28XX_XCLK_I2S_MSB_TIMING |
627 EM28XX_XCLK_FREQUENCY_12MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300628 .tda9887_conf = TDA9887_PRESENT,
629 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300630 .has_msp34xx = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300631 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300632 .type = EM28XX_VMUX_TELEVISION,
633 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300634 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300635 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300636 }, {
637 .type = EM28XX_VMUX_COMPOSITE1,
638 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300639 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300640 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300641 }, {
642 .type = EM28XX_VMUX_SVIDEO,
643 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300644 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -0300645 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300646 } },
647 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300648
649 /* Those boards with em2870 are DVB Only*/
650
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300651 [EM2870_BOARD_TERRATEC_XS] = {
652 .name = "Terratec Cinergy T XS",
653 .valid = EM28XX_BOARD_NOT_VALIDATED,
654 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300655 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300656 },
657 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
658 .name = "Terratec Cinergy T XS (MT2060)",
659 .valid = EM28XX_BOARD_NOT_VALIDATED,
660 .tuner_type = TUNER_ABSENT, /* MT2060 */
661 },
662 [EM2870_BOARD_KWORLD_350U] = {
663 .name = "Kworld 350 U DVB-T",
664 .valid = EM28XX_BOARD_NOT_VALIDATED,
665 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300666 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300667 },
668 [EM2870_BOARD_KWORLD_355U] = {
669 .name = "Kworld 355 U DVB-T",
670 .valid = EM28XX_BOARD_NOT_VALIDATED,
671 },
672 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
673 .name = "Pinnacle PCTV DVB-T",
674 .valid = EM28XX_BOARD_NOT_VALIDATED,
675 .tuner_type = TUNER_ABSENT, /* MT2060 */
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300676 /* djh - I have serious doubts this is right... */
677 .xclk = EM28XX_XCLK_IR_RC5_MODE |
678 EM28XX_XCLK_FREQUENCY_10MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300679 },
680 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
681 .name = "Compro, VideoMate U3",
682 .valid = EM28XX_BOARD_NOT_VALIDATED,
683 .tuner_type = TUNER_ABSENT, /* MT2060 */
684 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300685
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300686 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
687 .name = "Terratec Hybrid XS Secam",
688 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300689 .has_msp34xx = 1,
690 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300691 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300692 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300693 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300694 .type = EM28XX_VMUX_TELEVISION,
695 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300696 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300697 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300698 }, {
699 .type = EM28XX_VMUX_COMPOSITE1,
700 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300701 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300702 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300703 }, {
704 .type = EM28XX_VMUX_SVIDEO,
705 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300706 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300707 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300708 } },
709 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300710 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -0300711 .name = "Hauppauge WinTV HVR 900",
Aidan Thornton122d1582007-11-20 15:25:08 -0300712 .tda9887_conf = TDA9887_PRESENT,
713 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300714 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -0300715 .mts_firmware = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300716 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300717 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller62cfc342009-03-22 22:58:46 -0300718 .ir_codes = ir_codes_hauppauge_new,
Aidan Thornton122d1582007-11-20 15:25:08 -0300719 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300720 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -0300721 .type = EM28XX_VMUX_TELEVISION,
722 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300723 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300724 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300725 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300726 .type = EM28XX_VMUX_COMPOSITE1,
727 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300728 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300729 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300730 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300731 .type = EM28XX_VMUX_SVIDEO,
732 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300733 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300734 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300735 } },
Aidan Thornton122d1582007-11-20 15:25:08 -0300736 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300737 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
738 .name = "Hauppauge WinTV HVR 900 (R2)",
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300739 .tda9887_conf = TDA9887_PRESENT,
740 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300741 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300742 .mts_firmware = 1,
Devin Heitmueller62cfc342009-03-22 22:58:46 -0300743 .ir_codes = ir_codes_hauppauge_new,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300744 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300745 .input = { {
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300746 .type = EM28XX_VMUX_TELEVISION,
747 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300748 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300749 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300750 }, {
751 .type = EM28XX_VMUX_COMPOSITE1,
752 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300753 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300754 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300755 }, {
756 .type = EM28XX_VMUX_SVIDEO,
757 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300758 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300759 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300760 } },
761 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -0300762 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = {
763 .name = "Hauppauge WinTV HVR 850",
764 .tuner_type = TUNER_XC2028,
765 .tuner_gpio = default_tuner_gpio,
766 .mts_firmware = 1,
767 .has_dvb = 1,
768 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
769 .ir_codes = ir_codes_hauppauge_new,
770 .decoder = EM28XX_TVP5150,
771 .input = { {
772 .type = EM28XX_VMUX_TELEVISION,
773 .vmux = TVP5150_COMPOSITE0,
774 .amux = EM28XX_AMUX_VIDEO,
775 .gpio = hauppauge_wintv_hvr_900_analog,
776 }, {
777 .type = EM28XX_VMUX_COMPOSITE1,
778 .vmux = TVP5150_COMPOSITE1,
779 .amux = EM28XX_AMUX_LINE_IN,
780 .gpio = hauppauge_wintv_hvr_900_analog,
781 }, {
782 .type = EM28XX_VMUX_SVIDEO,
783 .vmux = TVP5150_SVIDEO,
784 .amux = EM28XX_AMUX_LINE_IN,
785 .gpio = hauppauge_wintv_hvr_900_analog,
786 } },
787 },
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -0300788 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300789 .name = "Hauppauge WinTV HVR 950",
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300790 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300791 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300792 .mts_firmware = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -0300793 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300794 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller4b922532008-11-13 03:15:55 -0300795 .ir_codes = ir_codes_hauppauge_new,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300796 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300797 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300798 .type = EM28XX_VMUX_TELEVISION,
799 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300800 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300801 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300802 }, {
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -0300803 .type = EM28XX_VMUX_COMPOSITE1,
804 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300805 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300806 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300807 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300808 .type = EM28XX_VMUX_SVIDEO,
809 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300810 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300811 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300812 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300813 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300814 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
815 .name = "Pinnacle PCTV HD Pro Stick",
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300816 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300817 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300818 .mts_firmware = 1,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300819 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300820 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller4b922532008-11-13 03:15:55 -0300821 .ir_codes = ir_codes_pinnacle_pctv_hd,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300822 .decoder = EM28XX_TVP5150,
823 .input = { {
824 .type = EM28XX_VMUX_TELEVISION,
825 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300826 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300827 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300828 }, {
829 .type = EM28XX_VMUX_COMPOSITE1,
830 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300831 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300832 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300833 }, {
834 .type = EM28XX_VMUX_SVIDEO,
835 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300836 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300837 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300838 } },
839 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300840 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
841 .name = "AMD ATI TV Wonder HD 600",
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300842 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300843 .tuner_gpio = default_tuner_gpio,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300844 .mts_firmware = 1,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300845 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300846 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller60245e82008-11-16 08:03:53 -0300847 .ir_codes = ir_codes_ati_tv_wonder_hd_600,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300848 .decoder = EM28XX_TVP5150,
849 .input = { {
850 .type = EM28XX_VMUX_TELEVISION,
851 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300852 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300853 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300854 }, {
855 .type = EM28XX_VMUX_COMPOSITE1,
856 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300857 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300858 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300859 }, {
860 .type = EM28XX_VMUX_SVIDEO,
861 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300862 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300863 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300864 } },
865 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300866 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300867 .name = "Terratec Hybrid XS",
868 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300869 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300870 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -0300871 .has_dvb = 1,
Devin Heitmuellerf7976082009-06-22 22:32:32 -0300872 .dvb_gpio = default_digital,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300873 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300874 .type = EM28XX_VMUX_TELEVISION,
875 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300876 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300877 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300878 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300879 .type = EM28XX_VMUX_COMPOSITE1,
880 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300881 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300882 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300883 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300884 .type = EM28XX_VMUX_SVIDEO,
885 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300886 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300887 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300888 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300889 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300890 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
891 as Prodigy XS with a different PID, let's keep it separated for now
892 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300893 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
894 .name = "Terratec Prodigy XS",
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300895 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300896 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300897 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300898 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300899 .type = EM28XX_VMUX_TELEVISION,
900 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300901 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300902 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300903 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300904 .type = EM28XX_VMUX_COMPOSITE1,
905 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300906 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300907 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300908 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300909 .type = EM28XX_VMUX_SVIDEO,
910 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300911 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300912 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300913 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300914 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800915 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300916 .name = "MSI VOX USB 2.0",
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300917 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
918 .tda9887_conf = TDA9887_PRESENT |
919 TDA9887_PORT1_ACTIVE |
920 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300921 .max_range_640_480 = 1,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300922 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300923 .input = { {
924 .type = EM28XX_VMUX_TELEVISION,
925 .vmux = SAA7115_COMPOSITE4,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300926 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300927 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300928 .type = EM28XX_VMUX_COMPOSITE1,
929 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300930 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300931 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300932 .type = EM28XX_VMUX_SVIDEO,
933 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300934 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300935 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800936 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800937 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
938 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800939 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800940 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
941 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300942 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300943 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800944 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300945 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300946 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300947 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800948 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300949 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300950 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300951 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800952 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300953 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300954 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300955 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800956 },
Aron Szabo59d07f12008-07-27 13:47:52 -0300957 [EM2800_BOARD_GRABBEEX_USB2800] = {
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300958 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
959 .is_em2800 = 1,
960 .decoder = EM28XX_SAA711X,
961 .tuner_type = TUNER_ABSENT, /* capture only board */
962 .input = { {
Aron Szabo59d07f12008-07-27 13:47:52 -0300963 .type = EM28XX_VMUX_COMPOSITE1,
964 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300965 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -0300966 }, {
967 .type = EM28XX_VMUX_SVIDEO,
968 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300969 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -0300970 } },
971 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800972 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
973 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800974 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800975 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
976 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300977 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300978 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800979 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300980 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300981 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300982 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800983 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300984 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300985 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300986 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800987 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300988 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300989 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300990 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800991 },
992 [EM2800_BOARD_KWORLD_USB2800] = {
993 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800994 .is_em2800 = 1,
Michael Krufkyab8b8702008-04-22 14:46:05 -0300995 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800996 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300997 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300998 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800999 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001000 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001001 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001002 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001003 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001004 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001005 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001006 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001007 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001008 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001009 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001010 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -08001011 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001012 [EM2820_BOARD_PINNACLE_DVC_90] = {
Douglas Schilling Landgrafac40d9e2009-02-25 16:55:48 -03001013 .name = "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker",
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -03001014 .tuner_type = TUNER_ABSENT, /* capture only board */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001015 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001016 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001017 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001018 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001019 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001020 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001021 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -03001022 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001023 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001024 } },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -08001025 },
Sascha Sommer43625592007-11-03 15:05:07 -03001026 [EM2800_BOARD_VGEAR_POCKETTV] = {
1027 .name = "V-Gear PocketTV",
1028 .is_em2800 = 1,
Sascha Sommer43625592007-11-03 15:05:07 -03001029 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1030 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001031 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001032 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -03001033 .type = EM28XX_VMUX_TELEVISION,
1034 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001035 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001036 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001037 .type = EM28XX_VMUX_COMPOSITE1,
1038 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001039 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001040 }, {
Sascha Sommer43625592007-11-03 15:05:07 -03001041 .type = EM28XX_VMUX_SVIDEO,
1042 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001043 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001044 } },
Sascha Sommer43625592007-11-03 15:05:07 -03001045 },
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001046 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = {
1047 .name = "Pixelview PlayTV Box 4 USB 2.0",
1048 .tda9887_conf = TDA9887_PRESENT,
1049 .tuner_type = TUNER_YMEC_TVF_5533MF,
1050 .decoder = EM28XX_SAA711X,
1051 .input = { {
1052 .type = EM28XX_VMUX_TELEVISION,
1053 .vmux = SAA7115_COMPOSITE2,
1054 .amux = EM28XX_AMUX_VIDEO,
1055 .aout = EM28XX_AOUT_MONO | /* I2S */
1056 EM28XX_AOUT_MASTER, /* Line out pin */
1057 }, {
1058 .type = EM28XX_VMUX_COMPOSITE1,
1059 .vmux = SAA7115_COMPOSITE0,
1060 .amux = EM28XX_AMUX_LINE_IN,
1061 }, {
1062 .type = EM28XX_VMUX_SVIDEO,
1063 .vmux = SAA7115_SVIDEO3,
1064 .amux = EM28XX_AMUX_LINE_IN,
1065 } },
1066 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001067 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
Douglas Schilling Landgraf1f372a92009-02-25 16:54:31 -03001068 .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
Douglas Schilling Landgraf5609cfd2008-12-27 21:39:35 -03001069 .has_snapshot_button = 1,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001070 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001071 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001072 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001073 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001074 .type = EM28XX_VMUX_TELEVISION,
1075 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab30e4ac72008-11-20 13:43:05 -03001076 .amux = EM28XX_AMUX_VIDEO,
1077 .aout = EM28XX_AOUT_MONO | /* I2S */
1078 EM28XX_AOUT_MASTER, /* Line out pin */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001079 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001080 .type = EM28XX_VMUX_COMPOSITE1,
1081 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001082 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001083 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001084 .type = EM28XX_VMUX_SVIDEO,
1085 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -03001086 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001087 } },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001088 },
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001089 [EM2860_BOARD_SAA711X_REFERENCE_DESIGN] = {
1090 .name = "EM2860/SAA711X Reference Design",
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001091 .has_snapshot_button = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001092 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001093 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001094 .input = { {
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001095 .type = EM28XX_VMUX_SVIDEO,
1096 .vmux = SAA7115_SVIDEO3,
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001097 }, {
1098 .type = EM28XX_VMUX_COMPOSITE1,
1099 .vmux = SAA7115_COMPOSITE0,
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001100 } },
1101 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001102 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
1103 .name = "MSI DigiVox A/D",
1104 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001105 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001106 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001107 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001108 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001109 .type = EM28XX_VMUX_TELEVISION,
1110 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001111 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001112 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001113 }, {
1114 .type = EM28XX_VMUX_COMPOSITE1,
1115 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001116 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001117 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001118 }, {
1119 .type = EM28XX_VMUX_SVIDEO,
1120 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001121 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001122 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001123 } },
1124 },
1125 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
1126 .name = "MSI DigiVox A/D II",
1127 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001128 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001129 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001130 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001131 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001132 .type = EM28XX_VMUX_TELEVISION,
1133 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001134 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001135 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001136 }, {
1137 .type = EM28XX_VMUX_COMPOSITE1,
1138 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001139 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001140 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001141 }, {
1142 .type = EM28XX_VMUX_SVIDEO,
1143 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001144 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001145 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001146 } },
1147 },
1148 [EM2880_BOARD_KWORLD_DVB_305U] = {
1149 .name = "KWorld DVB-T 305U",
1150 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001151 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001152 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001153 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001154 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001155 .type = EM28XX_VMUX_TELEVISION,
1156 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001157 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001158 }, {
1159 .type = EM28XX_VMUX_COMPOSITE1,
1160 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001161 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001162 }, {
1163 .type = EM28XX_VMUX_SVIDEO,
1164 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001165 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001166 } },
1167 },
1168 [EM2880_BOARD_KWORLD_DVB_310U] = {
1169 .name = "KWorld DVB-T 310U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001170 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001171 .tuner_gpio = default_tuner_gpio,
Darron Broadda3808e2008-09-30 02:46:41 -03001172 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001173 .dvb_gpio = default_digital,
Darron Broadda3808e2008-09-30 02:46:41 -03001174 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001175 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001176 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001177 .type = EM28XX_VMUX_TELEVISION,
1178 .vmux = TVP5150_COMPOSITE0,
Darron Broadda3808e2008-09-30 02:46:41 -03001179 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001180 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001181 }, {
1182 .type = EM28XX_VMUX_COMPOSITE1,
1183 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001184 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001185 .gpio = default_analog,
Darron Broadda3808e2008-09-30 02:46:41 -03001186 }, { /* S-video has not been tested yet */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001187 .type = EM28XX_VMUX_SVIDEO,
1188 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001189 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001190 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001191 } },
1192 },
Franklin Mengd7de5d82009-06-06 17:05:02 -03001193 [EM2882_BOARD_KWORLD_ATSC_315U] = {
1194 .name = "KWorld ATSC 315U HDTV TV Box",
1195 .valid = EM28XX_BOARD_NOT_VALIDATED,
1196 .tuner_type = TUNER_THOMSON_DTT761X,
1197 .tuner_gpio = em2882_kworld_315u_tuner_gpio,
1198 .tda9887_conf = TDA9887_PRESENT,
1199 .decoder = EM28XX_SAA711X,
1200 .has_dvb = 1,
1201 .dvb_gpio = em2882_kworld_315u_digital,
1202 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1203 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE,
1204 /* Analog mode - still not ready */
1205 /*.input = { {
1206 .type = EM28XX_VMUX_TELEVISION,
1207 .vmux = SAA7115_COMPOSITE2,
1208 .amux = EM28XX_AMUX_VIDEO,
1209 .gpio = em2882_kworld_315u_analog,
1210 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1211 }, {
1212 .type = EM28XX_VMUX_COMPOSITE1,
1213 .vmux = SAA7115_COMPOSITE0,
1214 .amux = EM28XX_AMUX_LINE_IN,
1215 .gpio = em2882_kworld_315u_analog1,
1216 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1217 }, {
1218 .type = EM28XX_VMUX_SVIDEO,
1219 .vmux = SAA7115_SVIDEO3,
1220 .amux = EM28XX_AMUX_LINE_IN,
1221 .gpio = em2882_kworld_315u_analog1,
1222 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
1223 } }, */
1224 },
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001225 [EM2880_BOARD_EMPIRE_DUAL_TV] = {
1226 .name = "Empire dual TV",
1227 .tuner_type = TUNER_XC2028,
1228 .tuner_gpio = default_tuner_gpio,
1229 .has_dvb = 1,
1230 .dvb_gpio = default_digital,
1231 .mts_firmware = 1,
1232 .decoder = EM28XX_TVP5150,
1233 .input = { {
1234 .type = EM28XX_VMUX_TELEVISION,
1235 .vmux = TVP5150_COMPOSITE0,
1236 .amux = EM28XX_AMUX_VIDEO,
1237 .gpio = default_analog,
1238 }, {
1239 .type = EM28XX_VMUX_COMPOSITE1,
1240 .vmux = TVP5150_COMPOSITE1,
1241 .amux = EM28XX_AMUX_LINE_IN,
1242 .gpio = default_analog,
1243 }, {
1244 .type = EM28XX_VMUX_SVIDEO,
1245 .vmux = TVP5150_SVIDEO,
1246 .amux = EM28XX_AMUX_LINE_IN,
1247 .gpio = default_analog,
1248 } },
1249 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001250 [EM2881_BOARD_DNT_DA2_HYBRID] = {
1251 .name = "DNT DA2 Hybrid",
1252 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001253 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001254 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001255 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001256 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001257 .type = EM28XX_VMUX_TELEVISION,
1258 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001259 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001260 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001261 }, {
1262 .type = EM28XX_VMUX_COMPOSITE1,
1263 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001264 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001265 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001266 }, {
1267 .type = EM28XX_VMUX_SVIDEO,
1268 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001269 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001270 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001271 } },
1272 },
1273 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1274 .name = "Pinnacle Hybrid Pro",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001275 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001276 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001277 .decoder = EM28XX_TVP5150,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001278 .has_dvb = 1,
1279 .dvb_gpio = pinnacle_hybrid_pro_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001280 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001281 .type = EM28XX_VMUX_TELEVISION,
1282 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001283 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001284 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001285 }, {
1286 .type = EM28XX_VMUX_COMPOSITE1,
1287 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001288 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001289 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001290 }, {
1291 .type = EM28XX_VMUX_SVIDEO,
1292 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001293 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001294 .gpio = pinnacle_hybrid_pro_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001295 } },
1296 },
1297 [EM2882_BOARD_PINNACLE_HYBRID_PRO] = {
1298 .name = "Pinnacle Hybrid Pro (2)",
1299 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001300 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001301 .tuner_gpio = default_tuner_gpio,
Eugeniy Meshcheryakova674a3b2008-08-01 08:23:41 -03001302 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001303 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001304 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001305 .type = EM28XX_VMUX_TELEVISION,
1306 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001307 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001308 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001309 }, {
1310 .type = EM28XX_VMUX_COMPOSITE1,
1311 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001312 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001313 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001314 }, {
1315 .type = EM28XX_VMUX_SVIDEO,
1316 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001317 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001318 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001319 } },
1320 },
1321 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1322 .name = "Kworld VS-DVB-T 323UR",
1323 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001324 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001325 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001326 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001327 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001328 .type = EM28XX_VMUX_TELEVISION,
1329 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001330 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001331 }, {
1332 .type = EM28XX_VMUX_COMPOSITE1,
1333 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001334 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001335 }, {
1336 .type = EM28XX_VMUX_SVIDEO,
1337 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001338 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001339 } },
1340 },
1341 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
1342 .name = "Terratec Hybrid XS (em2882)",
1343 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001344 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001345 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001346 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001347 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001348 .type = EM28XX_VMUX_TELEVISION,
1349 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001350 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001351 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001352 }, {
1353 .type = EM28XX_VMUX_COMPOSITE1,
1354 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001355 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001356 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001357 }, {
1358 .type = EM28XX_VMUX_SVIDEO,
1359 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001360 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001361 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001362 } },
1363 },
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001364 [EM2883_BOARD_KWORLD_HYBRID_330U] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001365 .name = "Kworld PlusTV HD Hybrid 330",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001366 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001367 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001368 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabbe2c6db2008-12-09 15:43:10 -03001369 .mts_firmware = 1,
1370 .has_dvb = 1,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001371 .dvb_gpio = kworld_330u_digital,
1372 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001373 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1374 EM28XX_I2C_EEPROM_ON_BOARD |
1375 EM28XX_I2C_EEPROM_KEY_VALID,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001376 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001377 .type = EM28XX_VMUX_TELEVISION,
1378 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001379 .amux = EM28XX_AMUX_VIDEO,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001380 .gpio = kworld_330u_analog,
1381 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001382 }, {
1383 .type = EM28XX_VMUX_COMPOSITE1,
1384 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001385 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001386 .gpio = kworld_330u_analog,
1387 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001388 }, {
1389 .type = EM28XX_VMUX_SVIDEO,
1390 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001391 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001392 .gpio = kworld_330u_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001393 } },
1394 },
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001395 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
Vitaly Woold3603342008-07-27 14:10:11 -03001396 .name = "Compro VideoMate ForYou/Stereo",
Vitaly Woold3603342008-07-27 14:10:11 -03001397 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001398 .tvaudio_addr = 0xb0,
Vitaly Woold3603342008-07-27 14:10:11 -03001399 .tda9887_conf = TDA9887_PRESENT,
1400 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03001401 .adecoder = EM28XX_TVAUDIO,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001402 .mute_gpio = compro_mute_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001403 .input = { {
Vitaly Woold3603342008-07-27 14:10:11 -03001404 .type = EM28XX_VMUX_TELEVISION,
1405 .vmux = TVP5150_COMPOSITE0,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001406 .amux = EM28XX_AMUX_VIDEO,
1407 .gpio = compro_unmute_tv_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001408 }, {
1409 .type = EM28XX_VMUX_SVIDEO,
1410 .vmux = TVP5150_SVIDEO,
1411 .amux = EM28XX_AMUX_LINE_IN,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001412 .gpio = compro_unmute_svid_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001413 } },
1414 },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001415 [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
1416 .name = "Kaiomy TVnPC U2",
1417 .vchannels = 3,
1418 .tuner_type = TUNER_XC2028,
1419 .tuner_addr = 0x61,
1420 .mts_firmware = 1,
1421 .decoder = EM28XX_TVP5150,
1422 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab9fc2c5e2009-02-11 14:15:14 -03001423 .ir_codes = ir_codes_kaiomy,
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001424 .input = { {
1425 .type = EM28XX_VMUX_TELEVISION,
1426 .vmux = TVP5150_COMPOSITE0,
1427 .amux = EM28XX_AMUX_VIDEO,
1428
1429 }, {
1430 .type = EM28XX_VMUX_COMPOSITE1,
1431 .vmux = TVP5150_COMPOSITE1,
1432 .amux = EM28XX_AMUX_LINE_IN,
1433 }, {
1434 .type = EM28XX_VMUX_SVIDEO,
1435 .vmux = TVP5150_SVIDEO,
1436 .amux = EM28XX_AMUX_LINE_IN,
1437 } },
1438 .radio = {
1439 .type = EM28XX_RADIO,
1440 .amux = EM28XX_AMUX_LINE_IN,
1441 }
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03001442 },
1443 [EM2860_BOARD_EASYCAP] = {
1444 .name = "Easy Cap Capture DC-60",
1445 .vchannels = 2,
1446 .tuner_type = TUNER_ABSENT,
1447 .decoder = EM28XX_SAA711X,
1448 .input = { {
1449 .type = EM28XX_VMUX_COMPOSITE1,
1450 .vmux = SAA7115_COMPOSITE0,
1451 .amux = EM28XX_AMUX_LINE_IN,
1452 }, {
1453 .type = EM28XX_VMUX_SVIDEO,
1454 .vmux = SAA7115_SVIDEO3,
1455 .amux = EM28XX_AMUX_LINE_IN,
1456 } },
1457 },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03001458 [EM2820_BOARD_IODATA_GVMVP_SZ] = {
1459 .name = "IO-DATA GV-MVP/SZ",
1460 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
1461 .tuner_gpio = default_tuner_gpio,
1462 .tda9887_conf = TDA9887_PRESENT,
1463 .decoder = EM28XX_TVP5150,
1464 .input = { {
1465 .type = EM28XX_VMUX_TELEVISION,
1466 .vmux = TVP5150_COMPOSITE0,
1467 .amux = EM28XX_AMUX_VIDEO,
1468 }, { /* Composite has not been tested yet */
1469 .type = EM28XX_VMUX_COMPOSITE1,
1470 .vmux = TVP5150_COMPOSITE1,
1471 .amux = EM28XX_AMUX_VIDEO,
1472 }, { /* S-video has not been tested yet */
1473 .type = EM28XX_VMUX_SVIDEO,
1474 .vmux = TVP5150_SVIDEO,
1475 .amux = EM28XX_AMUX_VIDEO,
1476 } },
1477 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001478 [EM2860_BOARD_TERRATEC_GRABBY] = {
1479 .name = "Terratec Grabby",
1480 .vchannels = 2,
1481 .tuner_type = TUNER_ABSENT,
1482 .decoder = EM28XX_SAA711X,
1483 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1484 .input = { {
1485 .type = EM28XX_VMUX_COMPOSITE1,
1486 .vmux = SAA7115_COMPOSITE0,
1487 .amux = EM28XX_AMUX_VIDEO2,
1488 }, {
1489 .type = EM28XX_VMUX_SVIDEO,
1490 .vmux = SAA7115_SVIDEO3,
1491 .amux = EM28XX_AMUX_VIDEO2,
1492 } },
1493 },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001494 [EM2860_BOARD_TERRATEC_AV350] = {
1495 .name = "Terratec AV350",
1496 .vchannels = 2,
1497 .tuner_type = TUNER_ABSENT,
1498 .decoder = EM28XX_TVP5150,
1499 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
1500 .mute_gpio = terratec_av350_mute_gpio,
1501 .input = { {
1502 .type = EM28XX_VMUX_COMPOSITE1,
1503 .vmux = TVP5150_COMPOSITE1,
1504 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03001505 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001506
1507 }, {
1508 .type = EM28XX_VMUX_SVIDEO,
1509 .vmux = TVP5150_SVIDEO,
1510 .amux = EM28XX_AUDIO_SRC_LINE,
Jean Delvare1df8e982009-05-13 16:48:07 -03001511 .gpio = terratec_av350_unmute_gpio,
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001512 } },
1513 },
Devin Heitmueller19859222009-06-19 00:33:54 -03001514 [EM2882_BOARD_EVGA_INDTUBE] = {
1515 .name = "Evga inDtube",
1516 .tuner_type = TUNER_XC2028,
1517 .tuner_gpio = default_tuner_gpio,
1518 .decoder = EM28XX_TVP5150,
Devin Heitmuellera4c47302009-06-20 21:34:42 -03001519 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, /* NEC IR */
Devin Heitmueller19859222009-06-19 00:33:54 -03001520 .mts_firmware = 1,
1521 .has_dvb = 1,
1522 .dvb_gpio = evga_indtube_digital,
Devin Heitmuellera4c47302009-06-20 21:34:42 -03001523 .ir_codes = ir_codes_evga_indtube,
Devin Heitmueller19859222009-06-19 00:33:54 -03001524 .input = { {
1525 .type = EM28XX_VMUX_TELEVISION,
1526 .vmux = TVP5150_COMPOSITE0,
1527 .amux = EM28XX_AMUX_VIDEO,
1528 .gpio = evga_indtube_analog,
1529 }, {
1530 .type = EM28XX_VMUX_COMPOSITE1,
1531 .vmux = TVP5150_COMPOSITE1,
1532 .amux = EM28XX_AMUX_LINE_IN,
1533 .gpio = evga_indtube_analog,
1534 }, {
1535 .type = EM28XX_VMUX_SVIDEO,
1536 .vmux = TVP5150_SVIDEO,
1537 .amux = EM28XX_AMUX_LINE_IN,
1538 .gpio = evga_indtube_analog,
1539 } },
1540 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001541};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001542const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001543
1544/* table of devices that work with this driver */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001545struct usb_device_id em28xx_id_table[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001546 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001547 .driver_info = EM2750_BOARD_UNKNOWN },
1548 { USB_DEVICE(0xeb1a, 0x2751),
1549 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001550 { USB_DEVICE(0xeb1a, 0x2800),
1551 .driver_info = EM2800_BOARD_UNKNOWN },
Mauro Carvalho Chehab9b4e8452009-08-07 12:08:02 -03001552 { USB_DEVICE(0xeb1a, 0x2710),
1553 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001554 { USB_DEVICE(0xeb1a, 0x2820),
1555 .driver_info = EM2820_BOARD_UNKNOWN },
1556 { USB_DEVICE(0xeb1a, 0x2821),
Devin Heitmuellerc665f4d2008-12-16 23:35:23 -03001557 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001558 { USB_DEVICE(0xeb1a, 0x2860),
1559 .driver_info = EM2820_BOARD_UNKNOWN },
1560 { USB_DEVICE(0xeb1a, 0x2861),
1561 .driver_info = EM2820_BOARD_UNKNOWN },
1562 { USB_DEVICE(0xeb1a, 0x2870),
1563 .driver_info = EM2820_BOARD_UNKNOWN },
1564 { USB_DEVICE(0xeb1a, 0x2881),
1565 .driver_info = EM2820_BOARD_UNKNOWN },
1566 { USB_DEVICE(0xeb1a, 0x2883),
1567 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001568 { USB_DEVICE(0xeb1a, 0xe300),
1569 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001570 { USB_DEVICE(0xeb1a, 0xe303),
1571 .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001572 { USB_DEVICE(0xeb1a, 0xe305),
1573 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
1574 { USB_DEVICE(0xeb1a, 0xe310),
1575 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
Franklin Mengd7de5d82009-06-06 17:05:02 -03001576 { USB_DEVICE(0xeb1a, 0xa313),
1577 .driver_info = EM2882_BOARD_KWORLD_ATSC_315U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001578 { USB_DEVICE(0xeb1a, 0xa316),
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001579 .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001580 { USB_DEVICE(0xeb1a, 0xe320),
1581 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
1582 { USB_DEVICE(0xeb1a, 0xe323),
1583 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
1584 { USB_DEVICE(0xeb1a, 0xe350),
1585 .driver_info = EM2870_BOARD_KWORLD_350U },
1586 { USB_DEVICE(0xeb1a, 0xe355),
1587 .driver_info = EM2870_BOARD_KWORLD_355U },
1588 { USB_DEVICE(0xeb1a, 0x2801),
1589 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
1590 { USB_DEVICE(0xeb1a, 0xe357),
1591 .driver_info = EM2870_BOARD_KWORLD_355U },
Douglas Schilling Landgrafac40d9e2009-02-25 16:55:48 -03001592 { USB_DEVICE(0x1b80, 0xe302),
1593 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001594 { USB_DEVICE(0x0ccd, 0x0036),
1595 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001596 { USB_DEVICE(0x0ccd, 0x004c),
1597 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
1598 { USB_DEVICE(0x0ccd, 0x004f),
1599 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
1600 { USB_DEVICE(0x0ccd, 0x005e),
1601 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
1602 { USB_DEVICE(0x0ccd, 0x0042),
1603 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS },
1604 { USB_DEVICE(0x0ccd, 0x0043),
1605 .driver_info = EM2870_BOARD_TERRATEC_XS },
1606 { USB_DEVICE(0x0ccd, 0x0047),
1607 .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS },
Mauro Carvalho Chehab766ed642009-05-24 00:46:01 -03001608 { USB_DEVICE(0x0ccd, 0x0084),
1609 .driver_info = EM2860_BOARD_TERRATEC_AV350 },
Mauro Carvalho Chehab4557af92009-05-23 09:58:52 -03001610 { USB_DEVICE(0x0ccd, 0x0096),
1611 .driver_info = EM2860_BOARD_TERRATEC_GRABBY },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001612 { USB_DEVICE(0x185b, 0x2870),
1613 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03001614 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001615 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001616 { USB_DEVICE(0x2040, 0x4200),
1617 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03001618 { USB_DEVICE(0x2040, 0x4201),
1619 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001620 { USB_DEVICE(0x2040, 0x6500),
1621 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03001622 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001623 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001624 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001625 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001626 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001627 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001628 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001629 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001630 { USB_DEVICE(0x2040, 0x651f),
1631 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001632 { USB_DEVICE(0x0438, 0xb002),
1633 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001634 { USB_DEVICE(0x2001, 0xf112),
1635 .driver_info = EM2820_BOARD_DLINK_USB_TV },
1636 { USB_DEVICE(0x2304, 0x0207),
1637 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1638 { USB_DEVICE(0x2304, 0x0208),
1639 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
1640 { USB_DEVICE(0x2304, 0x021a),
1641 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1642 { USB_DEVICE(0x2304, 0x0226),
1643 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO },
1644 { USB_DEVICE(0x2304, 0x0227),
1645 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
1646 { USB_DEVICE(0x0413, 0x6023),
1647 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
1648 { USB_DEVICE(0x093b, 0xa005),
1649 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03001650 { USB_DEVICE(0x04bb, 0x0515),
1651 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001652 { },
1653};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001654MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001655
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001656/*
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001657 * EEPROM hash table for devices with generic USB IDs
1658 */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001659static struct em28xx_hash_table em28xx_eeprom_hash[] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001660 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001661 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001662 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03001663 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001664 {0x9567eb1a, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
Devin Heitmueller19859222009-06-19 00:33:54 -03001665 {0xcee44a99, EM2882_BOARD_EVGA_INDTUBE, TUNER_XC2028},
Devin Heitmuellerd5b3ba92009-07-08 21:51:35 -03001666 {0xb8846b20, EM2881_BOARD_PINNACLE_HYBRID_PRO, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001667};
1668
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001669/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03001670static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001671 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
1672 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmueller3ed58ba2009-05-27 23:27:26 -03001673 {0x1ba50080, EM2860_BOARD_SAA711X_REFERENCE_DESIGN, TUNER_ABSENT},
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -03001674 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
Sascha Sommerfad7b952007-11-04 08:06:48 -03001675};
1676
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001677/* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
1678static unsigned short saa711x_addrs[] = {
1679 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
1680 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
1681 I2C_CLIENT_END };
1682
1683static unsigned short tvp5150_addrs[] = {
1684 0xb8 >> 1,
1685 0xba >> 1,
1686 I2C_CLIENT_END
1687};
1688
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -03001689static unsigned short mt9v011_addrs[] = {
1690 0xba >> 1,
1691 I2C_CLIENT_END
1692};
1693
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001694static unsigned short msp3400_addrs[] = {
1695 0x80 >> 1,
1696 0x88 >> 1,
1697 I2C_CLIENT_END
1698};
1699
Michael Krufkyd7cba042008-09-12 13:31:45 -03001700int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001701{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001702 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001703 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001704
1705 if (dev->tuner_type != TUNER_XC2028)
1706 return 0;
1707
1708 if (command != XC2028_TUNER_RESET)
1709 return 0;
1710
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001711 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001712
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001713 return rc;
1714}
1715EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
1716
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001717static inline void em28xx_set_model(struct em28xx *dev)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001718{
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001719 memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board));
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03001720
1721 /* Those are the default values for the majority of boards
1722 Use those values if not specified otherwise at boards entry
1723 */
1724 if (!dev->board.xclk)
1725 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
1726 EM28XX_XCLK_FREQUENCY_12MHZ;
1727
1728 if (!dev->board.i2c_speed)
1729 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1730 EM28XX_I2C_FREQ_100_KHZ;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001731}
1732
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03001733/* FIXME: Should be replaced by a proper mt9m001 driver */
1734static int em28xx_initialize_mt9m001(struct em28xx *dev)
1735{
1736 int i;
1737 unsigned char regs[][3] = {
1738 { 0x0d, 0x00, 0x01, },
1739 { 0x0d, 0x00, 0x00, },
1740 { 0x04, 0x05, 0x00, }, /* hres = 1280 */
1741 { 0x03, 0x04, 0x00, }, /* vres = 1024 */
1742 { 0x20, 0x11, 0x00, },
1743 { 0x06, 0x00, 0x10, },
1744 { 0x2b, 0x00, 0x24, },
1745 { 0x2e, 0x00, 0x24, },
1746 { 0x35, 0x00, 0x24, },
1747 { 0x2d, 0x00, 0x20, },
1748 { 0x2c, 0x00, 0x20, },
1749 { 0x09, 0x0a, 0xd4, },
1750 { 0x35, 0x00, 0x57, },
1751 };
1752
1753 for (i = 0; i < ARRAY_SIZE(regs); i++)
1754 i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
1755
1756 return 0;
1757}
1758
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03001759/* HINT method: webcam I2C chips
1760 *
1761 * This method work for webcams with Micron sensors
1762 */
1763static int em28xx_hint_sensor(struct em28xx *dev)
1764{
1765 int rc;
1766 char *sensor_name;
1767 unsigned char cmd;
1768 __be16 version_be;
1769 u16 version;
1770
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03001771 dev->i2c_client.addr = 0xba >> 1;
1772 cmd = 0;
1773 i2c_master_send(&dev->i2c_client, &cmd, 1);
1774 rc = i2c_master_recv(&dev->i2c_client, (char *)&version_be, 2);
1775 if (rc != 2)
1776 return -EINVAL;
1777
1778 version = be16_to_cpu(version_be);
1779
1780 switch (version) {
Mauro Carvalho Chehab296544e2009-07-27 08:24:29 -03001781 case 0x8232: /* mt9v011 640x480 1.3 Mpix sensor */
1782 case 0x8243: /* mt9v011 rev B 640x480 1.3 Mpix sensor */
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03001783 dev->model = EM2820_BOARD_SILVERCREST_WEBCAM;
1784 sensor_name = "mt9v011";
Mauro Carvalho Chehab527f09a2009-07-12 11:04:15 -03001785 dev->em28xx_sensor = EM28XX_MT9V011;
Mauro Carvalho Chehab55699962009-07-13 20:15:02 -03001786 dev->sensor_xres = 640;
1787 dev->sensor_yres = 480;
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03001788 dev->sensor_xtal = 6300000;
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03001789
1790 /* probably means GRGB 16 bit bayer */
1791 dev->vinmode = 0x0d;
1792 dev->vinctl = 0x00;
1793
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03001794 break;
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03001795 case 0x8431:
1796 dev->model = EM2750_BOARD_UNKNOWN;
1797 sensor_name = "mt9m001";
1798 dev->em28xx_sensor = EM28XX_MT9M001;
1799 em28xx_initialize_mt9m001(dev);
1800 dev->sensor_xres = 1280;
1801 dev->sensor_yres = 1024;
1802
1803 /* probably means BGGR 16 bit bayer */
1804 dev->vinmode = 0x0c;
1805 dev->vinctl = 0x00;
1806
1807 break;
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03001808 default:
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -03001809 printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version));
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03001810 return -EINVAL;
1811 }
1812
Mauro Carvalho Chehab8b220792009-07-12 10:56:21 -03001813 em28xx_errdev("Sensor is %s, using model %s entry.\n",
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03001814 sensor_name, em28xx_boards[dev->model].name);
1815
1816 return 0;
1817}
1818
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001819/* Since em28xx_pre_card_setup() requires a proper dev->model,
1820 * this won't work for boards with generic PCI IDs
1821 */
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001822void em28xx_pre_card_setup(struct em28xx *dev)
1823{
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001824 int rc;
1825
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001826 em28xx_set_model(dev);
1827
Mauro Carvalho Chehab8c239982008-11-28 23:46:43 -03001828 em28xx_info("Identified as %s (card=%d)\n",
1829 dev->board.name, dev->model);
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001830
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001831 /* Set the default GPO/GPIO for legacy devices */
1832 dev->reg_gpo_num = EM2880_R04_GPO;
1833 dev->reg_gpio_num = EM28XX_R08_GPIO;
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001834
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001835 dev->wait_after_write = 5;
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001836
1837 /* Based on the Chip ID, set the device configuration */
Mauro Carvalho Chehab41facaa2008-04-17 21:44:58 -03001838 rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001839 if (rc > 0) {
Devin Heitmueller600bd7f2008-11-12 02:05:02 -03001840 dev->chip_id = rc;
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001841
1842 switch (dev->chip_id) {
Devin Heitmueller67c96f62008-11-18 05:05:46 -03001843 case CHIP_ID_EM2750:
1844 em28xx_info("chip ID is em2750\n");
1845 break;
Mauro Carvalho Chehabf09fb532008-11-16 10:40:21 -03001846 case CHIP_ID_EM2820:
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -03001847 em28xx_info("chip ID is em2710 or em2820\n");
Mauro Carvalho Chehabf09fb532008-11-16 10:40:21 -03001848 break;
1849 case CHIP_ID_EM2840:
1850 em28xx_info("chip ID is em2840\n");
1851 break;
Devin Heitmuellera8a1f8c2008-06-10 12:35:42 -03001852 case CHIP_ID_EM2860:
1853 em28xx_info("chip ID is em2860\n");
1854 break;
Devin Heitmuellerb1fa26c2008-12-16 23:15:33 -03001855 case CHIP_ID_EM2870:
1856 em28xx_info("chip ID is em2870\n");
1857 dev->wait_after_write = 0;
1858 break;
Devin Heitmueller5caeba02008-11-12 02:04:48 -03001859 case CHIP_ID_EM2874:
1860 em28xx_info("chip ID is em2874\n");
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001861 dev->reg_gpio_num = EM2874_R80_GPIO;
Devin Heitmueller5caeba02008-11-12 02:04:48 -03001862 dev->wait_after_write = 0;
1863 break;
Mauro Carvalho Chehab2ba890e2008-04-17 21:42:58 -03001864 case CHIP_ID_EM2883:
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001865 em28xx_info("chip ID is em2882/em2883\n");
1866 dev->wait_after_write = 0;
1867 break;
1868 default:
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001869 em28xx_info("em28xx chip ID = %d\n", dev->chip_id);
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001870 }
1871 }
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001872
1873 /* Prepopulate cached GPO register content */
1874 rc = em28xx_read_reg(dev, dev->reg_gpo_num);
1875 if (rc >= 0)
1876 dev->reg_gpo = rc;
1877
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03001878 /* Set the initial XCLK and I2C clock values based on the board
1879 definition */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001880 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
1881 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001882 msleep(50);
1883
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001884 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001885 switch (dev->model) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001886 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Mauro Carvalho Chehab0a6e44d2009-07-29 01:39:12 -03001887 /* Sets the msp34xx I2S speed */
1888 dev->i2s_speed = 2048000;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001889 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001890 case EM2861_BOARD_KWORLD_PVRTV_300U:
1891 case EM2880_BOARD_KWORLD_DVB_305U:
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001892 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001893 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001894 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001895 msleep(10);
1896 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001897 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001898 /* TODO: someone can do some cleanup here...
1899 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001900 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001901 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001902 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001903 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001904 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001905 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001906 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001907 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001908 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001909 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001910 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001911 mdelay(70);
1912 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001913 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001914 /* this device needs some gpio writes to get the DVB-T
1915 demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001916 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001917 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001918 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001919 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001920 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001921 mdelay(70);
1922 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001923 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001924 /* this device needs some gpio writes to get the
1925 DVB-T demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001926 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001927 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001928 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001929 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001930 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001931 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001932 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001933 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001934 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001935 /* enables audio for that devices */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001936 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001937 break;
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001938
Franklin Mengd7de5d82009-06-06 17:05:02 -03001939 case EM2882_BOARD_KWORLD_ATSC_315U:
1940 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
1941 msleep(10);
1942 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
1943 msleep(10);
1944 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
1945 msleep(10);
1946 em28xx_write_reg(dev, EM2880_R04_GPO, 0x08);
1947 msleep(10);
1948 break;
1949
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001950 case EM2860_BOARD_KAIOMY_TVNPC_U2:
1951 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
1952 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1953 em28xx_write_regs(dev, 0x0d, "\x42", 1);
1954 em28xx_write_regs(dev, 0x08, "\xfd", 1);
1955 msleep(10);
1956 em28xx_write_regs(dev, 0x08, "\xff", 1);
1957 msleep(10);
1958 em28xx_write_regs(dev, 0x08, "\x7f", 1);
1959 msleep(10);
1960 em28xx_write_regs(dev, 0x08, "\x6b", 1);
1961
1962 break;
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03001963 case EM2860_BOARD_EASYCAP:
1964 em28xx_write_regs(dev, 0x08, "\xf8", 1);
1965 break;
1966
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03001967 case EM2820_BOARD_IODATA_GVMVP_SZ:
1968 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
1969 msleep(70);
1970 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
1971 msleep(10);
1972 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
1973 msleep(70);
1974 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
1975 msleep(70);
1976 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001977 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001978
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001979 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001980 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
1981
1982 /* Unlock device */
Mauro Carvalho Chehab2fe3e2e2008-11-27 09:10:40 -03001983 em28xx_set_mode(dev, EM28XX_SUSPEND);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001984}
1985
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001986static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001987{
1988 memset(ctl, 0, sizeof(*ctl));
1989
1990 ctl->fname = XC2028_DEFAULT_FIRMWARE;
1991 ctl->max_len = 64;
1992 ctl->mts = em28xx_boards[dev->model].mts_firmware;
1993
1994 switch (dev->model) {
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001995 case EM2880_BOARD_EMPIRE_DUAL_TV:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001996 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
1997 ctl->demod = XC3028_FE_ZARLINK456;
1998 break;
reinhard schwab655b8402008-07-26 10:47:00 -03001999 case EM2880_BOARD_TERRATEC_HYBRID_XS:
Devin Heitmuellere16e5a32009-07-15 00:37:22 -03002000 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
reinhard schwab655b8402008-07-26 10:47:00 -03002001 ctl->demod = XC3028_FE_ZARLINK456;
2002 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002003 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
2004 /* djh - Not sure which demod we need here */
2005 ctl->demod = XC3028_FE_DEFAULT;
2006 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03002007 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
2008 ctl->demod = XC3028_FE_DEFAULT;
2009 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2010 break;
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002011 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002012 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03002013 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03002014 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03002015 ctl->demod = XC3028_FE_DEFAULT;
2016 break;
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03002017 case EM2883_BOARD_KWORLD_HYBRID_330U:
2018 ctl->demod = XC3028_FE_CHINA;
2019 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2020 break;
Devin Heitmueller19859222009-06-19 00:33:54 -03002021 case EM2882_BOARD_EVGA_INDTUBE:
2022 ctl->demod = XC3028_FE_CHINA;
2023 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
2024 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002025 default:
2026 ctl->demod = XC3028_FE_OREN538;
2027 }
2028}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002029
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002030static void em28xx_tuner_setup(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002031{
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002032 struct tuner_setup tun_setup;
2033 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002034
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002035 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002036 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002037
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002038 memset(&tun_setup, 0, sizeof(tun_setup));
2039
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002040 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002041 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002042
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002043 if (dev->board.radio.type) {
2044 tun_setup.type = dev->board.radio.type;
2045 tun_setup.addr = dev->board.radio_addr;
2046
2047 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2048 }
2049
2050 if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type)) {
2051 tun_setup.type = dev->tuner_type;
2052 tun_setup.addr = dev->tuner_addr;
2053
2054 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
2055 }
2056
2057 if (dev->tda9887_conf) {
2058 struct v4l2_priv_tun_config tda9887_cfg;
2059
2060 tda9887_cfg.tuner = TUNER_TDA9887;
2061 tda9887_cfg.priv = &dev->tda9887_conf;
2062
2063 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &tda9887_cfg);
2064 }
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002065
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002066 if (dev->tuner_type == TUNER_XC2028) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002067 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002068 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002069
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002070 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
2071 memset(&ctl, 0, sizeof(ctl));
2072
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03002073 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002074
2075 xc2028_cfg.tuner = TUNER_XC2028;
2076 xc2028_cfg.priv = &ctl;
2077
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002078 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &xc2028_cfg);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002079 }
2080
2081 /* configure tuner */
2082 f.tuner = 0;
2083 f.type = V4L2_TUNER_ANALOG_TV;
2084 f.frequency = 9076; /* just a magic number */
2085 dev->ctl_freq = f.frequency;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002086 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002087}
2088
2089static int em28xx_hint_board(struct em28xx *dev)
2090{
2091 int i;
2092
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002093 /* HINT method: EEPROM
2094 *
2095 * This method works only for boards with eeprom.
2096 * Uses a hash of all eeprom bytes. The hash should be
2097 * unique for a vendor/tuner pair.
2098 * There are a high chance that tuners for different
2099 * video standards produce different hashes.
2100 */
2101 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
2102 if (dev->hash == em28xx_eeprom_hash[i].hash) {
2103 dev->model = em28xx_eeprom_hash[i].model;
2104 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002105
2106 em28xx_errdev("Your board has no unique USB ID.\n");
2107 em28xx_errdev("A hint were successfully done, "
2108 "based on eeprom hash.\n");
2109 em28xx_errdev("This method is not 100%% failproof.\n");
2110 em28xx_errdev("If the board were missdetected, "
2111 "please email this log to:\n");
2112 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002113 " <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002114 em28xx_errdev("Board detected as %s\n",
2115 em28xx_boards[dev->model].name);
2116
2117 return 0;
2118 }
2119 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03002120
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03002121 /* HINT method: I2C attached devices
2122 *
2123 * This method works for all boards.
2124 * Uses a hash of i2c scanned devices.
2125 * Devices with the same i2c attached chips will
2126 * be considered equal.
2127 * This method is less precise than the eeprom one.
2128 */
2129
Sascha Sommerfad7b952007-11-04 08:06:48 -03002130 /* user did not request i2c scanning => do it now */
2131 if (!dev->i2c_hash)
2132 em28xx_do_i2c_scan(dev);
2133
2134 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
2135 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
2136 dev->model = em28xx_i2c_hash[i].model;
2137 dev->tuner_type = em28xx_i2c_hash[i].tuner;
2138 em28xx_errdev("Your board has no unique USB ID.\n");
2139 em28xx_errdev("A hint were successfully done, "
2140 "based on i2c devicelist hash.\n");
2141 em28xx_errdev("This method is not 100%% failproof.\n");
2142 em28xx_errdev("If the board were missdetected, "
2143 "please email this log to:\n");
2144 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03002145 " <linux-media@vger.kernel.org>\n");
Sascha Sommerfad7b952007-11-04 08:06:48 -03002146 em28xx_errdev("Board detected as %s\n",
2147 em28xx_boards[dev->model].name);
2148
2149 return 0;
2150 }
2151 }
2152
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002153 em28xx_errdev("Your board has no unique USB ID and thus need a "
2154 "hint to be detected.\n");
2155 em28xx_errdev("You may try to use card=<n> insmod option to "
2156 "workaround that.\n");
2157 em28xx_errdev("Please send an email with this log to:\n");
Alexey Klimov51caf912009-01-25 12:53:09 -03002158 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002159 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03002160 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002161
2162 em28xx_errdev("Here is a list of valid choices for the card=<n>"
2163 " insmod option:\n");
2164 for (i = 0; i < em28xx_bcount; i++) {
2165 em28xx_errdev(" card=%d -> %s\n",
2166 i, em28xx_boards[i].name);
2167 }
2168 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03002169}
2170
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03002171/* ----------------------------------------------------------------------- */
Jean Delvarec668f322009-05-13 16:48:50 -03002172void em28xx_register_i2c_ir(struct em28xx *dev)
2173{
2174 struct i2c_board_info info;
Jean Delvare4d7a2d62009-05-13 16:49:32 -03002175 struct IR_i2c_init_data init_data;
Jean Delvarec668f322009-05-13 16:48:50 -03002176 const unsigned short addr_list[] = {
2177 0x30, 0x47, I2C_CLIENT_END
2178 };
2179
2180 if (disable_ir)
2181 return;
2182
2183 memset(&info, 0, sizeof(struct i2c_board_info));
Jean Delvare4d7a2d62009-05-13 16:49:32 -03002184 memset(&init_data, 0, sizeof(struct IR_i2c_init_data));
Jean Delvarec668f322009-05-13 16:48:50 -03002185 strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
Jean Delvarec668f322009-05-13 16:48:50 -03002186
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03002187 /* detect & configure */
2188 switch (dev->model) {
2189 case (EM2800_BOARD_UNKNOWN):
2190 break;
2191 case (EM2820_BOARD_UNKNOWN):
2192 break;
2193 case (EM2800_BOARD_TERRATEC_CINERGY_200):
2194 case (EM2820_BOARD_TERRATEC_CINERGY_250):
Jean Delvare4d7a2d62009-05-13 16:49:32 -03002195 init_data.ir_codes = ir_codes_em_terratec;
2196 init_data.get_key = em28xx_get_key_terratec;
2197 init_data.name = "i2c IR (EM28XX Terratec)";
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03002198 break;
2199 case (EM2820_BOARD_PINNACLE_USB_2):
Jean Delvare4d7a2d62009-05-13 16:49:32 -03002200 init_data.ir_codes = ir_codes_pinnacle_grey;
2201 init_data.get_key = em28xx_get_key_pinnacle_usb_grey;
2202 init_data.name = "i2c IR (EM28XX Pinnacle PCTV)";
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03002203 break;
2204 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
Jean Delvare4d7a2d62009-05-13 16:49:32 -03002205 init_data.ir_codes = ir_codes_hauppauge_new;
2206 init_data.get_key = em28xx_get_key_em_haup;
2207 init_data.name = "i2c IR (EM2840 Hauppauge)";
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03002208 break;
2209 case (EM2820_BOARD_MSI_VOX_USB_2):
2210 break;
2211 case (EM2800_BOARD_LEADTEK_WINFAST_USBII):
2212 break;
2213 case (EM2800_BOARD_KWORLD_USB2800):
2214 break;
Aron Szabo59d07f12008-07-27 13:47:52 -03002215 case (EM2800_BOARD_GRABBEEX_USB2800):
2216 break;
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03002217 }
Jean Delvare4d7a2d62009-05-13 16:49:32 -03002218
2219 if (init_data.name)
2220 info.platform_data = &init_data;
2221 i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03002222}
2223
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08002224void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002225{
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002226 em28xx_set_model(dev);
2227
2228 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
Mauro Carvalho Chehab31e05302008-11-20 18:47:37 -03002229 if (em28xx_boards[dev->model].tuner_addr)
2230 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002231
Franklin Mengae3340c2009-06-06 16:34:01 -03002232 if (em28xx_boards[dev->model].tda9887_conf)
2233 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
2234
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002235 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002236 switch (dev->model) {
2237 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03002238 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03002239 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03002240 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03002241 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002242 {
2243 struct tveeprom tv;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002244#ifdef CONFIG_MODULES
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002245 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002246#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002247 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002248
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002249 dev->i2c_client.addr = 0xa0 >> 1;
2250 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002251
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002252 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03002253
Hans Verkuil38f9d302008-07-23 05:09:15 -03002254 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002255 dev->i2s_speed = 2048000;
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002256 dev->board.has_msp34xx = 1;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002257 }
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03002258#ifdef CONFIG_MODULES
2259 if (tv.has_ir)
2260 request_module("ir-kbd-i2c");
2261#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002262 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002263 }
Franklin Mengd7de5d82009-06-06 17:05:02 -03002264 case EM2882_BOARD_KWORLD_ATSC_315U:
2265 em28xx_write_reg(dev, 0x0d, 0x42);
2266 msleep(10);
2267 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
2268 msleep(10);
2269 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002270 case EM2820_BOARD_KWORLD_PVRTV2800RF:
2271 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03002272 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002273 break;
2274 case EM2820_BOARD_UNKNOWN:
2275 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03002276 /*
2277 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
2278 *
2279 * This occurs because they share identical USB vendor and
2280 * product IDs.
2281 *
2282 * What we do here is look up the EEPROM hash of the K-WORLD
2283 * and if it is found then we decide that we do not have
2284 * a DIGIVOX and reset the device to the K-WORLD instead.
2285 *
2286 * This solution is only valid if they do not share eeprom
2287 * hash identities which has not been determined as yet.
2288 */
2289 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002290 if (!em28xx_hint_board(dev))
2291 em28xx_set_model(dev);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002292
2293 /* In cases where we had to use a board hint, the call to
2294 em28xx_set_mode() in em28xx_pre_card_setup() was a no-op,
2295 so make the call now so the analog GPIOs are set properly
2296 before probing the i2c bus. */
Devin Heitmueller5343e442009-07-15 00:35:47 -03002297 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Devin Heitmuellercdf7bfa2009-06-19 00:20:28 -03002298 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002299 break;
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -03002300 case EM2820_BOARD_SILVERCREST_WEBCAM:
2301 /* FIXME: need to document the registers bellow */
2302 em28xx_write_reg(dev, 0x0d, 0x42);
2303 em28xx_write_reg(dev, 0x13, 0x08);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002304 }
2305
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002306 if (dev->board.has_snapshot_button)
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03002307 em28xx_register_snapshot_button(dev);
2308
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002309 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03002310 em28xx_errdev("\n\n");
2311 em28xx_errdev("The support for this board weren't "
2312 "valid yet.\n");
2313 em28xx_errdev("Please send a report of having this working\n");
2314 em28xx_errdev("not to V4L mailing list (and/or to other "
2315 "addresses)\n\n");
2316 }
2317
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03002318 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002319 if (tuner >= 0)
2320 dev->tuner_type = tuner;
2321
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002322 /* request some modules */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002323 if (dev->board.has_msp34xx)
Hans Verkuile6574f22009-04-01 03:57:53 -03002324 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2325 "msp3400", "msp3400", msp3400_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002326
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03002327 if (dev->board.decoder == EM28XX_SAA711X)
Hans Verkuile6574f22009-04-01 03:57:53 -03002328 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2329 "saa7115", "saa7115_auto", saa711x_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002330
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03002331 if (dev->board.decoder == EM28XX_TVP5150)
Hans Verkuile6574f22009-04-01 03:57:53 -03002332 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2333 "tvp5150", "tvp5150", tvp5150_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002334
Mauro Carvalho Chehabd36bb4e2009-07-14 03:18:39 -03002335 if (dev->em28xx_sensor == EM28XX_MT9V011) {
2336 struct v4l2_subdev *sd;
2337
2338 sd = v4l2_i2c_new_probed_subdev(&dev->v4l2_dev,
2339 &dev->i2c_adap, "mt9v011", "mt9v011", mt9v011_addrs);
2340 v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal);
2341 }
Mauro Carvalho Chehab02e78042009-06-29 11:35:05 -03002342
Mauro Carvalho Chehabb80fd2d2009-07-14 21:08:22 -03002343
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03002344 if (dev->board.adecoder == EM28XX_TVAUDIO)
Hans Verkuile6574f22009-04-01 03:57:53 -03002345 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2346 "tvaudio", "tvaudio", dev->board.tvaudio_addr);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002347
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002348 if (dev->board.tuner_type != TUNER_ABSENT) {
2349 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03002350
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002351 if (dev->board.radio.type)
Hans Verkuile6574f22009-04-01 03:57:53 -03002352 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2353 "tuner", "tuner", dev->board.radio_addr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002354
2355 if (has_demod)
Hans Verkuile6574f22009-04-01 03:57:53 -03002356 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev,
2357 &dev->i2c_adap, "tuner", "tuner",
2358 v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002359 if (dev->tuner_addr == 0) {
2360 enum v4l2_i2c_tuner_type type =
2361 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
2362 struct v4l2_subdev *sd;
2363
Hans Verkuile6574f22009-04-01 03:57:53 -03002364 sd = v4l2_i2c_new_probed_subdev(&dev->v4l2_dev,
2365 &dev->i2c_adap, "tuner", "tuner",
2366 v4l2_i2c_tuner_addrs(type));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002367
2368 if (sd)
2369 dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
2370 } else {
Hans Verkuile6574f22009-04-01 03:57:53 -03002371 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2372 "tuner", "tuner", dev->tuner_addr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002373 }
2374 }
2375
2376 em28xx_tuner_setup(dev);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03002377 em28xx_ir_init(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002378}
Mauro Carvalho Chehabc8644052008-11-25 13:10:14 -03002379
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002380
2381#if defined(CONFIG_MODULES) && defined(MODULE)
2382static void request_module_async(struct work_struct *work)
2383{
2384 struct em28xx *dev = container_of(work,
2385 struct em28xx, request_module_wk);
2386
2387 if (dev->has_audio_class)
2388 request_module("snd-usb-audio");
2389 else if (dev->has_alsa_audio)
2390 request_module("em28xx-alsa");
2391
2392 if (dev->board.has_dvb)
2393 request_module("em28xx-dvb");
2394}
2395
2396static void request_modules(struct em28xx *dev)
2397{
2398 INIT_WORK(&dev->request_module_wk, request_module_async);
2399 schedule_work(&dev->request_module_wk);
2400}
2401#else
2402#define request_modules(dev)
2403#endif /* CONFIG_MODULES */
2404
2405/*
2406 * em28xx_realease_resources()
2407 * unregisters the v4l2,i2c and usb devices
2408 * called when the device gets disconected or at module unload
2409*/
2410void em28xx_release_resources(struct em28xx *dev)
2411{
2412 if (dev->sbutton_input_dev)
2413 em28xx_deregister_snapshot_button(dev);
2414
2415 if (dev->ir)
2416 em28xx_ir_fini(dev);
2417
2418 /*FIXME: I2C IR should be disconnected */
2419
2420 em28xx_release_analog_resources(dev);
2421
2422 em28xx_remove_from_devlist(dev);
2423
2424 em28xx_i2c_unregister(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002425
2426 v4l2_device_unregister(&dev->v4l2_dev);
2427
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002428 usb_put_dev(dev->udev);
2429
2430 /* Mark device as unused */
2431 em28xx_devused &= ~(1 << dev->devno);
2432};
2433
2434/*
2435 * em28xx_init_dev()
2436 * allocates and inits the device structs, registers i2c bus and v4l device
2437 */
Mauro Carvalho Chehab26cdc762009-01-05 01:00:40 -03002438static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002439 struct usb_interface *interface,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002440 int minor)
2441{
2442 struct em28xx *dev = *devhandle;
2443 int retval = -ENOMEM;
2444 int errCode;
2445
2446 dev->udev = udev;
2447 mutex_init(&dev->ctrl_urb_lock);
2448 spin_lock_init(&dev->slock);
2449 init_waitqueue_head(&dev->open);
2450 init_waitqueue_head(&dev->wait_frame);
2451 init_waitqueue_head(&dev->wait_stream);
2452
2453 dev->em28xx_write_regs = em28xx_write_regs;
2454 dev->em28xx_read_reg = em28xx_read_reg;
2455 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
2456 dev->em28xx_write_regs_req = em28xx_write_regs_req;
2457 dev->em28xx_read_reg_req = em28xx_read_reg_req;
2458 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
2459
2460 em28xx_pre_card_setup(dev);
2461
2462 if (!dev->board.is_em2800) {
2463 /* Sets I2C speed to 100 KHz */
2464 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x40);
2465 if (retval < 0) {
2466 em28xx_errdev("%s: em28xx_write_regs_req failed!"
2467 " retval [%d]\n",
2468 __func__, retval);
2469 return retval;
2470 }
2471 }
2472
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002473 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002474 if (retval < 0) {
2475 em28xx_errdev("Call to v4l2_device_register() failed!\n");
2476 return retval;
2477 }
2478
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002479 /* register i2c bus */
2480 errCode = em28xx_i2c_register(dev);
2481 if (errCode < 0) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002482 v4l2_device_unregister(&dev->v4l2_dev);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002483 em28xx_errdev("%s: em28xx_i2c_register - errCode [%d]!\n",
2484 __func__, errCode);
2485 return errCode;
2486 }
2487
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -03002488 /*
Mauro Carvalho Chehab579d3152009-07-14 12:33:25 -03002489 * Default format, used for tvp5150 or saa711x output formats
2490 */
2491 dev->vinmode = 0x10;
2492 dev->vinctl = 0x11;
2493
2494 /*
Mauro Carvalho Chehabb04fb662009-07-13 01:28:21 -03002495 * If the device can be a webcam, seek for a sensor.
2496 * If sensor is not found, then it isn't a webcam.
2497 */
2498 if (dev->board.is_webcam)
2499 if (em28xx_hint_sensor(dev) < 0)
2500 dev->board.is_webcam = 0;
Mauro Carvalho Chehab791a08f2009-07-03 15:36:18 -03002501
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002502 /* Do board specific init and eeprom reading */
2503 em28xx_card_setup(dev);
2504
2505 /* Configure audio */
2506 errCode = em28xx_audio_setup(dev);
2507 if (errCode < 0) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002508 v4l2_device_unregister(&dev->v4l2_dev);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002509 em28xx_errdev("%s: Error while setting audio - errCode [%d]!\n",
2510 __func__, errCode);
2511 }
2512
2513 /* wake i2c devices */
2514 em28xx_wake_i2c(dev);
2515
2516 /* init video dma queues */
2517 INIT_LIST_HEAD(&dev->vidq.active);
2518 INIT_LIST_HEAD(&dev->vidq.queued);
2519
2520
2521 if (dev->board.has_msp34xx) {
2522 /* Send a reset to other chips via gpio */
2523 errCode = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
2524 if (errCode < 0) {
2525 em28xx_errdev("%s: em28xx_write_regs_req - "
2526 "msp34xx(1) failed! errCode [%d]\n",
2527 __func__, errCode);
2528 return errCode;
2529 }
2530 msleep(3);
2531
2532 errCode = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2533 if (errCode < 0) {
2534 em28xx_errdev("%s: em28xx_write_regs_req - "
2535 "msp34xx(2) failed! errCode [%d]\n",
2536 __func__, errCode);
2537 return errCode;
2538 }
2539 msleep(3);
2540 }
2541
2542 em28xx_add_into_devlist(dev);
2543
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002544 retval = em28xx_register_analog_devices(dev);
2545 if (retval < 0) {
2546 em28xx_release_resources(dev);
2547 goto fail_reg_devices;
2548 }
2549
2550 em28xx_init_extension(dev);
2551
2552 /* Save some power by putting tuner to sleep */
Hans Verkuil7c9fc9d2009-04-01 03:49:59 -03002553 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_standby);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002554
2555 return 0;
2556
2557fail_reg_devices:
2558 return retval;
2559}
2560
2561/*
2562 * em28xx_usb_probe()
2563 * checks for supported devices
2564 */
2565static int em28xx_usb_probe(struct usb_interface *interface,
2566 const struct usb_device_id *id)
2567{
2568 const struct usb_endpoint_descriptor *endpoint;
2569 struct usb_device *udev;
2570 struct usb_interface *uif;
2571 struct em28xx *dev = NULL;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002572 int retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002573 int i, nr, ifnum, isoc_pipe;
2574 char *speed;
2575 char descr[255] = "";
2576
2577 udev = usb_get_dev(interface_to_usbdev(interface));
2578 ifnum = interface->altsetting[0].desc.bInterfaceNumber;
2579
2580 /* Check to see next free device and mark as used */
2581 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
2582 em28xx_devused |= 1<<nr;
2583
2584 /* Don't register audio interfaces */
2585 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
2586 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
2587 "interface %i, class %i\n",
2588 le16_to_cpu(udev->descriptor.idVendor),
2589 le16_to_cpu(udev->descriptor.idProduct),
2590 ifnum,
2591 interface->altsetting[0].desc.bInterfaceClass);
2592
2593 em28xx_devused &= ~(1<<nr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002594 retval = -ENODEV;
2595 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002596 }
2597
2598 endpoint = &interface->cur_altsetting->endpoint[0].desc;
2599
2600 /* check if the device has the iso in endpoint at the correct place */
Julia Lawall13417982008-12-29 21:49:22 -03002601 if (usb_endpoint_xfer_isoc(endpoint)
2602 &&
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002603 (interface->altsetting[1].endpoint[0].desc.wMaxPacketSize == 940)) {
2604 /* It's a newer em2874/em2875 device */
2605 isoc_pipe = 0;
2606 } else {
2607 int check_interface = 1;
2608 isoc_pipe = 1;
2609 endpoint = &interface->cur_altsetting->endpoint[1].desc;
Julia Lawall2230c3c2009-01-03 16:53:10 -03002610 if (!usb_endpoint_xfer_isoc(endpoint))
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002611 check_interface = 0;
2612
Julia Lawall13417982008-12-29 21:49:22 -03002613 if (usb_endpoint_dir_out(endpoint))
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002614 check_interface = 0;
2615
2616 if (!check_interface) {
2617 em28xx_err(DRIVER_NAME " video device (%04x:%04x): "
2618 "interface %i, class %i found.\n",
2619 le16_to_cpu(udev->descriptor.idVendor),
2620 le16_to_cpu(udev->descriptor.idProduct),
2621 ifnum,
2622 interface->altsetting[0].desc.bInterfaceClass);
2623
2624 em28xx_err(DRIVER_NAME " This is an anciliary "
2625 "interface not used by the driver\n");
2626
2627 em28xx_devused &= ~(1<<nr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002628 retval = -ENODEV;
2629 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002630 }
2631 }
2632
2633 switch (udev->speed) {
2634 case USB_SPEED_LOW:
2635 speed = "1.5";
2636 break;
2637 case USB_SPEED_UNKNOWN:
2638 case USB_SPEED_FULL:
2639 speed = "12";
2640 break;
2641 case USB_SPEED_HIGH:
2642 speed = "480";
2643 break;
2644 default:
2645 speed = "unknown";
2646 }
2647
2648 if (udev->manufacturer)
2649 strlcpy(descr, udev->manufacturer, sizeof(descr));
2650
2651 if (udev->product) {
2652 if (*descr)
2653 strlcat(descr, " ", sizeof(descr));
2654 strlcat(descr, udev->product, sizeof(descr));
2655 }
2656 if (*descr)
2657 strlcat(descr, " ", sizeof(descr));
2658
2659 printk(DRIVER_NAME ": New device %s@ %s Mbps "
2660 "(%04x:%04x, interface %d, class %d)\n",
2661 descr,
2662 speed,
2663 le16_to_cpu(udev->descriptor.idVendor),
2664 le16_to_cpu(udev->descriptor.idProduct),
2665 ifnum,
2666 interface->altsetting->desc.bInterfaceNumber);
2667
Devin Heitmueller64a00b42009-05-27 23:23:37 -03002668 /*
2669 * Make sure we have 480 Mbps of bandwidth, otherwise things like
2670 * video stream wouldn't likely work, since 12 Mbps is generally
2671 * not enough even for most Digital TV streams.
2672 */
Devin Heitmuellere2a1b792009-05-27 23:44:10 -03002673 if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
Devin Heitmueller64a00b42009-05-27 23:23:37 -03002674 printk(DRIVER_NAME ": Device initialization failed.\n");
2675 printk(DRIVER_NAME ": Device must be connected to a high-speed"
2676 " USB 2.0 port.\n");
2677 em28xx_devused &= ~(1<<nr);
2678 retval = -ENODEV;
2679 goto err;
2680 }
2681
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002682 if (nr >= EM28XX_MAXBOARDS) {
2683 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
2684 EM28XX_MAXBOARDS);
2685 em28xx_devused &= ~(1<<nr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002686 retval = -ENOMEM;
2687 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002688 }
2689
2690 /* allocate memory for our device state and initialize it */
2691 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
2692 if (dev == NULL) {
2693 em28xx_err(DRIVER_NAME ": out of memory!\n");
2694 em28xx_devused &= ~(1<<nr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002695 retval = -ENOMEM;
2696 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002697 }
2698
2699 snprintf(dev->name, 29, "em28xx #%d", nr);
2700 dev->devno = nr;
2701 dev->model = id->driver_info;
2702 dev->alt = -1;
2703
2704 /* Checks if audio is provided by some interface */
2705 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
2706 uif = udev->config->interface[i];
2707 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
2708 dev->has_audio_class = 1;
2709 break;
2710 }
2711 }
2712
2713 /* compute alternate max packet sizes */
2714 uif = udev->actconfig->interface[0];
2715
2716 dev->num_alt = uif->num_altsetting;
2717 dev->alt_max_pkt_size = kmalloc(32 * dev->num_alt, GFP_KERNEL);
2718
2719 if (dev->alt_max_pkt_size == NULL) {
2720 em28xx_errdev("out of memory!\n");
2721 em28xx_devused &= ~(1<<nr);
2722 kfree(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002723 retval = -ENOMEM;
2724 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002725 }
2726
2727 for (i = 0; i < dev->num_alt ; i++) {
2728 u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.wMaxPacketSize);
2729 dev->alt_max_pkt_size[i] =
2730 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
2731 }
2732
2733 if ((card[nr] >= 0) && (card[nr] < em28xx_bcount))
2734 dev->model = card[nr];
2735
2736 /* allocate device struct */
2737 mutex_init(&dev->lock);
2738 mutex_lock(&dev->lock);
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002739 retval = em28xx_init_dev(&dev, udev, interface, nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002740 if (retval) {
2741 em28xx_devused &= ~(1<<dev->devno);
Jiri Slaby11b79ea2009-07-05 14:06:41 -03002742 mutex_unlock(&dev->lock);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002743 kfree(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002744 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002745 }
2746
2747 /* save our data pointer in this interface device */
2748 usb_set_intfdata(interface, dev);
2749
2750 request_modules(dev);
2751
2752 /* Should be the last thing to do, to avoid newer udev's to
2753 open the device before fully initializing it
2754 */
2755 mutex_unlock(&dev->lock);
2756
2757 return 0;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002758
2759err:
2760 return retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002761}
2762
2763/*
2764 * em28xx_usb_disconnect()
2765 * called when the device gets diconencted
2766 * video device will be unregistered on v4l2_close in case it is still open
2767 */
2768static void em28xx_usb_disconnect(struct usb_interface *interface)
2769{
2770 struct em28xx *dev;
2771
2772 dev = usb_get_intfdata(interface);
2773 usb_set_intfdata(interface, NULL);
2774
2775 if (!dev)
2776 return;
2777
2778 em28xx_info("disconnecting %s\n", dev->vdev->name);
2779
2780 /* wait until all current v4l2 io is finished then deallocate
2781 resources */
2782 mutex_lock(&dev->lock);
2783
2784 wake_up_interruptible_all(&dev->open);
2785
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002786 v4l2_device_disconnect(&dev->v4l2_dev);
2787
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002788 if (dev->users) {
2789 em28xx_warn
2790 ("device /dev/video%d is open! Deregistration and memory "
2791 "deallocation are deferred on close.\n",
2792 dev->vdev->num);
2793
2794 dev->state |= DEV_MISCONFIGURED;
2795 em28xx_uninit_isoc(dev);
2796 dev->state |= DEV_DISCONNECTED;
2797 wake_up_interruptible(&dev->wait_frame);
2798 wake_up_interruptible(&dev->wait_stream);
2799 } else {
2800 dev->state |= DEV_DISCONNECTED;
2801 em28xx_release_resources(dev);
2802 }
2803
2804 em28xx_close_extension(dev);
2805
2806 mutex_unlock(&dev->lock);
2807
2808 if (!dev->users) {
2809 kfree(dev->alt_max_pkt_size);
2810 kfree(dev);
2811 }
2812}
2813
2814static struct usb_driver em28xx_usb_driver = {
2815 .name = "em28xx",
2816 .probe = em28xx_usb_probe,
2817 .disconnect = em28xx_usb_disconnect,
2818 .id_table = em28xx_id_table,
2819};
2820
2821static int __init em28xx_module_init(void)
2822{
2823 int result;
2824
2825 /* register this driver with the USB subsystem */
2826 result = usb_register(&em28xx_usb_driver);
2827 if (result)
2828 em28xx_err(DRIVER_NAME
2829 " usb_register failed. Error number %d.\n", result);
2830
2831 printk(KERN_INFO DRIVER_NAME " driver loaded\n");
2832
2833 return result;
2834}
2835
2836static void __exit em28xx_module_exit(void)
2837{
2838 /* deregister this driver with the USB subsystem */
2839 usb_deregister(&em28xx_usb_driver);
2840}
2841
2842module_init(em28xx_module_init);
2843module_exit(em28xx_module_exit);