blob: 729c76c59ec50fac882a4727ce13115243a86b17 [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 Chehab03910cc2007-11-03 21:20:59 -030040static int tuner = -1;
41module_param(tuner, int, 0444);
42MODULE_PARM_DESC(tuner, "tuner type");
43
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -030044static unsigned int disable_ir;
45module_param(disable_ir, int, 0444);
46MODULE_PARM_DESC(disable_ir, "disable infrared remote support");
47
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -030048struct em28xx_hash_table {
49 unsigned long hash;
50 unsigned int model;
51 unsigned int tuner;
52};
53
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -080054struct em28xx_board em28xx_boards[] = {
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -030055 [EM2750_BOARD_UNKNOWN] = {
56 .name = "Unknown EM2750/EM2751 webcam grabber",
57 .vchannels = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -030058 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -030059 .input = { {
60 .type = EM28XX_VMUX_COMPOSITE1,
61 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -030062 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -030063 } },
64 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080065 [EM2800_BOARD_UNKNOWN] = {
66 .name = "Unknown EM2800 video grabber",
67 .is_em2800 = 1,
68 .vchannels = 2,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080069 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -080070 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -030071 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -080072 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -030073 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -030074 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -030075 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -080076 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -030077 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -030078 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -030079 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080080 },
81 [EM2820_BOARD_UNKNOWN] = {
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -030082 .name = "Unknown EM2750/28xx video grabber",
83 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -080084 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -030085 [EM2750_BOARD_DLCW_130] = {
86 /* Beijing Huaqi Information Digital Technology Co., Ltd */
87 .name = "Huaqi DLCW-130",
88 .valid = EM28XX_BOARD_NOT_VALIDATED,
89 .vchannels = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -030090 .xclk = EM28XX_XCLK_FREQUENCY_48MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -030091 .input = { {
92 .type = EM28XX_VMUX_COMPOSITE1,
93 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -030094 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -030095 } },
96 },
Markus Rechberger4d17d082006-02-07 06:25:39 -020097 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
Markus Rechberger33ccaa32006-02-07 06:25:41 -020098 .name = "Kworld PVR TV 2800 RF",
Markus Rechberger4d17d082006-02-07 06:25:39 -020099 .is_em2800 = 0,
100 .vchannels = 2,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300101 .tuner_type = TUNER_TEMIC_PAL,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200102 .tda9887_conf = TDA9887_PRESENT,
Markus Rechberger4d17d082006-02-07 06:25:39 -0200103 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300104 .input = { {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200105 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300106 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300107 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300108 }, {
Markus Rechberger4d17d082006-02-07 06:25:39 -0200109 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300110 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300111 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300112 } },
Markus Rechberger4d17d082006-02-07 06:25:39 -0200113 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800114 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
115 .name = "Terratec Cinergy 250 USB",
116 .vchannels = 3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800117 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
118 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800119 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300120 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800121 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300122 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300123 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300124 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800125 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300126 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300127 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300128 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800129 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300130 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300131 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300132 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800133 },
134 [EM2820_BOARD_PINNACLE_USB_2] = {
135 .name = "Pinnacle PCTV USB 2",
136 .vchannels = 3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800137 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
138 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800139 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300140 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800141 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300142 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300143 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300144 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800145 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300146 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300147 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300148 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800149 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300150 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300151 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300152 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800153 },
154 [EM2820_BOARD_HAUPPAUGE_WINTV_USB_2] = {
155 .name = "Hauppauge WinTV USB 2",
156 .vchannels = 3,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800157 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300158 .tda9887_conf = TDA9887_PRESENT |
159 TDA9887_PORT1_ACTIVE|
160 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800161 .decoder = EM28XX_TVP5150,
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800162 .has_msp34xx = 1,
163 /*FIXME: S-Video not tested */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300164 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800165 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300166 .vmux = TVP5150_COMPOSITE0,
Hans Verkuil2474ed42006-03-19 12:35:57 -0300167 .amux = MSP_INPUT_DEFAULT,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300168 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800169 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300170 .vmux = TVP5150_SVIDEO,
Hans Verkuil07151722006-04-01 18:03:23 -0300171 .amux = MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1,
172 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART),
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300173 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800174 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300175 [EM2820_BOARD_DLINK_USB_TV] = {
176 .name = "D-Link DUB-T210 TV Tuner",
177 .valid = EM28XX_BOARD_NOT_VALIDATED,
178 .vchannels = 3,
179 .is_em2800 = 0,
180 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
181 .tda9887_conf = TDA9887_PRESENT,
182 .decoder = EM28XX_SAA7113,
183 .input = { {
184 .type = EM28XX_VMUX_TELEVISION,
185 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300186 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300187 }, {
188 .type = EM28XX_VMUX_COMPOSITE1,
189 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300190 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300191 }, {
192 .type = EM28XX_VMUX_SVIDEO,
193 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300194 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300195 } },
196 },
197 [EM2820_BOARD_HERCULES_SMART_TV_USB2] = {
198 .name = "Hercules Smart TV USB 2.0",
199 .valid = EM28XX_BOARD_NOT_VALIDATED,
200 .vchannels = 3,
201 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
202 .tda9887_conf = TDA9887_PRESENT,
203 .decoder = EM28XX_SAA7113,
204 .input = { {
205 .type = EM28XX_VMUX_TELEVISION,
206 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300207 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300208 }, {
209 .type = EM28XX_VMUX_COMPOSITE1,
210 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300211 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300212 }, {
213 .type = EM28XX_VMUX_SVIDEO,
214 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300215 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300216 } },
217 },
218 [EM2820_BOARD_PINNACLE_USB_2_FM1216ME] = {
219 .name = "Pinnacle PCTV USB 2 (Philips FM1216ME)",
220 .valid = EM28XX_BOARD_NOT_VALIDATED,
221 .vchannels = 3,
222 .is_em2800 = 0,
223 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
224 .tda9887_conf = TDA9887_PRESENT,
225 .decoder = EM28XX_SAA7113,
226 .input = { {
227 .type = EM28XX_VMUX_TELEVISION,
228 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300229 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300230 }, {
231 .type = EM28XX_VMUX_COMPOSITE1,
232 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300233 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300234 }, {
235 .type = EM28XX_VMUX_SVIDEO,
236 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300237 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300238 } },
239 },
240 [EM2820_BOARD_GADMEI_UTV310] = {
241 .name = "Gadmei UTV310",
242 .valid = EM28XX_BOARD_NOT_VALIDATED,
243 .vchannels = 3,
244 .tuner_type = TUNER_TNF_5335MF,
245 .tda9887_conf = TDA9887_PRESENT,
246 .decoder = EM28XX_SAA7113,
247 .input = { {
248 .type = EM28XX_VMUX_TELEVISION,
249 .vmux = SAA7115_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300250 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300251 }, {
252 .type = EM28XX_VMUX_COMPOSITE1,
253 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300254 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300255 }, {
256 .type = EM28XX_VMUX_SVIDEO,
257 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300258 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300259 } },
260 },
261 [EM2820_BOARD_LEADTEK_WINFAST_USBII_DELUXE] = {
262 .name = "Leadtek Winfast USB II Deluxe",
263 .valid = EM28XX_BOARD_NOT_VALIDATED,
264 .vchannels = 3,
265 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
266 .tda9887_conf = TDA9887_PRESENT,
267 .decoder = EM28XX_SAA7114,
268 .input = { {
269 .type = EM28XX_VMUX_TELEVISION,
270 .vmux = 2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300271 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300272 }, {
273 .type = EM28XX_VMUX_COMPOSITE1,
274 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300275 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300276 }, {
277 .type = EM28XX_VMUX_SVIDEO,
278 .vmux = 9,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300279 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300280 } },
281 },
282 [EM2820_BOARD_PINNACLE_DVC_100] = {
283 .name = "Pinnacle Dazzle DVC 100",
284 .valid = EM28XX_BOARD_NOT_VALIDATED,
285 .vchannels = 3,
286 .decoder = EM28XX_SAA7113,
287 .input = { {
288 .type = EM28XX_VMUX_COMPOSITE1,
289 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300290 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300291 }, {
292 .type = EM28XX_VMUX_SVIDEO,
293 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300294 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300295 } },
296 },
297 [EM2820_BOARD_VIDEOLOGY_20K14XUSB] = {
298 .name = "Videology 20K14XUSB USB2.0",
299 .valid = EM28XX_BOARD_NOT_VALIDATED,
300 .vchannels = 1,
301 .input = { {
302 .type = EM28XX_VMUX_COMPOSITE1,
303 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300304 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300305 } },
306 },
307 [EM2821_BOARD_PROLINK_PLAYTV_USB2] = {
308 .name = "SIIG AVTuner-PVR/Prolink PlayTV USB 2.0",
309 .valid = EM28XX_BOARD_NOT_VALIDATED,
310 .vchannels = 3,
311 .is_em2800 = 0,
312 .tuner_type = TUNER_LG_PAL_NEW_TAPC, /* unknown? */
313 .tda9887_conf = TDA9887_PRESENT, /* unknown? */
314 .decoder = EM28XX_SAA7113,
315 .input = { {
316 .type = EM28XX_VMUX_TELEVISION,
317 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300318 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300319 }, {
320 .type = EM28XX_VMUX_COMPOSITE1,
321 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300322 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300323 }, {
324 .type = EM28XX_VMUX_SVIDEO,
325 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300326 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300327 } },
328 },
329 [EM2821_BOARD_SUPERCOMP_USB_2] = {
330 .name = "Supercomp USB 2.0 TV",
331 .valid = EM28XX_BOARD_NOT_VALIDATED,
332 .vchannels = 3,
333 .is_em2800 = 0,
334 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
335 .tda9887_conf = TDA9887_PRESENT |
336 TDA9887_PORT1_ACTIVE |
337 TDA9887_PORT2_ACTIVE,
338 .decoder = EM28XX_SAA7113,
339 .input = { {
340 .type = EM28XX_VMUX_TELEVISION,
341 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300342 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300343 }, {
344 .type = EM28XX_VMUX_COMPOSITE1,
345 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300346 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300347 }, {
348 .type = EM28XX_VMUX_SVIDEO,
349 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300350 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300351 } },
352 },
353 [EM2821_BOARD_USBGEAR_VD204] = {
354 .name = "Usbgear VD204v9",
355 .valid = EM28XX_BOARD_NOT_VALIDATED,
356 .vchannels = 2,
357 .decoder = EM28XX_SAA7113,
358 .input = { {
359 .type = EM28XX_VMUX_COMPOSITE1,
360 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300361 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300362 }, {
363 .type = EM28XX_VMUX_SVIDEO,
364 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300365 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300366 } },
367 },
368 [EM2860_BOARD_NETGMBH_CAM] = {
369 /* Beijing Huaqi Information Digital Technology Co., Ltd */
370 .name = "NetGMBH Cam",
371 .valid = EM28XX_BOARD_NOT_VALIDATED,
372 .vchannels = 1,
373 .input = { {
374 .type = EM28XX_VMUX_COMPOSITE1,
375 .vmux = 0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300376 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300377 } },
378 },
379 [EM2860_BOARD_TYPHOON_DVD_MAKER] = {
380 .name = "Typhoon DVD Maker",
381 .valid = EM28XX_BOARD_NOT_VALIDATED,
382 .vchannels = 2,
383 .decoder = EM28XX_SAA7113,
384 .input = { {
385 .type = EM28XX_VMUX_COMPOSITE1,
386 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300387 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300388 }, {
389 .type = EM28XX_VMUX_SVIDEO,
390 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300391 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300392 } },
393 },
394 [EM2860_BOARD_GADMEI_UTV330] = {
395 .name = "Gadmei UTV330",
396 .valid = EM28XX_BOARD_NOT_VALIDATED,
397 .vchannels = 3,
398 .tuner_type = TUNER_TNF_5335MF,
399 .tda9887_conf = TDA9887_PRESENT,
400 .decoder = EM28XX_SAA7113,
401 .input = { {
402 .type = EM28XX_VMUX_TELEVISION,
403 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300404 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300405 }, {
406 .type = EM28XX_VMUX_COMPOSITE1,
407 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300408 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300409 }, {
410 .type = EM28XX_VMUX_SVIDEO,
411 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300412 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300413 } },
414 },
415 [EM2860_BOARD_TERRATEC_HYBRID_XS] = {
416 .name = "Terratec Cinergy A Hybrid XS",
417 .valid = EM28XX_BOARD_NOT_VALIDATED,
418 .vchannels = 3,
419 .tuner_type = TUNER_XC2028,
420 .decoder = EM28XX_TVP5150,
421 .input = { {
422 .type = EM28XX_VMUX_TELEVISION,
423 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300424 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300425 }, {
426 .type = EM28XX_VMUX_COMPOSITE1,
427 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300428 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300429 }, {
430 .type = EM28XX_VMUX_SVIDEO,
431 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300432 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300433 } },
434 },
435 [EM2861_BOARD_KWORLD_PVRTV_300U] = {
436 .name = "KWorld PVRTV 300U",
437 .valid = EM28XX_BOARD_NOT_VALIDATED,
438 .vchannels = 3,
439 .tuner_type = TUNER_XC2028,
440 .decoder = EM28XX_TVP5150,
441 .input = { {
442 .type = EM28XX_VMUX_TELEVISION,
443 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300444 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300445 }, {
446 .type = EM28XX_VMUX_COMPOSITE1,
447 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300448 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300449 }, {
450 .type = EM28XX_VMUX_SVIDEO,
451 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300452 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300453 } },
454 },
455 [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = {
456 .name = "Yakumo MovieMixer",
457 .valid = EM28XX_BOARD_NOT_VALIDATED,
458 .vchannels = 1,
459 .decoder = EM28XX_TVP5150,
460 .input = { {
461 .type = EM28XX_VMUX_TELEVISION,
462 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300463 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300464 }, {
465 .type = EM28XX_VMUX_COMPOSITE1,
466 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300467 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300468 }, {
469 .type = EM28XX_VMUX_SVIDEO,
470 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300471 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300472 } },
473 },
474 [EM2861_BOARD_PLEXTOR_PX_TV100U] = {
475 .name = "Plextor ConvertX PX-TV100U",
476 .valid = EM28XX_BOARD_NOT_VALIDATED,
477 .vchannels = 3,
478 .tuner_type = TUNER_TNF_5335MF,
479 .tda9887_conf = TDA9887_PRESENT,
480 .decoder = EM28XX_TVP5150,
481 .input = { {
482 .type = EM28XX_VMUX_TELEVISION,
483 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300484 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300485 }, {
486 .type = EM28XX_VMUX_COMPOSITE1,
487 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300488 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300489 }, {
490 .type = EM28XX_VMUX_SVIDEO,
491 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300492 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300493 } },
494 },
495 [EM2870_BOARD_TERRATEC_XS] = {
496 .name = "Terratec Cinergy T XS",
497 .valid = EM28XX_BOARD_NOT_VALIDATED,
498 .tuner_type = TUNER_XC2028,
499 },
500 [EM2870_BOARD_TERRATEC_XS_MT2060] = {
501 .name = "Terratec Cinergy T XS (MT2060)",
502 .valid = EM28XX_BOARD_NOT_VALIDATED,
503 .tuner_type = TUNER_ABSENT, /* MT2060 */
504 },
505 [EM2870_BOARD_KWORLD_350U] = {
506 .name = "Kworld 350 U DVB-T",
507 .valid = EM28XX_BOARD_NOT_VALIDATED,
508 .tuner_type = TUNER_XC2028,
509 },
510 [EM2870_BOARD_KWORLD_355U] = {
511 .name = "Kworld 355 U DVB-T",
512 .valid = EM28XX_BOARD_NOT_VALIDATED,
513 },
514 [EM2870_BOARD_PINNACLE_PCTV_DVB] = {
515 .name = "Pinnacle PCTV DVB-T",
516 .valid = EM28XX_BOARD_NOT_VALIDATED,
517 .tuner_type = TUNER_ABSENT, /* MT2060 */
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300518
519 /* djh - I have serious doubts this is right... */
520 .xclk = EM28XX_XCLK_IR_RC5_MODE |
521 EM28XX_XCLK_FREQUENCY_10MHZ,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300522 },
523 [EM2870_BOARD_COMPRO_VIDEOMATE] = {
524 .name = "Compro, VideoMate U3",
525 .valid = EM28XX_BOARD_NOT_VALIDATED,
526 .tuner_type = TUNER_ABSENT, /* MT2060 */
527 },
528 [EM2880_BOARD_TERRATEC_HYBRID_XS_FR] = {
529 .name = "Terratec Hybrid XS Secam",
530 .valid = EM28XX_BOARD_NOT_VALIDATED,
531 .vchannels = 3,
532 .has_msp34xx = 1,
533 .tuner_type = TUNER_XC2028,
534 .decoder = EM28XX_TVP5150,
535 .input = { {
536 .type = EM28XX_VMUX_TELEVISION,
537 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300538 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300539 }, {
540 .type = EM28XX_VMUX_COMPOSITE1,
541 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300542 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300543 }, {
544 .type = EM28XX_VMUX_SVIDEO,
545 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300546 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300547 } },
548 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300549 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
Aidan Thornton122d1582007-11-20 15:25:08 -0300550 .name = "Hauppauge WinTV HVR 900",
551 .vchannels = 3,
552 .tda9887_conf = TDA9887_PRESENT,
553 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab5add9a62007-11-22 12:08:53 -0300554 .mts_firmware = 1,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -0300555 .has_dvb = 1,
Aidan Thornton122d1582007-11-20 15:25:08 -0300556 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300557 .input = { {
Aidan Thornton122d1582007-11-20 15:25:08 -0300558 .type = EM28XX_VMUX_TELEVISION,
559 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300560 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300561 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300562 .type = EM28XX_VMUX_COMPOSITE1,
563 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300564 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300565 }, {
Aidan Thornton122d1582007-11-20 15:25:08 -0300566 .type = EM28XX_VMUX_SVIDEO,
567 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300568 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300569 } },
Aidan Thornton122d1582007-11-20 15:25:08 -0300570 },
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300571 [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2] = {
572 .name = "Hauppauge WinTV HVR 900 (R2)",
573 .vchannels = 3,
574 .tda9887_conf = TDA9887_PRESENT,
575 .tuner_type = TUNER_XC2028,
576 .mts_firmware = 1,
577 .decoder = EM28XX_TVP5150,
578 .input = { {
579 .type = EM28XX_VMUX_TELEVISION,
580 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300581 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300582 }, {
583 .type = EM28XX_VMUX_COMPOSITE1,
584 .vmux = TVP5150_COMPOSITE1,
Wiktor Grebladb98fb82008-09-28 01:37:48 -0300585 .amux = 3,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300586 }, {
587 .type = EM28XX_VMUX_SVIDEO,
588 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300589 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmueller17d9d552008-06-08 10:22:03 -0300590 } },
591 },
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -0300592 [EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950] = {
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300593 .name = "Hauppauge WinTV HVR 950",
594 .vchannels = 3,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300595 .tuner_type = TUNER_XC2028,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300596 .mts_firmware = 1,
Mauro Carvalho Chehab227ad4a2008-04-17 21:37:40 -0300597 .has_dvb = 1,
Devin Heitmueller4b922532008-11-13 03:15:55 -0300598 .ir_codes = ir_codes_hauppauge_new,
Mauro Carvalho Chehab3abee532008-01-05 17:01:41 -0300599 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300600 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300601 .type = EM28XX_VMUX_TELEVISION,
602 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300603 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300604 }, {
Mauro Carvalho Chehab7d070e22007-11-01 21:52:58 -0300605 .type = EM28XX_VMUX_COMPOSITE1,
606 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300607 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300608 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300609 .type = EM28XX_VMUX_SVIDEO,
610 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300611 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300612 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300613 },
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300614 [EM2880_BOARD_PINNACLE_PCTV_HD_PRO] = {
615 .name = "Pinnacle PCTV HD Pro Stick",
616 .vchannels = 3,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300617 .tuner_type = TUNER_XC2028,
618 .mts_firmware = 1,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300619 .has_dvb = 1,
Devin Heitmueller4b922532008-11-13 03:15:55 -0300620 .ir_codes = ir_codes_pinnacle_pctv_hd,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300621 .decoder = EM28XX_TVP5150,
622 .input = { {
623 .type = EM28XX_VMUX_TELEVISION,
624 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300625 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300626 }, {
627 .type = EM28XX_VMUX_COMPOSITE1,
628 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300629 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300630 }, {
631 .type = EM28XX_VMUX_SVIDEO,
632 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300633 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmueller4fd305b2008-06-04 13:43:46 -0300634 } },
635 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300636 [EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600] = {
637 .name = "AMD ATI TV Wonder HD 600",
638 .vchannels = 3,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300639 .tuner_type = TUNER_XC2028,
640 .mts_firmware = 1,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300641 .has_dvb = 1,
Devin Heitmueller60245e82008-11-16 08:03:53 -0300642 .ir_codes = ir_codes_ati_tv_wonder_hd_600,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300643 .decoder = EM28XX_TVP5150,
644 .input = { {
645 .type = EM28XX_VMUX_TELEVISION,
646 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300647 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300648 }, {
649 .type = EM28XX_VMUX_COMPOSITE1,
650 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300651 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300652 }, {
653 .type = EM28XX_VMUX_SVIDEO,
654 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300655 .amux = EM28XX_AMUX_LINE_IN,
Devin Heitmuellere14b3652008-07-26 11:04:33 -0300656 } },
657 },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300658 [EM2880_BOARD_TERRATEC_HYBRID_XS] = {
659 .name = "Terratec Hybrid XS",
660 .vchannels = 3,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300661 .tuner_type = TUNER_XC2028,
662 .decoder = EM28XX_TVP5150,
reinhard schwab655b8402008-07-26 10:47:00 -0300663 .has_dvb = 1,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300664 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300665 .type = EM28XX_VMUX_TELEVISION,
666 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300667 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300668 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300669 .type = EM28XX_VMUX_COMPOSITE1,
670 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300671 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300672 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300673 .type = EM28XX_VMUX_SVIDEO,
674 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300675 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300676 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300677 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300678 /* maybe there's a reason behind it why Terratec sells the Hybrid XS
679 as Prodigy XS with a different PID, let's keep it separated for now
680 maybe we'll need it lateron */
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300681 [EM2880_BOARD_TERRATEC_PRODIGY_XS] = {
682 .name = "Terratec Prodigy XS",
683 .vchannels = 3,
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300684 .tuner_type = TUNER_XC2028,
685 .decoder = EM28XX_TVP5150,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300686 .input = { {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300687 .type = EM28XX_VMUX_TELEVISION,
688 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300689 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300690 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300691 .type = EM28XX_VMUX_COMPOSITE1,
692 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300693 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300694 }, {
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300695 .type = EM28XX_VMUX_SVIDEO,
696 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300697 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300698 } },
Mauro Carvalho Chehab12466572007-10-24 11:08:20 -0300699 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800700 [EM2820_BOARD_MSI_VOX_USB_2] = {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300701 .name = "MSI VOX USB 2.0",
702 .vchannels = 3,
703 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
704 .tda9887_conf = TDA9887_PRESENT |
705 TDA9887_PORT1_ACTIVE |
706 TDA9887_PORT2_ACTIVE,
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300707 .max_range_640_480 = 1,
708
709 .decoder = EM28XX_SAA7114,
710 .input = { {
711 .type = EM28XX_VMUX_TELEVISION,
712 .vmux = SAA7115_COMPOSITE4,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300713 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300714 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300715 .type = EM28XX_VMUX_COMPOSITE1,
716 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300717 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300718 }, {
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -0300719 .type = EM28XX_VMUX_SVIDEO,
720 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300721 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300722 } },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -0800723 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800724 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
725 .name = "Terratec Cinergy 200 USB",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800726 .is_em2800 = 1,
727 .vchannels = 3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800728 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
729 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800730 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300731 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800732 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300733 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300734 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300735 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800736 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300737 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300738 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300739 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800740 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300741 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300742 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300743 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800744 },
Aron Szabo59d07f12008-07-27 13:47:52 -0300745 [EM2800_BOARD_GRABBEEX_USB2800] = {
746 .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder",
747 .is_em2800 = 1,
748 .vchannels = 2,
749 .decoder = EM28XX_SAA7113,
750 .input = { {
751 .type = EM28XX_VMUX_COMPOSITE1,
752 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300753 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -0300754 }, {
755 .type = EM28XX_VMUX_SVIDEO,
756 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300757 .amux = EM28XX_AMUX_LINE_IN,
Aron Szabo59d07f12008-07-27 13:47:52 -0300758 } },
759 },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800760 [EM2800_BOARD_LEADTEK_WINFAST_USBII] = {
761 .name = "Leadtek Winfast USB II",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800762 .is_em2800 = 1,
763 .vchannels = 3,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800764 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
765 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800766 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300767 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800768 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300769 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300770 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300771 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800772 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300773 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300774 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300775 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800776 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300777 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300778 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300779 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800780 },
781 [EM2800_BOARD_KWORLD_USB2800] = {
782 .name = "Kworld USB2800",
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800783 .is_em2800 = 1,
784 .vchannels = 3,
Michael Krufkyab8b8702008-04-22 14:46:05 -0300785 .tuner_type = TUNER_PHILIPS_FCV1236D,
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800786 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800787 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300788 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800789 .type = EM28XX_VMUX_TELEVISION,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300790 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300791 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300792 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800793 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300794 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300795 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300796 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800797 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300798 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300799 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300800 } },
Mauro Carvalho Chehab596d92d2005-11-08 21:37:24 -0800801 },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800802 [EM2820_BOARD_PINNACLE_DVC_90] = {
Aurelien Jarnoaec2aef2007-12-17 13:49:17 -0300803 .name = "Pinnacle Dazzle DVC 90/DVC 100",
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800804 .vchannels = 3,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300805 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800806 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300807 .input = { {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800808 .type = EM28XX_VMUX_COMPOSITE1,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300809 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300810 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300811 }, {
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -0800812 .type = EM28XX_VMUX_SVIDEO,
Hans Verkuilc7c0b342006-04-02 13:35:00 -0300813 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300814 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300815 } },
Mauro Carvalho Chehab45632c42005-11-08 21:38:15 -0800816 },
Sascha Sommer43625592007-11-03 15:05:07 -0300817 [EM2800_BOARD_VGEAR_POCKETTV] = {
818 .name = "V-Gear PocketTV",
819 .is_em2800 = 1,
820 .vchannels = 3,
Sascha Sommer43625592007-11-03 15:05:07 -0300821 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
822 .tda9887_conf = TDA9887_PRESENT,
Sascha Sommer43625592007-11-03 15:05:07 -0300823 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300824 .input = { {
Sascha Sommer43625592007-11-03 15:05:07 -0300825 .type = EM28XX_VMUX_TELEVISION,
826 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300827 .amux = EM28XX_AMUX_VIDEO,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300828 }, {
Sascha Sommer43625592007-11-03 15:05:07 -0300829 .type = EM28XX_VMUX_COMPOSITE1,
830 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300831 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300832 }, {
Sascha Sommer43625592007-11-03 15:05:07 -0300833 .type = EM28XX_VMUX_SVIDEO,
834 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300835 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300836 } },
Sascha Sommer43625592007-11-03 15:05:07 -0300837 },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300838 [EM2820_BOARD_PROLINK_PLAYTV_USB2] = {
839 .name = "Pixelview Prolink PlayTV USB 2.0",
840 .vchannels = 3,
841 .tda9887_conf = TDA9887_PRESENT,
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -0300842 .tuner_type = TUNER_YMEC_TVF_5533MF,
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300843 .decoder = EM28XX_SAA7113,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300844 .input = { {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300845 .type = EM28XX_VMUX_TELEVISION,
846 .vmux = SAA7115_COMPOSITE2,
Mauro Carvalho Chehab30e4ac72008-11-20 13:43:05 -0300847 .amux = EM28XX_AMUX_VIDEO,
848 .aout = EM28XX_AOUT_MONO | /* I2S */
849 EM28XX_AOUT_MASTER, /* Line out pin */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300850 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300851 .type = EM28XX_VMUX_COMPOSITE1,
852 .vmux = SAA7115_COMPOSITE0,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300853 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300854 }, {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300855 .type = EM28XX_VMUX_SVIDEO,
856 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab7463dda2008-02-05 22:29:26 -0300857 .amux = EM28XX_AMUX_LINE_IN,
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -0300858 } },
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -0300859 },
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -0300860 [EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA] = {
861 .name = "PointNix Intra-Oral Camera",
862 .has_snapshot_button = 1,
863 .vchannels = 1,
864 .tda9887_conf = TDA9887_PRESENT,
865 .tuner_type = TUNER_ABSENT,
866 .decoder = EM28XX_SAA7113,
867 .input = { {
868 .type = EM28XX_VMUX_SVIDEO,
869 .vmux = SAA7115_SVIDEO3,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300870 .amux = EM28XX_AMUX_VIDEO,
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -0300871 } },
872 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300873 [EM2880_BOARD_MSI_DIGIVOX_AD] = {
874 .name = "MSI DigiVox A/D",
875 .valid = EM28XX_BOARD_NOT_VALIDATED,
876 .vchannels = 3,
877 .tuner_type = TUNER_XC2028,
878 .decoder = EM28XX_TVP5150,
879 .input = { {
880 .type = EM28XX_VMUX_TELEVISION,
881 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300882 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300883 }, {
884 .type = EM28XX_VMUX_COMPOSITE1,
885 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300886 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300887 }, {
888 .type = EM28XX_VMUX_SVIDEO,
889 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300890 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300891 } },
892 },
893 [EM2880_BOARD_MSI_DIGIVOX_AD_II] = {
894 .name = "MSI DigiVox A/D II",
895 .valid = EM28XX_BOARD_NOT_VALIDATED,
896 .vchannels = 3,
897 .tuner_type = TUNER_XC2028,
898 .decoder = EM28XX_TVP5150,
899 .input = { {
900 .type = EM28XX_VMUX_TELEVISION,
901 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300902 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300903 }, {
904 .type = EM28XX_VMUX_COMPOSITE1,
905 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300906 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300907 }, {
908 .type = EM28XX_VMUX_SVIDEO,
909 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300910 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300911 } },
912 },
913 [EM2880_BOARD_KWORLD_DVB_305U] = {
914 .name = "KWorld DVB-T 305U",
915 .valid = EM28XX_BOARD_NOT_VALIDATED,
916 .vchannels = 3,
917 .tuner_type = TUNER_XC2028,
918 .decoder = EM28XX_TVP5150,
919 .input = { {
920 .type = EM28XX_VMUX_TELEVISION,
921 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300922 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300923 }, {
924 .type = EM28XX_VMUX_COMPOSITE1,
925 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300926 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300927 }, {
928 .type = EM28XX_VMUX_SVIDEO,
929 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300930 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300931 } },
932 },
933 [EM2880_BOARD_KWORLD_DVB_310U] = {
934 .name = "KWorld DVB-T 310U",
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300935 .vchannels = 3,
936 .tuner_type = TUNER_XC2028,
Darron Broadda3808e2008-09-30 02:46:41 -0300937 .has_dvb = 1,
938 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300939 .decoder = EM28XX_TVP5150,
940 .input = { {
941 .type = EM28XX_VMUX_TELEVISION,
942 .vmux = TVP5150_COMPOSITE0,
Darron Broadda3808e2008-09-30 02:46:41 -0300943 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300944 }, {
945 .type = EM28XX_VMUX_COMPOSITE1,
946 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -0300947 .amux = EM28XX_AMUX_LINE_IN,
Darron Broadda3808e2008-09-30 02:46:41 -0300948 }, { /* S-video has not been tested yet */
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300949 .type = EM28XX_VMUX_SVIDEO,
950 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehaba42aa192008-11-19 11:08:53 -0300951 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300952 } },
953 },
954 [EM2881_BOARD_DNT_DA2_HYBRID] = {
955 .name = "DNT DA2 Hybrid",
956 .valid = EM28XX_BOARD_NOT_VALIDATED,
957 .vchannels = 3,
958 .tuner_type = TUNER_XC2028,
959 .decoder = EM28XX_TVP5150,
960 .input = { {
961 .type = EM28XX_VMUX_TELEVISION,
962 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300963 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300964 }, {
965 .type = EM28XX_VMUX_COMPOSITE1,
966 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300967 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300968 }, {
969 .type = EM28XX_VMUX_SVIDEO,
970 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300971 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300972 } },
973 },
974 [EM2881_BOARD_PINNACLE_HYBRID_PRO] = {
975 .name = "Pinnacle Hybrid Pro",
976 .valid = EM28XX_BOARD_NOT_VALIDATED,
977 .vchannels = 3,
978 .tuner_type = TUNER_XC2028,
979 .decoder = EM28XX_TVP5150,
980 .input = { {
981 .type = EM28XX_VMUX_TELEVISION,
982 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300983 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300984 }, {
985 .type = EM28XX_VMUX_COMPOSITE1,
986 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300987 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300988 }, {
989 .type = EM28XX_VMUX_SVIDEO,
990 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -0300991 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -0300992 } },
993 },
994 [EM2882_BOARD_PINNACLE_HYBRID_PRO] = {
995 .name = "Pinnacle Hybrid Pro (2)",
996 .valid = EM28XX_BOARD_NOT_VALIDATED,
997 .vchannels = 3,
998 .tuner_type = TUNER_XC2028,
Eugeniy Meshcheryakova674a3b2008-08-01 08:23:41 -0300999 .mts_firmware = 1,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001000 .decoder = EM28XX_TVP5150,
1001 .input = { {
1002 .type = EM28XX_VMUX_TELEVISION,
1003 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001004 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001005 }, {
1006 .type = EM28XX_VMUX_COMPOSITE1,
1007 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001008 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001009 }, {
1010 .type = EM28XX_VMUX_SVIDEO,
1011 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001012 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001013 } },
1014 },
1015 [EM2882_BOARD_KWORLD_VS_DVBT] = {
1016 .name = "Kworld VS-DVB-T 323UR",
1017 .valid = EM28XX_BOARD_NOT_VALIDATED,
1018 .vchannels = 3,
1019 .tuner_type = TUNER_XC2028,
1020 .decoder = EM28XX_TVP5150,
1021 .input = { {
1022 .type = EM28XX_VMUX_TELEVISION,
1023 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001024 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001025 }, {
1026 .type = EM28XX_VMUX_COMPOSITE1,
1027 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001028 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001029 }, {
1030 .type = EM28XX_VMUX_SVIDEO,
1031 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001032 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001033 } },
1034 },
1035 [EM2882_BOARD_TERRATEC_HYBRID_XS] = {
1036 .name = "Terratec Hybrid XS (em2882)",
1037 .valid = EM28XX_BOARD_NOT_VALIDATED,
1038 .vchannels = 3,
1039 .tuner_type = TUNER_XC2028,
1040 .decoder = EM28XX_TVP5150,
1041 .input = { {
1042 .type = EM28XX_VMUX_TELEVISION,
1043 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001044 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001045 }, {
1046 .type = EM28XX_VMUX_COMPOSITE1,
1047 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001048 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001049 }, {
1050 .type = EM28XX_VMUX_SVIDEO,
1051 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001052 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001053 } },
1054 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001055 [EM2883_BOARD_KWORLD_HYBRID_A316] = {
1056 .name = "Kworld PlusTV HD Hybrid 330",
1057 .valid = EM28XX_BOARD_NOT_VALIDATED,
1058 .vchannels = 3,
1059 .is_em2800 = 0,
1060 .tuner_type = TUNER_XC2028,
1061 .decoder = EM28XX_TVP5150,
1062 .input = { {
1063 .type = EM28XX_VMUX_TELEVISION,
1064 .vmux = TVP5150_COMPOSITE0,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001065 .amux = EM28XX_AMUX_VIDEO,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001066 }, {
1067 .type = EM28XX_VMUX_COMPOSITE1,
1068 .vmux = TVP5150_COMPOSITE1,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001069 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001070 }, {
1071 .type = EM28XX_VMUX_SVIDEO,
1072 .vmux = TVP5150_SVIDEO,
Mauro Carvalho Chehab8a5caa62008-11-19 11:10:50 -03001073 .amux = EM28XX_AMUX_LINE_IN,
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001074 } },
1075 },
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001076 [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
Vitaly Woold3603342008-07-27 14:10:11 -03001077 .name = "Compro VideoMate ForYou/Stereo",
1078 .vchannels = 2,
1079 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1080 .tda9887_conf = TDA9887_PRESENT,
1081 .decoder = EM28XX_TVP5150,
1082 .input = { {
1083 .type = EM28XX_VMUX_TELEVISION,
1084 .vmux = TVP5150_COMPOSITE0,
1085 .amux = EM28XX_AMUX_LINE_IN,
1086 }, {
1087 .type = EM28XX_VMUX_SVIDEO,
1088 .vmux = TVP5150_SVIDEO,
1089 .amux = EM28XX_AMUX_LINE_IN,
1090 } },
1091 },
Devin Heitmueller864ec0b2008-11-12 02:05:28 -03001092 [EM2874_BOARD_PINNACLE_PCTV_80E] = {
1093 .name = "Pinnacle PCTV HD Mini",
1094 .vchannels = 0,
1095 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001096 .has_dvb = 1,
1097 .ir_codes = ir_codes_pinnacle_pctv_hd,
Devin Heitmueller864ec0b2008-11-12 02:05:28 -03001098 .decoder = EM28XX_NODECODER,
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001099 .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1100 EM2874_I2C_SECONDARY_BUS_SELECT |
1101 EM28XX_I2C_FREQ_400_KHZ,
Devin Heitmueller864ec0b2008-11-12 02:05:28 -03001102#ifdef DJH_DEBUG
1103 .input = { {
1104 .type = EM28XX_VMUX_TELEVISION,
1105 .vmux = TVP5150_COMPOSITE0,
1106 .amux = EM28XX_AMUX_LINE_IN,
1107 } },
1108#endif
1109 },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001110};
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001111const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001112
1113/* table of devices that work with this driver */
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001114struct usb_device_id em28xx_id_table [] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001115 { USB_DEVICE(0xeb1a, 0x2750),
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001116 .driver_info = EM2750_BOARD_UNKNOWN },
1117 { USB_DEVICE(0xeb1a, 0x2751),
1118 .driver_info = EM2750_BOARD_UNKNOWN },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001119 { USB_DEVICE(0xeb1a, 0x2800),
1120 .driver_info = EM2800_BOARD_UNKNOWN },
1121 { USB_DEVICE(0xeb1a, 0x2820),
1122 .driver_info = EM2820_BOARD_UNKNOWN },
1123 { USB_DEVICE(0xeb1a, 0x2821),
Douglas Schilling Landgrafa50f4a442008-09-08 03:23:55 -03001124 .driver_info = EM2820_BOARD_PROLINK_PLAYTV_USB2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001125 { USB_DEVICE(0xeb1a, 0x2860),
1126 .driver_info = EM2820_BOARD_UNKNOWN },
1127 { USB_DEVICE(0xeb1a, 0x2861),
1128 .driver_info = EM2820_BOARD_UNKNOWN },
1129 { USB_DEVICE(0xeb1a, 0x2870),
1130 .driver_info = EM2820_BOARD_UNKNOWN },
1131 { USB_DEVICE(0xeb1a, 0x2881),
1132 .driver_info = EM2820_BOARD_UNKNOWN },
1133 { USB_DEVICE(0xeb1a, 0x2883),
1134 .driver_info = EM2820_BOARD_UNKNOWN },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001135 { USB_DEVICE(0xeb1a, 0xe300),
1136 .driver_info = EM2861_BOARD_KWORLD_PVRTV_300U },
1137 { USB_DEVICE(0xeb1a, 0xe305),
1138 .driver_info = EM2880_BOARD_KWORLD_DVB_305U },
1139 { USB_DEVICE(0xeb1a, 0xe310),
1140 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
1141 { USB_DEVICE(0xeb1a, 0xa316),
1142 .driver_info = EM2883_BOARD_KWORLD_HYBRID_A316 },
1143 { USB_DEVICE(0xeb1a, 0xe320),
1144 .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
1145 { USB_DEVICE(0xeb1a, 0xe323),
1146 .driver_info = EM2882_BOARD_KWORLD_VS_DVBT },
1147 { USB_DEVICE(0xeb1a, 0xe350),
1148 .driver_info = EM2870_BOARD_KWORLD_350U },
1149 { USB_DEVICE(0xeb1a, 0xe355),
1150 .driver_info = EM2870_BOARD_KWORLD_355U },
1151 { USB_DEVICE(0xeb1a, 0x2801),
1152 .driver_info = EM2800_BOARD_GRABBEEX_USB2800 },
1153 { USB_DEVICE(0xeb1a, 0xe357),
1154 .driver_info = EM2870_BOARD_KWORLD_355U },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001155 { USB_DEVICE(0x0ccd, 0x0036),
1156 .driver_info = EM2820_BOARD_TERRATEC_CINERGY_250 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001157 { USB_DEVICE(0x0ccd, 0x004c),
1158 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS_FR },
1159 { USB_DEVICE(0x0ccd, 0x004f),
1160 .driver_info = EM2860_BOARD_TERRATEC_HYBRID_XS },
1161 { USB_DEVICE(0x0ccd, 0x005e),
1162 .driver_info = EM2882_BOARD_TERRATEC_HYBRID_XS },
1163 { USB_DEVICE(0x0ccd, 0x0042),
1164 .driver_info = EM2880_BOARD_TERRATEC_HYBRID_XS },
1165 { USB_DEVICE(0x0ccd, 0x0043),
1166 .driver_info = EM2870_BOARD_TERRATEC_XS },
1167 { USB_DEVICE(0x0ccd, 0x0047),
1168 .driver_info = EM2880_BOARD_TERRATEC_PRODIGY_XS },
1169 { USB_DEVICE(0x185b, 0x2870),
1170 .driver_info = EM2870_BOARD_COMPRO_VIDEOMATE },
Vitaly Woold3603342008-07-27 14:10:11 -03001171 { USB_DEVICE(0x185b, 0x2041),
Mauro Carvalho Chehabee281b82008-07-27 16:58:04 -03001172 .driver_info = EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001173 { USB_DEVICE(0x2040, 0x4200),
1174 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehab15b9bec2008-01-13 12:02:20 -03001175 { USB_DEVICE(0x2040, 0x4201),
1176 .driver_info = EM2820_BOARD_HAUPPAUGE_WINTV_USB_2 },
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001177 { USB_DEVICE(0x2040, 0x6500),
1178 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900 },
Luc Saillard427d20c2008-01-30 17:23:00 -03001179 { USB_DEVICE(0x2040, 0x6502),
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001180 .driver_info = EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001181 { USB_DEVICE(0x2040, 0x6513), /* HCW HVR-980 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001182 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001183 { USB_DEVICE(0x2040, 0x6517), /* HP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001184 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001185 { USB_DEVICE(0x2040, 0x651b), /* RP HVR-950 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001186 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Michael Krufky74ee0512008-05-01 18:02:30 -03001187 { USB_DEVICE(0x2040, 0x651f), /* HCW HVR-850 */
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001188 .driver_info = EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950 },
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001189 { USB_DEVICE(0x0438, 0xb002),
1190 .driver_info = EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600 },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001191 { USB_DEVICE(0x2001, 0xf112),
1192 .driver_info = EM2820_BOARD_DLINK_USB_TV },
1193 { USB_DEVICE(0x2304, 0x0207),
1194 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1195 { USB_DEVICE(0x2304, 0x0208),
1196 .driver_info = EM2820_BOARD_PINNACLE_USB_2 },
1197 { USB_DEVICE(0x2304, 0x021a),
1198 .driver_info = EM2820_BOARD_PINNACLE_DVC_90 },
1199 { USB_DEVICE(0x2304, 0x0226),
1200 .driver_info = EM2882_BOARD_PINNACLE_HYBRID_PRO },
1201 { USB_DEVICE(0x2304, 0x0227),
1202 .driver_info = EM2880_BOARD_PINNACLE_PCTV_HD_PRO },
Devin Heitmueller864ec0b2008-11-12 02:05:28 -03001203 { USB_DEVICE(0x2304, 0x023f),
1204 .driver_info = EM2874_BOARD_PINNACLE_PCTV_80E },
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001205 { USB_DEVICE(0x0413, 0x6023),
1206 .driver_info = EM2800_BOARD_LEADTEK_WINFAST_USBII },
1207 { USB_DEVICE(0x093b, 0xa005),
1208 .driver_info = EM2861_BOARD_PLEXTOR_PX_TV100U },
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001209 { },
1210};
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001211MODULE_DEVICE_TABLE(usb, em28xx_id_table);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001212
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001213/*
1214 * Reset sequences for analog/digital modes
1215 */
1216
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001217/* Reset for the most [analog] boards */
1218static struct em28xx_reg_seq default_analog[] = {
1219 {EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
1220 { -1, -1, -1, -1},
1221};
1222
1223/* Reset for the most [digital] boards */
1224static struct em28xx_reg_seq default_digital[] = {
1225 {EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
1226 { -1, -1, -1, -1},
1227};
1228
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001229/* Board Hauppauge WinTV HVR 900 analog */
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001230static struct em28xx_reg_seq hauppauge_wintv_hvr_900_analog[] = {
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001231 {EM28XX_R08_GPIO, 0x2d, ~EM_GPIO_4, 10},
1232 {0x05, 0xff, 0x10, 10},
1233 { -1, -1, -1, -1},
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001234};
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001235
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001236/* Board Hauppauge WinTV HVR 900 digital */
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001237static struct em28xx_reg_seq hauppauge_wintv_hvr_900_digital[] = {
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001238 {EM28XX_R08_GPIO, 0x2e, ~EM_GPIO_4, 10},
1239 {EM2880_R04_GPO, 0x04, 0x0f, 10},
1240 {EM2880_R04_GPO, 0x0c, 0x0f, 10},
1241 { -1, -1, -1, -1},
1242};
1243
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001244/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
1245static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
1246 {EM28XX_R08_GPIO, 0x69, ~EM_GPIO_4, 10},
1247 { -1, -1, -1, -1},
1248};
1249
1250/* Boards - EM2880 MSI DIGIVOX AD and EM2880_BOARD_MSI_DIGIVOX_AD_II */
1251static struct em28xx_reg_seq em2880_msi_digivox_ad_digital[] = {
1252 {EM28XX_R08_GPIO, 0x6a, ~EM_GPIO_4, 10},
1253 { -1, -1, -1, -1},
1254};
1255
1256/* Board - EM2870 Kworld 355u
1257 Analog - No input analog */
1258static struct em28xx_reg_seq em2870_kworld_355u_digital[] = {
1259 {EM2880_R04_GPO, 0x01, 0xff, 10},
1260 { -1, -1, -1, -1},
1261};
1262
1263/* Callback for the most boards */
1264static struct em28xx_reg_seq default_callback[] = {
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001265 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
1266 {EM28XX_R08_GPIO, 0, EM_GPIO_4, 10},
1267 {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
1268 { -1, -1, -1, -1},
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001269};
1270
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001271/* Callback for EM2882 TERRATEC HYBRID XS */
1272static struct em28xx_reg_seq em2882_terratec_hybrid_xs_digital[] = {
1273 {EM28XX_R08_GPIO, 0x2e, 0xff, 6},
1274 {EM28XX_R08_GPIO, 0x3e, ~EM_GPIO_4, 6},
1275 {EM2880_R04_GPO, 0x04, 0xff, 10},
1276 {EM2880_R04_GPO, 0x0c, 0xff, 10},
1277 { -1, -1, -1, -1},
1278};
1279
Devin Heitmueller864ec0b2008-11-12 02:05:28 -03001280/* Pinnacle PCTV HD Mini (80e) GPIOs
1281 0-5: not used
1282 6: demod reset, active low
1283 7: LED on, active high */
1284static struct em28xx_reg_seq em2874_pinnacle_80e_digital[] = {
1285 {EM28XX_R06_I2C_CLK, 0x45, 0xff, 10}, /*400 KHz*/
1286 {EM2874_R80_GPIO, 0x80, 0xff, 100},/*Demod reset*/
1287 {EM2874_R80_GPIO, 0xc0, 0xff, 10},
1288 { -1, -1, -1, -1},
1289};
1290
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001291/*
1292 * EEPROM hash table for devices with generic USB IDs
1293 */
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001294static struct em28xx_hash_table em28xx_eeprom_hash [] = {
Mauro Carvalho Chehabea4fd562007-11-03 21:21:57 -03001295 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001296 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
Darron Broadda3808e2008-09-30 02:46:41 -03001297 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001298};
1299
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001300/* I2C devicelist hash table for devices with generic USB IDs */
Sascha Sommerfad7b952007-11-04 08:06:48 -03001301static struct em28xx_hash_table em28xx_i2c_hash[] = {
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001302 {0xb06a32c3, EM2800_BOARD_TERRATEC_CINERGY_200, TUNER_LG_PAL_NEW_TAPC},
1303 {0xf51200e3, EM2800_BOARD_VGEAR_POCKETTV, TUNER_LG_PAL_NEW_TAPC},
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001304 {0x1ba50080, EM2860_BOARD_POINTNIX_INTRAORAL_CAMERA, TUNER_ABSENT},
Sascha Sommerfad7b952007-11-04 08:06:48 -03001305};
1306
Michael Krufkyd7cba042008-09-12 13:31:45 -03001307int em28xx_tuner_callback(void *ptr, int component, int command, int arg)
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001308{
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001309 int rc = 0;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001310 struct em28xx *dev = ptr;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001311
1312 if (dev->tuner_type != TUNER_XC2028)
1313 return 0;
1314
1315 if (command != XC2028_TUNER_RESET)
1316 return 0;
1317
1318 if (dev->mode == EM28XX_ANALOG_MODE)
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001319 rc = em28xx_gpio_set(dev, dev->tun_analog_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001320 else
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001321 rc = em28xx_gpio_set(dev, dev->tun_digital_gpio);
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001322
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001323 return rc;
1324}
1325EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
1326
1327static void em28xx_set_model(struct em28xx *dev)
1328{
1329 dev->is_em2800 = em28xx_boards[dev->model].is_em2800;
1330 dev->has_msp34xx = em28xx_boards[dev->model].has_msp34xx;
1331 dev->tda9887_conf = em28xx_boards[dev->model].tda9887_conf;
1332 dev->decoder = em28xx_boards[dev->model].decoder;
1333 dev->video_inputs = em28xx_boards[dev->model].vchannels;
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001334 dev->xclk = em28xx_boards[dev->model].xclk;
1335 dev->i2c_speed = em28xx_boards[dev->model].i2c_speed;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001336 dev->max_range_640_480 = em28xx_boards[dev->model].max_range_640_480;
1337 dev->has_dvb = em28xx_boards[dev->model].has_dvb;
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001338 dev->has_snapshot_button = em28xx_boards[dev->model].has_snapshot_button;
Devin Heitmueller4b922532008-11-13 03:15:55 -03001339 dev->ir_codes = em28xx_boards[dev->model].ir_codes;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001340 dev->valid = em28xx_boards[dev->model].valid;
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001341}
1342
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001343/* Since em28xx_pre_card_setup() requires a proper dev->model,
1344 * this won't work for boards with generic PCI IDs
1345 */
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001346void em28xx_pre_card_setup(struct em28xx *dev)
1347{
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001348 int rc;
1349
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001350 /* Set the default GPO/GPIO for legacy devices */
1351 dev->reg_gpo_num = EM2880_R04_GPO;
1352 dev->reg_gpio_num = EM28XX_R08_GPIO;
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001353
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001354 dev->wait_after_write = 5;
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001355
1356 /* Based on the Chip ID, set the device configuration */
Mauro Carvalho Chehab41facaa2008-04-17 21:44:58 -03001357 rc = em28xx_read_reg(dev, EM28XX_R0A_CHIPID);
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001358 if (rc > 0) {
Devin Heitmueller600bd7f2008-11-12 02:05:02 -03001359 dev->chip_id = rc;
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001360 switch (rc) {
Devin Heitmueller67c96f62008-11-18 05:05:46 -03001361 case CHIP_ID_EM2750:
1362 em28xx_info("chip ID is em2750\n");
1363 break;
Mauro Carvalho Chehabf09fb532008-11-16 10:40:21 -03001364 case CHIP_ID_EM2820:
1365 em28xx_info("chip ID is em2820\n");
1366 break;
1367 case CHIP_ID_EM2840:
1368 em28xx_info("chip ID is em2840\n");
1369 break;
Devin Heitmuellera8a1f8c2008-06-10 12:35:42 -03001370 case CHIP_ID_EM2860:
1371 em28xx_info("chip ID is em2860\n");
1372 break;
Devin Heitmueller5caeba02008-11-12 02:04:48 -03001373 case CHIP_ID_EM2874:
1374 em28xx_info("chip ID is em2874\n");
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001375 dev->reg_gpio_num = EM2874_R80_GPIO;
Devin Heitmueller5caeba02008-11-12 02:04:48 -03001376 dev->wait_after_write = 0;
1377 break;
Mauro Carvalho Chehab2ba890e2008-04-17 21:42:58 -03001378 case CHIP_ID_EM2883:
Mauro Carvalho Chehab89b329e2008-04-17 21:42:14 -03001379 em28xx_info("chip ID is em2882/em2883\n");
1380 dev->wait_after_write = 0;
1381 break;
1382 default:
1383 em28xx_info("em28xx chip ID = %d\n", rc);
1384 }
1385 }
Devin Heitmueller6a1acc32008-11-12 02:05:06 -03001386
1387 /* Prepopulate cached GPO register content */
1388 rc = em28xx_read_reg(dev, dev->reg_gpo_num);
1389 if (rc >= 0)
1390 dev->reg_gpo = rc;
1391
Mauro Carvalho Chehabee6e3a82008-04-17 21:37:31 -03001392 em28xx_set_model(dev);
1393
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001394 /* Those are the default values for the majority of boards
1395 Use those values if not specified otherwise at boards entry
1396 */
1397 if (!dev->xclk)
1398 dev->xclk = EM28XX_XCLK_IR_RC5_MODE |
1399 EM28XX_XCLK_FREQUENCY_12MHZ;
1400
1401 if (!dev->i2c_speed)
1402 dev->i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1403 EM28XX_I2C_FREQ_100_KHZ;
1404
1405 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->xclk & 0x7f);
1406 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->i2c_speed);
1407 msleep(50);
1408
Markus Rechbergera94e95b2006-01-23 17:11:10 -02001409 /* request some modules */
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001410 switch (dev->model) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001411 case EM2880_BOARD_TERRATEC_PRODIGY_XS:
1412 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001413 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001414 case EM2860_BOARD_TERRATEC_HYBRID_XS:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001415 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001416 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001417 case EM2882_BOARD_PINNACLE_HYBRID_PRO:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001418 case EM2883_BOARD_KWORLD_HYBRID_A316:
Devin Heitmuellere14b3652008-07-26 11:04:33 -03001419 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001420 /* Sets GPO/GPIO sequences for this device */
1421 dev->analog_gpio = hauppauge_wintv_hvr_900_analog;
1422 dev->digital_gpio = hauppauge_wintv_hvr_900_digital;
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001423 dev->tun_analog_gpio = default_callback;
1424 dev->tun_digital_gpio = default_callback;
1425 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001426
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001427 case EM2882_BOARD_TERRATEC_HYBRID_XS:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001428 /* Sets GPO/GPIO sequences for this device */
1429 dev->analog_gpio = hauppauge_wintv_hvr_900_analog;
1430 dev->digital_gpio = hauppauge_wintv_hvr_900_digital;
1431 dev->tun_analog_gpio = default_callback;
1432 dev->tun_digital_gpio = em2882_terratec_hybrid_xs_digital;
1433 break;
1434
1435 case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:
1436 case EM2880_BOARD_TERRATEC_HYBRID_XS:
1437 case EM2870_BOARD_TERRATEC_XS:
1438 case EM2881_BOARD_PINNACLE_HYBRID_PRO:
1439 case EM2880_BOARD_KWORLD_DVB_310U:
1440 case EM2870_BOARD_KWORLD_350U:
1441 case EM2881_BOARD_DNT_DA2_HYBRID:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001442 /* NOTE: EM2881_DNT_DA2_HYBRID spend 140 msleep for digital
1443 and analog commands. If this commands doesn't work,
1444 add this timer. */
1445
1446 /* Sets GPO/GPIO sequences for this device */
1447 dev->analog_gpio = default_analog;
1448 dev->digital_gpio = default_digital;
1449 dev->tun_analog_gpio = default_callback;
1450 dev->tun_digital_gpio = default_callback;
1451 break;
1452
1453 case EM2880_BOARD_MSI_DIGIVOX_AD:
1454 case EM2880_BOARD_MSI_DIGIVOX_AD_II:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001455 /* Sets GPO/GPIO sequences for this device */
1456 dev->analog_gpio = em2880_msi_digivox_ad_analog;
1457 dev->digital_gpio = em2880_msi_digivox_ad_digital;
1458 dev->tun_analog_gpio = default_callback;
1459 dev->tun_digital_gpio = default_callback;
1460 break;
1461
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001462 case EM2861_BOARD_PLEXTOR_PX_TV100U:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001463 /* FIXME guess */
1464 /* Turn on analog audio output */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001465 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001466 break;
1467
1468 case EM2861_BOARD_KWORLD_PVRTV_300U:
1469 case EM2880_BOARD_KWORLD_DVB_305U:
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001470 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001471 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001472 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001473 msleep(10);
1474 break;
1475
1476 case EM2870_BOARD_KWORLD_355U:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001477 /* Sets GPO/GPIO sequences for this device */
1478 dev->digital_gpio = em2870_kworld_355u_digital;
1479 break;
1480
1481 case EM2870_BOARD_COMPRO_VIDEOMATE:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001482 /* TODO: someone can do some cleanup here...
1483 not everything's needed */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001484 em28xx_write_reg(dev, EM2880_R04_GPO, 0x00);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001485 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001486 em28xx_write_reg(dev, EM2880_R04_GPO, 0x01);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001487 msleep(10);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001488 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001489 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001490 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001491 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001492 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001493 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001494 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001495 mdelay(70);
1496 break;
1497
1498 case EM2870_BOARD_TERRATEC_XS_MT2060:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001499 /* this device needs some gpio writes to get the DVB-T
1500 demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001501 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001502 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001503 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001504 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001505 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001506 mdelay(70);
1507 break;
1508
1509 case EM2870_BOARD_PINNACLE_PCTV_DVB:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001510 /* this device needs some gpio writes to get the
1511 DVB-T demod work */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001512 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001513 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001514 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001515 mdelay(70);
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001516 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001517 mdelay(70);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001518 break;
1519
1520 case EM2820_BOARD_GADMEI_UTV310:
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001521 case EM2820_BOARD_MSI_VOX_USB_2:
Mauro Carvalho Chehaba2070c62008-11-25 07:05:06 -03001522 /* enables audio for that devices */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001523 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd);
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001524 break;
Devin Heitmueller864ec0b2008-11-12 02:05:28 -03001525
1526 case EM2874_BOARD_PINNACLE_PCTV_80E:
Devin Heitmueller864ec0b2008-11-12 02:05:28 -03001527 dev->digital_gpio = em2874_pinnacle_80e_digital;
1528 break;
Mauro Carvalho Chehab102a0b02008-04-17 21:40:45 -03001529 }
Mauro Carvalho Chehabc67ec532008-04-17 21:48:00 -03001530
1531 em28xx_gpio_set(dev, dev->tun_analog_gpio);
1532 em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
1533
1534 /* Unlock device */
1535 em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001536}
1537
Mauro Carvalho Chehabe54318e2008-04-18 18:34:31 -03001538static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001539{
1540 memset(ctl, 0, sizeof(*ctl));
1541
1542 ctl->fname = XC2028_DEFAULT_FIRMWARE;
1543 ctl->max_len = 64;
1544 ctl->mts = em28xx_boards[dev->model].mts_firmware;
1545
1546 switch (dev->model) {
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001547 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
1548 ctl->demod = XC3028_FE_ZARLINK456;
1549 break;
reinhard schwab655b8402008-07-26 10:47:00 -03001550 case EM2880_BOARD_TERRATEC_HYBRID_XS:
1551 ctl->demod = XC3028_FE_ZARLINK456;
1552 break;
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001553 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
1554 /* djh - Not sure which demod we need here */
1555 ctl->demod = XC3028_FE_DEFAULT;
1556 break;
Devin Heitmueller5ea7fe42008-09-16 02:02:12 -03001557 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
1558 ctl->demod = XC3028_FE_DEFAULT;
1559 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
1560 break;
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001561 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Devin Heitmueller4fd305b2008-06-04 13:43:46 -03001562 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
Mauro Carvalho Chehabe77ebda2008-04-18 18:37:25 -03001563 /* FIXME: Better to specify the needed IF */
Devin Heitmuellerbdfbf952008-04-17 21:38:27 -03001564 ctl->demod = XC3028_FE_DEFAULT;
1565 break;
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001566 default:
1567 ctl->demod = XC3028_FE_OREN538;
1568 }
1569}
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001570
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001571static void em28xx_config_tuner(struct em28xx *dev)
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001572{
1573 struct v4l2_priv_tun_config xc2028_cfg;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001574 struct tuner_setup tun_setup;
1575 struct v4l2_frequency f;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001576
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001577 if (dev->tuner_type == TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001578 return;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001579
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001580 tun_setup.mode_mask = T_ANALOG_TV | T_RADIO;
1581 tun_setup.type = dev->tuner_type;
1582 tun_setup.addr = dev->tuner_addr;
1583 tun_setup.tuner_callback = em28xx_tuner_callback;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001584
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001585 em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup);
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001586
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001587 if (dev->tuner_type == TUNER_XC2028) {
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001588 struct xc2028_ctrl ctl;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001589
Mauro Carvalho Chehab3ca9c092008-04-17 21:37:53 -03001590 em28xx_setup_xc3028(dev, &ctl);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001591
1592 xc2028_cfg.tuner = TUNER_XC2028;
1593 xc2028_cfg.priv = &ctl;
1594
1595 em28xx_i2c_call_clients(dev, TUNER_SET_CONFIG, &xc2028_cfg);
1596 }
1597
1598 /* configure tuner */
1599 f.tuner = 0;
1600 f.type = V4L2_TUNER_ANALOG_TV;
1601 f.frequency = 9076; /* just a magic number */
1602 dev->ctl_freq = f.frequency;
1603 em28xx_i2c_call_clients(dev, VIDIOC_S_FREQUENCY, &f);
1604}
1605
1606static int em28xx_hint_board(struct em28xx *dev)
1607{
1608 int i;
1609
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001610 /* HINT method: EEPROM
1611 *
1612 * This method works only for boards with eeprom.
1613 * Uses a hash of all eeprom bytes. The hash should be
1614 * unique for a vendor/tuner pair.
1615 * There are a high chance that tuners for different
1616 * video standards produce different hashes.
1617 */
1618 for (i = 0; i < ARRAY_SIZE(em28xx_eeprom_hash); i++) {
1619 if (dev->hash == em28xx_eeprom_hash[i].hash) {
1620 dev->model = em28xx_eeprom_hash[i].model;
1621 dev->tuner_type = em28xx_eeprom_hash[i].tuner;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001622
1623 em28xx_errdev("Your board has no unique USB ID.\n");
1624 em28xx_errdev("A hint were successfully done, "
1625 "based on eeprom hash.\n");
1626 em28xx_errdev("This method is not 100%% failproof.\n");
1627 em28xx_errdev("If the board were missdetected, "
1628 "please email this log to:\n");
1629 em28xx_errdev("\tV4L Mailing List "
1630 " <video4linux-list@redhat.com>\n");
1631 em28xx_errdev("Board detected as %s\n",
1632 em28xx_boards[dev->model].name);
1633
1634 return 0;
1635 }
1636 }
Sascha Sommerfad7b952007-11-04 08:06:48 -03001637
Mauro Carvalho Chehabd2ba0552007-11-04 08:32:42 -03001638 /* HINT method: I2C attached devices
1639 *
1640 * This method works for all boards.
1641 * Uses a hash of i2c scanned devices.
1642 * Devices with the same i2c attached chips will
1643 * be considered equal.
1644 * This method is less precise than the eeprom one.
1645 */
1646
Sascha Sommerfad7b952007-11-04 08:06:48 -03001647 /* user did not request i2c scanning => do it now */
1648 if (!dev->i2c_hash)
1649 em28xx_do_i2c_scan(dev);
1650
1651 for (i = 0; i < ARRAY_SIZE(em28xx_i2c_hash); i++) {
1652 if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
1653 dev->model = em28xx_i2c_hash[i].model;
1654 dev->tuner_type = em28xx_i2c_hash[i].tuner;
1655 em28xx_errdev("Your board has no unique USB ID.\n");
1656 em28xx_errdev("A hint were successfully done, "
1657 "based on i2c devicelist hash.\n");
1658 em28xx_errdev("This method is not 100%% failproof.\n");
1659 em28xx_errdev("If the board were missdetected, "
1660 "please email this log to:\n");
1661 em28xx_errdev("\tV4L Mailing List "
1662 " <video4linux-list@redhat.com>\n");
1663 em28xx_errdev("Board detected as %s\n",
1664 em28xx_boards[dev->model].name);
1665
1666 return 0;
1667 }
1668 }
1669
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001670 em28xx_errdev("Your board has no unique USB ID and thus need a "
1671 "hint to be detected.\n");
1672 em28xx_errdev("You may try to use card=<n> insmod option to "
1673 "workaround that.\n");
1674 em28xx_errdev("Please send an email with this log to:\n");
1675 em28xx_errdev("\tV4L Mailing List <video4linux-list@redhat.com>\n");
1676 em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash);
Sascha Sommerfad7b952007-11-04 08:06:48 -03001677 em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001678
1679 em28xx_errdev("Here is a list of valid choices for the card=<n>"
1680 " insmod option:\n");
1681 for (i = 0; i < em28xx_bcount; i++) {
1682 em28xx_errdev(" card=%d -> %s\n",
1683 i, em28xx_boards[i].name);
1684 }
1685 return -1;
Mauro Carvalho Chehab882876b2007-10-29 11:33:18 -03001686}
1687
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001688/* ----------------------------------------------------------------------- */
1689void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir)
1690{
1691 if (disable_ir) {
1692 ir->get_key = NULL;
1693 return ;
1694 }
1695
1696 /* detect & configure */
1697 switch (dev->model) {
1698 case (EM2800_BOARD_UNKNOWN):
1699 break;
1700 case (EM2820_BOARD_UNKNOWN):
1701 break;
1702 case (EM2800_BOARD_TERRATEC_CINERGY_200):
1703 case (EM2820_BOARD_TERRATEC_CINERGY_250):
1704 ir->ir_codes = ir_codes_em_terratec;
1705 ir->get_key = em28xx_get_key_terratec;
1706 snprintf(ir->c.name, sizeof(ir->c.name),
1707 "i2c IR (EM28XX Terratec)");
1708 break;
1709 case (EM2820_BOARD_PINNACLE_USB_2):
1710 ir->ir_codes = ir_codes_pinnacle_grey;
1711 ir->get_key = em28xx_get_key_pinnacle_usb_grey;
1712 snprintf(ir->c.name, sizeof(ir->c.name),
1713 "i2c IR (EM28XX Pinnacle PCTV)");
1714 break;
1715 case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
1716 ir->ir_codes = ir_codes_hauppauge_new;
1717 ir->get_key = em28xx_get_key_em_haup;
1718 snprintf(ir->c.name, sizeof(ir->c.name),
1719 "i2c IR (EM2840 Hauppauge)");
1720 break;
1721 case (EM2820_BOARD_MSI_VOX_USB_2):
1722 break;
1723 case (EM2800_BOARD_LEADTEK_WINFAST_USBII):
1724 break;
1725 case (EM2800_BOARD_KWORLD_USB2800):
1726 break;
Aron Szabo59d07f12008-07-27 13:47:52 -03001727 case (EM2800_BOARD_GRABBEEX_USB2800):
1728 break;
Mauro Carvalho Chehabc8793b02008-01-13 15:42:17 -03001729 }
1730}
1731
Mauro Carvalho Chehab3acf2802005-11-08 21:38:27 -08001732void em28xx_card_setup(struct em28xx *dev)
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001733{
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001734 em28xx_set_model(dev);
1735
1736 dev->tuner_type = em28xx_boards[dev->model].tuner_type;
Mauro Carvalho Chehab31e05302008-11-20 18:47:37 -03001737 if (em28xx_boards[dev->model].tuner_addr)
1738 dev->tuner_addr = em28xx_boards[dev->model].tuner_addr;
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001739
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001740 /* request some modules */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001741 switch (dev->model) {
1742 case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03001743 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
Devin Heitmueller17d9d552008-06-08 10:22:03 -03001744 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
Mauro Carvalho Chehab10ac6602008-07-27 14:58:58 -03001745 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001746 {
1747 struct tveeprom tv;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001748#ifdef CONFIG_MODULES
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001749 request_module("tveeprom");
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001750#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001751 /* Call first TVeeprom */
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001752
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001753 dev->i2c_client.addr = 0xa0 >> 1;
1754 tveeprom_hauppauge_analog(&dev->i2c_client, &tv, dev->eedata);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001755
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001756 dev->tuner_type = tv.tuner_type;
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001757
Hans Verkuil38f9d302008-07-23 05:09:15 -03001758 if (tv.audio_processor == V4L2_IDENT_MSPX4XX) {
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001759 dev->i2s_speed = 2048000;
1760 dev->has_msp34xx = 1;
1761 }
Mauro Carvalho Chehab98ae1272007-11-05 09:30:39 -03001762#ifdef CONFIG_MODULES
1763 if (tv.has_ir)
1764 request_module("ir-kbd-i2c");
1765#endif
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001766 break;
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001767 }
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001768 case EM2820_BOARD_KWORLD_PVRTV2800RF:
1769 /* GPIO enables sound on KWORLD PVR TV 2800RF */
Devin Heitmueller6d676d82008-11-25 06:04:02 -03001770 em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9);
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001771 break;
1772 case EM2820_BOARD_UNKNOWN:
1773 case EM2800_BOARD_UNKNOWN:
Darron Broadda3808e2008-09-30 02:46:41 -03001774 /*
1775 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
1776 *
1777 * This occurs because they share identical USB vendor and
1778 * product IDs.
1779 *
1780 * What we do here is look up the EEPROM hash of the K-WORLD
1781 * and if it is found then we decide that we do not have
1782 * a DIGIVOX and reset the device to the K-WORLD instead.
1783 *
1784 * This solution is only valid if they do not share eeprom
1785 * hash identities which has not been determined as yet.
1786 */
1787 case EM2880_BOARD_MSI_DIGIVOX_AD:
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001788 if (!em28xx_hint_board(dev))
1789 em28xx_set_model(dev);
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001790 break;
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001791 }
1792
Devin Heitmuellera9fc52b2008-06-28 08:57:06 -03001793 if (dev->has_snapshot_button)
1794 em28xx_register_snapshot_button(dev);
1795
Douglas Schilling Landgraf95b86a92008-07-27 14:03:32 -03001796 if (dev->valid == EM28XX_BOARD_NOT_VALIDATED) {
1797 em28xx_errdev("\n\n");
1798 em28xx_errdev("The support for this board weren't "
1799 "valid yet.\n");
1800 em28xx_errdev("Please send a report of having this working\n");
1801 em28xx_errdev("not to V4L mailing list (and/or to other "
1802 "addresses)\n\n");
1803 }
1804
Mauro Carvalho Chehabf8b60302007-11-05 08:42:55 -03001805 /* Allow override tuner type by a module parameter */
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001806 if (tuner >= 0)
1807 dev->tuner_type = tuner;
1808
1809#ifdef CONFIG_MODULES
1810 /* request some modules */
1811 if (dev->has_msp34xx)
1812 request_module("msp3400");
1813 if (dev->decoder == EM28XX_SAA7113 || dev->decoder == EM28XX_SAA7114)
1814 request_module("saa7115");
1815 if (dev->decoder == EM28XX_TVP5150)
1816 request_module("tvp5150");
Mauro Carvalho Chehabed086312008-01-24 06:59:20 -03001817 if (dev->tuner_type != TUNER_ABSENT)
Mauro Carvalho Chehab03910cc2007-11-03 21:20:59 -03001818 request_module("tuner");
1819#endif
1820
Mauro Carvalho Chehabc23f5942007-11-23 14:22:14 -03001821 em28xx_config_tuner(dev);
Mauro Carvalho Chehaba924a492008-11-12 08:41:29 -03001822
1823 em28xx_ir_init(dev);
akpm@osdl.orga6c2ba22005-11-08 21:37:07 -08001824}