Revert "[PATCH] paravirt: Add startup infrastructure for paravirtualization"
[pv_ops_mirror.git] / drivers / media / video / ivtv / ivtv-cards.c
blob8eab02083887034240101053a6ab23850b81dd18
1 /*
2 Functions to query card hardware
3 Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
4 Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "ivtv-driver.h"
22 #include "ivtv-cards.h"
23 #include "ivtv-i2c.h"
25 #include <media/msp3400.h>
26 #include <media/wm8775.h>
27 #include <media/cs53l32a.h>
28 #include <media/cx25840.h>
29 #include <media/upd64031a.h>
31 #define MSP_TUNER MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \
32 MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER)
33 #define MSP_SCART1 MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \
34 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART)
35 #define MSP_SCART2 MSP_INPUT(MSP_IN_SCART2, MSP_IN_TUNER1, \
36 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART)
37 #define MSP_SCART3 MSP_INPUT(MSP_IN_SCART3, MSP_IN_TUNER1, \
38 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART)
39 #define MSP_MONO MSP_INPUT(MSP_IN_MONO, MSP_IN_TUNER1, \
40 MSP_DSP_IN_SCART, MSP_DSP_IN_SCART)
42 /********************** card configuration *******************************/
44 /* Please add new PCI IDs to: http://pci-ids.ucw.cz/iii
45 This keeps the PCI ID database up to date. Note that the entries
46 must be added under vendor 0x4444 (Conexant) as subsystem IDs.
47 New vendor IDs should still be added to the vendor ID list. */
49 /* Hauppauge PVR-250 cards */
51 /* Note: for Hauppauge cards the tveeprom information is used instead of PCI IDs */
52 static const struct ivtv_card ivtv_card_pvr250 = {
53 .type = IVTV_CARD_PVR_250,
54 .name = "Hauppauge WinTV PVR-250",
55 .v4l2_capabilities = IVTV_CAP_ENCODER,
56 .hw_video = IVTV_HW_SAA7115,
57 .hw_audio = IVTV_HW_MSP34XX,
58 .hw_audio_ctrl = IVTV_HW_MSP34XX,
59 .hw_all = IVTV_HW_MSP34XX | IVTV_HW_SAA7115 |
60 IVTV_HW_TVEEPROM | IVTV_HW_TUNER,
61 .video_inputs = {
62 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 },
63 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
64 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE0 },
65 { IVTV_CARD_INPUT_SVIDEO2, 2, IVTV_SAA71XX_SVIDEO1 },
66 { IVTV_CARD_INPUT_COMPOSITE2, 2, IVTV_SAA71XX_COMPOSITE1 },
67 { IVTV_CARD_INPUT_COMPOSITE3, 1, IVTV_SAA71XX_COMPOSITE5 },
69 .audio_inputs = {
70 { IVTV_CARD_INPUT_AUD_TUNER, MSP_TUNER },
71 { IVTV_CARD_INPUT_LINE_IN1, MSP_SCART1 },
72 { IVTV_CARD_INPUT_LINE_IN2, MSP_SCART3 },
74 .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, MSP_SCART2 },
77 /* ------------------------------------------------------------------------- */
79 /* Hauppauge PVR-350 cards */
81 /* Outputs for Hauppauge PVR350 cards */
82 static struct ivtv_card_output ivtv_pvr350_outputs[] = {
84 .name = "S-Video + Composite",
85 .video_output = 0,
86 }, {
87 .name = "Composite",
88 .video_output = 1,
89 }, {
90 .name = "S-Video",
91 .video_output = 2,
92 }, {
93 .name = "RGB",
94 .video_output = 3,
95 }, {
96 .name = "YUV C",
97 .video_output = 4,
98 }, {
99 .name = "YUV V",
100 .video_output = 5,
104 static const struct ivtv_card ivtv_card_pvr350 = {
105 .type = IVTV_CARD_PVR_350,
106 .name = "Hauppauge WinTV PVR-350",
107 .v4l2_capabilities = IVTV_CAP_ENCODER | IVTV_CAP_DECODER,
108 .video_outputs = ivtv_pvr350_outputs,
109 .nof_outputs = ARRAY_SIZE(ivtv_pvr350_outputs),
110 .hw_video = IVTV_HW_SAA7115,
111 .hw_audio = IVTV_HW_MSP34XX,
112 .hw_audio_ctrl = IVTV_HW_MSP34XX,
113 .hw_all = IVTV_HW_MSP34XX | IVTV_HW_SAA7115 |
114 IVTV_HW_SAA7127 | IVTV_HW_TVEEPROM | IVTV_HW_TUNER,
115 .video_inputs = {
116 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 },
117 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
118 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE0 },
119 { IVTV_CARD_INPUT_SVIDEO2, 2, IVTV_SAA71XX_SVIDEO1 },
120 { IVTV_CARD_INPUT_COMPOSITE2, 2, IVTV_SAA71XX_COMPOSITE1 },
121 { IVTV_CARD_INPUT_COMPOSITE3, 1, IVTV_SAA71XX_COMPOSITE5 },
123 .audio_inputs = {
124 { IVTV_CARD_INPUT_AUD_TUNER, MSP_TUNER },
125 { IVTV_CARD_INPUT_LINE_IN1, MSP_SCART1 },
126 { IVTV_CARD_INPUT_LINE_IN2, MSP_SCART3 },
128 .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, MSP_SCART2 },
131 /* PVR-350 V1 boards have a different audio tuner input and use a
132 saa7114 instead of a saa7115.
133 Note that the info below comes from a pre-production model so it may
134 not be correct. Especially the audio behaves strangely (mono only it seems) */
135 static const struct ivtv_card ivtv_card_pvr350_v1 = {
136 .type = IVTV_CARD_PVR_350_V1,
137 .name = "Hauppauge WinTV PVR-350 (V1)",
138 .v4l2_capabilities = IVTV_CAP_ENCODER | IVTV_CAP_DECODER,
139 .video_outputs = ivtv_pvr350_outputs,
140 .nof_outputs = ARRAY_SIZE(ivtv_pvr350_outputs),
141 .hw_video = IVTV_HW_SAA7114,
142 .hw_audio = IVTV_HW_MSP34XX,
143 .hw_audio_ctrl = IVTV_HW_MSP34XX,
144 .hw_all = IVTV_HW_MSP34XX | IVTV_HW_SAA7114 |
145 IVTV_HW_SAA7127 | IVTV_HW_TVEEPROM | IVTV_HW_TUNER,
146 .video_inputs = {
147 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 },
148 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
149 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE0 },
150 { IVTV_CARD_INPUT_SVIDEO2, 2, IVTV_SAA71XX_SVIDEO1 },
151 { IVTV_CARD_INPUT_COMPOSITE2, 2, IVTV_SAA71XX_COMPOSITE1 },
152 { IVTV_CARD_INPUT_COMPOSITE3, 1, IVTV_SAA71XX_COMPOSITE5 },
154 .audio_inputs = {
155 { IVTV_CARD_INPUT_AUD_TUNER, MSP_MONO },
156 { IVTV_CARD_INPUT_LINE_IN1, MSP_SCART1 },
157 { IVTV_CARD_INPUT_LINE_IN2, MSP_SCART3 },
159 .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, MSP_SCART2 },
162 /* ------------------------------------------------------------------------- */
164 /* Hauppauge PVR-150/PVR-500 cards */
166 static const struct ivtv_card ivtv_card_pvr150 = {
167 .type = IVTV_CARD_PVR_150,
168 .name = "Hauppauge WinTV PVR-150",
169 .v4l2_capabilities = IVTV_CAP_ENCODER,
170 .hw_video = IVTV_HW_CX25840,
171 .hw_audio = IVTV_HW_CX25840,
172 .hw_audio_ctrl = IVTV_HW_CX25840,
173 .hw_muxer = IVTV_HW_WM8775,
174 .hw_all = IVTV_HW_WM8775 | IVTV_HW_CX25840 |
175 IVTV_HW_TVEEPROM | IVTV_HW_TUNER,
176 .video_inputs = {
177 { IVTV_CARD_INPUT_VID_TUNER, 0, CX25840_COMPOSITE7 },
178 { IVTV_CARD_INPUT_SVIDEO1, 1, CX25840_SVIDEO1 },
179 { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE3 },
180 { IVTV_CARD_INPUT_SVIDEO2, 2, CX25840_SVIDEO2 },
181 { IVTV_CARD_INPUT_COMPOSITE2, 2, CX25840_COMPOSITE4 },
183 .audio_inputs = {
184 { IVTV_CARD_INPUT_AUD_TUNER,
185 CX25840_AUDIO8, WM8775_AIN2 },
186 { IVTV_CARD_INPUT_LINE_IN1,
187 CX25840_AUDIO_SERIAL, WM8775_AIN2 },
188 { IVTV_CARD_INPUT_LINE_IN2,
189 CX25840_AUDIO_SERIAL, WM8775_AIN3 },
191 .radio_input = { IVTV_CARD_INPUT_AUD_TUNER,
192 CX25840_AUDIO_SERIAL, WM8775_AIN4 },
193 /* apparently needed for the IR blaster */
194 .gpio_init = { .direction = 0x1f01, .initial_value = 0x26f3 },
197 /* ------------------------------------------------------------------------- */
199 /* AVerMedia M179 cards */
201 static const struct ivtv_card_pci_info ivtv_pci_m179[] = {
202 { PCI_DEVICE_ID_IVTV15, IVTV_PCI_ID_AVERMEDIA, 0xa3cf },
203 { PCI_DEVICE_ID_IVTV15, IVTV_PCI_ID_AVERMEDIA, 0xa3ce },
204 { 0, 0, 0 }
207 static const struct ivtv_card ivtv_card_m179 = {
208 .type = IVTV_CARD_M179,
209 .name = "AVerMedia M179",
210 .v4l2_capabilities = IVTV_CAP_ENCODER,
211 .hw_video = IVTV_HW_SAA7114,
212 .hw_audio = IVTV_HW_GPIO,
213 .hw_audio_ctrl = IVTV_HW_GPIO,
214 .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA7114 | IVTV_HW_TUNER,
215 .video_inputs = {
216 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 },
217 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
218 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE3 },
220 .audio_inputs = {
221 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_GPIO_TUNER },
222 { IVTV_CARD_INPUT_LINE_IN1, IVTV_GPIO_LINE_IN },
224 .gpio_init = { .direction = 0xe380, .initial_value = 0x8290 },
225 .gpio_audio_input = { .mask = 0x8040, .tuner = 0x8000, .linein = 0x0000 },
226 .gpio_audio_mute = { .mask = 0x2000, .mute = 0x2000 },
227 .gpio_audio_mode = { .mask = 0x4300, .mono = 0x4000, .stereo = 0x0200,
228 .lang1 = 0x0200, .lang2 = 0x0100, .both = 0x0000 },
229 .gpio_audio_freq = { .mask = 0x0018, .f32000 = 0x0000,
230 .f44100 = 0x0008, .f48000 = 0x0010 },
231 .gpio_audio_detect = { .mask = 0x4000, .stereo = 0x0000 },
232 .tuners = {
233 /* As far as we know all M179 cards use this tuner */
234 { .std = V4L2_STD_ALL, .tuner = TUNER_PHILIPS_NTSC },
236 .pci_list = ivtv_pci_m179,
239 /* ------------------------------------------------------------------------- */
241 /* Yuan MPG600/Kuroutoshikou ITVC16-STVLP cards */
243 static const struct ivtv_card_pci_info ivtv_pci_mpg600[] = {
244 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN1, 0xfff3 },
245 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN1, 0xffff },
246 { 0, 0, 0 }
249 static const struct ivtv_card ivtv_card_mpg600 = {
250 .type = IVTV_CARD_MPG600,
251 .name = "Yuan MPG600, Kuroutoshikou ITVC16-STVLP",
252 .v4l2_capabilities = IVTV_CAP_ENCODER,
253 .hw_video = IVTV_HW_SAA7115,
254 .hw_audio = IVTV_HW_GPIO,
255 .hw_audio_ctrl = IVTV_HW_GPIO,
256 .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA7115 | IVTV_HW_TUNER,
257 .video_inputs = {
258 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 },
259 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
260 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE3 },
262 .audio_inputs = {
263 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_GPIO_TUNER },
264 { IVTV_CARD_INPUT_LINE_IN1, IVTV_GPIO_LINE_IN },
266 .gpio_init = { .direction = 0x3080, .initial_value = 0x0004 },
267 .gpio_audio_input = { .mask = 0x3000, .tuner = 0x0000, .linein = 0x2000 },
268 .gpio_audio_mute = { .mask = 0x0001, .mute = 0x0001 },
269 .gpio_audio_mode = { .mask = 0x000e, .mono = 0x0006, .stereo = 0x0004,
270 .lang1 = 0x0004, .lang2 = 0x0000, .both = 0x0008 },
271 .gpio_audio_detect = { .mask = 0x0900, .stereo = 0x0100 },
272 .tuners = {
273 /* The PAL tuner is confirmed */
274 { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FQ1216ME },
275 { .std = V4L2_STD_ALL, .tuner = TUNER_PHILIPS_FQ1286 },
277 .pci_list = ivtv_pci_mpg600,
280 /* ------------------------------------------------------------------------- */
282 /* Yuan MPG160/Kuroutoshikou ITVC15-STVLP cards */
284 static const struct ivtv_card_pci_info ivtv_pci_mpg160[] = {
285 { PCI_DEVICE_ID_IVTV15, IVTV_PCI_ID_YUAN1, 0 },
286 { PCI_DEVICE_ID_IVTV15, IVTV_PCI_ID_IODATA, 0x40a0 },
287 { 0, 0, 0 }
290 static const struct ivtv_card ivtv_card_mpg160 = {
291 .type = IVTV_CARD_MPG160,
292 .name = "YUAN MPG160, Kuroutoshikou ITVC15-STVLP, I/O Data GV-M2TV/PCI",
293 .v4l2_capabilities = IVTV_CAP_ENCODER,
294 .hw_video = IVTV_HW_SAA7114,
295 .hw_audio = IVTV_HW_GPIO,
296 .hw_audio_ctrl = IVTV_HW_GPIO,
297 .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA7114 | IVTV_HW_TUNER,
298 .video_inputs = {
299 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 },
300 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
301 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE3 },
303 .audio_inputs = {
304 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_GPIO_TUNER },
305 { IVTV_CARD_INPUT_LINE_IN1, IVTV_GPIO_LINE_IN },
307 .gpio_init = { .direction = 0x7080, .initial_value = 0x400c },
308 .gpio_audio_input = { .mask = 0x3000, .tuner = 0x0000, .linein = 0x2000 },
309 .gpio_audio_mute = { .mask = 0x0001, .mute = 0x0001 },
310 .gpio_audio_mode = { .mask = 0x000e, .mono = 0x0006, .stereo = 0x0004,
311 .lang1 = 0x0004, .lang2 = 0x0000, .both = 0x0008 },
312 .gpio_audio_detect = { .mask = 0x0900, .stereo = 0x0100 },
313 .tuners = {
314 { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FQ1216ME },
315 { .std = V4L2_STD_ALL, .tuner = TUNER_PHILIPS_FQ1286 },
317 .pci_list = ivtv_pci_mpg160,
320 /* ------------------------------------------------------------------------- */
322 /* Yuan PG600/Diamond PVR-550 cards */
324 static const struct ivtv_card_pci_info ivtv_pci_pg600[] = {
325 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_DIAMONDMM, 0x0070 },
326 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN3, 0x0600 },
327 { 0, 0, 0 }
330 static const struct ivtv_card ivtv_card_pg600 = {
331 .type = IVTV_CARD_PG600,
332 .name = "Yuan PG600, Diamond PVR-550",
333 .v4l2_capabilities = IVTV_CAP_ENCODER,
334 .hw_video = IVTV_HW_CX25840,
335 .hw_audio = IVTV_HW_CX25840,
336 .hw_audio_ctrl = IVTV_HW_CX25840,
337 .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER,
338 .video_inputs = {
339 { IVTV_CARD_INPUT_VID_TUNER, 0, CX25840_COMPOSITE2 },
340 { IVTV_CARD_INPUT_SVIDEO1, 1,
341 CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
342 { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE1 },
344 .audio_inputs = {
345 { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5 },
346 { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL },
348 .tuners = {
349 { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FQ1216ME },
350 { .std = V4L2_STD_ALL, .tuner = TUNER_PHILIPS_FQ1286 },
352 .pci_list = ivtv_pci_pg600,
355 /* ------------------------------------------------------------------------- */
357 /* Adaptec VideOh! AVC-2410 card */
359 static const struct ivtv_card_pci_info ivtv_pci_avc2410[] = {
360 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_ADAPTEC, 0x0093 },
361 { 0, 0, 0 }
364 static const struct ivtv_card ivtv_card_avc2410 = {
365 .type = IVTV_CARD_AVC2410,
366 .name = "Adaptec VideOh! AVC-2410",
367 .v4l2_capabilities = IVTV_CAP_ENCODER,
368 .hw_video = IVTV_HW_SAA7115,
369 .hw_audio = IVTV_HW_MSP34XX,
370 .hw_audio_ctrl = IVTV_HW_MSP34XX,
371 .hw_muxer = IVTV_HW_CS53L32A,
372 .hw_all = IVTV_HW_MSP34XX | IVTV_HW_CS53L32A |
373 IVTV_HW_SAA7115 | IVTV_HW_TUNER,
374 .video_inputs = {
375 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 },
376 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
377 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE3 },
379 .audio_inputs = {
380 { IVTV_CARD_INPUT_AUD_TUNER,
381 MSP_TUNER, CS53L32A_IN0 },
382 { IVTV_CARD_INPUT_LINE_IN1,
383 MSP_SCART1, CS53L32A_IN2 },
385 /* This card has no eeprom and in fact the Windows driver relies
386 on the country/region setting of the user to decide which tuner
387 is available. */
388 .tuners = {
389 /* This tuner has been verified for the AVC2410 */
390 { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FM1216ME_MK3 },
391 /* This is a good guess, but I'm not totally sure this is
392 the correct tuner for NTSC. */
393 { .std = V4L2_STD_ALL, .tuner = TUNER_PHILIPS_FM1236_MK3 },
395 .pci_list = ivtv_pci_avc2410,
398 /* ------------------------------------------------------------------------- */
400 /* Adaptec VideOh! AVC-2010 card */
402 static const struct ivtv_card_pci_info ivtv_pci_avc2010[] = {
403 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_ADAPTEC, 0x0092 },
404 { 0, 0, 0 }
407 static const struct ivtv_card ivtv_card_avc2010 = {
408 .type = IVTV_CARD_AVC2010,
409 .name = "Adaptec VideOh! AVC-2010",
410 .v4l2_capabilities = IVTV_CAP_ENCODER,
411 .hw_video = IVTV_HW_SAA7115,
412 .hw_audio = IVTV_HW_CS53L32A,
413 .hw_audio_ctrl = IVTV_HW_CS53L32A,
414 .hw_all = IVTV_HW_CS53L32A | IVTV_HW_SAA7115,
415 .video_inputs = {
416 { IVTV_CARD_INPUT_SVIDEO1, 0, IVTV_SAA71XX_SVIDEO0 },
417 { IVTV_CARD_INPUT_COMPOSITE1, 0, IVTV_SAA71XX_COMPOSITE3 },
419 .audio_inputs = {
420 { IVTV_CARD_INPUT_LINE_IN1, CS53L32A_IN2 },
422 /* Does not have a tuner */
423 .pci_list = ivtv_pci_avc2010,
426 /* ------------------------------------------------------------------------- */
428 /* Nagase Transgear 5000TV card */
430 static const struct ivtv_card_pci_info ivtv_pci_tg5000tv[] = {
431 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_AVERMEDIA, 0xbfff },
432 { 0, 0, 0 }
435 static const struct ivtv_card ivtv_card_tg5000tv = {
436 .type = IVTV_CARD_TG5000TV,
437 .name = "Nagase Transgear 5000TV",
438 .v4l2_capabilities = IVTV_CAP_ENCODER,
439 .hw_video = IVTV_HW_SAA7114 | IVTV_HW_UPD64031A | IVTV_HW_UPD6408X |
440 IVTV_HW_GPIO,
441 .hw_audio = IVTV_HW_GPIO,
442 .hw_audio_ctrl = IVTV_HW_GPIO,
443 .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA7114 | IVTV_HW_TUNER |
444 IVTV_HW_UPD64031A | IVTV_HW_UPD6408X,
445 .video_inputs = {
446 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_SVIDEO0 },
447 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO2 },
448 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_SVIDEO2 },
450 .audio_inputs = {
451 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_GPIO_TUNER },
452 { IVTV_CARD_INPUT_LINE_IN1, IVTV_GPIO_LINE_IN },
454 .gr_config = UPD64031A_VERTICAL_EXTERNAL,
455 .gpio_init = { .direction = 0xe080, .initial_value = 0x8000 },
456 .gpio_audio_input = { .mask = 0x8080, .tuner = 0x8000, .linein = 0x0080 },
457 .gpio_audio_mute = { .mask = 0x6000, .mute = 0x6000 },
458 .gpio_audio_mode = { .mask = 0x4300, .mono = 0x4000, .stereo = 0x0200,
459 .lang1 = 0x0300, .lang2 = 0x0000, .both = 0x0200 },
460 .gpio_video_input = { .mask = 0x0030, .tuner = 0x0000,
461 .composite = 0x0010, .svideo = 0x0020 },
462 .tuners = {
463 { .std = V4L2_STD_525_60, .tuner = TUNER_PHILIPS_FQ1286 },
465 .pci_list = ivtv_pci_tg5000tv,
468 /* ------------------------------------------------------------------------- */
470 /* AOpen VA2000MAX-SNT6 card */
472 static const struct ivtv_card_pci_info ivtv_pci_va2000[] = {
473 { PCI_DEVICE_ID_IVTV16, 0, 0xff5f },
474 { 0, 0, 0 }
477 static const struct ivtv_card ivtv_card_va2000 = {
478 .type = IVTV_CARD_VA2000MAX_SNT6,
479 .name = "AOpen VA2000MAX-SNT6",
480 .v4l2_capabilities = IVTV_CAP_ENCODER,
481 .hw_video = IVTV_HW_SAA7115 | IVTV_HW_UPD6408X,
482 .hw_audio = IVTV_HW_MSP34XX,
483 .hw_audio_ctrl = IVTV_HW_MSP34XX,
484 .hw_all = IVTV_HW_MSP34XX | IVTV_HW_SAA7115 |
485 IVTV_HW_UPD6408X | IVTV_HW_TUNER,
486 .video_inputs = {
487 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_SVIDEO0 },
489 .audio_inputs = {
490 { IVTV_CARD_INPUT_AUD_TUNER, MSP_TUNER },
492 .tuners = {
493 { .std = V4L2_STD_525_60, .tuner = TUNER_PHILIPS_FQ1286 },
495 .pci_list = ivtv_pci_va2000,
498 /* ------------------------------------------------------------------------- */
500 /* Yuan MPG600GR/Kuroutoshikou CX23416GYC-STVLP cards */
502 static const struct ivtv_card_pci_info ivtv_pci_cx23416gyc[] = {
503 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN1, 0x0600 },
504 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN4, 0x0600 },
505 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_MELCO, 0x0523 },
506 { 0, 0, 0 }
509 static const struct ivtv_card ivtv_card_cx23416gyc = {
510 .type = IVTV_CARD_CX23416GYC,
511 .name = "Yuan MPG600GR, Kuroutoshikou CX23416GYC-STVLP",
512 .v4l2_capabilities = IVTV_CAP_ENCODER,
513 .hw_video = IVTV_HW_SAA717X | IVTV_HW_GPIO |
514 IVTV_HW_UPD64031A | IVTV_HW_UPD6408X,
515 .hw_audio = IVTV_HW_SAA717X,
516 .hw_audio_ctrl = IVTV_HW_SAA717X,
517 .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA717X | IVTV_HW_TUNER |
518 IVTV_HW_UPD64031A | IVTV_HW_UPD6408X,
519 .video_inputs = {
520 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_SVIDEO3 |
521 IVTV_SAA717X_TUNER_FLAG },
522 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
523 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_SVIDEO3 },
525 .audio_inputs = {
526 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_SAA717X_IN2 },
527 { IVTV_CARD_INPUT_LINE_IN1, IVTV_SAA717X_IN0 },
529 .gr_config = UPD64031A_VERTICAL_EXTERNAL,
530 .gpio_init = { .direction = 0xf880, .initial_value = 0x8800 },
531 .gpio_video_input = { .mask = 0x0020, .tuner = 0x0000,
532 .composite = 0x0020, .svideo = 0x0020 },
533 .gpio_audio_freq = { .mask = 0xc000, .f32000 = 0x0000,
534 .f44100 = 0x4000, .f48000 = 0x8000 },
535 .tuners = {
536 { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FM1216ME_MK3 },
537 { .std = V4L2_STD_ALL, .tuner = TUNER_PHILIPS_FM1236_MK3 },
539 .pci_list = ivtv_pci_cx23416gyc,
542 static const struct ivtv_card ivtv_card_cx23416gyc_nogr = {
543 .type = IVTV_CARD_CX23416GYC_NOGR,
544 .name = "Yuan MPG600GR, Kuroutoshikou CX23416GYC-STVLP (no GR)",
545 .v4l2_capabilities = IVTV_CAP_ENCODER,
546 .hw_video = IVTV_HW_SAA717X | IVTV_HW_GPIO | IVTV_HW_UPD6408X,
547 .hw_audio = IVTV_HW_SAA717X,
548 .hw_audio_ctrl = IVTV_HW_SAA717X,
549 .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA717X | IVTV_HW_TUNER |
550 IVTV_HW_UPD6408X,
551 .video_inputs = {
552 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 |
553 IVTV_SAA717X_TUNER_FLAG },
554 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
555 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE0 },
557 .audio_inputs = {
558 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_SAA717X_IN2 },
559 { IVTV_CARD_INPUT_LINE_IN1, IVTV_SAA717X_IN0 },
561 .gpio_init = { .direction = 0xf880, .initial_value = 0x8800 },
562 .gpio_video_input = { .mask = 0x0020, .tuner = 0x0000,
563 .composite = 0x0020, .svideo = 0x0020 },
564 .gpio_audio_freq = { .mask = 0xc000, .f32000 = 0x0000,
565 .f44100 = 0x4000, .f48000 = 0x8000 },
566 .tuners = {
567 { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FM1216ME_MK3 },
568 { .std = V4L2_STD_ALL, .tuner = TUNER_PHILIPS_FM1236_MK3 },
572 static const struct ivtv_card ivtv_card_cx23416gyc_nogrycs = {
573 .type = IVTV_CARD_CX23416GYC_NOGRYCS,
574 .name = "Yuan MPG600GR, Kuroutoshikou CX23416GYC-STVLP (no GR/YCS)",
575 .v4l2_capabilities = IVTV_CAP_ENCODER,
576 .hw_video = IVTV_HW_SAA717X | IVTV_HW_GPIO,
577 .hw_audio = IVTV_HW_SAA717X,
578 .hw_audio_ctrl = IVTV_HW_SAA717X,
579 .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA717X | IVTV_HW_TUNER,
580 .video_inputs = {
581 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 |
582 IVTV_SAA717X_TUNER_FLAG },
583 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
584 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE0 },
586 .audio_inputs = {
587 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_SAA717X_IN2 },
588 { IVTV_CARD_INPUT_LINE_IN1, IVTV_SAA717X_IN0 },
590 .gpio_init = { .direction = 0xf880, .initial_value = 0x8800 },
591 .gpio_video_input = { .mask = 0x0020, .tuner = 0x0000,
592 .composite = 0x0020, .svideo = 0x0020 },
593 .gpio_audio_freq = { .mask = 0xc000, .f32000 = 0x0000,
594 .f44100 = 0x4000, .f48000 = 0x8000 },
595 .tuners = {
596 { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FM1216ME_MK3 },
597 { .std = V4L2_STD_ALL, .tuner = TUNER_PHILIPS_FM1236_MK3 },
601 /* ------------------------------------------------------------------------- */
603 /* I/O Data GV-MVP/RX & GV-MVP/RX2W (dual tuner) cards */
605 static const struct ivtv_card_pci_info ivtv_pci_gv_mvprx[] = {
606 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_IODATA, 0xd01e },
607 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_IODATA, 0xd038 }, /* 2W unit #1 */
608 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_IODATA, 0xd039 }, /* 2W unit #2 */
609 { 0, 0, 0 }
612 static const struct ivtv_card ivtv_card_gv_mvprx = {
613 .type = IVTV_CARD_GV_MVPRX,
614 .name = "I/O Data GV-MVP/RX, GV-MVP/RX2W (dual tuner)",
615 .v4l2_capabilities = IVTV_CAP_ENCODER,
616 .hw_video = IVTV_HW_SAA7115 | IVTV_HW_UPD64031A | IVTV_HW_UPD6408X,
617 .hw_audio = IVTV_HW_GPIO,
618 .hw_audio_ctrl = IVTV_HW_WM8739,
619 .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA7115 | IVTV_HW_TVAUDIO |
620 IVTV_HW_TUNER | IVTV_HW_WM8739 |
621 IVTV_HW_UPD64031A | IVTV_HW_UPD6408X,
622 .video_inputs = {
623 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_SVIDEO0 },
624 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO1 },
625 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_SVIDEO2 },
627 .audio_inputs = {
628 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_GPIO_TUNER },
629 { IVTV_CARD_INPUT_LINE_IN1, IVTV_GPIO_LINE_IN },
631 .gpio_init = { .direction = 0xc301, .initial_value = 0x0200 },
632 .gpio_audio_input = { .mask = 0xffff, .tuner = 0x0200, .linein = 0x0300 },
633 .tuners = {
634 /* This card has the Panasonic VP27 tuner */
635 { .std = V4L2_STD_525_60, .tuner = TUNER_PANASONIC_VP27 },
637 .pci_list = ivtv_pci_gv_mvprx,
640 /* ------------------------------------------------------------------------- */
642 /* I/O Data GV-MVP/RX2E card */
644 static const struct ivtv_card_pci_info ivtv_pci_gv_mvprx2e[] = {
645 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_IODATA, 0xd025 },
646 {0, 0, 0}
649 static const struct ivtv_card ivtv_card_gv_mvprx2e = {
650 .type = IVTV_CARD_GV_MVPRX2E,
651 .name = "I/O Data GV-MVP/RX2E",
652 .v4l2_capabilities = IVTV_CAP_ENCODER,
653 .hw_video = IVTV_HW_SAA7115,
654 .hw_audio = IVTV_HW_GPIO,
655 .hw_audio_ctrl = IVTV_HW_WM8739,
656 .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA7115 | IVTV_HW_TUNER |
657 IVTV_HW_TVAUDIO | IVTV_HW_WM8739,
658 .video_inputs = {
659 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE4 },
660 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 },
661 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE3 },
663 .audio_inputs = {
664 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_GPIO_TUNER },
665 { IVTV_CARD_INPUT_LINE_IN1, IVTV_GPIO_LINE_IN },
667 .gpio_init = { .direction = 0xc301, .initial_value = 0x0200 },
668 .gpio_audio_input = { .mask = 0xffff, .tuner = 0x0200, .linein = 0x0300 },
669 .tuners = {
670 /* This card has the Panasonic VP27 tuner */
671 { .std = V4L2_STD_525_60, .tuner = TUNER_PANASONIC_VP27 },
673 .pci_list = ivtv_pci_gv_mvprx2e,
676 /* ------------------------------------------------------------------------- */
678 /* GotVIEW PCI DVD card */
680 static const struct ivtv_card_pci_info ivtv_pci_gotview_pci_dvd[] = {
681 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN1, 0x0600 },
682 { 0, 0, 0 }
685 static const struct ivtv_card ivtv_card_gotview_pci_dvd = {
686 .type = IVTV_CARD_GOTVIEW_PCI_DVD,
687 .name = "GotView PCI DVD",
688 .v4l2_capabilities = IVTV_CAP_ENCODER,
689 .hw_video = IVTV_HW_SAA717X,
690 .hw_audio = IVTV_HW_SAA717X,
691 .hw_audio_ctrl = IVTV_HW_SAA717X,
692 .hw_all = IVTV_HW_SAA717X | IVTV_HW_TUNER,
693 .video_inputs = {
694 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_COMPOSITE1 }, /* pin 116 */
695 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO0 }, /* pin 114/109 */
696 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_COMPOSITE3 }, /* pin 118 */
698 .audio_inputs = {
699 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_SAA717X_IN0 },
700 { IVTV_CARD_INPUT_LINE_IN1, IVTV_SAA717X_IN2 },
702 .gpio_init = { .direction = 0xf000, .initial_value = 0xA000 },
703 .tuners = {
704 /* This card has a Philips FQ1216ME MK3 tuner */
705 { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FM1216ME_MK3 },
707 .pci_list = ivtv_pci_gotview_pci_dvd,
710 /* ------------------------------------------------------------------------- */
712 /* GotVIEW PCI DVD2 Deluxe card */
714 static const struct ivtv_card_pci_info ivtv_pci_gotview_pci_dvd2[] = {
715 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_GOTVIEW1, 0x0600 },
716 { 0, 0, 0 }
719 static const struct ivtv_card ivtv_card_gotview_pci_dvd2 = {
720 .type = IVTV_CARD_GOTVIEW_PCI_DVD2,
721 .name = "GotView PCI DVD2 Deluxe",
722 .v4l2_capabilities = IVTV_CAP_ENCODER,
723 .hw_video = IVTV_HW_CX25840,
724 .hw_audio = IVTV_HW_CX25840,
725 .hw_audio_ctrl = IVTV_HW_CX25840,
726 .hw_muxer = IVTV_HW_GPIO,
727 .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER,
728 .video_inputs = {
729 { IVTV_CARD_INPUT_VID_TUNER, 0, CX25840_COMPOSITE2 },
730 { IVTV_CARD_INPUT_SVIDEO1, 1,
731 CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
732 { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE1 },
734 .audio_inputs = {
735 { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5, 0 },
736 { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL, 1 },
738 .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO_SERIAL, 2 },
739 .gpio_init = { .direction = 0x0800, .initial_value = 0 },
740 .gpio_audio_input = { .mask = 0x0800, .tuner = 0, .linein = 0, .radio = 0x0800 },
741 .tuners = {
742 /* This card has a Philips FQ1216ME MK5 tuner */
743 { .std = V4L2_STD_625_50, .tuner = TUNER_PHILIPS_FM1216ME_MK3 },
745 .pci_list = ivtv_pci_gotview_pci_dvd2,
748 /* ------------------------------------------------------------------------- */
750 /* Yuan MPC622 miniPCI card */
752 static const struct ivtv_card_pci_info ivtv_pci_yuan_mpc622[] = {
753 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN2, 0xd998 },
754 { 0, 0, 0 }
757 static const struct ivtv_card ivtv_card_yuan_mpc622 = {
758 .type = IVTV_CARD_YUAN_MPC622,
759 .name = "Yuan MPC622",
760 .v4l2_capabilities = IVTV_CAP_ENCODER,
761 .hw_video = IVTV_HW_CX25840,
762 .hw_audio = IVTV_HW_CX25840,
763 .hw_audio_ctrl = IVTV_HW_CX25840,
764 .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER,
765 .video_inputs = {
766 { IVTV_CARD_INPUT_VID_TUNER, 0, CX25840_COMPOSITE2 },
767 { IVTV_CARD_INPUT_SVIDEO1, 1,
768 CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
769 { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE1 },
771 .audio_inputs = {
772 { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5 },
773 { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL },
775 .gpio_init = { .direction = 0x00ff, .initial_value = 0x0002 },
776 .tuners = {
777 /* This card has the TDA8290/TDA8275 tuner chips */
778 { .std = V4L2_STD_ALL, .tuner = TUNER_PHILIPS_TDA8290 },
780 .pci_list = ivtv_pci_yuan_mpc622,
783 /* ------------------------------------------------------------------------- */
785 /* DIGITAL COWBOY DCT-MTVP1 card */
787 static const struct ivtv_card_pci_info ivtv_pci_dctmvtvp1[] = {
788 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_AVERMEDIA, 0xbfff },
789 { 0, 0, 0 }
792 static const struct ivtv_card ivtv_card_dctmvtvp1 = {
793 .type = IVTV_CARD_DCTMTVP1,
794 .name = "Digital Cowboy DCT-MTVP1",
795 .v4l2_capabilities = IVTV_CAP_ENCODER,
796 .hw_video = IVTV_HW_SAA7115 | IVTV_HW_UPD64031A | IVTV_HW_UPD6408X |
797 IVTV_HW_GPIO,
798 .hw_audio = IVTV_HW_GPIO,
799 .hw_audio_ctrl = IVTV_HW_GPIO,
800 .hw_all = IVTV_HW_GPIO | IVTV_HW_SAA7115 | IVTV_HW_TUNER |
801 IVTV_HW_UPD64031A | IVTV_HW_UPD6408X,
802 .video_inputs = {
803 { IVTV_CARD_INPUT_VID_TUNER, 0, IVTV_SAA71XX_SVIDEO0 },
804 { IVTV_CARD_INPUT_SVIDEO1, 1, IVTV_SAA71XX_SVIDEO2 },
805 { IVTV_CARD_INPUT_COMPOSITE1, 1, IVTV_SAA71XX_SVIDEO2 },
807 .audio_inputs = {
808 { IVTV_CARD_INPUT_AUD_TUNER, IVTV_GPIO_TUNER },
809 { IVTV_CARD_INPUT_LINE_IN1, IVTV_GPIO_LINE_IN },
811 .gpio_init = { .direction = 0xe080, .initial_value = 0x8000 },
812 .gpio_audio_input = { .mask = 0x8080, .tuner = 0x8000, .linein = 0x0080 },
813 .gpio_audio_mute = { .mask = 0x6000, .mute = 0x6000 },
814 .gpio_audio_mode = { .mask = 0x4300, .mono = 0x4000, .stereo = 0x0200,
815 .lang1 = 0x0300, .lang2 = 0x0000, .both = 0x0200 },
816 .gpio_video_input = { .mask = 0x0030, .tuner = 0x0000,
817 .composite = 0x0010, .svideo = 0x0020},
818 .tuners = {
819 { .std = V4L2_STD_525_60, .tuner = TUNER_PHILIPS_FQ1286 },
821 .pci_list = ivtv_pci_dctmvtvp1,
824 /* ------------------------------------------------------------------------- */
826 #ifdef HAVE_XC3028
828 /* Yuan PG600-2/GotView PCI DVD Lite/Club3D ZAP-TV1x01 cards */
830 static const struct ivtv_card_pci_info ivtv_pci_pg600v2[] = {
831 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_YUAN3, 0x0600 },
832 { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_GOTVIEW2, 0x0600 },
833 { 0, 0, 0 }
836 static const struct ivtv_card ivtv_card_pg600v2 = {
837 .type = IVTV_CARD_PG600V2,
838 .name = "Yuan PG600-2, GotView PCI DVD Lite, Club3D ZAP-TV1x01",
839 .v4l2_capabilities = IVTV_CAP_ENCODER,
840 .hw_video = IVTV_HW_CX25840,
841 .hw_audio = IVTV_HW_CX25840,
842 .hw_audio_ctrl = IVTV_HW_CX25840,
843 .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER,
844 .video_inputs = {
845 { IVTV_CARD_INPUT_VID_TUNER, 0, CX25840_COMPOSITE2 },
846 { IVTV_CARD_INPUT_SVIDEO1, 1,
847 CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
849 .audio_inputs = {
850 { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5 },
851 { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL },
853 .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5 },
854 .tuners = {
855 { .std = V4L2_STD_ALL, .tuner = TUNER_XCEIVE_XC3028 },
857 .gpio_init = { .direction = 0x1000, .initial_value = 0x1000 }, /* tuner reset */
858 .pci_list = ivtv_pci_pg600v2,
860 #endif
862 static const struct ivtv_card *ivtv_card_list[] = {
863 &ivtv_card_pvr250,
864 &ivtv_card_pvr350,
865 &ivtv_card_pvr150,
866 &ivtv_card_m179,
867 &ivtv_card_mpg600,
868 &ivtv_card_mpg160,
869 &ivtv_card_pg600,
870 &ivtv_card_avc2410,
871 &ivtv_card_avc2010,
872 &ivtv_card_tg5000tv,
873 &ivtv_card_va2000,
874 &ivtv_card_cx23416gyc,
875 &ivtv_card_gv_mvprx,
876 &ivtv_card_gv_mvprx2e,
877 &ivtv_card_gotview_pci_dvd,
878 &ivtv_card_gotview_pci_dvd2,
879 &ivtv_card_yuan_mpc622,
880 &ivtv_card_dctmvtvp1,
881 #ifdef HAVE_XC3028
882 &ivtv_card_pg600v2,
883 #endif
885 /* Variations of standard cards but with the same PCI IDs.
886 These cards must come last in this list. */
887 &ivtv_card_pvr350_v1,
888 &ivtv_card_cx23416gyc_nogr,
889 &ivtv_card_cx23416gyc_nogrycs,
892 const struct ivtv_card *ivtv_get_card(u16 index)
894 if (index >= ARRAY_SIZE(ivtv_card_list))
895 return NULL;
896 return ivtv_card_list[index];
899 int ivtv_get_input(struct ivtv *itv, u16 index, struct v4l2_input *input)
901 const struct ivtv_card_video_input *card_input = itv->card->video_inputs + index;
902 static const char * const input_strs[] = {
903 "Tuner 1",
904 "S-Video 1",
905 "S-Video 2",
906 "Composite 1",
907 "Composite 2",
908 "Composite 3"
911 memset(input, 0, sizeof(*input));
912 if (index >= itv->nof_inputs)
913 return -EINVAL;
914 input->index = index;
915 strcpy(input->name, input_strs[card_input->video_type - 1]);
916 input->type = (card_input->video_type == IVTV_CARD_INPUT_VID_TUNER ?
917 V4L2_INPUT_TYPE_TUNER : V4L2_INPUT_TYPE_CAMERA);
918 input->audioset = (1 << itv->nof_audio_inputs) - 1;
919 input->std = (input->type == V4L2_INPUT_TYPE_TUNER) ?
920 itv->tuner_std : V4L2_STD_ALL;
921 return 0;
924 int ivtv_get_output(struct ivtv *itv, u16 index, struct v4l2_output *output)
926 const struct ivtv_card_output *card_output = itv->card->video_outputs + index;
928 memset(output, 0, sizeof(*output));
929 if (index >= itv->card->nof_outputs)
930 return -EINVAL;
931 output->index = index;
932 strcpy(output->name, card_output->name);
933 output->type = V4L2_OUTPUT_TYPE_ANALOG;
934 output->audioset = 1;
935 output->std = V4L2_STD_ALL;
936 return 0;
939 int ivtv_get_audio_input(struct ivtv *itv, u16 index, struct v4l2_audio *audio)
941 const struct ivtv_card_audio_input *aud_input = itv->card->audio_inputs + index;
942 static const char * const input_strs[] = {
943 "Tuner 1",
944 "Line In 1",
945 "Line In 2"
948 memset(audio, 0, sizeof(*audio));
949 if (index >= itv->nof_audio_inputs)
950 return -EINVAL;
951 strcpy(audio->name, input_strs[aud_input->audio_type - 1]);
952 audio->index = index;
953 audio->capability = V4L2_AUDCAP_STEREO;
954 return 0;
957 int ivtv_get_audio_output(struct ivtv *itv, u16 index, struct v4l2_audioout *aud_output)
959 memset(aud_output, 0, sizeof(*aud_output));
960 if (itv->card->video_outputs == NULL || index != 0)
961 return -EINVAL;
962 strcpy(aud_output->name, "A/V Audio Out");
963 return 0;