blob: 7cb93fbbbbf8dbfba379ac27a20f56bc9c87e4b2 [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
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030052static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = UNSET };
53module_param_array(card, int, NULL, 0444);
54MODULE_PARM_DESC(card, "card type");
55
56/* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS */
57static unsigned long em28xx_devused;
58
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030059struct em28xx_hash_table {
60 unsigned long hash;
61 unsigned int model;
62 unsigned int tuner;
63};
64
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -030065/*
66 * Reset sequences for analog/digital modes
67 */
68
69/* Reset for the most [analog] boards */
70static struct em28xx_reg_seq default_analog[] = {
71 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
72 { -1, -1, -1, -1},
73};
74
75/* Reset for the most [digital] boards */
76static struct em28xx_reg_seq default_digital[] = {
77 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
78 { -1, -1, -1, -1},
79};
80
81/* Board Hauppauge WinTV HVR 900 analog */
82static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
83 {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10},
84 {0x05, 0xff, 0x10, 10},
85 { -1, -1, -1, -1},
86};
87
88/* Board Hauppauge WinTV HVR 900 digital */
89static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
90 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
91 {EM2880_R04_GPO, 0x04, 0x0f, 10},
92 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
93 { -1, -1, -1, -1},
94};
95
96/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
97static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
98 {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10},
99 { -1, -1, -1, -1},
100};
101
102/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300103
104/* Board - EM2870 Kworld 355u
105 Analog - No input analog */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300106
Robert Krakora6e7b9ea2009-01-18 21:59:34 -0300107static struct em28xx_reg_seq kworld_330u_analog[] = {
108 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
109 {EM2880_R04_GPO, 0x00, 0xff, 10},
110 { -1, -1, -1, -1},
111};
112
113static struct em28xx_reg_seq kworld_330u_digital[] = {
114 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
115 {EM2880_R04_GPO, 0x08, 0xff, 10},
116 { -1, -1, -1, -1},
117};
118
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300119/* Callback for the most boards */
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300120static struct em28xx_reg_seq default_tuner_gpio[] = {
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300121 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
122 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10},
123 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
124 { -1, -1, -1, -1},
125};
126
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -0300127/* Mute/unmute */
128static struct em28xx_reg_seq compro_unmute_tv_gpio[] = {
129 {EM28XX_R08_GPIO, 5, 7, 10},
130 { -1, -1, -1, -1},
131};
132
133static struct em28xx_reg_seq compro_unmute_svid_gpio[] = {
134 {EM28XX_R08_GPIO, 4, 7, 10},
135 { -1, -1, -1, -1},
136};
137
138static struct em28xx_reg_seq compro_mute_gpio[] = {
139 {EM28XX_R08_GPIO, 6, 7, 10},
140 { -1, -1, -1, -1},
141};
142
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300143/*
144 * Board definitions
145 */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800146struct em28xx_board em28xx_boards[] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300147 [EM2750_BOARD_UNKNOWN] = {
148 .name = "Unknown EM2750/EM2751 webcam grabber",
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300149 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300150 .tuner_type = TUNER_ABSENT, /* This is a webcam */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300151 .input = { {
152 .type = EM28XX_VMUX_COMPOSITE1,
153 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300154 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300155 } },
156 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800157 [EM2800_BOARD_UNKNOWN] = {
158 .name = "Unknown EM2800 video grabber",
159 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800160 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300161 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300162 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300163 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800164 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300165 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300166 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300167 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800168 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300169 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300170 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300171 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800172 },
173 [EM2820_BOARD_UNKNOWN] = {
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300174 .name = "Unknown EM2750/28xx video grabber",
175 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800176 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300177 [EM2750_BOARD_DLCW_130] = {
178 /* Beijing Huaqi Information Digital Technology Co., Ltd */
179 .name = "Huaqi DLCW-130",
180 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300181 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300182 .tuner_type = TUNER_ABSENT, /* This is a webcam */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300183 .input = { {
184 .type = EM28XX_VMUX_COMPOSITE1,
185 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300186 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300187 } },
188 },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200189 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
Markus Rechberger33ccaa32006-02-07 06:25:41 -0200190 .name = "Kworld PVR TV 2800 RF",
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300191 .tuner_type = TUNER_TEMIC_PAL,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200192 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300193 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300194 .input = { {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200195 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300196 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300197 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300198 }, {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200199 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300200 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300201 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300202 } },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200203 },
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -0300204 [EM2820_BOARD_GADMEI_TVR200] = {
205 .name = "Gadmei TVR200",
206 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
207 .tda9887_conf = TDA9887_PRESENT,
208 .decoder = EM28XX_SAA711X,
209 .input = { {
210 .type = EM28XX_VMUX_TELEVISION,
211 .vmux = SAA7115_COMPOSITE2,
212 .amux = EM28XX_AMUX_LINE_IN,
213 }, {
214 .type = EM28XX_VMUX_COMPOSITE1,
215 .vmux = SAA7115_COMPOSITE0,
216 .amux = EM28XX_AMUX_LINE_IN,
217 }, {
218 .type = EM28XX_VMUX_SVIDEO,
219 .vmux = SAA7115_SVIDEO3,
220 .amux = EM28XX_AMUX_LINE_IN,
221 } },
222 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800223 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
224 .name = "Terratec Cinergy 250 USB",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800225 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
226 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300227 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300228 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800229 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300230 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300231 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300232 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800233 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300234 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300235 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300236 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800237 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300238 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300239 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300240 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800241 },
242 [EM2820_BOARD_PINNACLE_USB_2] = {
243 .name = "Pinnacle PCTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800244 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
245 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300246 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300247 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800248 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300249 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300250 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300251 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800252 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300253 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300254 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300255 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800256 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300257 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300258 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300259 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800260 },
261 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
262 .name = "Hauppauge WinTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800263 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300264 .tda9887_conf = TDA9887_PRESENT |
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300265 TDA9887_PORT1_ACTIVE |
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300266 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800267 .decoder = EM28XX_TVP5150,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800268 .has_msp34xx = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300269 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800270 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300271 .vmux = TVP5150_COMPOSITE0,
Hans Verkuil2474ed42006-03-19 12:35:57 -0300272 .amux = MSP_INPUT_DEFAULT,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300273 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800274 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300275 .vmux = TVP5150_SVIDEO,
Hans Verkuil07151722006-04-01 18:03:23 -0300276 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
277 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300278 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800279 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300280 [EM2820_BOARD_DLINK_USB_TV] = {
281 .name = "D-Link DUB-T210 TV Tuner",
282 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300283 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
284 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300285 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300286 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300287 .type = EM28XX_VMUX_TELEVISION,
288 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300289 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300290 }, {
291 .type = EM28XX_VMUX_COMPOSITE1,
292 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300293 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300294 }, {
295 .type = EM28XX_VMUX_SVIDEO,
296 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300297 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300298 } },
299 },
300 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
301 .name = "Hercules Smart TV USB 2.0",
302 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300303 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
304 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300305 .decoder = EM28XX_SAA711X,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300306 .input = { {
307 .type = EM28XX_VMUX_TELEVISION,
308 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300309 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300310 }, {
311 .type = EM28XX_VMUX_COMPOSITE1,
312 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300313 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300314 }, {
315 .type = EM28XX_VMUX_SVIDEO,
316 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300317 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300318 } },
319 },
320 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
321 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
322 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300323 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
324 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300325 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300326 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300327 .type = EM28XX_VMUX_TELEVISION,
328 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300329 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300330 }, {
331 .type = EM28XX_VMUX_COMPOSITE1,
332 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300333 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300334 }, {
335 .type = EM28XX_VMUX_SVIDEO,
336 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300337 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300338 } },
339 },
340 [EM2820_BOARD_GADMEI_UTV310] = {
341 .name = "Gadmei UTV310",
342 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300343 .tuner_type = TUNER_TNF_5335MF,
344 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300345 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300346 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300347 .type = EM28XX_VMUX_TELEVISION,
348 .vmux = SAA7115_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300349 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300350 }, {
351 .type = EM28XX_VMUX_COMPOSITE1,
352 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300353 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300354 }, {
355 .type = EM28XX_VMUX_SVIDEO,
356 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300357 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300358 } },
359 },
360 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
361 .name = "Leadtek Winfast USB II Deluxe",
362 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300363 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
364 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300365 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300366 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300367 .type = EM28XX_VMUX_TELEVISION,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300368 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300369 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300370 }, {
371 .type = EM28XX_VMUX_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300372 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300373 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300374 }, {
375 .type = EM28XX_VMUX_SVIDEO,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300376 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300377 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300378 } },
379 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300380 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300381 .name = "Videology 20K14XUSB USB2.0",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300382 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300383 .tuner_type = TUNER_ABSENT, /* This is a webcam */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300384 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300385 .type = EM28XX_VMUX_COMPOSITE1,
386 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300387 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300388 } },
389 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300390 [EM2821_BOARD_SUPERCOMP_USB_2] = {
391 .name = "Supercomp USB 2.0 TV",
392 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300393 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
394 .tda9887_conf = TDA9887_PRESENT |
395 TDA9887_PORT1_ACTIVE |
396 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300397 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300398 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300399 .type = EM28XX_VMUX_TELEVISION,
400 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300401 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300402 }, {
403 .type = EM28XX_VMUX_COMPOSITE1,
404 .vmux = SAA7115_COMPOSITE0,
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_SVIDEO,
408 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300409 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300410 } },
411 },
412 [EM2821_BOARD_USBGEAR_VD204] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300413 .name = "Usbgear VD204v9",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300414 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300415 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300416 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300417 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300418 .type = EM28XX_VMUX_COMPOSITE1,
419 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300420 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300421 }, {
422 .type = EM28XX_VMUX_SVIDEO,
423 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300424 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300425 } },
426 },
427 [EM2860_BOARD_NETGMBH_CAM] = {
428 /* Beijing Huaqi Information Digital Technology Co., Ltd */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300429 .name = "NetGMBH Cam",
430 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300431 .tuner_type = TUNER_ABSENT, /* This is a webcam */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300432 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300433 .type = EM28XX_VMUX_COMPOSITE1,
434 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300435 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300436 } },
437 },
438 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300439 .name = "Typhoon DVD Maker",
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300440 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300441 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300442 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300443 .type = EM28XX_VMUX_COMPOSITE1,
444 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300445 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300446 }, {
447 .type = EM28XX_VMUX_SVIDEO,
448 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300449 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300450 } },
451 },
452 [EM2860_BOARD_GADMEI_UTV330] = {
453 .name = "Gadmei UTV330",
454 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300455 .tuner_type = TUNER_TNF_5335MF,
456 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300457 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300458 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300459 .type = EM28XX_VMUX_TELEVISION,
460 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300461 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300462 }, {
463 .type = EM28XX_VMUX_COMPOSITE1,
464 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300465 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300466 }, {
467 .type = EM28XX_VMUX_SVIDEO,
468 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300469 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300470 } },
471 },
472 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
473 .name = "Terratec Cinergy A Hybrid XS",
474 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300475 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300476 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300477 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300478
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300479 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300480 .type = EM28XX_VMUX_TELEVISION,
481 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300482 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300483 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300484 }, {
485 .type = EM28XX_VMUX_COMPOSITE1,
486 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300487 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300488 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300489 }, {
490 .type = EM28XX_VMUX_SVIDEO,
491 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300492 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300493 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300494 } },
495 },
496 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
497 .name = "KWorld PVRTV 300U",
498 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300499 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300500 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300501 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300502 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300503 .type = EM28XX_VMUX_TELEVISION,
504 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300505 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300506 }, {
507 .type = EM28XX_VMUX_COMPOSITE1,
508 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300509 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300510 }, {
511 .type = EM28XX_VMUX_SVIDEO,
512 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300513 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300514 } },
515 },
516 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
517 .name = "Yakumo MovieMixer",
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300518 .tuner_type = TUNER_ABSENT, /* Capture only device */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300519 .decoder = EM28XX_TVP5150,
520 .input = { {
521 .type = EM28XX_VMUX_TELEVISION,
522 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300523 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300524 }, {
525 .type = EM28XX_VMUX_COMPOSITE1,
526 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300527 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300528 }, {
529 .type = EM28XX_VMUX_SVIDEO,
530 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300531 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300532 } },
533 },
534 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
535 .name = "Plextor ConvertX PX-TV100U",
536 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300537 .tuner_type = TUNER_TNF_5335MF,
538 .tda9887_conf = TDA9887_PRESENT,
539 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300540 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300541 .type = EM28XX_VMUX_TELEVISION,
542 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300543 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300544 }, {
545 .type = EM28XX_VMUX_COMPOSITE1,
546 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300547 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300548 }, {
549 .type = EM28XX_VMUX_SVIDEO,
550 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300551 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300552 } },
553 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300554
555 /* Those boards with em2870 are DVB Only*/
556
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300557 [EM2870_BOARD_TERRATEC_XS] = {
558 .name = "Terratec Cinergy T XS",
559 .valid = EM28XX_BOARD_NOT_VALIDATED,
560 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300561 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300562 },
563 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
564 .name = "Terratec Cinergy T XS (MT2060)",
565 .valid = EM28XX_BOARD_NOT_VALIDATED,
566 .tuner_type = TUNER_ABSENT, /* MT2060 */
567 },
568 [EM2870_BOARD_KWORLD_350U] = {
569 .name = "Kworld 350 U DVB-T",
570 .valid = EM28XX_BOARD_NOT_VALIDATED,
571 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300572 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300573 },
574 [EM2870_BOARD_KWORLD_355U] = {
575 .name = "Kworld 355 U DVB-T",
576 .valid = EM28XX_BOARD_NOT_VALIDATED,
577 },
578 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
579 .name = "Pinnacle PCTV DVB-T",
580 .valid = EM28XX_BOARD_NOT_VALIDATED,
581 .tuner_type = TUNER_ABSENT, /* MT2060 */
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300582 /* djh - I have serious doubts this is right... */
583 .xclk = EM28XX_XCLK_IR_RC5_MODE |
584 EM28XX_XCLK_FREQUENCY_10MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300585 },
586 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
587 .name = "Compro, VideoMate U3",
588 .valid = EM28XX_BOARD_NOT_VALIDATED,
589 .tuner_type = TUNER_ABSENT, /* MT2060 */
590 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300591
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300592 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
593 .name = "Terratec Hybrid XS Secam",
594 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300595 .has_msp34xx = 1,
596 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300597 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300598 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300599 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300600 .type = EM28XX_VMUX_TELEVISION,
601 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300602 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300603 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300604 }, {
605 .type = EM28XX_VMUX_COMPOSITE1,
606 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300607 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300608 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300609 }, {
610 .type = EM28XX_VMUX_SVIDEO,
611 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300612 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300613 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300614 } },
615 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300616 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -0300617 .name = "Hauppauge WinTV HVR 900",
Aidan Thornton122d1582007-11-20 15:25:08 -0300618 .tda9887_conf = TDA9887_PRESENT,
619 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300620 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -0300621 .mts_firmware = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300622 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300623 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller62cfc342009-03-22 22:58:46 -0300624 .ir_codes = ir_codes_hauppauge_new,
Aidan Thornton122d1582007-11-20 15:25:08 -0300625 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300626 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -0300627 .type = EM28XX_VMUX_TELEVISION,
628 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300629 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300630 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300631 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300632 .type = EM28XX_VMUX_COMPOSITE1,
633 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300634 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300635 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300636 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300637 .type = EM28XX_VMUX_SVIDEO,
638 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300639 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300640 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300641 } },
Aidan Thornton122d1582007-11-20 15:25:08 -0300642 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300643 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
644 .name = "Hauppauge WinTV HVR 900 (R2)",
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300645 .tda9887_conf = TDA9887_PRESENT,
646 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300647 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300648 .mts_firmware = 1,
Devin Heitmueller62cfc342009-03-22 22:58:46 -0300649 .ir_codes = ir_codes_hauppauge_new,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300650 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300651 .input = { {
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300652 .type = EM28XX_VMUX_TELEVISION,
653 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300654 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300655 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300656 }, {
657 .type = EM28XX_VMUX_COMPOSITE1,
658 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300659 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300660 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300661 }, {
662 .type = EM28XX_VMUX_SVIDEO,
663 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300664 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300665 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300666 } },
667 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -0300668 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = {
669 .name = "Hauppauge WinTV HVR 850",
670 .tuner_type = TUNER_XC2028,
671 .tuner_gpio = default_tuner_gpio,
672 .mts_firmware = 1,
673 .has_dvb = 1,
674 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
675 .ir_codes = ir_codes_hauppauge_new,
676 .decoder = EM28XX_TVP5150,
677 .input = { {
678 .type = EM28XX_VMUX_TELEVISION,
679 .vmux = TVP5150_COMPOSITE0,
680 .amux = EM28XX_AMUX_VIDEO,
681 .gpio = hauppauge_wintv_hvr_900_analog,
682 }, {
683 .type = EM28XX_VMUX_COMPOSITE1,
684 .vmux = TVP5150_COMPOSITE1,
685 .amux = EM28XX_AMUX_LINE_IN,
686 .gpio = hauppauge_wintv_hvr_900_analog,
687 }, {
688 .type = EM28XX_VMUX_SVIDEO,
689 .vmux = TVP5150_SVIDEO,
690 .amux = EM28XX_AMUX_LINE_IN,
691 .gpio = hauppauge_wintv_hvr_900_analog,
692 } },
693 },
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -0300694 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300695 .name = "Hauppauge WinTV HVR 950",
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300696 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300697 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300698 .mts_firmware = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -0300699 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300700 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller4b922532008-11-13 03:15:55 -0300701 .ir_codes = ir_codes_hauppauge_new,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300702 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300703 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300704 .type = EM28XX_VMUX_TELEVISION,
705 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300706 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300707 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300708 }, {
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -0300709 .type = EM28XX_VMUX_COMPOSITE1,
710 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300711 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300712 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300713 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300714 .type = EM28XX_VMUX_SVIDEO,
715 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300716 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300717 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300718 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300719 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300720 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
721 .name = "Pinnacle PCTV HD Pro Stick",
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300722 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300723 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300724 .mts_firmware = 1,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300725 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300726 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller4b922532008-11-13 03:15:55 -0300727 .ir_codes = ir_codes_pinnacle_pctv_hd,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300728 .decoder = EM28XX_TVP5150,
729 .input = { {
730 .type = EM28XX_VMUX_TELEVISION,
731 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300732 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300733 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300734 }, {
735 .type = EM28XX_VMUX_COMPOSITE1,
736 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300737 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300738 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300739 }, {
740 .type = EM28XX_VMUX_SVIDEO,
741 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300742 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300743 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300744 } },
745 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300746 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
747 .name = "AMD ATI TV Wonder HD 600",
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300748 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300749 .tuner_gpio = default_tuner_gpio,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300750 .mts_firmware = 1,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300751 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300752 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller60245e82008-11-16 08:03:53 -0300753 .ir_codes = ir_codes_ati_tv_wonder_hd_600,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300754 .decoder = EM28XX_TVP5150,
755 .input = { {
756 .type = EM28XX_VMUX_TELEVISION,
757 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300758 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300759 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300760 }, {
761 .type = EM28XX_VMUX_COMPOSITE1,
762 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300763 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300764 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300765 }, {
766 .type = EM28XX_VMUX_SVIDEO,
767 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300768 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300769 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300770 } },
771 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300772 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300773 .name = "Terratec Hybrid XS",
774 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300775 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300776 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -0300777 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300778 .dvb_gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300779 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300780 .type = EM28XX_VMUX_TELEVISION,
781 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300782 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300783 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300784 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300785 .type = EM28XX_VMUX_COMPOSITE1,
786 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300787 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300788 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300789 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300790 .type = EM28XX_VMUX_SVIDEO,
791 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300792 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300793 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300794 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300795 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300796 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
797 as Prodigy XS with a different PID, let's keep it separated for now
798 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300799 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
800 .name = "Terratec Prodigy XS",
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300801 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300802 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300803 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300804 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300805 .type = EM28XX_VMUX_TELEVISION,
806 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300807 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300808 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300809 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300810 .type = EM28XX_VMUX_COMPOSITE1,
811 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300812 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300813 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300814 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300815 .type = EM28XX_VMUX_SVIDEO,
816 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300817 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300818 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300819 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300820 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800821 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300822 .name = "MSI VOX USB 2.0",
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300823 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
824 .tda9887_conf = TDA9887_PRESENT |
825 TDA9887_PORT1_ACTIVE |
826 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300827 .max_range_640_480 = 1,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300828 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300829 .input = { {
830 .type = EM28XX_VMUX_TELEVISION,
831 .vmux = SAA7115_COMPOSITE4,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300832 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300833 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300834 .type = EM28XX_VMUX_COMPOSITE1,
835 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300836 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300837 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300838 .type = EM28XX_VMUX_SVIDEO,
839 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300840 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300841 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800842 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800843 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
844 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800845 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800846 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
847 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300848 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300849 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800850 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300851 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300852 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300853 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800854 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300855 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300856 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300857 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800858 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300859 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300860 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300861 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800862 },
Aron Szabo59d07f12008-07-27 13:47:52 -0300863 [EM2800_BOARD_GRABBEEX_USB2800] = {
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -0300864 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
865 .is_em2800 = 1,
866 .decoder = EM28XX_SAA711X,
867 .tuner_type = TUNER_ABSENT, /* capture only board */
868 .input = { {
Aron Szabo59d07f12008-07-27 13:47:52 -0300869 .type = EM28XX_VMUX_COMPOSITE1,
870 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300871 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -0300872 }, {
873 .type = EM28XX_VMUX_SVIDEO,
874 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300875 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -0300876 } },
877 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800878 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
879 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800880 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800881 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
882 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300883 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300884 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800885 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300886 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300887 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300888 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800889 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300890 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300891 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300892 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800893 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300894 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300895 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300896 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800897 },
898 [EM2800_BOARD_KWORLD_USB2800] = {
899 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800900 .is_em2800 = 1,
Michael Krufkyab8b8702008-04-22 14:46:05 -0300901 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800902 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300903 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300904 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800905 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300906 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300907 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300908 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800909 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300910 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300911 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300912 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800913 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300914 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300915 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300916 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800917 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800918 [EM2820_BOARD_PINNACLE_DVC_90] = {
Douglas Schilling Landgrafac40d9e2009-02-25 16:55:48 -0300919 .name = "Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker",
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300920 .tuner_type = TUNER_ABSENT, /* capture only board */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300921 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300922 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800923 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300924 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300925 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300926 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800927 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300928 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300929 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300930 } },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800931 },
Sascha Sommer43625592007-11-03 15:05:07 -0300932 [EM2800_BOARD_VGEAR_POCKETTV] = {
933 .name = "V-Gear PocketTV",
934 .is_em2800 = 1,
Sascha Sommer43625592007-11-03 15:05:07 -0300935 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
936 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300937 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300938 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -0300939 .type = EM28XX_VMUX_TELEVISION,
940 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300941 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300942 }, {
Sascha Sommer43625592007-11-03 15:05:07 -0300943 .type = EM28XX_VMUX_COMPOSITE1,
944 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300945 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300946 }, {
Sascha Sommer43625592007-11-03 15:05:07 -0300947 .type = EM28XX_VMUX_SVIDEO,
948 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300949 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300950 } },
Sascha Sommer43625592007-11-03 15:05:07 -0300951 },
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -0300952 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = {
953 .name = "Pixelview PlayTV Box 4 USB 2.0",
954 .tda9887_conf = TDA9887_PRESENT,
955 .tuner_type = TUNER_YMEC_TVF_5533MF,
956 .decoder = EM28XX_SAA711X,
957 .input = { {
958 .type = EM28XX_VMUX_TELEVISION,
959 .vmux = SAA7115_COMPOSITE2,
960 .amux = EM28XX_AMUX_VIDEO,
961 .aout = EM28XX_AOUT_MONO | /* I2S */
962 EM28XX_AOUT_MASTER, /* Line out pin */
963 }, {
964 .type = EM28XX_VMUX_COMPOSITE1,
965 .vmux = SAA7115_COMPOSITE0,
966 .amux = EM28XX_AMUX_LINE_IN,
967 }, {
968 .type = EM28XX_VMUX_SVIDEO,
969 .vmux = SAA7115_SVIDEO3,
970 .amux = EM28XX_AMUX_LINE_IN,
971 } },
972 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300973 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
Douglas Schilling Landgraf1f372a92009-02-25 16:54:31 -0300974 .name = "SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0",
Douglas Schilling Landgraf5609cfd2008-12-27 21:39:35 -0300975 .has_snapshot_button = 1,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300976 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300977 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300978 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300979 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300980 .type = EM28XX_VMUX_TELEVISION,
981 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab30e4ac72008-11-20 13:43:05 -0300982 .amux = EM28XX_AMUX_VIDEO,
983 .aout = EM28XX_AOUT_MONO | /* I2S */
984 EM28XX_AOUT_MASTER, /* Line out pin */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300985 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300986 .type = EM28XX_VMUX_COMPOSITE1,
987 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300988 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300989 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300990 .type = EM28XX_VMUX_SVIDEO,
991 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300992 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300993 } },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300994 },
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -0300995 [EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300996 .name = "PointNix Intra-Oral Camera",
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -0300997 .has_snapshot_button = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300998 .tda9887_conf = TDA9887_PRESENT,
999 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001000 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001001 .input = { {
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001002 .type = EM28XX_VMUX_SVIDEO,
1003 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001004 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001005 } },
1006 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001007 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
1008 .name = "MSI DigiVox A/D",
1009 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001010 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001011 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001012 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001013 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001014 .type = EM28XX_VMUX_TELEVISION,
1015 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001016 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001017 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001018 }, {
1019 .type = EM28XX_VMUX_COMPOSITE1,
1020 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001021 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001022 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001023 }, {
1024 .type = EM28XX_VMUX_SVIDEO,
1025 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001026 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001027 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001028 } },
1029 },
1030 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
1031 .name = "MSI DigiVox A/D II",
1032 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001033 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001034 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001035 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001036 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001037 .type = EM28XX_VMUX_TELEVISION,
1038 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001039 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001040 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001041 }, {
1042 .type = EM28XX_VMUX_COMPOSITE1,
1043 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001044 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001045 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001046 }, {
1047 .type = EM28XX_VMUX_SVIDEO,
1048 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001049 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001050 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001051 } },
1052 },
1053 [EM2880_BOARD_KWORLD_DVB_305U] = {
1054 .name = "KWorld DVB-T 305U",
1055 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001056 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001057 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001058 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001059 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001060 .type = EM28XX_VMUX_TELEVISION,
1061 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001062 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001063 }, {
1064 .type = EM28XX_VMUX_COMPOSITE1,
1065 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001066 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001067 }, {
1068 .type = EM28XX_VMUX_SVIDEO,
1069 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001070 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001071 } },
1072 },
1073 [EM2880_BOARD_KWORLD_DVB_310U] = {
1074 .name = "KWorld DVB-T 310U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001075 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001076 .tuner_gpio = default_tuner_gpio,
Darron Broadda3808e2008-09-30 02:46:41 -03001077 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001078 .dvb_gpio = default_digital,
Darron Broadda3808e2008-09-30 02:46:41 -03001079 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001080 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001081 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001082 .type = EM28XX_VMUX_TELEVISION,
1083 .vmux = TVP5150_COMPOSITE0,
Darron Broadda3808e2008-09-30 02:46:41 -03001084 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001085 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001086 }, {
1087 .type = EM28XX_VMUX_COMPOSITE1,
1088 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001089 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001090 .gpio = default_analog,
Darron Broadda3808e2008-09-30 02:46:41 -03001091 }, { /* S-video has not been tested yet */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001092 .type = EM28XX_VMUX_SVIDEO,
1093 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001094 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001095 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001096 } },
1097 },
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001098 [EM2880_BOARD_EMPIRE_DUAL_TV] = {
1099 .name = "Empire dual TV",
1100 .tuner_type = TUNER_XC2028,
1101 .tuner_gpio = default_tuner_gpio,
1102 .has_dvb = 1,
1103 .dvb_gpio = default_digital,
1104 .mts_firmware = 1,
1105 .decoder = EM28XX_TVP5150,
1106 .input = { {
1107 .type = EM28XX_VMUX_TELEVISION,
1108 .vmux = TVP5150_COMPOSITE0,
1109 .amux = EM28XX_AMUX_VIDEO,
1110 .gpio = default_analog,
1111 }, {
1112 .type = EM28XX_VMUX_COMPOSITE1,
1113 .vmux = TVP5150_COMPOSITE1,
1114 .amux = EM28XX_AMUX_LINE_IN,
1115 .gpio = default_analog,
1116 }, {
1117 .type = EM28XX_VMUX_SVIDEO,
1118 .vmux = TVP5150_SVIDEO,
1119 .amux = EM28XX_AMUX_LINE_IN,
1120 .gpio = default_analog,
1121 } },
1122 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001123 [EM2881_BOARD_DNT_DA2_HYBRID] = {
1124 .name = "DNT DA2 Hybrid",
1125 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001126 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001127 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001128 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001129 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001130 .type = EM28XX_VMUX_TELEVISION,
1131 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001132 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001133 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001134 }, {
1135 .type = EM28XX_VMUX_COMPOSITE1,
1136 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001137 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001138 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001139 }, {
1140 .type = EM28XX_VMUX_SVIDEO,
1141 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001142 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001143 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001144 } },
1145 },
1146 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1147 .name = "Pinnacle Hybrid Pro",
1148 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001149 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001150 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001151 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001152 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001153 .type = EM28XX_VMUX_TELEVISION,
1154 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001155 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001156 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001157 }, {
1158 .type = EM28XX_VMUX_COMPOSITE1,
1159 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001160 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001161 .gpio = default_analog,
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,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001166 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001167 } },
1168 },
1169 [EM2882_BOARD_PINNACLE_HYBRID_PRO] = {
1170 .name = "Pinnacle Hybrid Pro (2)",
1171 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001172 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001173 .tuner_gpio = default_tuner_gpio,
Eugeniy Meshcheryakova674a3b2008-08-01 08:23: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,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001179 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001180 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001181 }, {
1182 .type = EM28XX_VMUX_COMPOSITE1,
1183 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001184 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001185 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001186 }, {
1187 .type = EM28XX_VMUX_SVIDEO,
1188 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001189 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001190 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001191 } },
1192 },
1193 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1194 .name = "Kworld VS-DVB-T 323UR",
1195 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001196 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001197 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001198 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001199 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001200 .type = EM28XX_VMUX_TELEVISION,
1201 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001202 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001203 }, {
1204 .type = EM28XX_VMUX_COMPOSITE1,
1205 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001206 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001207 }, {
1208 .type = EM28XX_VMUX_SVIDEO,
1209 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001210 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001211 } },
1212 },
1213 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
1214 .name = "Terratec Hybrid XS (em2882)",
1215 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001216 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001217 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001218 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001219 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001220 .type = EM28XX_VMUX_TELEVISION,
1221 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001222 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001223 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001224 }, {
1225 .type = EM28XX_VMUX_COMPOSITE1,
1226 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001227 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001228 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001229 }, {
1230 .type = EM28XX_VMUX_SVIDEO,
1231 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001232 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001233 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001234 } },
1235 },
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001236 [EM2883_BOARD_KWORLD_HYBRID_330U] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001237 .name = "Kworld PlusTV HD Hybrid 330",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001238 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001239 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001240 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabbe2c6db2008-12-09 15:43:10 -03001241 .mts_firmware = 1,
1242 .has_dvb = 1,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001243 .dvb_gpio = kworld_330u_digital,
1244 .xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001245 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1246 EM28XX_I2C_EEPROM_ON_BOARD |
1247 EM28XX_I2C_EEPROM_KEY_VALID,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001248 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001249 .type = EM28XX_VMUX_TELEVISION,
1250 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001251 .amux = EM28XX_AMUX_VIDEO,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001252 .gpio = kworld_330u_analog,
1253 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001254 }, {
1255 .type = EM28XX_VMUX_COMPOSITE1,
1256 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001257 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001258 .gpio = kworld_330u_analog,
1259 .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001260 }, {
1261 .type = EM28XX_VMUX_SVIDEO,
1262 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001263 .amux = EM28XX_AMUX_LINE_IN,
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001264 .gpio = kworld_330u_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001265 } },
1266 },
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001267 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
Vitaly Woold3603342008-07-27 14:10:11 -03001268 .name = "Compro VideoMate ForYou/Stereo",
Vitaly Woold3603342008-07-27 14:10:11 -03001269 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001270 .tvaudio_addr = 0xb0,
Vitaly Woold3603342008-07-27 14:10:11 -03001271 .tda9887_conf = TDA9887_PRESENT,
1272 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03001273 .adecoder = EM28XX_TVAUDIO,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001274 .mute_gpio = compro_mute_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001275 .input = { {
Vitaly Woold3603342008-07-27 14:10:11 -03001276 .type = EM28XX_VMUX_TELEVISION,
1277 .vmux = TVP5150_COMPOSITE0,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001278 .amux = EM28XX_AMUX_VIDEO,
1279 .gpio = compro_unmute_tv_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001280 }, {
1281 .type = EM28XX_VMUX_SVIDEO,
1282 .vmux = TVP5150_SVIDEO,
1283 .amux = EM28XX_AMUX_LINE_IN,
Vitaly Wool2bd1d9e2009-03-04 08:27:52 -03001284 .gpio = compro_unmute_svid_gpio,
Vitaly Woold3603342008-07-27 14:10:11 -03001285 } },
1286 },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001287 [EM2860_BOARD_KAIOMY_TVNPC_U2] = {
1288 .name = "Kaiomy TVnPC U2",
1289 .vchannels = 3,
1290 .tuner_type = TUNER_XC2028,
1291 .tuner_addr = 0x61,
1292 .mts_firmware = 1,
1293 .decoder = EM28XX_TVP5150,
1294 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab9fc2c5e2009-02-11 14:15:14 -03001295 .ir_codes = ir_codes_kaiomy,
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001296 .input = { {
1297 .type = EM28XX_VMUX_TELEVISION,
1298 .vmux = TVP5150_COMPOSITE0,
1299 .amux = EM28XX_AMUX_VIDEO,
1300
1301 }, {
1302 .type = EM28XX_VMUX_COMPOSITE1,
1303 .vmux = TVP5150_COMPOSITE1,
1304 .amux = EM28XX_AMUX_LINE_IN,
1305 }, {
1306 .type = EM28XX_VMUX_SVIDEO,
1307 .vmux = TVP5150_SVIDEO,
1308 .amux = EM28XX_AMUX_LINE_IN,
1309 } },
1310 .radio = {
1311 .type = EM28XX_RADIO,
1312 .amux = EM28XX_AMUX_LINE_IN,
1313 }
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03001314 },
1315 [EM2860_BOARD_EASYCAP] = {
1316 .name = "Easy Cap Capture DC-60",
1317 .vchannels = 2,
1318 .tuner_type = TUNER_ABSENT,
1319 .decoder = EM28XX_SAA711X,
1320 .input = { {
1321 .type = EM28XX_VMUX_COMPOSITE1,
1322 .vmux = SAA7115_COMPOSITE0,
1323 .amux = EM28XX_AMUX_LINE_IN,
1324 }, {
1325 .type = EM28XX_VMUX_SVIDEO,
1326 .vmux = SAA7115_SVIDEO3,
1327 .amux = EM28XX_AMUX_LINE_IN,
1328 } },
1329 },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03001330 [EM2820_BOARD_IODATA_GVMVP_SZ] = {
1331 .name = "IO-DATA GV-MVP/SZ",
1332 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
1333 .tuner_gpio = default_tuner_gpio,
1334 .tda9887_conf = TDA9887_PRESENT,
1335 .decoder = EM28XX_TVP5150,
1336 .input = { {
1337 .type = EM28XX_VMUX_TELEVISION,
1338 .vmux = TVP5150_COMPOSITE0,
1339 .amux = EM28XX_AMUX_VIDEO,
1340 }, { /* Composite has not been tested yet */
1341 .type = EM28XX_VMUX_COMPOSITE1,
1342 .vmux = TVP5150_COMPOSITE1,
1343 .amux = EM28XX_AMUX_VIDEO,
1344 }, { /* S-video has not been tested yet */
1345 .type = EM28XX_VMUX_SVIDEO,
1346 .vmux = TVP5150_SVIDEO,
1347 .amux = EM28XX_AMUX_VIDEO,
1348 } },
1349 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001350};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001351const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001352
1353/* table of devices that work with this driver */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001354struct usb_device_id em28xx_id_table[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001355 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001356 .driver_info = EM2750_BOARD_UNKNOWN },
1357 { USB_DEVICE(0xeb1a, 0x2751),
1358 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001359 { USB_DEVICE(0xeb1a, 0x2800),
1360 .driver_info = EM2800_BOARD_UNKNOWN },
1361 { USB_DEVICE(0xeb1a, 0x2820),
1362 .driver_info = EM2820_BOARD_UNKNOWN },
1363 { USB_DEVICE(0xeb1a, 0x2821),
Devin Heitmuellerc665f4d2008-12-16 23:35:23 -03001364 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001365 { USB_DEVICE(0xeb1a, 0x2860),
1366 .driver_info = EM2820_BOARD_UNKNOWN },
1367 { USB_DEVICE(0xeb1a, 0x2861),
1368 .driver_info = EM2820_BOARD_UNKNOWN },
1369 { USB_DEVICE(0xeb1a, 0x2870),
1370 .driver_info = EM2820_BOARD_UNKNOWN },
1371 { USB_DEVICE(0xeb1a, 0x2881),
1372 .driver_info = EM2820_BOARD_UNKNOWN },
1373 { USB_DEVICE(0xeb1a, 0x2883),
1374 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001375 { USB_DEVICE(0xeb1a, 0xe300),
1376 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001377 { USB_DEVICE(0xeb1a, 0xe303),
1378 .driver_info = EM2860_BOARD_KAIOMY_TVNPC_U2 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001379 { USB_DEVICE(0xeb1a, 0xe305),
1380 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
1381 { USB_DEVICE(0xeb1a, 0xe310),
1382 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
1383 { USB_DEVICE(0xeb1a, 0xa316),
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001384 .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001385 { USB_DEVICE(0xeb1a, 0xe320),
1386 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
1387 { USB_DEVICE(0xeb1a, 0xe323),
1388 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
1389 { USB_DEVICE(0xeb1a, 0xe350),
1390 .driver_info = EM2870_BOARD_KWORLD_350U },
1391 { USB_DEVICE(0xeb1a, 0xe355),
1392 .driver_info = EM2870_BOARD_KWORLD_355U },
1393 { USB_DEVICE(0xeb1a, 0x2801),
1394 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
1395 { USB_DEVICE(0xeb1a, 0xe357),
1396 .driver_info = EM2870_BOARD_KWORLD_355U },
Douglas Schilling Landgrafac40d9e2009-02-25 16:55:48 -03001397 { USB_DEVICE(0x1b80, 0xe302),
1398 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 }, /* Kaiser Baas Video to DVD maker */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001399 { USB_DEVICE(0x0ccd, 0x0036),
1400 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001401 { USB_DEVICE(0x0ccd, 0x004c),
1402 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
1403 { USB_DEVICE(0x0ccd, 0x004f),
1404 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
1405 { USB_DEVICE(0x0ccd, 0x005e),
1406 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
1407 { USB_DEVICE(0x0ccd, 0x0042),
1408 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS },
1409 { USB_DEVICE(0x0ccd, 0x0043),
1410 .driver_info = EM2870_BOARD_TERRATEC_XS },
1411 { USB_DEVICE(0x0ccd, 0x0047),
1412 .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS },
1413 { USB_DEVICE(0x185b, 0x2870),
1414 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03001415 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001416 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001417 { USB_DEVICE(0x2040, 0x4200),
1418 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03001419 { USB_DEVICE(0x2040, 0x4201),
1420 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001421 { USB_DEVICE(0x2040, 0x6500),
1422 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03001423 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001424 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001425 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001426 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001427 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001428 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001429 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001430 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001431 { USB_DEVICE(0x2040, 0x651f),
1432 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001433 { USB_DEVICE(0x0438, 0xb002),
1434 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001435 { USB_DEVICE(0x2001, 0xf112),
1436 .driver_info = EM2820_BOARD_DLINK_USB_TV },
1437 { USB_DEVICE(0x2304, 0x0207),
1438 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1439 { USB_DEVICE(0x2304, 0x0208),
1440 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
1441 { USB_DEVICE(0x2304, 0x021a),
1442 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1443 { USB_DEVICE(0x2304, 0x0226),
1444 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO },
1445 { USB_DEVICE(0x2304, 0x0227),
1446 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
1447 { USB_DEVICE(0x0413, 0x6023),
1448 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
1449 { USB_DEVICE(0x093b, 0xa005),
1450 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03001451 { USB_DEVICE(0x04bb, 0x0515),
1452 .driver_info = EM2820_BOARD_IODATA_GVMVP_SZ },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001453 { },
1454};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001455MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001456
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001457/*
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001458 * EEPROM hash table for devices with generic USB IDs
1459 */
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001460static struct em28xx_hash_table em28xx_eeprom_hash[] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001461 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001462 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001463 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03001464 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001465 {0x9567eb1a, EM2880_BOARD_EMPIRE_DUAL_TV, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001466};
1467
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001468/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03001469static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001470 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
1471 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001472 {0x1ba50080, EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA, TUNER_ABSENT},
Douglas Schilling Landgraff7fe3e62009-01-19 09:31:55 -03001473 {0xc51200e3, EM2820_BOARD_GADMEI_TVR200, TUNER_LG_PAL_NEW_TAPC},
Sascha Sommerfad7b952007-11-04 08:06:48 -03001474};
1475
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001476/* I2C possible address to saa7115, tvp5150, msp3400, tvaudio */
1477static unsigned short saa711x_addrs[] = {
1478 0x4a >> 1, 0x48 >> 1, /* SAA7111, SAA7111A and SAA7113 */
1479 0x42 >> 1, 0x40 >> 1, /* SAA7114, SAA7115 and SAA7118 */
1480 I2C_CLIENT_END };
1481
1482static unsigned short tvp5150_addrs[] = {
1483 0xb8 >> 1,
1484 0xba >> 1,
1485 I2C_CLIENT_END
1486};
1487
1488static unsigned short msp3400_addrs[] = {
1489 0x80 >> 1,
1490 0x88 >> 1,
1491 I2C_CLIENT_END
1492};
1493
Michael Krufkyd7cba042008-09-12 13:31:45 -03001494int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001495{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001496 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001497 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001498
1499 if (dev->tuner_type != TUNER_XC2028)
1500 return 0;
1501
1502 if (command != XC2028_TUNER_RESET)
1503 return 0;
1504
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001505 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001506
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001507 return rc;
1508}
1509EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
1510
Nicola Soranzoa1a6ee72009-02-10 23:28:24 -03001511static inline void em28xx_set_model(struct em28xx *dev)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001512{
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001513 memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board));
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03001514
1515 /* Those are the default values for the majority of boards
1516 Use those values if not specified otherwise at boards entry
1517 */
1518 if (!dev->board.xclk)
1519 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
1520 EM28XX_XCLK_FREQUENCY_12MHZ;
1521
1522 if (!dev->board.i2c_speed)
1523 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1524 EM28XX_I2C_FREQ_100_KHZ;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001525}
1526
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001527/* Since em28xx_pre_card_setup() requires a proper dev->model,
1528 * this won't work for boards with generic PCI IDs
1529 */
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001530void em28xx_pre_card_setup(struct em28xx *dev)
1531{
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001532 int rc;
1533
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001534 em28xx_set_model(dev);
1535
Mauro Carvalho Chehab8c239982008-11-28 23:46:43 -03001536 em28xx_info("Identified as %s (card=%d)\n",
1537 dev->board.name, dev->model);
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001538
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001539 /* Set the default GPO/GPIO for legacy devices */
1540 dev->reg_gpo_num = EM2880_R04_GPO;
1541 dev->reg_gpio_num = EM28XX_R08_GPIO;
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001542
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001543 dev->wait_after_write = 5;
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001544
1545 /* Based on the Chip ID, set the device configuration */
Mauro Carvalho Chehab41facaa2008-04-17 21:44:58 -03001546 rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001547 if (rc > 0) {
Devin Heitmueller600bd7f2008-11-12 02:05:02 -03001548 dev->chip_id = rc;
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001549
1550 switch (dev->chip_id) {
Devin Heitmueller67c96f62008-11-18 05:05:46 -03001551 case CHIP_ID_EM2750:
1552 em28xx_info("chip ID is em2750\n");
1553 break;
Mauro Carvalho Chehabf09fb532008-11-16 10:40:21 -03001554 case CHIP_ID_EM2820:
1555 em28xx_info("chip ID is em2820\n");
1556 break;
1557 case CHIP_ID_EM2840:
1558 em28xx_info("chip ID is em2840\n");
1559 break;
Devin Heitmuellera8a1f8c2008-06-10 12:35:42 -03001560 case CHIP_ID_EM2860:
1561 em28xx_info("chip ID is em2860\n");
1562 break;
Devin Heitmuellerb1fa26c2008-12-16 23:15:33 -03001563 case CHIP_ID_EM2870:
1564 em28xx_info("chip ID is em2870\n");
1565 dev->wait_after_write = 0;
1566 break;
Devin Heitmueller5caeba02008-11-12 02:04:48 -03001567 case CHIP_ID_EM2874:
1568 em28xx_info("chip ID is em2874\n");
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001569 dev->reg_gpio_num = EM2874_R80_GPIO;
Devin Heitmueller5caeba02008-11-12 02:04:48 -03001570 dev->wait_after_write = 0;
1571 break;
Mauro Carvalho Chehab2ba890e2008-04-17 21:42:58 -03001572 case CHIP_ID_EM2883:
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001573 em28xx_info("chip ID is em2882/em2883\n");
1574 dev->wait_after_write = 0;
1575 break;
1576 default:
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001577 em28xx_info("em28xx chip ID = %d\n", dev->chip_id);
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001578 }
1579 }
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001580
1581 /* Prepopulate cached GPO register content */
1582 rc = em28xx_read_reg(dev, dev->reg_gpo_num);
1583 if (rc >= 0)
1584 dev->reg_gpo = rc;
1585
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03001586 /* Set the initial XCLK and I2C clock values based on the board
1587 definition */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001588 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
1589 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001590 msleep(50);
1591
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001592 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001593 switch (dev->model) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001594 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001595 /* FIXME guess */
1596 /* Turn on analog audio output */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001597 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001598 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001599 case EM2861_BOARD_KWORLD_PVRTV_300U:
1600 case EM2880_BOARD_KWORLD_DVB_305U:
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001601 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001602 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001603 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001604 msleep(10);
1605 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001606 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001607 /* TODO: someone can do some cleanup here...
1608 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001609 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001610 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001611 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001612 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001613 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001614 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001615 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001616 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001617 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001618 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001619 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001620 mdelay(70);
1621 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001622 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001623 /* this device needs some gpio writes to get the DVB-T
1624 demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001625 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001626 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001627 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001628 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001629 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001630 mdelay(70);
1631 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001632 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001633 /* this device needs some gpio writes to get the
1634 DVB-T demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001635 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001636 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001637 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001638 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001639 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001640 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001641 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001642 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001643 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001644 /* enables audio for that devices */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001645 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001646 break;
Mauro Carvalho Chehab0bf4f6c2009-02-11 14:13:20 -03001647
1648 case EM2860_BOARD_KAIOMY_TVNPC_U2:
1649 em28xx_write_regs(dev, EM28XX_R0F_XCLK, "\x07", 1);
1650 em28xx_write_regs(dev, EM28XX_R06_I2C_CLK, "\x40", 1);
1651 em28xx_write_regs(dev, 0x0d, "\x42", 1);
1652 em28xx_write_regs(dev, 0x08, "\xfd", 1);
1653 msleep(10);
1654 em28xx_write_regs(dev, 0x08, "\xff", 1);
1655 msleep(10);
1656 em28xx_write_regs(dev, 0x08, "\x7f", 1);
1657 msleep(10);
1658 em28xx_write_regs(dev, 0x08, "\x6b", 1);
1659
1660 break;
Mauro Carvalho Chehab56ee3802009-02-11 14:18:36 -03001661 case EM2860_BOARD_EASYCAP:
1662 em28xx_write_regs(dev, 0x08, "\xf8", 1);
1663 break;
1664
Indika Katugampalaf74a61e32009-02-11 11:13:05 -03001665 case EM2820_BOARD_IODATA_GVMVP_SZ:
1666 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
1667 msleep(70);
1668 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
1669 msleep(10);
1670 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
1671 msleep(70);
1672 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
1673 msleep(70);
1674 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001675 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001676
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001677 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001678 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
1679
1680 /* Unlock device */
Mauro Carvalho Chehab2fe3e2e2008-11-27 09:10:40 -03001681 em28xx_set_mode(dev, EM28XX_SUSPEND);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001682}
1683
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001684static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001685{
1686 memset(ctl, 0, sizeof(*ctl));
1687
1688 ctl->fname = XC2028_DEFAULT_FIRMWARE;
1689 ctl->max_len = 64;
1690 ctl->mts = em28xx_boards[dev->model].mts_firmware;
1691
1692 switch (dev->model) {
Douglas Schilling Landgrafe5db5d42009-04-09 18:24:34 -03001693 case EM2880_BOARD_EMPIRE_DUAL_TV:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001694 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
1695 ctl->demod = XC3028_FE_ZARLINK456;
1696 break;
reinhard schwab655b8402008-07-26 10:47:00 -03001697 case EM2880_BOARD_TERRATEC_HYBRID_XS:
1698 ctl->demod = XC3028_FE_ZARLINK456;
1699 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001700 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
1701 /* djh - Not sure which demod we need here */
1702 ctl->demod = XC3028_FE_DEFAULT;
1703 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03001704 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
1705 ctl->demod = XC3028_FE_DEFAULT;
1706 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
1707 break;
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001708 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001709 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001710 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001711 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03001712 ctl->demod = XC3028_FE_DEFAULT;
1713 break;
Robert Krakora6e7b9ea2009-01-18 21:59:34 -03001714 case EM2883_BOARD_KWORLD_HYBRID_330U:
1715 ctl->demod = XC3028_FE_CHINA;
1716 ctl->fname = XC2028_DEFAULT_FIRMWARE;
1717 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001718 default:
1719 ctl->demod = XC3028_FE_OREN538;
1720 }
1721}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001722
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001723static void em28xx_tuner_setup(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001724{
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001725 struct tuner_setup tun_setup;
1726 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001727
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001728 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001729 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001730
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001731 memset(&tun_setup, 0, sizeof(tun_setup));
1732
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001733 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001734 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001735
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001736 if (dev->board.radio.type) {
1737 tun_setup.type = dev->board.radio.type;
1738 tun_setup.addr = dev->board.radio_addr;
1739
1740 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
1741 }
1742
1743 if ((dev->tuner_type != TUNER_ABSENT) && (dev->tuner_type)) {
1744 tun_setup.type = dev->tuner_type;
1745 tun_setup.addr = dev->tuner_addr;
1746
1747 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_type_addr, &tun_setup);
1748 }
1749
1750 if (dev->tda9887_conf) {
1751 struct v4l2_priv_tun_config tda9887_cfg;
1752
1753 tda9887_cfg.tuner = TUNER_TDA9887;
1754 tda9887_cfg.priv = &dev->tda9887_conf;
1755
1756 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &tda9887_cfg);
1757 }
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001758
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001759 if (dev->tuner_type == TUNER_XC2028) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001760 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001761 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001762
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001763 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
1764 memset(&ctl, 0, sizeof(ctl));
1765
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001766 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001767
1768 xc2028_cfg.tuner = TUNER_XC2028;
1769 xc2028_cfg.priv = &ctl;
1770
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001771 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_config, &xc2028_cfg);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001772 }
1773
1774 /* configure tuner */
1775 f.tuner = 0;
1776 f.type = V4L2_TUNER_ANALOG_TV;
1777 f.frequency = 9076; /* just a magic number */
1778 dev->ctl_freq = f.frequency;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001779 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_frequency, &f);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001780}
1781
1782static int em28xx_hint_board(struct em28xx *dev)
1783{
1784 int i;
1785
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001786 /* HINT method: EEPROM
1787 *
1788 * This method works only for boards with eeprom.
1789 * Uses a hash of all eeprom bytes. The hash should be
1790 * unique for a vendor/tuner pair.
1791 * There are a high chance that tuners for different
1792 * video standards produce different hashes.
1793 */
1794 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
1795 if (dev->hash == em28xx_eeprom_hash[i].hash) {
1796 dev->model = em28xx_eeprom_hash[i].model;
1797 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001798
1799 em28xx_errdev("Your board has no unique USB ID.\n");
1800 em28xx_errdev("A hint were successfully done, "
1801 "based on eeprom hash.\n");
1802 em28xx_errdev("This method is not 100%% failproof.\n");
1803 em28xx_errdev("If the board were missdetected, "
1804 "please email this log to:\n");
1805 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03001806 " <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001807 em28xx_errdev("Board detected as %s\n",
1808 em28xx_boards[dev->model].name);
1809
1810 return 0;
1811 }
1812 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03001813
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001814 /* HINT method: I2C attached devices
1815 *
1816 * This method works for all boards.
1817 * Uses a hash of i2c scanned devices.
1818 * Devices with the same i2c attached chips will
1819 * be considered equal.
1820 * This method is less precise than the eeprom one.
1821 */
1822
Sascha Sommerfad7b952007-11-04 08:06:48 -03001823 /* user did not request i2c scanning => do it now */
1824 if (!dev->i2c_hash)
1825 em28xx_do_i2c_scan(dev);
1826
1827 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
1828 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
1829 dev->model = em28xx_i2c_hash[i].model;
1830 dev->tuner_type = em28xx_i2c_hash[i].tuner;
1831 em28xx_errdev("Your board has no unique USB ID.\n");
1832 em28xx_errdev("A hint were successfully done, "
1833 "based on i2c devicelist hash.\n");
1834 em28xx_errdev("This method is not 100%% failproof.\n");
1835 em28xx_errdev("If the board were missdetected, "
1836 "please email this log to:\n");
1837 em28xx_errdev("\tV4L Mailing List "
Alexey Klimov51caf912009-01-25 12:53:09 -03001838 " <linux-media@vger.kernel.org>\n");
Sascha Sommerfad7b952007-11-04 08:06:48 -03001839 em28xx_errdev("Board detected as %s\n",
1840 em28xx_boards[dev->model].name);
1841
1842 return 0;
1843 }
1844 }
1845
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001846 em28xx_errdev("Your board has no unique USB ID and thus need a "
1847 "hint to be detected.\n");
1848 em28xx_errdev("You may try to use card=<n> insmod option to "
1849 "workaround that.\n");
1850 em28xx_errdev("Please send an email with this log to:\n");
Alexey Klimov51caf912009-01-25 12:53:09 -03001851 em28xx_errdev("\tV4L Mailing List <linux-media@vger.kernel.org>\n");
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001852 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03001853 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001854
1855 em28xx_errdev("Here is a list of valid choices for the card=<n>"
1856 " insmod option:\n");
1857 for (i = 0; i < em28xx_bcount; i++) {
1858 em28xx_errdev(" card=%d -> %s\n",
1859 i, em28xx_boards[i].name);
1860 }
1861 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001862}
1863
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001864/* ----------------------------------------------------------------------- */
1865void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir)
1866{
1867 if (disable_ir) {
1868 ir->get_key = NULL;
1869 return ;
1870 }
1871
1872 /* detect & configure */
1873 switch (dev->model) {
1874 case (EM2800_BOARD_UNKNOWN):
1875 break;
1876 case (EM2820_BOARD_UNKNOWN):
1877 break;
1878 case (EM2800_BOARD_TERRATEC_CINERGY_200):
1879 case (EM2820_BOARD_TERRATEC_CINERGY_250):
1880 ir->ir_codes = ir_codes_em_terratec;
1881 ir->get_key = em28xx_get_key_terratec;
1882 snprintf(ir->c.name, sizeof(ir->c.name),
1883 "i2c IR (EM28XX Terratec)");
1884 break;
1885 case (EM2820_BOARD_PINNACLE_USB_2):
1886 ir->ir_codes = ir_codes_pinnacle_grey;
1887 ir->get_key = em28xx_get_key_pinnacle_usb_grey;
1888 snprintf(ir->c.name, sizeof(ir->c.name),
1889 "i2c IR (EM28XX Pinnacle PCTV)");
1890 break;
1891 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
1892 ir->ir_codes = ir_codes_hauppauge_new;
1893 ir->get_key = em28xx_get_key_em_haup;
1894 snprintf(ir->c.name, sizeof(ir->c.name),
1895 "i2c IR (EM2840 Hauppauge)");
1896 break;
1897 case (EM2820_BOARD_MSI_VOX_USB_2):
1898 break;
1899 case (EM2800_BOARD_LEADTEK_WINFAST_USBII):
1900 break;
1901 case (EM2800_BOARD_KWORLD_USB2800):
1902 break;
Aron Szabo59d07f12008-07-27 13:47:52 -03001903 case (EM2800_BOARD_GRABBEEX_USB2800):
1904 break;
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001905 }
1906}
1907
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001908void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001909{
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001910 em28xx_set_model(dev);
1911
1912 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
Mauro Carvalho Chehab31e05302008-11-20 18:47:37 -03001913 if (em28xx_boards[dev->model].tuner_addr)
1914 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001915
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001916 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001917 switch (dev->model) {
1918 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03001919 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001920 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001921 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001922 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001923 {
1924 struct tveeprom tv;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001925#ifdef CONFIG_MODULES
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001926 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001927#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001928 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001929
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001930 dev->i2c_client.addr = 0xa0 >> 1;
1931 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001932
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001933 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001934
Hans Verkuil38f9d302008-07-23 05:09:15 -03001935 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001936 dev->i2s_speed = 2048000;
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001937 dev->board.has_msp34xx = 1;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001938 }
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03001939#ifdef CONFIG_MODULES
1940 if (tv.has_ir)
1941 request_module("ir-kbd-i2c");
1942#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001943 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001944 }
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001945 case EM2820_BOARD_KWORLD_PVRTV2800RF:
1946 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001947 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001948 break;
1949 case EM2820_BOARD_UNKNOWN:
1950 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03001951 /*
1952 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
1953 *
1954 * This occurs because they share identical USB vendor and
1955 * product IDs.
1956 *
1957 * What we do here is look up the EEPROM hash of the K-WORLD
1958 * and if it is found then we decide that we do not have
1959 * a DIGIVOX and reset the device to the K-WORLD instead.
1960 *
1961 * This solution is only valid if they do not share eeprom
1962 * hash identities which has not been determined as yet.
1963 */
1964 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001965 if (!em28xx_hint_board(dev))
1966 em28xx_set_model(dev);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001967 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001968 }
1969
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001970 if (dev->board.has_snapshot_button)
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001971 em28xx_register_snapshot_button(dev);
1972
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001973 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001974 em28xx_errdev("\n\n");
1975 em28xx_errdev("The support for this board weren't "
1976 "valid yet.\n");
1977 em28xx_errdev("Please send a report of having this working\n");
1978 em28xx_errdev("not to V4L mailing list (and/or to other "
1979 "addresses)\n\n");
1980 }
1981
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001982 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001983 if (tuner >= 0)
1984 dev->tuner_type = tuner;
1985
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001986 /* request some modules */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001987 if (dev->board.has_msp34xx)
Hans Verkuile6574f22009-04-01 03:57:53 -03001988 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
1989 "msp3400", "msp3400", msp3400_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001990
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001991 if (dev->board.decoder == EM28XX_SAA711X)
Hans Verkuile6574f22009-04-01 03:57:53 -03001992 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
1993 "saa7115", "saa7115_auto", saa711x_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001994
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001995 if (dev->board.decoder == EM28XX_TVP5150)
Hans Verkuile6574f22009-04-01 03:57:53 -03001996 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev, &dev->i2c_adap,
1997 "tvp5150", "tvp5150", tvp5150_addrs);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03001998
Mauro Carvalho Chehabdf7fa092009-02-25 09:06:13 -03001999 if (dev->board.adecoder == EM28XX_TVAUDIO)
Hans Verkuile6574f22009-04-01 03:57:53 -03002000 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2001 "tvaudio", "tvaudio", dev->board.tvaudio_addr);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03002002
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002003 if (dev->board.tuner_type != TUNER_ABSENT) {
2004 int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03002005
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002006 if (dev->board.radio.type)
Hans Verkuile6574f22009-04-01 03:57:53 -03002007 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2008 "tuner", "tuner", dev->board.radio_addr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002009
2010 if (has_demod)
Hans Verkuile6574f22009-04-01 03:57:53 -03002011 v4l2_i2c_new_probed_subdev(&dev->v4l2_dev,
2012 &dev->i2c_adap, "tuner", "tuner",
2013 v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002014 if (dev->tuner_addr == 0) {
2015 enum v4l2_i2c_tuner_type type =
2016 has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
2017 struct v4l2_subdev *sd;
2018
Hans Verkuile6574f22009-04-01 03:57:53 -03002019 sd = v4l2_i2c_new_probed_subdev(&dev->v4l2_dev,
2020 &dev->i2c_adap, "tuner", "tuner",
2021 v4l2_i2c_tuner_addrs(type));
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002022
2023 if (sd)
2024 dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
2025 } else {
Hans Verkuile6574f22009-04-01 03:57:53 -03002026 v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
2027 "tuner", "tuner", dev->tuner_addr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002028 }
2029 }
2030
2031 em28xx_tuner_setup(dev);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03002032 em28xx_ir_init(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08002033}
Mauro Carvalho Chehabc8644052008-11-25 13:10:14 -03002034
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002035
2036#if defined(CONFIG_MODULES) && defined(MODULE)
2037static void request_module_async(struct work_struct *work)
2038{
2039 struct em28xx *dev = container_of(work,
2040 struct em28xx, request_module_wk);
2041
2042 if (dev->has_audio_class)
2043 request_module("snd-usb-audio");
2044 else if (dev->has_alsa_audio)
2045 request_module("em28xx-alsa");
2046
2047 if (dev->board.has_dvb)
2048 request_module("em28xx-dvb");
2049}
2050
2051static void request_modules(struct em28xx *dev)
2052{
2053 INIT_WORK(&dev->request_module_wk, request_module_async);
2054 schedule_work(&dev->request_module_wk);
2055}
2056#else
2057#define request_modules(dev)
2058#endif /* CONFIG_MODULES */
2059
2060/*
2061 * em28xx_realease_resources()
2062 * unregisters the v4l2,i2c and usb devices
2063 * called when the device gets disconected or at module unload
2064*/
2065void em28xx_release_resources(struct em28xx *dev)
2066{
2067 if (dev->sbutton_input_dev)
2068 em28xx_deregister_snapshot_button(dev);
2069
2070 if (dev->ir)
2071 em28xx_ir_fini(dev);
2072
2073 /*FIXME: I2C IR should be disconnected */
2074
2075 em28xx_release_analog_resources(dev);
2076
2077 em28xx_remove_from_devlist(dev);
2078
2079 em28xx_i2c_unregister(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002080
2081 v4l2_device_unregister(&dev->v4l2_dev);
2082
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002083 usb_put_dev(dev->udev);
2084
2085 /* Mark device as unused */
2086 em28xx_devused &= ~(1 << dev->devno);
2087};
2088
2089/*
2090 * em28xx_init_dev()
2091 * allocates and inits the device structs, registers i2c bus and v4l device
2092 */
Mauro Carvalho Chehab26cdc762009-01-05 01:00:40 -03002093static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002094 struct usb_interface *interface,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002095 int minor)
2096{
2097 struct em28xx *dev = *devhandle;
2098 int retval = -ENOMEM;
2099 int errCode;
2100
2101 dev->udev = udev;
2102 mutex_init(&dev->ctrl_urb_lock);
2103 spin_lock_init(&dev->slock);
2104 init_waitqueue_head(&dev->open);
2105 init_waitqueue_head(&dev->wait_frame);
2106 init_waitqueue_head(&dev->wait_stream);
2107
2108 dev->em28xx_write_regs = em28xx_write_regs;
2109 dev->em28xx_read_reg = em28xx_read_reg;
2110 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
2111 dev->em28xx_write_regs_req = em28xx_write_regs_req;
2112 dev->em28xx_read_reg_req = em28xx_read_reg_req;
2113 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
2114
2115 em28xx_pre_card_setup(dev);
2116
2117 if (!dev->board.is_em2800) {
2118 /* Sets I2C speed to 100 KHz */
2119 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x40);
2120 if (retval < 0) {
2121 em28xx_errdev("%s: em28xx_write_regs_req failed!"
2122 " retval [%d]\n",
2123 __func__, retval);
2124 return retval;
2125 }
2126 }
2127
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002128 retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002129 if (retval < 0) {
2130 em28xx_errdev("Call to v4l2_device_register() failed!\n");
2131 return retval;
2132 }
2133
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002134 /* register i2c bus */
2135 errCode = em28xx_i2c_register(dev);
2136 if (errCode < 0) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002137 v4l2_device_unregister(&dev->v4l2_dev);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002138 em28xx_errdev("%s: em28xx_i2c_register - errCode [%d]!\n",
2139 __func__, errCode);
2140 return errCode;
2141 }
2142
2143 /* Do board specific init and eeprom reading */
2144 em28xx_card_setup(dev);
2145
2146 /* Configure audio */
2147 errCode = em28xx_audio_setup(dev);
2148 if (errCode < 0) {
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002149 v4l2_device_unregister(&dev->v4l2_dev);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002150 em28xx_errdev("%s: Error while setting audio - errCode [%d]!\n",
2151 __func__, errCode);
2152 }
2153
2154 /* wake i2c devices */
2155 em28xx_wake_i2c(dev);
2156
2157 /* init video dma queues */
2158 INIT_LIST_HEAD(&dev->vidq.active);
2159 INIT_LIST_HEAD(&dev->vidq.queued);
2160
2161
2162 if (dev->board.has_msp34xx) {
2163 /* Send a reset to other chips via gpio */
2164 errCode = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
2165 if (errCode < 0) {
2166 em28xx_errdev("%s: em28xx_write_regs_req - "
2167 "msp34xx(1) failed! errCode [%d]\n",
2168 __func__, errCode);
2169 return errCode;
2170 }
2171 msleep(3);
2172
2173 errCode = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
2174 if (errCode < 0) {
2175 em28xx_errdev("%s: em28xx_write_regs_req - "
2176 "msp34xx(2) failed! errCode [%d]\n",
2177 __func__, errCode);
2178 return errCode;
2179 }
2180 msleep(3);
2181 }
2182
2183 em28xx_add_into_devlist(dev);
2184
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002185 retval = em28xx_register_analog_devices(dev);
2186 if (retval < 0) {
2187 em28xx_release_resources(dev);
2188 goto fail_reg_devices;
2189 }
2190
2191 em28xx_init_extension(dev);
2192
2193 /* Save some power by putting tuner to sleep */
Hans Verkuil7c9fc9d2009-04-01 03:49:59 -03002194 v4l2_device_call_all(&dev->v4l2_dev, 0, tuner, s_standby);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002195
2196 return 0;
2197
2198fail_reg_devices:
2199 return retval;
2200}
2201
2202/*
2203 * em28xx_usb_probe()
2204 * checks for supported devices
2205 */
2206static int em28xx_usb_probe(struct usb_interface *interface,
2207 const struct usb_device_id *id)
2208{
2209 const struct usb_endpoint_descriptor *endpoint;
2210 struct usb_device *udev;
2211 struct usb_interface *uif;
2212 struct em28xx *dev = NULL;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002213 int retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002214 int i, nr, ifnum, isoc_pipe;
2215 char *speed;
2216 char descr[255] = "";
2217
2218 udev = usb_get_dev(interface_to_usbdev(interface));
2219 ifnum = interface->altsetting[0].desc.bInterfaceNumber;
2220
2221 /* Check to see next free device and mark as used */
2222 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
2223 em28xx_devused |= 1<<nr;
2224
2225 /* Don't register audio interfaces */
2226 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
2227 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
2228 "interface %i, class %i\n",
2229 le16_to_cpu(udev->descriptor.idVendor),
2230 le16_to_cpu(udev->descriptor.idProduct),
2231 ifnum,
2232 interface->altsetting[0].desc.bInterfaceClass);
2233
2234 em28xx_devused &= ~(1<<nr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002235 retval = -ENODEV;
2236 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002237 }
2238
2239 endpoint = &interface->cur_altsetting->endpoint[0].desc;
2240
2241 /* check if the device has the iso in endpoint at the correct place */
Julia Lawall13417982008-12-29 21:49:22 -03002242 if (usb_endpoint_xfer_isoc(endpoint)
2243 &&
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002244 (interface->altsetting[1].endpoint[0].desc.wMaxPacketSize == 940)) {
2245 /* It's a newer em2874/em2875 device */
2246 isoc_pipe = 0;
2247 } else {
2248 int check_interface = 1;
2249 isoc_pipe = 1;
2250 endpoint = &interface->cur_altsetting->endpoint[1].desc;
Julia Lawall2230c3c2009-01-03 16:53:10 -03002251 if (!usb_endpoint_xfer_isoc(endpoint))
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002252 check_interface = 0;
2253
Julia Lawall13417982008-12-29 21:49:22 -03002254 if (usb_endpoint_dir_out(endpoint))
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002255 check_interface = 0;
2256
2257 if (!check_interface) {
2258 em28xx_err(DRIVER_NAME " video device (%04x:%04x): "
2259 "interface %i, class %i found.\n",
2260 le16_to_cpu(udev->descriptor.idVendor),
2261 le16_to_cpu(udev->descriptor.idProduct),
2262 ifnum,
2263 interface->altsetting[0].desc.bInterfaceClass);
2264
2265 em28xx_err(DRIVER_NAME " This is an anciliary "
2266 "interface not used by the driver\n");
2267
2268 em28xx_devused &= ~(1<<nr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002269 retval = -ENODEV;
2270 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002271 }
2272 }
2273
2274 switch (udev->speed) {
2275 case USB_SPEED_LOW:
2276 speed = "1.5";
2277 break;
2278 case USB_SPEED_UNKNOWN:
2279 case USB_SPEED_FULL:
2280 speed = "12";
2281 break;
2282 case USB_SPEED_HIGH:
2283 speed = "480";
2284 break;
2285 default:
2286 speed = "unknown";
2287 }
2288
2289 if (udev->manufacturer)
2290 strlcpy(descr, udev->manufacturer, sizeof(descr));
2291
2292 if (udev->product) {
2293 if (*descr)
2294 strlcat(descr, " ", sizeof(descr));
2295 strlcat(descr, udev->product, sizeof(descr));
2296 }
2297 if (*descr)
2298 strlcat(descr, " ", sizeof(descr));
2299
2300 printk(DRIVER_NAME ": New device %s@ %s Mbps "
2301 "(%04x:%04x, interface %d, class %d)\n",
2302 descr,
2303 speed,
2304 le16_to_cpu(udev->descriptor.idVendor),
2305 le16_to_cpu(udev->descriptor.idProduct),
2306 ifnum,
2307 interface->altsetting->desc.bInterfaceNumber);
2308
2309 if (nr >= EM28XX_MAXBOARDS) {
2310 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
2311 EM28XX_MAXBOARDS);
2312 em28xx_devused &= ~(1<<nr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002313 retval = -ENOMEM;
2314 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002315 }
2316
2317 /* allocate memory for our device state and initialize it */
2318 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
2319 if (dev == NULL) {
2320 em28xx_err(DRIVER_NAME ": out of memory!\n");
2321 em28xx_devused &= ~(1<<nr);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002322 retval = -ENOMEM;
2323 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002324 }
2325
2326 snprintf(dev->name, 29, "em28xx #%d", nr);
2327 dev->devno = nr;
2328 dev->model = id->driver_info;
2329 dev->alt = -1;
2330
2331 /* Checks if audio is provided by some interface */
2332 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
2333 uif = udev->config->interface[i];
2334 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
2335 dev->has_audio_class = 1;
2336 break;
2337 }
2338 }
2339
2340 /* compute alternate max packet sizes */
2341 uif = udev->actconfig->interface[0];
2342
2343 dev->num_alt = uif->num_altsetting;
2344 dev->alt_max_pkt_size = kmalloc(32 * dev->num_alt, GFP_KERNEL);
2345
2346 if (dev->alt_max_pkt_size == NULL) {
2347 em28xx_errdev("out of memory!\n");
2348 em28xx_devused &= ~(1<<nr);
2349 kfree(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002350 retval = -ENOMEM;
2351 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002352 }
2353
2354 for (i = 0; i < dev->num_alt ; i++) {
2355 u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.wMaxPacketSize);
2356 dev->alt_max_pkt_size[i] =
2357 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
2358 }
2359
2360 if ((card[nr] >= 0) && (card[nr] < em28xx_bcount))
2361 dev->model = card[nr];
2362
2363 /* allocate device struct */
2364 mutex_init(&dev->lock);
2365 mutex_lock(&dev->lock);
Mauro Carvalho Chehab36fa6742009-04-05 08:02:15 -03002366 retval = em28xx_init_dev(&dev, udev, interface, nr);
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002367 if (retval) {
2368 em28xx_devused &= ~(1<<dev->devno);
2369 kfree(dev);
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002370 goto err;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002371 }
2372
2373 /* save our data pointer in this interface device */
2374 usb_set_intfdata(interface, dev);
2375
2376 request_modules(dev);
2377
2378 /* Should be the last thing to do, to avoid newer udev's to
2379 open the device before fully initializing it
2380 */
2381 mutex_unlock(&dev->lock);
2382
2383 return 0;
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002384
2385err:
2386 return retval;
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002387}
2388
2389/*
2390 * em28xx_usb_disconnect()
2391 * called when the device gets diconencted
2392 * video device will be unregistered on v4l2_close in case it is still open
2393 */
2394static void em28xx_usb_disconnect(struct usb_interface *interface)
2395{
2396 struct em28xx *dev;
2397
2398 dev = usb_get_intfdata(interface);
2399 usb_set_intfdata(interface, NULL);
2400
2401 if (!dev)
2402 return;
2403
2404 em28xx_info("disconnecting %s\n", dev->vdev->name);
2405
2406 /* wait until all current v4l2 io is finished then deallocate
2407 resources */
2408 mutex_lock(&dev->lock);
2409
2410 wake_up_interruptible_all(&dev->open);
2411
Douglas Schilling Landgraff2cf2502009-03-31 17:10:58 -03002412 v4l2_device_disconnect(&dev->v4l2_dev);
2413
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03002414 if (dev->users) {
2415 em28xx_warn
2416 ("device /dev/video%d is open! Deregistration and memory "
2417 "deallocation are deferred on close.\n",
2418 dev->vdev->num);
2419
2420 dev->state |= DEV_MISCONFIGURED;
2421 em28xx_uninit_isoc(dev);
2422 dev->state |= DEV_DISCONNECTED;
2423 wake_up_interruptible(&dev->wait_frame);
2424 wake_up_interruptible(&dev->wait_stream);
2425 } else {
2426 dev->state |= DEV_DISCONNECTED;
2427 em28xx_release_resources(dev);
2428 }
2429
2430 em28xx_close_extension(dev);
2431
2432 mutex_unlock(&dev->lock);
2433
2434 if (!dev->users) {
2435 kfree(dev->alt_max_pkt_size);
2436 kfree(dev);
2437 }
2438}
2439
2440static struct usb_driver em28xx_usb_driver = {
2441 .name = "em28xx",
2442 .probe = em28xx_usb_probe,
2443 .disconnect = em28xx_usb_disconnect,
2444 .id_table = em28xx_id_table,
2445};
2446
2447static int __init em28xx_module_init(void)
2448{
2449 int result;
2450
2451 /* register this driver with the USB subsystem */
2452 result = usb_register(&em28xx_usb_driver);
2453 if (result)
2454 em28xx_err(DRIVER_NAME
2455 " usb_register failed. Error number %d.\n", result);
2456
2457 printk(KERN_INFO DRIVER_NAME " driver loaded\n");
2458
2459 return result;
2460}
2461
2462static void __exit em28xx_module_exit(void)
2463{
2464 /* deregister this driver with the USB subsystem */
2465 usb_deregister(&em28xx_usb_driver);
2466}
2467
2468module_init(em28xx_module_init);
2469module_exit(em28xx_module_exit);