blob: 6d2e4a6f8b2b607b23285e66047ddae884a6e5c7 [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>
Mauro Carvalho Chehab1f6173e2005-11-08 21:37:16 -080034#include <media/tveeprom.h>
Mauro Carvalho Chehab9bb13a62006-01-09 15:25:37 -020035#include <media/v4l2-common.h>
Hans Verkuil38f9d302008-07-23 05:09:15 -030036#include <media/v4l2-chip-ident.h>
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080037
Mauro Carvalho Chehabf7abcd32005-11-08 21:38:25 -080038#include "em28xx.h"
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -080039
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030040#define DRIVER_NAME "em28xx"
41
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030042static int tuner = -1;
43module_param(tuner, int, 0444);
44MODULE_PARM_DESC(tuner, "tuner type");
45
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -030046static unsigned int disable_ir;
47module_param(disable_ir, int, 0444);
48MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
49
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -030050static unsigned int card[] = {[0 ... (EM28XX_MAXBOARDS - 1)] = UNSET };
51module_param_array(card, int, NULL, 0444);
52MODULE_PARM_DESC(card, "card type");
53
54/* Bitmask marking allocated devices from 0 to EM28XX_MAXBOARDS */
55static unsigned long em28xx_devused;
56
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030057struct em28xx_hash_table {
58 unsigned long hash;
59 unsigned int model;
60 unsigned int tuner;
61};
62
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -030063/*
64 * Reset sequences for analog/digital modes
65 */
66
67/* Reset for the most [analog] boards */
68static struct em28xx_reg_seq default_analog[] = {
69 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
70 { -1, -1, -1, -1},
71};
72
73/* Reset for the most [digital] boards */
74static struct em28xx_reg_seq default_digital[] = {
75 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
76 { -1, -1, -1, -1},
77};
78
79/* Board Hauppauge WinTV HVR 900 analog */
80static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
81 {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10},
82 {0x05, 0xff, 0x10, 10},
83 { -1, -1, -1, -1},
84};
85
86/* Board Hauppauge WinTV HVR 900 digital */
87static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
88 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
89 {EM2880_R04_GPO, 0x04, 0x0f, 10},
90 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
91 { -1, -1, -1, -1},
92};
93
94/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
95static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
96 {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10},
97 { -1, -1, -1, -1},
98};
99
100/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300101
102/* Board - EM2870 Kworld 355u
103 Analog - No input analog */
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300104
105/* Callback for the most boards */
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300106static struct em28xx_reg_seq default_tuner_gpio[] = {
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300107 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
108 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10},
109 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
110 { -1, -1, -1, -1},
111};
112
Mauro Carvalho Chehab0ec202d2008-11-25 13:16:13 -0300113/*
114 * Board definitions
115 */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800116struct em28xx_board em28xx_boards[] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300117 [EM2750_BOARD_UNKNOWN] = {
118 .name = "Unknown EM2750/EM2751 webcam grabber",
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300119 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300120 .tuner_type = TUNER_ABSENT, /* This is a webcam */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300121 .input = { {
122 .type = EM28XX_VMUX_COMPOSITE1,
123 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300124 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300125 } },
126 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800127 [EM2800_BOARD_UNKNOWN] = {
128 .name = "Unknown EM2800 video grabber",
129 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800130 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300131 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300132 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300133 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800134 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300135 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300136 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300137 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800138 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300139 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300140 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300141 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800142 },
143 [EM2820_BOARD_UNKNOWN] = {
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300144 .name = "Unknown EM2750/28xx video grabber",
145 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800146 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300147 [EM2750_BOARD_DLCW_130] = {
148 /* Beijing Huaqi Information Digital Technology Co., Ltd */
149 .name = "Huaqi DLCW-130",
150 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300151 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300152 .tuner_type = TUNER_ABSENT, /* This is a webcam */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300153 .input = { {
154 .type = EM28XX_VMUX_COMPOSITE1,
155 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300156 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300157 } },
158 },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200159 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
Markus Rechberger33ccaa32006-02-07 06:25:41 -0200160 .name = "Kworld PVR TV 2800 RF",
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300161 .tuner_type = TUNER_TEMIC_PAL,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200162 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300163 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300164 .input = { {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200165 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300166 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300167 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300168 }, {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200169 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300170 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300171 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300172 } },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200173 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800174 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
175 .name = "Terratec Cinergy 250 USB",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800176 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
177 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300178 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300179 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800180 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300181 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300182 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300183 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800184 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300185 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300186 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300187 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800188 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300189 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300190 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300191 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800192 },
193 [EM2820_BOARD_PINNACLE_USB_2] = {
194 .name = "Pinnacle PCTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800195 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
196 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300197 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300198 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800199 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300200 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300201 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300202 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800203 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300204 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300205 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300206 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800207 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300208 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300209 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300210 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800211 },
212 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
213 .name = "Hauppauge WinTV USB 2",
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800214 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300215 .tda9887_conf = TDA9887_PRESENT |
216 TDA9887_PORT1_ACTIVE|
217 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800218 .decoder = EM28XX_TVP5150,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800219 .has_msp34xx = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300220 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800221 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300222 .vmux = TVP5150_COMPOSITE0,
Hans Verkuil2474ed42006-03-19 12:35:57 -0300223 .amux = MSP_INPUT_DEFAULT,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300224 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800225 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300226 .vmux = TVP5150_SVIDEO,
Hans Verkuil07151722006-04-01 18:03:23 -0300227 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
228 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300229 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800230 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300231 [EM2820_BOARD_DLINK_USB_TV] = {
232 .name = "D-Link DUB-T210 TV Tuner",
233 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300234 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
235 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300236 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300237 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300238 .type = EM28XX_VMUX_TELEVISION,
239 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300240 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300241 }, {
242 .type = EM28XX_VMUX_COMPOSITE1,
243 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300244 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300245 }, {
246 .type = EM28XX_VMUX_SVIDEO,
247 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300248 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300249 } },
250 },
251 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
252 .name = "Hercules Smart TV USB 2.0",
253 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300254 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
255 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300256 .decoder = EM28XX_SAA711X,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300257 .input = { {
258 .type = EM28XX_VMUX_TELEVISION,
259 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300260 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300261 }, {
262 .type = EM28XX_VMUX_COMPOSITE1,
263 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300264 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300265 }, {
266 .type = EM28XX_VMUX_SVIDEO,
267 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300268 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300269 } },
270 },
271 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
272 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
273 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300274 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
275 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300276 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300277 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300278 .type = EM28XX_VMUX_TELEVISION,
279 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300280 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300281 }, {
282 .type = EM28XX_VMUX_COMPOSITE1,
283 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300284 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300285 }, {
286 .type = EM28XX_VMUX_SVIDEO,
287 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300288 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300289 } },
290 },
291 [EM2820_BOARD_GADMEI_UTV310] = {
292 .name = "Gadmei UTV310",
293 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300294 .tuner_type = TUNER_TNF_5335MF,
295 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300296 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300297 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300298 .type = EM28XX_VMUX_TELEVISION,
299 .vmux = SAA7115_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300300 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300301 }, {
302 .type = EM28XX_VMUX_COMPOSITE1,
303 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300304 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300305 }, {
306 .type = EM28XX_VMUX_SVIDEO,
307 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300308 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300309 } },
310 },
311 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
312 .name = "Leadtek Winfast USB II Deluxe",
313 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300314 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
315 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300316 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300317 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300318 .type = EM28XX_VMUX_TELEVISION,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300319 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300320 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300321 }, {
322 .type = EM28XX_VMUX_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300323 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300324 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300325 }, {
326 .type = EM28XX_VMUX_SVIDEO,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300327 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300328 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300329 } },
330 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300331 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300332 .name = "Videology 20K14XUSB USB2.0",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300333 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300334 .tuner_type = TUNER_ABSENT, /* This is a webcam */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300335 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300336 .type = EM28XX_VMUX_COMPOSITE1,
337 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300338 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300339 } },
340 },
341 [EM2821_BOARD_PROLINK_PLAYTV_USB2] = {
342 .name = "SIIG AVTuner-PVR/Prolink PlayTV USB 2.0",
343 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300344 .tuner_type = TUNER_LG_PAL_NEW_TAPC, /* unknown? */
345 .tda9887_conf = TDA9887_PRESENT, /* unknown? */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300346 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300347 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300348 .type = EM28XX_VMUX_TELEVISION,
349 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300350 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300351 }, {
352 .type = EM28XX_VMUX_COMPOSITE1,
353 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300354 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300355 }, {
356 .type = EM28XX_VMUX_SVIDEO,
357 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300358 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300359 } },
360 },
361 [EM2821_BOARD_SUPERCOMP_USB_2] = {
362 .name = "Supercomp USB 2.0 TV",
363 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300364 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
365 .tda9887_conf = TDA9887_PRESENT |
366 TDA9887_PORT1_ACTIVE |
367 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300368 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300369 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300370 .type = EM28XX_VMUX_TELEVISION,
371 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300372 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300373 }, {
374 .type = EM28XX_VMUX_COMPOSITE1,
375 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300376 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300377 }, {
378 .type = EM28XX_VMUX_SVIDEO,
379 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300380 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300381 } },
382 },
383 [EM2821_BOARD_USBGEAR_VD204] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300384 .name = "Usbgear VD204v9",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300385 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300386 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300387 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300388 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300389 .type = EM28XX_VMUX_COMPOSITE1,
390 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300391 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300392 }, {
393 .type = EM28XX_VMUX_SVIDEO,
394 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300395 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300396 } },
397 },
398 [EM2860_BOARD_NETGMBH_CAM] = {
399 /* Beijing Huaqi Information Digital Technology Co., Ltd */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300400 .name = "NetGMBH Cam",
401 .valid = EM28XX_BOARD_NOT_VALIDATED,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300402 .tuner_type = TUNER_ABSENT, /* This is a webcam */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300403 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300404 .type = EM28XX_VMUX_COMPOSITE1,
405 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300406 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300407 } },
408 },
409 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300410 .name = "Typhoon DVD Maker",
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300411 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300412 .tuner_type = TUNER_ABSENT, /* Capture only device */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300413 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300414 .type = EM28XX_VMUX_COMPOSITE1,
415 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300416 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300417 }, {
418 .type = EM28XX_VMUX_SVIDEO,
419 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300420 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300421 } },
422 },
423 [EM2860_BOARD_GADMEI_UTV330] = {
424 .name = "Gadmei UTV330",
425 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300426 .tuner_type = TUNER_TNF_5335MF,
427 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300428 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300429 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300430 .type = EM28XX_VMUX_TELEVISION,
431 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300432 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300433 }, {
434 .type = EM28XX_VMUX_COMPOSITE1,
435 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300436 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300437 }, {
438 .type = EM28XX_VMUX_SVIDEO,
439 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300440 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300441 } },
442 },
443 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
444 .name = "Terratec Cinergy A Hybrid XS",
445 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300446 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300447 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300448 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300449
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300450 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300451 .type = EM28XX_VMUX_TELEVISION,
452 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300453 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300454 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300455 }, {
456 .type = EM28XX_VMUX_COMPOSITE1,
457 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300458 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300459 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300460 }, {
461 .type = EM28XX_VMUX_SVIDEO,
462 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300463 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300464 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300465 } },
466 },
467 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
468 .name = "KWorld PVRTV 300U",
469 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300470 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300471 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300472 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300473 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300474 .type = EM28XX_VMUX_TELEVISION,
475 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300476 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300477 }, {
478 .type = EM28XX_VMUX_COMPOSITE1,
479 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300480 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300481 }, {
482 .type = EM28XX_VMUX_SVIDEO,
483 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300484 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300485 } },
486 },
487 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
488 .name = "Yakumo MovieMixer",
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300489 .tuner_type = TUNER_ABSENT, /* Capture only device */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300490 .decoder = EM28XX_TVP5150,
491 .input = { {
492 .type = EM28XX_VMUX_TELEVISION,
493 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300494 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300495 }, {
496 .type = EM28XX_VMUX_COMPOSITE1,
497 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300498 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300499 }, {
500 .type = EM28XX_VMUX_SVIDEO,
501 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300502 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300503 } },
504 },
505 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
506 .name = "Plextor ConvertX PX-TV100U",
507 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300508 .tuner_type = TUNER_TNF_5335MF,
509 .tda9887_conf = TDA9887_PRESENT,
510 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300511 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300512 .type = EM28XX_VMUX_TELEVISION,
513 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300514 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300515 }, {
516 .type = EM28XX_VMUX_COMPOSITE1,
517 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300518 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300519 }, {
520 .type = EM28XX_VMUX_SVIDEO,
521 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300522 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300523 } },
524 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300525
526 /* Those boards with em2870 are DVB Only*/
527
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300528 [EM2870_BOARD_TERRATEC_XS] = {
529 .name = "Terratec Cinergy T XS",
530 .valid = EM28XX_BOARD_NOT_VALIDATED,
531 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300532 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300533 },
534 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
535 .name = "Terratec Cinergy T XS (MT2060)",
536 .valid = EM28XX_BOARD_NOT_VALIDATED,
537 .tuner_type = TUNER_ABSENT, /* MT2060 */
538 },
539 [EM2870_BOARD_KWORLD_350U] = {
540 .name = "Kworld 350 U DVB-T",
541 .valid = EM28XX_BOARD_NOT_VALIDATED,
542 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300543 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300544 },
545 [EM2870_BOARD_KWORLD_355U] = {
546 .name = "Kworld 355 U DVB-T",
547 .valid = EM28XX_BOARD_NOT_VALIDATED,
548 },
549 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
550 .name = "Pinnacle PCTV DVB-T",
551 .valid = EM28XX_BOARD_NOT_VALIDATED,
552 .tuner_type = TUNER_ABSENT, /* MT2060 */
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300553 /* djh - I have serious doubts this is right... */
554 .xclk = EM28XX_XCLK_IR_RC5_MODE |
555 EM28XX_XCLK_FREQUENCY_10MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300556 },
557 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
558 .name = "Compro, VideoMate U3",
559 .valid = EM28XX_BOARD_NOT_VALIDATED,
560 .tuner_type = TUNER_ABSENT, /* MT2060 */
561 },
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300562
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300563 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
564 .name = "Terratec Hybrid XS Secam",
565 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300566 .has_msp34xx = 1,
567 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300568 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300569 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300570 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300571 .type = EM28XX_VMUX_TELEVISION,
572 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300573 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300574 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300575 }, {
576 .type = EM28XX_VMUX_COMPOSITE1,
577 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300578 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300579 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300580 }, {
581 .type = EM28XX_VMUX_SVIDEO,
582 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300583 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300584 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300585 } },
586 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300587 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -0300588 .name = "Hauppauge WinTV HVR 900",
Aidan Thornton122d1582007-11-20 15:25:08 -0300589 .tda9887_conf = TDA9887_PRESENT,
590 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300591 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -0300592 .mts_firmware = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300593 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300594 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Aidan Thornton122d1582007-11-20 15:25:08 -0300595 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300596 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -0300597 .type = EM28XX_VMUX_TELEVISION,
598 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300599 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300600 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300601 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300602 .type = EM28XX_VMUX_COMPOSITE1,
603 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300604 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300605 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300606 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300607 .type = EM28XX_VMUX_SVIDEO,
608 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300609 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300610 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300611 } },
Aidan Thornton122d1582007-11-20 15:25:08 -0300612 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300613 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
614 .name = "Hauppauge WinTV HVR 900 (R2)",
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300615 .tda9887_conf = TDA9887_PRESENT,
616 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300617 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300618 .mts_firmware = 1,
619 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300620 .input = { {
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300621 .type = EM28XX_VMUX_TELEVISION,
622 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300623 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300624 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300625 }, {
626 .type = EM28XX_VMUX_COMPOSITE1,
627 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba5942b52008-11-27 07:44:00 -0300628 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300629 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300630 }, {
631 .type = EM28XX_VMUX_SVIDEO,
632 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300633 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300634 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300635 } },
636 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -0300637 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850] = {
638 .name = "Hauppauge WinTV HVR 850",
639 .tuner_type = TUNER_XC2028,
640 .tuner_gpio = default_tuner_gpio,
641 .mts_firmware = 1,
642 .has_dvb = 1,
643 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
644 .ir_codes = ir_codes_hauppauge_new,
645 .decoder = EM28XX_TVP5150,
646 .input = { {
647 .type = EM28XX_VMUX_TELEVISION,
648 .vmux = TVP5150_COMPOSITE0,
649 .amux = EM28XX_AMUX_VIDEO,
650 .gpio = hauppauge_wintv_hvr_900_analog,
651 }, {
652 .type = EM28XX_VMUX_COMPOSITE1,
653 .vmux = TVP5150_COMPOSITE1,
654 .amux = EM28XX_AMUX_LINE_IN,
655 .gpio = hauppauge_wintv_hvr_900_analog,
656 }, {
657 .type = EM28XX_VMUX_SVIDEO,
658 .vmux = TVP5150_SVIDEO,
659 .amux = EM28XX_AMUX_LINE_IN,
660 .gpio = hauppauge_wintv_hvr_900_analog,
661 } },
662 },
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -0300663 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300664 .name = "Hauppauge WinTV HVR 950",
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300665 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300666 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300667 .mts_firmware = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -0300668 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300669 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller4b922532008-11-13 03:15:55 -0300670 .ir_codes = ir_codes_hauppauge_new,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300671 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300672 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300673 .type = EM28XX_VMUX_TELEVISION,
674 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300675 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300676 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300677 }, {
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -0300678 .type = EM28XX_VMUX_COMPOSITE1,
679 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300680 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300681 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300682 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300683 .type = EM28XX_VMUX_SVIDEO,
684 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300685 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300686 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300687 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300688 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300689 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
690 .name = "Pinnacle PCTV HD Pro Stick",
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300691 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300692 .tuner_gpio = default_tuner_gpio,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300693 .mts_firmware = 1,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300694 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300695 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller4b922532008-11-13 03:15:55 -0300696 .ir_codes = ir_codes_pinnacle_pctv_hd,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300697 .decoder = EM28XX_TVP5150,
698 .input = { {
699 .type = EM28XX_VMUX_TELEVISION,
700 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300701 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300702 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300703 }, {
704 .type = EM28XX_VMUX_COMPOSITE1,
705 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300706 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300707 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300708 }, {
709 .type = EM28XX_VMUX_SVIDEO,
710 .vmux = TVP5150_SVIDEO,
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,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300713 } },
714 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300715 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
716 .name = "AMD ATI TV Wonder HD 600",
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300717 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300718 .tuner_gpio = default_tuner_gpio,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300719 .mts_firmware = 1,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300720 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300721 .dvb_gpio = hauppauge_wintv_hvr_900_digital,
Devin Heitmueller60245e82008-11-16 08:03:53 -0300722 .ir_codes = ir_codes_ati_tv_wonder_hd_600,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300723 .decoder = EM28XX_TVP5150,
724 .input = { {
725 .type = EM28XX_VMUX_TELEVISION,
726 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300727 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300728 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300729 }, {
730 .type = EM28XX_VMUX_COMPOSITE1,
731 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300732 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300733 .gpio = hauppauge_wintv_hvr_900_analog,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300734 }, {
735 .type = EM28XX_VMUX_SVIDEO,
736 .vmux = TVP5150_SVIDEO,
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 Heitmuellere14b3652008-07-26 11:04:33 -0300739 } },
740 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300741 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300742 .name = "Terratec Hybrid XS",
743 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300744 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300745 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -0300746 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300747 .dvb_gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300748 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300749 .type = EM28XX_VMUX_TELEVISION,
750 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300751 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300752 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300753 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300754 .type = EM28XX_VMUX_COMPOSITE1,
755 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300756 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300757 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300758 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300759 .type = EM28XX_VMUX_SVIDEO,
760 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300761 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300762 .gpio = default_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300763 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300764 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300765 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
766 as Prodigy XS with a different PID, let's keep it separated for now
767 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300768 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
769 .name = "Terratec Prodigy XS",
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300770 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300771 .tuner_gpio = default_tuner_gpio,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300772 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300773 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300774 .type = EM28XX_VMUX_TELEVISION,
775 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300776 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300777 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300778 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300779 .type = EM28XX_VMUX_COMPOSITE1,
780 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300781 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300782 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300783 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300784 .type = EM28XX_VMUX_SVIDEO,
785 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300786 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300787 .gpio = hauppauge_wintv_hvr_900_analog,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300788 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300789 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800790 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300791 .name = "MSI VOX USB 2.0",
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300792 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
793 .tda9887_conf = TDA9887_PRESENT |
794 TDA9887_PORT1_ACTIVE |
795 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300796 .max_range_640_480 = 1,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300797 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300798 .input = { {
799 .type = EM28XX_VMUX_TELEVISION,
800 .vmux = SAA7115_COMPOSITE4,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300801 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300802 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300803 .type = EM28XX_VMUX_COMPOSITE1,
804 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300805 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300806 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300807 .type = EM28XX_VMUX_SVIDEO,
808 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300809 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300810 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800811 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800812 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
813 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800814 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800815 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
816 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300817 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300818 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800819 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300820 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300821 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300822 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800823 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300824 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300825 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300826 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800827 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300828 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300829 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300830 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800831 },
Aron Szabo59d07f12008-07-27 13:47:52 -0300832 [EM2800_BOARD_GRABBEEX_USB2800] = {
833 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
834 .is_em2800 = 1,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300835 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300836 .tuner_type = TUNER_ABSENT, /* capture only board */
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300837 .input = { {
Aron Szabo59d07f12008-07-27 13:47:52 -0300838 .type = EM28XX_VMUX_COMPOSITE1,
839 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300840 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -0300841 }, {
842 .type = EM28XX_VMUX_SVIDEO,
843 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300844 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -0300845 } },
846 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800847 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
848 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800849 .is_em2800 = 1,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800850 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
851 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300852 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300853 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800854 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300855 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300856 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300857 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800858 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300859 .vmux = SAA7115_COMPOSITE0,
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 Chehab3acf2802005-11-08 21:38:27 -0800862 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300863 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300864 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300865 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800866 },
867 [EM2800_BOARD_KWORLD_USB2800] = {
868 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800869 .is_em2800 = 1,
Michael Krufkyab8b8702008-04-22 14:46:05 -0300870 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800871 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300872 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300873 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800874 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300875 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300876 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300877 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800878 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300879 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300880 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300881 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800882 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300883 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300884 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300885 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800886 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800887 [EM2820_BOARD_PINNACLE_DVC_90] = {
Aurelien Jarnoaec2aef2007-12-17 13:49:17 -0300888 .name = "Pinnacle Dazzle DVC 90/DVC 100",
Mauro Carvalho Chehab1c67e762008-11-27 07:46:59 -0300889 .tuner_type = TUNER_ABSENT, /* capture only board */
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300890 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300891 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800892 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300893 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300894 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300895 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800896 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300897 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300898 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300899 } },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800900 },
Sascha Sommer43625592007-11-03 15:05:07 -0300901 [EM2800_BOARD_VGEAR_POCKETTV] = {
902 .name = "V-Gear PocketTV",
903 .is_em2800 = 1,
Sascha Sommer43625592007-11-03 15:05:07 -0300904 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
905 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300906 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300907 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -0300908 .type = EM28XX_VMUX_TELEVISION,
909 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300910 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300911 }, {
Sascha Sommer43625592007-11-03 15:05:07 -0300912 .type = EM28XX_VMUX_COMPOSITE1,
913 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300914 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300915 }, {
Sascha Sommer43625592007-11-03 15:05:07 -0300916 .type = EM28XX_VMUX_SVIDEO,
917 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300918 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300919 } },
Sascha Sommer43625592007-11-03 15:05:07 -0300920 },
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -0300921 [EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2] = {
922 .name = "Pixelview PlayTV Box 4 USB 2.0",
923 .tda9887_conf = TDA9887_PRESENT,
924 .tuner_type = TUNER_YMEC_TVF_5533MF,
925 .decoder = EM28XX_SAA711X,
926 .input = { {
927 .type = EM28XX_VMUX_TELEVISION,
928 .vmux = SAA7115_COMPOSITE2,
929 .amux = EM28XX_AMUX_VIDEO,
930 .aout = EM28XX_AOUT_MONO | /* I2S */
931 EM28XX_AOUT_MASTER, /* Line out pin */
932 }, {
933 .type = EM28XX_VMUX_COMPOSITE1,
934 .vmux = SAA7115_COMPOSITE0,
935 .amux = EM28XX_AMUX_LINE_IN,
936 }, {
937 .type = EM28XX_VMUX_SVIDEO,
938 .vmux = SAA7115_SVIDEO3,
939 .amux = EM28XX_AMUX_LINE_IN,
940 } },
941 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300942 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
943 .name = "Pixelview Prolink PlayTV USB 2.0",
Douglas Schilling Landgraf5609cfd2008-12-27 21:39:35 -0300944 .has_snapshot_button = 1,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300945 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300946 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300947 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300948 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300949 .type = EM28XX_VMUX_TELEVISION,
950 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab30e4ac72008-11-20 13:43:05 -0300951 .amux = EM28XX_AMUX_VIDEO,
952 .aout = EM28XX_AOUT_MONO | /* I2S */
953 EM28XX_AOUT_MASTER, /* Line out pin */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300954 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300955 .type = EM28XX_VMUX_COMPOSITE1,
956 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300957 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300958 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300959 .type = EM28XX_VMUX_SVIDEO,
960 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300961 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300962 } },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300963 },
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -0300964 [EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA] = {
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300965 .name = "PointNix Intra-Oral Camera",
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -0300966 .has_snapshot_button = 1,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300967 .tda9887_conf = TDA9887_PRESENT,
968 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -0300969 .decoder = EM28XX_SAA711X,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300970 .input = { {
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -0300971 .type = EM28XX_VMUX_SVIDEO,
972 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300973 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -0300974 } },
975 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300976 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
977 .name = "MSI DigiVox A/D",
978 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300979 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -0300980 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300981 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -0300982 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300983 .type = EM28XX_VMUX_TELEVISION,
984 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300985 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300986 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300987 }, {
988 .type = EM28XX_VMUX_COMPOSITE1,
989 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300990 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300991 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300992 }, {
993 .type = EM28XX_VMUX_SVIDEO,
994 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300995 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -0300996 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300997 } },
998 },
999 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
1000 .name = "MSI DigiVox A/D II",
1001 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001002 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001003 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001004 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001005 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001006 .type = EM28XX_VMUX_TELEVISION,
1007 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001008 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001009 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001010 }, {
1011 .type = EM28XX_VMUX_COMPOSITE1,
1012 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001013 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001014 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001015 }, {
1016 .type = EM28XX_VMUX_SVIDEO,
1017 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001018 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001019 .gpio = em2880_msi_digivox_ad_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001020 } },
1021 },
1022 [EM2880_BOARD_KWORLD_DVB_305U] = {
1023 .name = "KWorld DVB-T 305U",
1024 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001025 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001026 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001027 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001028 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001029 .type = EM28XX_VMUX_TELEVISION,
1030 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001031 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001032 }, {
1033 .type = EM28XX_VMUX_COMPOSITE1,
1034 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001035 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001036 }, {
1037 .type = EM28XX_VMUX_SVIDEO,
1038 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001039 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001040 } },
1041 },
1042 [EM2880_BOARD_KWORLD_DVB_310U] = {
1043 .name = "KWorld DVB-T 310U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001044 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001045 .tuner_gpio = default_tuner_gpio,
Darron Broadda3808e2008-09-30 02:46:41 -03001046 .has_dvb = 1,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001047 .dvb_gpio = default_digital,
Darron Broadda3808e2008-09-30 02:46:41 -03001048 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001049 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001050 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001051 .type = EM28XX_VMUX_TELEVISION,
1052 .vmux = TVP5150_COMPOSITE0,
Darron Broadda3808e2008-09-30 02:46:41 -03001053 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001054 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001055 }, {
1056 .type = EM28XX_VMUX_COMPOSITE1,
1057 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001058 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001059 .gpio = default_analog,
Darron Broadda3808e2008-09-30 02:46:41 -03001060 }, { /* S-video has not been tested yet */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001061 .type = EM28XX_VMUX_SVIDEO,
1062 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -03001063 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001064 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001065 } },
1066 },
1067 [EM2881_BOARD_DNT_DA2_HYBRID] = {
1068 .name = "DNT DA2 Hybrid",
1069 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001070 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001071 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001072 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001073 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001074 .type = EM28XX_VMUX_TELEVISION,
1075 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001076 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001077 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001078 }, {
1079 .type = EM28XX_VMUX_COMPOSITE1,
1080 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001081 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001082 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001083 }, {
1084 .type = EM28XX_VMUX_SVIDEO,
1085 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001086 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001087 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001088 } },
1089 },
1090 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
1091 .name = "Pinnacle Hybrid Pro",
1092 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001093 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001094 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001095 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001096 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001097 .type = EM28XX_VMUX_TELEVISION,
1098 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001099 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001100 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001101 }, {
1102 .type = EM28XX_VMUX_COMPOSITE1,
1103 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001104 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001105 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001106 }, {
1107 .type = EM28XX_VMUX_SVIDEO,
1108 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001109 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001110 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001111 } },
1112 },
1113 [EM2882_BOARD_PINNACLE_HYBRID_PRO] = {
1114 .name = "Pinnacle Hybrid Pro (2)",
1115 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001116 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001117 .tuner_gpio = default_tuner_gpio,
Eugeniy Meshcheryakova674a3b2008-08-01 08:23:41 -03001118 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001119 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001120 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001121 .type = EM28XX_VMUX_TELEVISION,
1122 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001123 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001124 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001125 }, {
1126 .type = EM28XX_VMUX_COMPOSITE1,
1127 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001128 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001129 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001130 }, {
1131 .type = EM28XX_VMUX_SVIDEO,
1132 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001133 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001134 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001135 } },
1136 },
1137 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1138 .name = "Kworld VS-DVB-T 323UR",
1139 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001140 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001141 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001142 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001143 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001144 .type = EM28XX_VMUX_TELEVISION,
1145 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001146 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001147 }, {
1148 .type = EM28XX_VMUX_COMPOSITE1,
1149 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001150 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001151 }, {
1152 .type = EM28XX_VMUX_SVIDEO,
1153 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001154 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001155 } },
1156 },
1157 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
1158 .name = "Terratec Hybrid XS (em2882)",
1159 .valid = EM28XX_BOARD_NOT_VALIDATED,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001160 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001161 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001162 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001163 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001164 .type = EM28XX_VMUX_TELEVISION,
1165 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001166 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001167 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001168 }, {
1169 .type = EM28XX_VMUX_COMPOSITE1,
1170 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001171 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001172 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001173 }, {
1174 .type = EM28XX_VMUX_SVIDEO,
1175 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001176 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001177 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001178 } },
1179 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001180 [EM2883_BOARD_KWORLD_HYBRID_A316] = {
1181 .name = "Kworld PlusTV HD Hybrid 330",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001182 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001183 .tuner_gpio = default_tuner_gpio,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001184 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabbe2c6db2008-12-09 15:43:10 -03001185 .mts_firmware = 1,
1186 .has_dvb = 1,
1187 .dvb_gpio = default_digital,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001188 .input = { {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001189 .type = EM28XX_VMUX_TELEVISION,
1190 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001191 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabbe2c6db2008-12-09 15:43:10 -03001192 .gpio = default_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001193 }, {
1194 .type = EM28XX_VMUX_COMPOSITE1,
1195 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001196 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001197 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001198 }, {
1199 .type = EM28XX_VMUX_SVIDEO,
1200 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001201 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehab122b77e2008-11-27 07:42:26 -03001202 .gpio = hauppauge_wintv_hvr_900_analog,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001203 } },
1204 },
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001205 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
Vitaly Woold3603342008-07-27 14:10:11 -03001206 .name = "Compro VideoMate ForYou/Stereo",
Vitaly Woold3603342008-07-27 14:10:11 -03001207 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1208 .tda9887_conf = TDA9887_PRESENT,
1209 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabd4d889e2008-11-25 09:10:25 -03001210 .input = { {
Vitaly Woold3603342008-07-27 14:10:11 -03001211 .type = EM28XX_VMUX_TELEVISION,
1212 .vmux = TVP5150_COMPOSITE0,
1213 .amux = EM28XX_AMUX_LINE_IN,
1214 }, {
1215 .type = EM28XX_VMUX_SVIDEO,
1216 .vmux = TVP5150_SVIDEO,
1217 .amux = EM28XX_AMUX_LINE_IN,
1218 } },
1219 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001220};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001221const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001222
1223/* table of devices that work with this driver */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001224struct usb_device_id em28xx_id_table [] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001225 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001226 .driver_info = EM2750_BOARD_UNKNOWN },
1227 { USB_DEVICE(0xeb1a, 0x2751),
1228 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001229 { USB_DEVICE(0xeb1a, 0x2800),
1230 .driver_info = EM2800_BOARD_UNKNOWN },
1231 { USB_DEVICE(0xeb1a, 0x2820),
1232 .driver_info = EM2820_BOARD_UNKNOWN },
1233 { USB_DEVICE(0xeb1a, 0x2821),
Devin Heitmuellerc665f4d2008-12-16 23:35:23 -03001234 .driver_info = EM2820_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001235 { USB_DEVICE(0xeb1a, 0x2860),
1236 .driver_info = EM2820_BOARD_UNKNOWN },
1237 { USB_DEVICE(0xeb1a, 0x2861),
1238 .driver_info = EM2820_BOARD_UNKNOWN },
1239 { USB_DEVICE(0xeb1a, 0x2870),
1240 .driver_info = EM2820_BOARD_UNKNOWN },
1241 { USB_DEVICE(0xeb1a, 0x2881),
1242 .driver_info = EM2820_BOARD_UNKNOWN },
1243 { USB_DEVICE(0xeb1a, 0x2883),
1244 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001245 { USB_DEVICE(0xeb1a, 0xe300),
1246 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
1247 { USB_DEVICE(0xeb1a, 0xe305),
1248 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
1249 { USB_DEVICE(0xeb1a, 0xe310),
1250 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
1251 { USB_DEVICE(0xeb1a, 0xa316),
1252 .driver_info = EM2883_BOARD_KWORLD_HYBRID_A316 },
1253 { USB_DEVICE(0xeb1a, 0xe320),
1254 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
1255 { USB_DEVICE(0xeb1a, 0xe323),
1256 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
1257 { USB_DEVICE(0xeb1a, 0xe350),
1258 .driver_info = EM2870_BOARD_KWORLD_350U },
1259 { USB_DEVICE(0xeb1a, 0xe355),
1260 .driver_info = EM2870_BOARD_KWORLD_355U },
1261 { USB_DEVICE(0xeb1a, 0x2801),
1262 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
1263 { USB_DEVICE(0xeb1a, 0xe357),
1264 .driver_info = EM2870_BOARD_KWORLD_355U },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001265 { USB_DEVICE(0x0ccd, 0x0036),
1266 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001267 { USB_DEVICE(0x0ccd, 0x004c),
1268 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
1269 { USB_DEVICE(0x0ccd, 0x004f),
1270 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
1271 { USB_DEVICE(0x0ccd, 0x005e),
1272 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
1273 { USB_DEVICE(0x0ccd, 0x0042),
1274 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS },
1275 { USB_DEVICE(0x0ccd, 0x0043),
1276 .driver_info = EM2870_BOARD_TERRATEC_XS },
1277 { USB_DEVICE(0x0ccd, 0x0047),
1278 .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS },
1279 { USB_DEVICE(0x185b, 0x2870),
1280 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03001281 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001282 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001283 { USB_DEVICE(0x2040, 0x4200),
1284 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03001285 { USB_DEVICE(0x2040, 0x4201),
1286 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001287 { USB_DEVICE(0x2040, 0x6500),
1288 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03001289 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001290 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001291 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001292 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001293 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001294 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001295 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001296 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001297 { USB_DEVICE(0x2040, 0x651f),
1298 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001299 { USB_DEVICE(0x0438, 0xb002),
1300 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001301 { USB_DEVICE(0x2001, 0xf112),
1302 .driver_info = EM2820_BOARD_DLINK_USB_TV },
1303 { USB_DEVICE(0x2304, 0x0207),
1304 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1305 { USB_DEVICE(0x2304, 0x0208),
1306 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
1307 { USB_DEVICE(0x2304, 0x021a),
1308 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1309 { USB_DEVICE(0x2304, 0x0226),
1310 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO },
1311 { USB_DEVICE(0x2304, 0x0227),
1312 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
1313 { USB_DEVICE(0x0413, 0x6023),
1314 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
1315 { USB_DEVICE(0x093b, 0xa005),
1316 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001317 { },
1318};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001319MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001320
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001321/*
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001322 * EEPROM hash table for devices with generic USB IDs
1323 */
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001324static struct em28xx_hash_table em28xx_eeprom_hash [] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001325 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001326 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Douglas Schilling Landgraf1e1addd2008-12-27 21:38:14 -03001327 {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03001328 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001329};
1330
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001331/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03001332static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001333 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
1334 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001335 {0x1ba50080, EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03001336};
1337
Michael Krufkyd7cba042008-09-12 13:31:45 -03001338int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001339{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001340 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001341 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001342
1343 if (dev->tuner_type != TUNER_XC2028)
1344 return 0;
1345
1346 if (command != XC2028_TUNER_RESET)
1347 return 0;
1348
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001349 rc = em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001350
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001351 return rc;
1352}
1353EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
1354
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001355static void inline em28xx_set_model(struct em28xx *dev)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001356{
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001357 memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board));
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03001358
1359 /* Those are the default values for the majority of boards
1360 Use those values if not specified otherwise at boards entry
1361 */
1362 if (!dev->board.xclk)
1363 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
1364 EM28XX_XCLK_FREQUENCY_12MHZ;
1365
1366 if (!dev->board.i2c_speed)
1367 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1368 EM28XX_I2C_FREQ_100_KHZ;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001369}
1370
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001371/* Since em28xx_pre_card_setup() requires a proper dev->model,
1372 * this won't work for boards with generic PCI IDs
1373 */
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001374void em28xx_pre_card_setup(struct em28xx *dev)
1375{
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001376 int rc;
1377
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001378 em28xx_set_model(dev);
1379
Mauro Carvalho Chehab8c239982008-11-28 23:46:43 -03001380 em28xx_info("Identified as %s (card=%d)\n",
1381 dev->board.name, dev->model);
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001382
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001383 /* Set the default GPO/GPIO for legacy devices */
1384 dev->reg_gpo_num = EM2880_R04_GPO;
1385 dev->reg_gpio_num = EM28XX_R08_GPIO;
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001386
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001387 dev->wait_after_write = 5;
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001388
1389 /* Based on the Chip ID, set the device configuration */
Mauro Carvalho Chehab41facaa2008-04-17 21:44:58 -03001390 rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001391 if (rc > 0) {
Devin Heitmueller600bd7f2008-11-12 02:05:02 -03001392 dev->chip_id = rc;
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001393
1394 switch (dev->chip_id) {
Devin Heitmueller67c96f62008-11-18 05:05:46 -03001395 case CHIP_ID_EM2750:
1396 em28xx_info("chip ID is em2750\n");
1397 break;
Mauro Carvalho Chehabf09fb532008-11-16 10:40:21 -03001398 case CHIP_ID_EM2820:
1399 em28xx_info("chip ID is em2820\n");
1400 break;
1401 case CHIP_ID_EM2840:
1402 em28xx_info("chip ID is em2840\n");
1403 break;
Devin Heitmuellera8a1f8c2008-06-10 12:35:42 -03001404 case CHIP_ID_EM2860:
1405 em28xx_info("chip ID is em2860\n");
1406 break;
Devin Heitmuellerb1fa26c2008-12-16 23:15:33 -03001407 case CHIP_ID_EM2870:
1408 em28xx_info("chip ID is em2870\n");
1409 dev->wait_after_write = 0;
1410 break;
Devin Heitmueller5caeba02008-11-12 02:04:48 -03001411 case CHIP_ID_EM2874:
1412 em28xx_info("chip ID is em2874\n");
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001413 dev->reg_gpio_num = EM2874_R80_GPIO;
Devin Heitmueller5caeba02008-11-12 02:04:48 -03001414 dev->wait_after_write = 0;
1415 break;
Mauro Carvalho Chehab2ba890e2008-04-17 21:42:58 -03001416 case CHIP_ID_EM2883:
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001417 em28xx_info("chip ID is em2882/em2883\n");
1418 dev->wait_after_write = 0;
1419 break;
1420 default:
Mauro Carvalho Chehab1bee0182008-11-25 10:06:21 -03001421 em28xx_info("em28xx chip ID = %d\n", dev->chip_id);
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001422 }
1423 }
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001424
1425 /* Prepopulate cached GPO register content */
1426 rc = em28xx_read_reg(dev, dev->reg_gpo_num);
1427 if (rc >= 0)
1428 dev->reg_gpo = rc;
1429
Devin Heitmuellered14e1c2008-12-29 22:27:30 -03001430 /* Set the initial XCLK and I2C clock values based on the board
1431 definition */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001432 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
1433 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001434 msleep(50);
1435
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001436 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001437 switch (dev->model) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001438 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001439 /* FIXME guess */
1440 /* Turn on analog audio output */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001441 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001442 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001443 case EM2861_BOARD_KWORLD_PVRTV_300U:
1444 case EM2880_BOARD_KWORLD_DVB_305U:
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001445 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001446 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001447 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001448 msleep(10);
1449 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001450 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001451 /* TODO: someone can do some cleanup here...
1452 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001453 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001454 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001455 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001456 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001457 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001458 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001459 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001460 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001461 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001462 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001463 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001464 mdelay(70);
1465 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001466 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001467 /* this device needs some gpio writes to get the DVB-T
1468 demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001469 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001470 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001471 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001472 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001473 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001474 mdelay(70);
1475 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001476 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001477 /* this device needs some gpio writes to get the
1478 DVB-T demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001479 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001480 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001481 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001482 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001483 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001484 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001485 break;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001486 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001487 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001488 /* enables audio for that devices */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001489 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001490 break;
1491 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001492
Mauro Carvalho Chehab017ab4b2008-11-27 09:21:55 -03001493 em28xx_gpio_set(dev, dev->board.tuner_gpio);
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001494 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
1495
1496 /* Unlock device */
Mauro Carvalho Chehab2fe3e2e2008-11-27 09:10:40 -03001497 em28xx_set_mode(dev, EM28XX_SUSPEND);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001498}
1499
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001500static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001501{
1502 memset(ctl, 0, sizeof(*ctl));
1503
1504 ctl->fname = XC2028_DEFAULT_FIRMWARE;
1505 ctl->max_len = 64;
1506 ctl->mts = em28xx_boards[dev->model].mts_firmware;
1507
1508 switch (dev->model) {
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001509 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
1510 ctl->demod = XC3028_FE_ZARLINK456;
1511 break;
reinhard schwab655b8402008-07-26 10:47:00 -03001512 case EM2880_BOARD_TERRATEC_HYBRID_XS:
1513 ctl->demod = XC3028_FE_ZARLINK456;
1514 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001515 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
1516 /* djh - Not sure which demod we need here */
1517 ctl->demod = XC3028_FE_DEFAULT;
1518 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03001519 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
1520 ctl->demod = XC3028_FE_DEFAULT;
1521 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
1522 break;
Douglas Schilling Landgraff89bc322008-12-01 21:01:04 -03001523 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001524 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001525 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001526 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03001527 ctl->demod = XC3028_FE_DEFAULT;
1528 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001529 default:
1530 ctl->demod = XC3028_FE_OREN538;
1531 }
1532}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001533
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001534static void em28xx_config_tuner(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001535{
1536 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001537 struct tuner_setup tun_setup;
1538 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001539
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001540 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001541 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001542
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001543 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
1544 tun_setup.type = dev->tuner_type;
1545 tun_setup.addr = dev->tuner_addr;
1546 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001547
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001548 em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup);
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001549
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001550 if (dev->tuner_type == TUNER_XC2028) {
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001551 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001552
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001553 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001554
1555 xc2028_cfg.tuner = TUNER_XC2028;
1556 xc2028_cfg.priv = &ctl;
1557
1558 em28xx_i2c_call_clients(dev, TUNER_SET_CONFIG, &xc2028_cfg);
1559 }
1560
1561 /* configure tuner */
1562 f.tuner = 0;
1563 f.type = V4L2_TUNER_ANALOG_TV;
1564 f.frequency = 9076; /* just a magic number */
1565 dev->ctl_freq = f.frequency;
1566 em28xx_i2c_call_clients(dev, VIDIOC_S_FREQUENCY, &f);
1567}
1568
1569static int em28xx_hint_board(struct em28xx *dev)
1570{
1571 int i;
1572
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001573 /* HINT method: EEPROM
1574 *
1575 * This method works only for boards with eeprom.
1576 * Uses a hash of all eeprom bytes. The hash should be
1577 * unique for a vendor/tuner pair.
1578 * There are a high chance that tuners for different
1579 * video standards produce different hashes.
1580 */
1581 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
1582 if (dev->hash == em28xx_eeprom_hash[i].hash) {
1583 dev->model = em28xx_eeprom_hash[i].model;
1584 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001585
1586 em28xx_errdev("Your board has no unique USB ID.\n");
1587 em28xx_errdev("A hint were successfully done, "
1588 "based on eeprom hash.\n");
1589 em28xx_errdev("This method is not 100%% failproof.\n");
1590 em28xx_errdev("If the board were missdetected, "
1591 "please email this log to:\n");
1592 em28xx_errdev("\tV4L Mailing List "
1593 " <video4linux-list@redhat.com>\n");
1594 em28xx_errdev("Board detected as %s\n",
1595 em28xx_boards[dev->model].name);
1596
1597 return 0;
1598 }
1599 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03001600
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001601 /* HINT method: I2C attached devices
1602 *
1603 * This method works for all boards.
1604 * Uses a hash of i2c scanned devices.
1605 * Devices with the same i2c attached chips will
1606 * be considered equal.
1607 * This method is less precise than the eeprom one.
1608 */
1609
Sascha Sommerfad7b952007-11-04 08:06:48 -03001610 /* user did not request i2c scanning => do it now */
1611 if (!dev->i2c_hash)
1612 em28xx_do_i2c_scan(dev);
1613
1614 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
1615 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
1616 dev->model = em28xx_i2c_hash[i].model;
1617 dev->tuner_type = em28xx_i2c_hash[i].tuner;
1618 em28xx_errdev("Your board has no unique USB ID.\n");
1619 em28xx_errdev("A hint were successfully done, "
1620 "based on i2c devicelist hash.\n");
1621 em28xx_errdev("This method is not 100%% failproof.\n");
1622 em28xx_errdev("If the board were missdetected, "
1623 "please email this log to:\n");
1624 em28xx_errdev("\tV4L Mailing List "
1625 " <video4linux-list@redhat.com>\n");
1626 em28xx_errdev("Board detected as %s\n",
1627 em28xx_boards[dev->model].name);
1628
1629 return 0;
1630 }
1631 }
1632
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001633 em28xx_errdev("Your board has no unique USB ID and thus need a "
1634 "hint to be detected.\n");
1635 em28xx_errdev("You may try to use card=<n> insmod option to "
1636 "workaround that.\n");
1637 em28xx_errdev("Please send an email with this log to:\n");
1638 em28xx_errdev("\tV4L Mailing List <video4linux-list@redhat.com>\n");
1639 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03001640 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001641
1642 em28xx_errdev("Here is a list of valid choices for the card=<n>"
1643 " insmod option:\n");
1644 for (i = 0; i < em28xx_bcount; i++) {
1645 em28xx_errdev(" card=%d -> %s\n",
1646 i, em28xx_boards[i].name);
1647 }
1648 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001649}
1650
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001651/* ----------------------------------------------------------------------- */
1652void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir)
1653{
1654 if (disable_ir) {
1655 ir->get_key = NULL;
1656 return ;
1657 }
1658
1659 /* detect & configure */
1660 switch (dev->model) {
1661 case (EM2800_BOARD_UNKNOWN):
1662 break;
1663 case (EM2820_BOARD_UNKNOWN):
1664 break;
1665 case (EM2800_BOARD_TERRATEC_CINERGY_200):
1666 case (EM2820_BOARD_TERRATEC_CINERGY_250):
1667 ir->ir_codes = ir_codes_em_terratec;
1668 ir->get_key = em28xx_get_key_terratec;
1669 snprintf(ir->c.name, sizeof(ir->c.name),
1670 "i2c IR (EM28XX Terratec)");
1671 break;
1672 case (EM2820_BOARD_PINNACLE_USB_2):
1673 ir->ir_codes = ir_codes_pinnacle_grey;
1674 ir->get_key = em28xx_get_key_pinnacle_usb_grey;
1675 snprintf(ir->c.name, sizeof(ir->c.name),
1676 "i2c IR (EM28XX Pinnacle PCTV)");
1677 break;
1678 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
1679 ir->ir_codes = ir_codes_hauppauge_new;
1680 ir->get_key = em28xx_get_key_em_haup;
1681 snprintf(ir->c.name, sizeof(ir->c.name),
1682 "i2c IR (EM2840 Hauppauge)");
1683 break;
1684 case (EM2820_BOARD_MSI_VOX_USB_2):
1685 break;
1686 case (EM2800_BOARD_LEADTEK_WINFAST_USBII):
1687 break;
1688 case (EM2800_BOARD_KWORLD_USB2800):
1689 break;
Aron Szabo59d07f12008-07-27 13:47:52 -03001690 case (EM2800_BOARD_GRABBEEX_USB2800):
1691 break;
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001692 }
1693}
1694
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001695void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001696{
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001697 em28xx_set_model(dev);
1698
1699 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
Mauro Carvalho Chehab31e05302008-11-20 18:47:37 -03001700 if (em28xx_boards[dev->model].tuner_addr)
1701 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001702
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001703 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001704 switch (dev->model) {
1705 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03001706 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001707 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
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:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001710 {
1711 struct tveeprom tv;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001712#ifdef CONFIG_MODULES
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001713 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001714#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001715 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001716
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001717 dev->i2c_client.addr = 0xa0 >> 1;
1718 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001719
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001720 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001721
Hans Verkuil38f9d302008-07-23 05:09:15 -03001722 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001723 dev->i2s_speed = 2048000;
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001724 dev->board.has_msp34xx = 1;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001725 }
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03001726#ifdef CONFIG_MODULES
1727 if (tv.has_ir)
1728 request_module("ir-kbd-i2c");
1729#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001730 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001731 }
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001732 case EM2820_BOARD_KWORLD_PVRTV2800RF:
1733 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001734 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001735 break;
1736 case EM2820_BOARD_UNKNOWN:
1737 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03001738 /*
1739 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
1740 *
1741 * This occurs because they share identical USB vendor and
1742 * product IDs.
1743 *
1744 * What we do here is look up the EEPROM hash of the K-WORLD
1745 * and if it is found then we decide that we do not have
1746 * a DIGIVOX and reset the device to the K-WORLD instead.
1747 *
1748 * This solution is only valid if they do not share eeprom
1749 * hash identities which has not been determined as yet.
1750 */
1751 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001752 if (!em28xx_hint_board(dev))
1753 em28xx_set_model(dev);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001754 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001755 }
1756
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001757 if (dev->board.has_snapshot_button)
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001758 em28xx_register_snapshot_button(dev);
1759
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001760 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001761 em28xx_errdev("\n\n");
1762 em28xx_errdev("The support for this board weren't "
1763 "valid yet.\n");
1764 em28xx_errdev("Please send a report of having this working\n");
1765 em28xx_errdev("not to V4L mailing list (and/or to other "
1766 "addresses)\n\n");
1767 }
1768
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001769 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001770 if (tuner >= 0)
1771 dev->tuner_type = tuner;
1772
1773#ifdef CONFIG_MODULES
1774 /* request some modules */
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001775 if (dev->board.has_msp34xx)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001776 request_module("msp3400");
Mauro Carvalho Chehabec5de992008-11-25 09:43:29 -03001777 if (dev->board.decoder == EM28XX_SAA711X)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001778 request_module("saa7115");
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001779 if (dev->board.decoder == EM28XX_TVP5150)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001780 request_module("tvp5150");
Mauro Carvalho Chehab505b6d02008-11-25 09:39:50 -03001781 if (dev->board.tuner_type != TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001782 request_module("tuner");
1783#endif
1784
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001785 em28xx_config_tuner(dev);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03001786
1787 em28xx_ir_init(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001788}
Mauro Carvalho Chehabc8644052008-11-25 13:10:14 -03001789
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03001790
1791#if defined(CONFIG_MODULES) && defined(MODULE)
1792static void request_module_async(struct work_struct *work)
1793{
1794 struct em28xx *dev = container_of(work,
1795 struct em28xx, request_module_wk);
1796
1797 if (dev->has_audio_class)
1798 request_module("snd-usb-audio");
1799 else if (dev->has_alsa_audio)
1800 request_module("em28xx-alsa");
1801
1802 if (dev->board.has_dvb)
1803 request_module("em28xx-dvb");
1804}
1805
1806static void request_modules(struct em28xx *dev)
1807{
1808 INIT_WORK(&dev->request_module_wk, request_module_async);
1809 schedule_work(&dev->request_module_wk);
1810}
1811#else
1812#define request_modules(dev)
1813#endif /* CONFIG_MODULES */
1814
1815/*
1816 * em28xx_realease_resources()
1817 * unregisters the v4l2,i2c and usb devices
1818 * called when the device gets disconected or at module unload
1819*/
1820void em28xx_release_resources(struct em28xx *dev)
1821{
1822 if (dev->sbutton_input_dev)
1823 em28xx_deregister_snapshot_button(dev);
1824
1825 if (dev->ir)
1826 em28xx_ir_fini(dev);
1827
1828 /*FIXME: I2C IR should be disconnected */
1829
1830 em28xx_release_analog_resources(dev);
1831
1832 em28xx_remove_from_devlist(dev);
1833
1834 em28xx_i2c_unregister(dev);
1835 usb_put_dev(dev->udev);
1836
1837 /* Mark device as unused */
1838 em28xx_devused &= ~(1 << dev->devno);
1839};
1840
1841/*
1842 * em28xx_init_dev()
1843 * allocates and inits the device structs, registers i2c bus and v4l device
1844 */
Mauro Carvalho Chehab26cdc762009-01-05 01:00:40 -03001845static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03001846 int minor)
1847{
1848 struct em28xx *dev = *devhandle;
1849 int retval = -ENOMEM;
1850 int errCode;
1851
1852 dev->udev = udev;
1853 mutex_init(&dev->ctrl_urb_lock);
1854 spin_lock_init(&dev->slock);
1855 init_waitqueue_head(&dev->open);
1856 init_waitqueue_head(&dev->wait_frame);
1857 init_waitqueue_head(&dev->wait_stream);
1858
1859 dev->em28xx_write_regs = em28xx_write_regs;
1860 dev->em28xx_read_reg = em28xx_read_reg;
1861 dev->em28xx_read_reg_req_len = em28xx_read_reg_req_len;
1862 dev->em28xx_write_regs_req = em28xx_write_regs_req;
1863 dev->em28xx_read_reg_req = em28xx_read_reg_req;
1864 dev->board.is_em2800 = em28xx_boards[dev->model].is_em2800;
1865
1866 em28xx_pre_card_setup(dev);
1867
1868 if (!dev->board.is_em2800) {
1869 /* Sets I2C speed to 100 KHz */
1870 retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x40);
1871 if (retval < 0) {
1872 em28xx_errdev("%s: em28xx_write_regs_req failed!"
1873 " retval [%d]\n",
1874 __func__, retval);
1875 return retval;
1876 }
1877 }
1878
1879 /* register i2c bus */
1880 errCode = em28xx_i2c_register(dev);
1881 if (errCode < 0) {
1882 em28xx_errdev("%s: em28xx_i2c_register - errCode [%d]!\n",
1883 __func__, errCode);
1884 return errCode;
1885 }
1886
1887 /* Do board specific init and eeprom reading */
1888 em28xx_card_setup(dev);
1889
1890 /* Configure audio */
1891 errCode = em28xx_audio_setup(dev);
1892 if (errCode < 0) {
1893 em28xx_errdev("%s: Error while setting audio - errCode [%d]!\n",
1894 __func__, errCode);
1895 }
1896
1897 /* wake i2c devices */
1898 em28xx_wake_i2c(dev);
1899
1900 /* init video dma queues */
1901 INIT_LIST_HEAD(&dev->vidq.active);
1902 INIT_LIST_HEAD(&dev->vidq.queued);
1903
1904
1905 if (dev->board.has_msp34xx) {
1906 /* Send a reset to other chips via gpio */
1907 errCode = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf7);
1908 if (errCode < 0) {
1909 em28xx_errdev("%s: em28xx_write_regs_req - "
1910 "msp34xx(1) failed! errCode [%d]\n",
1911 __func__, errCode);
1912 return errCode;
1913 }
1914 msleep(3);
1915
1916 errCode = em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xff);
1917 if (errCode < 0) {
1918 em28xx_errdev("%s: em28xx_write_regs_req - "
1919 "msp34xx(2) failed! errCode [%d]\n",
1920 __func__, errCode);
1921 return errCode;
1922 }
1923 msleep(3);
1924 }
1925
1926 em28xx_add_into_devlist(dev);
1927
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03001928 retval = em28xx_register_analog_devices(dev);
1929 if (retval < 0) {
1930 em28xx_release_resources(dev);
1931 goto fail_reg_devices;
1932 }
1933
1934 em28xx_init_extension(dev);
1935
1936 /* Save some power by putting tuner to sleep */
1937 em28xx_i2c_call_clients(dev, TUNER_SET_STANDBY, NULL);
1938
1939 return 0;
1940
1941fail_reg_devices:
1942 return retval;
1943}
1944
1945/*
1946 * em28xx_usb_probe()
1947 * checks for supported devices
1948 */
1949static int em28xx_usb_probe(struct usb_interface *interface,
1950 const struct usb_device_id *id)
1951{
1952 const struct usb_endpoint_descriptor *endpoint;
1953 struct usb_device *udev;
1954 struct usb_interface *uif;
1955 struct em28xx *dev = NULL;
1956 int retval = -ENODEV;
1957 int i, nr, ifnum, isoc_pipe;
1958 char *speed;
1959 char descr[255] = "";
1960
1961 udev = usb_get_dev(interface_to_usbdev(interface));
1962 ifnum = interface->altsetting[0].desc.bInterfaceNumber;
1963
1964 /* Check to see next free device and mark as used */
1965 nr = find_first_zero_bit(&em28xx_devused, EM28XX_MAXBOARDS);
1966 em28xx_devused |= 1<<nr;
1967
1968 /* Don't register audio interfaces */
1969 if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
1970 em28xx_err(DRIVER_NAME " audio device (%04x:%04x): "
1971 "interface %i, class %i\n",
1972 le16_to_cpu(udev->descriptor.idVendor),
1973 le16_to_cpu(udev->descriptor.idProduct),
1974 ifnum,
1975 interface->altsetting[0].desc.bInterfaceClass);
1976
1977 em28xx_devused &= ~(1<<nr);
1978 return -ENODEV;
1979 }
1980
1981 endpoint = &interface->cur_altsetting->endpoint[0].desc;
1982
1983 /* check if the device has the iso in endpoint at the correct place */
Julia Lawall13417982008-12-29 21:49:22 -03001984 if (usb_endpoint_xfer_isoc(endpoint)
1985 &&
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03001986 (interface->altsetting[1].endpoint[0].desc.wMaxPacketSize == 940)) {
1987 /* It's a newer em2874/em2875 device */
1988 isoc_pipe = 0;
1989 } else {
1990 int check_interface = 1;
1991 isoc_pipe = 1;
1992 endpoint = &interface->cur_altsetting->endpoint[1].desc;
Julia Lawall13417982008-12-29 21:49:22 -03001993 if (usb_endpoint_type(endpoint) !=
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03001994 USB_ENDPOINT_XFER_ISOC)
1995 check_interface = 0;
1996
Julia Lawall13417982008-12-29 21:49:22 -03001997 if (usb_endpoint_dir_out(endpoint))
Mauro Carvalho Chehab1a23f812008-12-28 22:18:14 -03001998 check_interface = 0;
1999
2000 if (!check_interface) {
2001 em28xx_err(DRIVER_NAME " video device (%04x:%04x): "
2002 "interface %i, class %i found.\n",
2003 le16_to_cpu(udev->descriptor.idVendor),
2004 le16_to_cpu(udev->descriptor.idProduct),
2005 ifnum,
2006 interface->altsetting[0].desc.bInterfaceClass);
2007
2008 em28xx_err(DRIVER_NAME " This is an anciliary "
2009 "interface not used by the driver\n");
2010
2011 em28xx_devused &= ~(1<<nr);
2012 return -ENODEV;
2013 }
2014 }
2015
2016 switch (udev->speed) {
2017 case USB_SPEED_LOW:
2018 speed = "1.5";
2019 break;
2020 case USB_SPEED_UNKNOWN:
2021 case USB_SPEED_FULL:
2022 speed = "12";
2023 break;
2024 case USB_SPEED_HIGH:
2025 speed = "480";
2026 break;
2027 default:
2028 speed = "unknown";
2029 }
2030
2031 if (udev->manufacturer)
2032 strlcpy(descr, udev->manufacturer, sizeof(descr));
2033
2034 if (udev->product) {
2035 if (*descr)
2036 strlcat(descr, " ", sizeof(descr));
2037 strlcat(descr, udev->product, sizeof(descr));
2038 }
2039 if (*descr)
2040 strlcat(descr, " ", sizeof(descr));
2041
2042 printk(DRIVER_NAME ": New device %s@ %s Mbps "
2043 "(%04x:%04x, interface %d, class %d)\n",
2044 descr,
2045 speed,
2046 le16_to_cpu(udev->descriptor.idVendor),
2047 le16_to_cpu(udev->descriptor.idProduct),
2048 ifnum,
2049 interface->altsetting->desc.bInterfaceNumber);
2050
2051 if (nr >= EM28XX_MAXBOARDS) {
2052 printk(DRIVER_NAME ": Supports only %i em28xx boards.\n",
2053 EM28XX_MAXBOARDS);
2054 em28xx_devused &= ~(1<<nr);
2055 return -ENOMEM;
2056 }
2057
2058 /* allocate memory for our device state and initialize it */
2059 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
2060 if (dev == NULL) {
2061 em28xx_err(DRIVER_NAME ": out of memory!\n");
2062 em28xx_devused &= ~(1<<nr);
2063 return -ENOMEM;
2064 }
2065
2066 snprintf(dev->name, 29, "em28xx #%d", nr);
2067 dev->devno = nr;
2068 dev->model = id->driver_info;
2069 dev->alt = -1;
2070
2071 /* Checks if audio is provided by some interface */
2072 for (i = 0; i < udev->config->desc.bNumInterfaces; i++) {
2073 uif = udev->config->interface[i];
2074 if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
2075 dev->has_audio_class = 1;
2076 break;
2077 }
2078 }
2079
2080 /* compute alternate max packet sizes */
2081 uif = udev->actconfig->interface[0];
2082
2083 dev->num_alt = uif->num_altsetting;
2084 dev->alt_max_pkt_size = kmalloc(32 * dev->num_alt, GFP_KERNEL);
2085
2086 if (dev->alt_max_pkt_size == NULL) {
2087 em28xx_errdev("out of memory!\n");
2088 em28xx_devused &= ~(1<<nr);
2089 kfree(dev);
2090 return -ENOMEM;
2091 }
2092
2093 for (i = 0; i < dev->num_alt ; i++) {
2094 u16 tmp = le16_to_cpu(uif->altsetting[i].endpoint[isoc_pipe].desc.wMaxPacketSize);
2095 dev->alt_max_pkt_size[i] =
2096 (tmp & 0x07ff) * (((tmp & 0x1800) >> 11) + 1);
2097 }
2098
2099 if ((card[nr] >= 0) && (card[nr] < em28xx_bcount))
2100 dev->model = card[nr];
2101
2102 /* allocate device struct */
2103 mutex_init(&dev->lock);
2104 mutex_lock(&dev->lock);
2105 retval = em28xx_init_dev(&dev, udev, nr);
2106 if (retval) {
2107 em28xx_devused &= ~(1<<dev->devno);
2108 kfree(dev);
2109
2110 return retval;
2111 }
2112
2113 /* save our data pointer in this interface device */
2114 usb_set_intfdata(interface, dev);
2115
2116 request_modules(dev);
2117
2118 /* Should be the last thing to do, to avoid newer udev's to
2119 open the device before fully initializing it
2120 */
2121 mutex_unlock(&dev->lock);
2122
2123 return 0;
2124}
2125
2126/*
2127 * em28xx_usb_disconnect()
2128 * called when the device gets diconencted
2129 * video device will be unregistered on v4l2_close in case it is still open
2130 */
2131static void em28xx_usb_disconnect(struct usb_interface *interface)
2132{
2133 struct em28xx *dev;
2134
2135 dev = usb_get_intfdata(interface);
2136 usb_set_intfdata(interface, NULL);
2137
2138 if (!dev)
2139 return;
2140
2141 em28xx_info("disconnecting %s\n", dev->vdev->name);
2142
2143 /* wait until all current v4l2 io is finished then deallocate
2144 resources */
2145 mutex_lock(&dev->lock);
2146
2147 wake_up_interruptible_all(&dev->open);
2148
2149 if (dev->users) {
2150 em28xx_warn
2151 ("device /dev/video%d is open! Deregistration and memory "
2152 "deallocation are deferred on close.\n",
2153 dev->vdev->num);
2154
2155 dev->state |= DEV_MISCONFIGURED;
2156 em28xx_uninit_isoc(dev);
2157 dev->state |= DEV_DISCONNECTED;
2158 wake_up_interruptible(&dev->wait_frame);
2159 wake_up_interruptible(&dev->wait_stream);
2160 } else {
2161 dev->state |= DEV_DISCONNECTED;
2162 em28xx_release_resources(dev);
2163 }
2164
2165 em28xx_close_extension(dev);
2166
2167 mutex_unlock(&dev->lock);
2168
2169 if (!dev->users) {
2170 kfree(dev->alt_max_pkt_size);
2171 kfree(dev);
2172 }
2173}
2174
2175static struct usb_driver em28xx_usb_driver = {
2176 .name = "em28xx",
2177 .probe = em28xx_usb_probe,
2178 .disconnect = em28xx_usb_disconnect,
2179 .id_table = em28xx_id_table,
2180};
2181
2182static int __init em28xx_module_init(void)
2183{
2184 int result;
2185
2186 /* register this driver with the USB subsystem */
2187 result = usb_register(&em28xx_usb_driver);
2188 if (result)
2189 em28xx_err(DRIVER_NAME
2190 " usb_register failed. Error number %d.\n", result);
2191
2192 printk(KERN_INFO DRIVER_NAME " driver loaded\n");
2193
2194 return result;
2195}
2196
2197static void __exit em28xx_module_exit(void)
2198{
2199 /* deregister this driver with the USB subsystem */
2200 usb_deregister(&em28xx_usb_driver);
2201}
2202
2203module_init(em28xx_module_init);
2204module_exit(em28xx_module_exit);