2 * cx18 functions to query card hardware
4 * Derived from ivtv-cards.c
6 * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
7 * Copyright (C) 2008 Andy Walls <awalls@md.metrocast.net>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25 #include "cx18-driver.h"
26 #include "cx18-cards.h"
27 #include "cx18-av-core.h"
29 #include <media/cs5345.h>
31 #define V4L2_STD_PAL_SECAM (V4L2_STD_PAL|V4L2_STD_SECAM)
33 /********************** card configuration *******************************/
35 /* usual i2c tuner addresses to probe */
36 static struct cx18_card_tuner_i2c cx18_i2c_std
= {
37 .radio
= { I2C_CLIENT_END
},
38 .demod
= { 0x43, I2C_CLIENT_END
},
39 .tv
= { 0x61, 0x60, I2C_CLIENT_END
},
43 * usual i2c tuner addresses to probe with additional demod address for
44 * an NXP TDA8295 at 0x42 (N.B. it can possibly be at 0x4b or 0x4c too).
46 static struct cx18_card_tuner_i2c cx18_i2c_nxp
= {
47 .radio
= { I2C_CLIENT_END
},
48 .demod
= { 0x42, 0x43, I2C_CLIENT_END
},
49 .tv
= { 0x61, 0x60, I2C_CLIENT_END
},
52 /* Please add new PCI IDs to: http://pci-ids.ucw.cz/
53 This keeps the PCI ID database up to date. Note that the entries
54 must be added under vendor 0x4444 (Conexant) as subsystem IDs.
55 New vendor IDs should still be added to the vendor ID list. */
57 /* Hauppauge HVR-1600 cards */
59 /* Note: for Hauppauge cards the tveeprom information is used instead
61 static const struct cx18_card cx18_card_hvr1600_esmt
= {
62 .type
= CX18_CARD_HVR_1600_ESMT
,
63 .name
= "Hauppauge HVR-1600",
64 .comment
= "Simultaneous Digital and Analog TV capture supported\n",
65 .v4l2_capabilities
= CX18_CAP_ENCODER
,
66 .hw_audio_ctrl
= CX18_HW_418_AV
,
67 .hw_muxer
= CX18_HW_CS5345
,
68 .hw_all
= CX18_HW_TVEEPROM
| CX18_HW_418_AV
| CX18_HW_TUNER
|
69 CX18_HW_CS5345
| CX18_HW_DVB
| CX18_HW_GPIO_RESET_CTRL
|
70 CX18_HW_Z8F0811_IR_HAUP
,
72 { CX18_CARD_INPUT_VID_TUNER
, 0, CX18_AV_COMPOSITE7
},
73 { CX18_CARD_INPUT_SVIDEO1
, 1, CX18_AV_SVIDEO1
},
74 { CX18_CARD_INPUT_COMPOSITE1
, 1, CX18_AV_COMPOSITE3
},
75 { CX18_CARD_INPUT_SVIDEO2
, 2, CX18_AV_SVIDEO2
},
76 { CX18_CARD_INPUT_COMPOSITE2
, 2, CX18_AV_COMPOSITE4
},
79 { CX18_CARD_INPUT_AUD_TUNER
,
80 CX18_AV_AUDIO8
, CS5345_IN_1
| CS5345_MCLK_1_5
},
81 { CX18_CARD_INPUT_LINE_IN1
,
82 CX18_AV_AUDIO_SERIAL1
, CS5345_IN_2
},
83 { CX18_CARD_INPUT_LINE_IN2
,
84 CX18_AV_AUDIO_SERIAL1
, CS5345_IN_3
},
86 .radio_input
= { CX18_CARD_INPUT_AUD_TUNER
,
87 CX18_AV_AUDIO_SERIAL1
, CS5345_IN_4
},
89 /* ESMT M13S128324A-5B memory */
92 .timing1
= 0x44220e82,
97 .gpio_init
.initial_value
= 0x3001,
98 .gpio_init
.direction
= 0x3001,
99 .gpio_i2c_slave_reset
= {
100 .active_lo_mask
= 0x3001,
101 .msecs_asserted
= 10,
102 .msecs_recovery
= 40,
103 .ir_reset_mask
= 0x0001,
105 .i2c
= &cx18_i2c_std
,
108 static const struct cx18_card cx18_card_hvr1600_s5h1411
= {
109 .type
= CX18_CARD_HVR_1600_S5H1411
,
110 .name
= "Hauppauge HVR-1600",
111 .comment
= "Simultaneous Digital and Analog TV capture supported\n",
112 .v4l2_capabilities
= CX18_CAP_ENCODER
,
113 .hw_audio_ctrl
= CX18_HW_418_AV
,
114 .hw_muxer
= CX18_HW_CS5345
,
115 .hw_all
= CX18_HW_TVEEPROM
| CX18_HW_418_AV
| CX18_HW_TUNER
|
116 CX18_HW_CS5345
| CX18_HW_DVB
| CX18_HW_GPIO_RESET_CTRL
|
117 CX18_HW_Z8F0811_IR_HAUP
,
119 { CX18_CARD_INPUT_VID_TUNER
, 0, CX18_AV_COMPOSITE7
},
120 { CX18_CARD_INPUT_SVIDEO1
, 1, CX18_AV_SVIDEO1
},
121 { CX18_CARD_INPUT_COMPOSITE1
, 1, CX18_AV_COMPOSITE3
},
122 { CX18_CARD_INPUT_SVIDEO2
, 2, CX18_AV_SVIDEO2
},
123 { CX18_CARD_INPUT_COMPOSITE2
, 2, CX18_AV_COMPOSITE4
},
126 { CX18_CARD_INPUT_AUD_TUNER
,
127 CX18_AV_AUDIO8
, CS5345_IN_1
| CS5345_MCLK_1_5
},
128 { CX18_CARD_INPUT_LINE_IN1
,
129 CX18_AV_AUDIO_SERIAL1
, CS5345_IN_2
},
130 { CX18_CARD_INPUT_LINE_IN2
,
131 CX18_AV_AUDIO_SERIAL1
, CS5345_IN_3
},
133 .radio_input
= { CX18_CARD_INPUT_AUD_TUNER
,
134 CX18_AV_AUDIO_SERIAL1
, CS5345_IN_4
},
136 /* ESMT M13S128324A-5B memory */
137 .chip_config
= 0x003,
139 .timing1
= 0x44220e82,
144 .gpio_init
.initial_value
= 0x3801,
145 .gpio_init
.direction
= 0x3801,
146 .gpio_i2c_slave_reset
= {
147 .active_lo_mask
= 0x3801,
148 .msecs_asserted
= 10,
149 .msecs_recovery
= 40,
150 .ir_reset_mask
= 0x0001,
152 .i2c
= &cx18_i2c_nxp
,
155 static const struct cx18_card cx18_card_hvr1600_samsung
= {
156 .type
= CX18_CARD_HVR_1600_SAMSUNG
,
157 .name
= "Hauppauge HVR-1600 (Preproduction)",
158 .comment
= "Simultaneous Digital and Analog TV capture supported\n",
159 .v4l2_capabilities
= CX18_CAP_ENCODER
,
160 .hw_audio_ctrl
= CX18_HW_418_AV
,
161 .hw_muxer
= CX18_HW_CS5345
,
162 .hw_all
= CX18_HW_TVEEPROM
| CX18_HW_418_AV
| CX18_HW_TUNER
|
163 CX18_HW_CS5345
| CX18_HW_DVB
| CX18_HW_GPIO_RESET_CTRL
|
164 CX18_HW_Z8F0811_IR_HAUP
,
166 { CX18_CARD_INPUT_VID_TUNER
, 0, CX18_AV_COMPOSITE7
},
167 { CX18_CARD_INPUT_SVIDEO1
, 1, CX18_AV_SVIDEO1
},
168 { CX18_CARD_INPUT_COMPOSITE1
, 1, CX18_AV_COMPOSITE3
},
169 { CX18_CARD_INPUT_SVIDEO2
, 2, CX18_AV_SVIDEO2
},
170 { CX18_CARD_INPUT_COMPOSITE2
, 2, CX18_AV_COMPOSITE4
},
173 { CX18_CARD_INPUT_AUD_TUNER
,
174 CX18_AV_AUDIO8
, CS5345_IN_1
| CS5345_MCLK_1_5
},
175 { CX18_CARD_INPUT_LINE_IN1
,
176 CX18_AV_AUDIO_SERIAL1
, CS5345_IN_2
},
177 { CX18_CARD_INPUT_LINE_IN2
,
178 CX18_AV_AUDIO_SERIAL1
, CS5345_IN_3
},
180 .radio_input
= { CX18_CARD_INPUT_AUD_TUNER
,
181 CX18_AV_AUDIO_SERIAL1
, CS5345_IN_4
},
183 /* Samsung K4D263238G-VC33 memory */
184 .chip_config
= 0x003,
186 .timing1
= 0x23230b73,
191 .gpio_init
.initial_value
= 0x3001,
192 .gpio_init
.direction
= 0x3001,
193 .gpio_i2c_slave_reset
= {
194 .active_lo_mask
= 0x3001,
195 .msecs_asserted
= 10,
196 .msecs_recovery
= 40,
197 .ir_reset_mask
= 0x0001,
199 .i2c
= &cx18_i2c_std
,
202 /* ------------------------------------------------------------------------- */
204 /* Compro VideoMate H900: note that this card is analog only! */
206 static const struct cx18_card_pci_info cx18_pci_h900
[] = {
207 { PCI_DEVICE_ID_CX23418
, CX18_PCI_ID_COMPRO
, 0xe100 },
211 static const struct cx18_card cx18_card_h900
= {
212 .type
= CX18_CARD_COMPRO_H900
,
213 .name
= "Compro VideoMate H900",
214 .comment
= "Analog TV capture supported\n",
215 .v4l2_capabilities
= CX18_CAP_ENCODER
,
216 .hw_audio_ctrl
= CX18_HW_418_AV
,
217 .hw_all
= CX18_HW_418_AV
| CX18_HW_TUNER
| CX18_HW_GPIO_RESET_CTRL
,
219 { CX18_CARD_INPUT_VID_TUNER
, 0, CX18_AV_COMPOSITE2
},
220 { CX18_CARD_INPUT_SVIDEO1
, 1,
221 CX18_AV_SVIDEO_LUMA3
| CX18_AV_SVIDEO_CHROMA4
},
222 { CX18_CARD_INPUT_COMPOSITE1
, 1, CX18_AV_COMPOSITE1
},
225 { CX18_CARD_INPUT_AUD_TUNER
,
227 { CX18_CARD_INPUT_LINE_IN1
,
228 CX18_AV_AUDIO_SERIAL1
, 0 },
230 .radio_input
= { CX18_CARD_INPUT_AUD_TUNER
,
231 CX18_AV_AUDIO_SERIAL1
, 0 },
233 { .std
= V4L2_STD_ALL
, .tuner
= TUNER_XC2028
},
236 /* EtronTech EM6A9160TS-5G memory */
237 .chip_config
= 0x50003,
239 .timing1
= 0x24330e84,
245 .pci_list
= cx18_pci_h900
,
246 .i2c
= &cx18_i2c_std
,
249 /* ------------------------------------------------------------------------- */
251 /* Yuan MPC718: not working at the moment! */
253 static const struct cx18_card_pci_info cx18_pci_mpc718
[] = {
254 { PCI_DEVICE_ID_CX23418
, CX18_PCI_ID_YUAN
, 0x0718 },
258 static const struct cx18_card cx18_card_mpc718
= {
259 .type
= CX18_CARD_YUAN_MPC718
,
260 .name
= "Yuan MPC718 MiniPCI DVB-T/Analog",
261 .comment
= "Experimenters needed for device to work well.\n"
262 "\tTo help, mail the ivtv-devel list (www.ivtvdriver.org).\n",
263 .v4l2_capabilities
= CX18_CAP_ENCODER
,
264 .hw_audio_ctrl
= CX18_HW_418_AV
,
265 .hw_muxer
= CX18_HW_GPIO_MUX
,
266 .hw_all
= CX18_HW_TVEEPROM
| CX18_HW_418_AV
| CX18_HW_TUNER
|
267 CX18_HW_GPIO_MUX
| CX18_HW_DVB
| CX18_HW_GPIO_RESET_CTRL
,
269 { CX18_CARD_INPUT_VID_TUNER
, 0, CX18_AV_COMPOSITE2
},
270 { CX18_CARD_INPUT_SVIDEO1
, 1,
271 CX18_AV_SVIDEO_LUMA3
| CX18_AV_SVIDEO_CHROMA4
},
272 { CX18_CARD_INPUT_COMPOSITE1
, 1, CX18_AV_COMPOSITE1
},
273 { CX18_CARD_INPUT_SVIDEO2
, 2,
274 CX18_AV_SVIDEO_LUMA7
| CX18_AV_SVIDEO_CHROMA8
},
275 { CX18_CARD_INPUT_COMPOSITE2
, 2, CX18_AV_COMPOSITE6
},
278 { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO5
, 0 },
279 { CX18_CARD_INPUT_LINE_IN1
, CX18_AV_AUDIO_SERIAL1
, 1 },
280 { CX18_CARD_INPUT_LINE_IN2
, CX18_AV_AUDIO_SERIAL2
, 1 },
284 { .std
= V4L2_STD_ALL
, .tuner
= TUNER_XC2028
},
286 /* FIXME - the FM radio is just a guess and driver doesn't use SIF */
287 .radio_input
= { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO5
, 2 },
289 /* Hynix HY5DU283222B DDR RAM */
290 .chip_config
= 0x303,
292 .timing1
= 0x36320966,
297 .gpio_init
.initial_value
= 0x1,
298 .gpio_init
.direction
= 0x3,
299 /* FIXME - these GPIO's are just guesses */
300 .gpio_audio_input
= { .mask
= 0x3,
305 .pci_list
= cx18_pci_mpc718
,
306 .i2c
= &cx18_i2c_std
,
309 /* ------------------------------------------------------------------------- */
313 static const struct cx18_card_pci_info cx18_pci_gotview_dvd3
[] = {
314 { PCI_DEVICE_ID_CX23418
, CX18_PCI_ID_GOTVIEW
, 0x3343 },
318 static const struct cx18_card cx18_card_gotview_dvd3
= {
319 .type
= CX18_CARD_GOTVIEW_PCI_DVD3
,
320 .name
= "GoTView PCI DVD3 Hybrid",
321 .comment
= "Experimenters needed for device to work well.\n"
322 "\tTo help, mail the ivtv-devel list (www.ivtvdriver.org).\n",
323 .v4l2_capabilities
= CX18_CAP_ENCODER
,
324 .hw_audio_ctrl
= CX18_HW_418_AV
,
325 .hw_muxer
= CX18_HW_GPIO_MUX
,
326 .hw_all
= CX18_HW_TVEEPROM
| CX18_HW_418_AV
| CX18_HW_TUNER
|
327 CX18_HW_GPIO_MUX
| CX18_HW_DVB
| CX18_HW_GPIO_RESET_CTRL
,
329 { CX18_CARD_INPUT_VID_TUNER
, 0, CX18_AV_COMPOSITE2
},
330 { CX18_CARD_INPUT_SVIDEO1
, 1,
331 CX18_AV_SVIDEO_LUMA3
| CX18_AV_SVIDEO_CHROMA4
},
332 { CX18_CARD_INPUT_COMPOSITE1
, 1, CX18_AV_COMPOSITE1
},
333 { CX18_CARD_INPUT_SVIDEO2
, 2,
334 CX18_AV_SVIDEO_LUMA7
| CX18_AV_SVIDEO_CHROMA8
},
335 { CX18_CARD_INPUT_COMPOSITE2
, 2, CX18_AV_COMPOSITE6
},
338 { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO5
, 0 },
339 { CX18_CARD_INPUT_LINE_IN1
, CX18_AV_AUDIO_SERIAL1
, 1 },
340 { CX18_CARD_INPUT_LINE_IN2
, CX18_AV_AUDIO_SERIAL2
, 1 },
344 { .std
= V4L2_STD_ALL
, .tuner
= TUNER_XC2028
},
346 /* FIXME - the FM radio is just a guess and driver doesn't use SIF */
347 .radio_input
= { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO5
, 2 },
349 /* Hynix HY5DU283222B DDR RAM */
350 .chip_config
= 0x303,
352 .timing1
= 0x36320966,
357 .gpio_init
.initial_value
= 0x1,
358 .gpio_init
.direction
= 0x3,
360 .gpio_audio_input
= { .mask
= 0x3,
365 .pci_list
= cx18_pci_gotview_dvd3
,
366 .i2c
= &cx18_i2c_std
,
369 /* ------------------------------------------------------------------------- */
371 /* Conexant Raptor PAL/SECAM: note that this card is analog only! */
373 static const struct cx18_card_pci_info cx18_pci_cnxt_raptor_pal
[] = {
374 { PCI_DEVICE_ID_CX23418
, CX18_PCI_ID_CONEXANT
, 0x0009 },
378 static const struct cx18_card cx18_card_cnxt_raptor_pal
= {
379 .type
= CX18_CARD_CNXT_RAPTOR_PAL
,
380 .name
= "Conexant Raptor PAL/SECAM",
381 .comment
= "Analog TV capture supported\n",
382 .v4l2_capabilities
= CX18_CAP_ENCODER
,
383 .hw_audio_ctrl
= CX18_HW_418_AV
,
384 .hw_muxer
= CX18_HW_GPIO_MUX
,
385 .hw_all
= CX18_HW_418_AV
| CX18_HW_TUNER
| CX18_HW_GPIO_MUX
,
387 { CX18_CARD_INPUT_VID_TUNER
, 0, CX18_AV_COMPOSITE2
},
388 { CX18_CARD_INPUT_SVIDEO1
, 1,
389 CX18_AV_SVIDEO_LUMA3
| CX18_AV_SVIDEO_CHROMA4
},
390 { CX18_CARD_INPUT_COMPOSITE1
, 1, CX18_AV_COMPOSITE1
},
391 { CX18_CARD_INPUT_SVIDEO2
, 2,
392 CX18_AV_SVIDEO_LUMA7
| CX18_AV_SVIDEO_CHROMA8
},
393 { CX18_CARD_INPUT_COMPOSITE2
, 2, CX18_AV_COMPOSITE6
},
396 { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO5
, 0 },
397 { CX18_CARD_INPUT_LINE_IN1
, CX18_AV_AUDIO_SERIAL1
, 1 },
398 { CX18_CARD_INPUT_LINE_IN2
, CX18_AV_AUDIO_SERIAL2
, 1 },
401 { .std
= V4L2_STD_PAL_SECAM
, .tuner
= TUNER_PHILIPS_FM1216ME_MK3
},
403 .radio_input
= { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO_SERIAL1
, 2 },
405 /* MT 46V16M16 memory */
406 .chip_config
= 0x50306,
408 .timing1
= 0x33220953,
413 .gpio_init
.initial_value
= 0x1002,
414 .gpio_init
.direction
= 0xf002,
415 .gpio_audio_input
= { .mask
= 0xf002,
416 .tuner
= 0x1002, /* LED D1 Tuner AF */
417 .linein
= 0x2000, /* LED D2 Line In 1 */
418 .radio
= 0x4002 }, /* LED D3 Tuner AF */
419 .pci_list
= cx18_pci_cnxt_raptor_pal
,
420 .i2c
= &cx18_i2c_std
,
423 /* ------------------------------------------------------------------------- */
425 /* Toshiba Qosmio laptop internal DVB-T/Analog Hybrid Tuner */
427 static const struct cx18_card_pci_info cx18_pci_toshiba_qosmio_dvbt
[] = {
428 { PCI_DEVICE_ID_CX23418
, CX18_PCI_ID_TOSHIBA
, 0x0110 },
432 static const struct cx18_card cx18_card_toshiba_qosmio_dvbt
= {
433 .type
= CX18_CARD_TOSHIBA_QOSMIO_DVBT
,
434 .name
= "Toshiba Qosmio DVB-T/Analog",
435 .comment
= "Experimenters and photos needed for device to work well.\n"
436 "\tTo help, mail the ivtv-devel list (www.ivtvdriver.org).\n",
437 .v4l2_capabilities
= CX18_CAP_ENCODER
,
438 .hw_audio_ctrl
= CX18_HW_418_AV
,
439 .hw_all
= CX18_HW_418_AV
| CX18_HW_TUNER
| CX18_HW_GPIO_RESET_CTRL
,
441 { CX18_CARD_INPUT_VID_TUNER
, 0, CX18_AV_COMPOSITE6
},
442 { CX18_CARD_INPUT_SVIDEO1
, 1,
443 CX18_AV_SVIDEO_LUMA3
| CX18_AV_SVIDEO_CHROMA4
},
444 { CX18_CARD_INPUT_COMPOSITE1
, 1, CX18_AV_COMPOSITE1
},
447 { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO5
, 0 },
448 { CX18_CARD_INPUT_LINE_IN1
, CX18_AV_AUDIO_SERIAL1
, 1 },
451 { .std
= V4L2_STD_ALL
, .tuner
= TUNER_XC2028
},
454 .chip_config
= 0x202,
456 .timing1
= 0x33320a63,
459 .initial_emrs
= 0x42,
462 .pci_list
= cx18_pci_toshiba_qosmio_dvbt
,
463 .i2c
= &cx18_i2c_std
,
466 /* ------------------------------------------------------------------------- */
468 /* Leadtek WinFast PVR2100 */
470 static const struct cx18_card_pci_info cx18_pci_leadtek_pvr2100
[] = {
471 { PCI_DEVICE_ID_CX23418
, CX18_PCI_ID_LEADTEK
, 0x6f27 }, /* PVR2100 */
475 static const struct cx18_card cx18_card_leadtek_pvr2100
= {
476 .type
= CX18_CARD_LEADTEK_PVR2100
,
477 .name
= "Leadtek WinFast PVR2100",
478 .comment
= "Experimenters and photos needed for device to work well.\n"
479 "\tTo help, mail the ivtv-devel list (www.ivtvdriver.org).\n",
480 .v4l2_capabilities
= CX18_CAP_ENCODER
,
481 .hw_audio_ctrl
= CX18_HW_418_AV
,
482 .hw_muxer
= CX18_HW_GPIO_MUX
,
483 .hw_all
= CX18_HW_418_AV
| CX18_HW_TUNER
| CX18_HW_GPIO_MUX
|
484 CX18_HW_GPIO_RESET_CTRL
,
486 { CX18_CARD_INPUT_VID_TUNER
, 0, CX18_AV_COMPOSITE2
},
487 { CX18_CARD_INPUT_SVIDEO1
, 1,
488 CX18_AV_SVIDEO_LUMA3
| CX18_AV_SVIDEO_CHROMA4
},
489 { CX18_CARD_INPUT_COMPOSITE1
, 1, CX18_AV_COMPOSITE7
},
490 { CX18_CARD_INPUT_COMPONENT1
, 1, CX18_AV_COMPONENT1
},
493 { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO5
, 0 },
494 { CX18_CARD_INPUT_LINE_IN1
, CX18_AV_AUDIO_SERIAL1
, 1 },
498 { .std
= V4L2_STD_ALL
, .tuner
= TUNER_XC2028
},
500 .radio_input
= { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO5
, 2 },
502 /* Pointer to proper DDR config values provided by Terry Wu */
503 .chip_config
= 0x303,
505 .timing1
= 0x24220e83,
510 .gpio_init
.initial_value
= 0x6,
511 .gpio_init
.direction
= 0x7,
512 .gpio_audio_input
= { .mask
= 0x7,
513 .tuner
= 0x6, .linein
= 0x2, .radio
= 0x2 },
515 .pci_list
= cx18_pci_leadtek_pvr2100
,
516 .i2c
= &cx18_i2c_std
,
519 /* ------------------------------------------------------------------------- */
521 /* Leadtek WinFast DVR3100 H */
523 static const struct cx18_card_pci_info cx18_pci_leadtek_dvr3100h
[] = {
524 { PCI_DEVICE_ID_CX23418
, CX18_PCI_ID_LEADTEK
, 0x6690 }, /* DVR3100 H */
528 static const struct cx18_card cx18_card_leadtek_dvr3100h
= {
529 .type
= CX18_CARD_LEADTEK_DVR3100H
,
530 .name
= "Leadtek WinFast DVR3100 H",
531 .comment
= "Simultaneous DVB-T and Analog capture supported,\n"
532 "\texcept when capturing Analog from the antenna input.\n",
533 .v4l2_capabilities
= CX18_CAP_ENCODER
,
534 .hw_audio_ctrl
= CX18_HW_418_AV
,
535 .hw_muxer
= CX18_HW_GPIO_MUX
,
536 .hw_all
= CX18_HW_418_AV
| CX18_HW_TUNER
| CX18_HW_GPIO_MUX
|
537 CX18_HW_DVB
| CX18_HW_GPIO_RESET_CTRL
,
539 { CX18_CARD_INPUT_VID_TUNER
, 0, CX18_AV_COMPOSITE2
},
540 { CX18_CARD_INPUT_SVIDEO1
, 1,
541 CX18_AV_SVIDEO_LUMA3
| CX18_AV_SVIDEO_CHROMA4
},
542 { CX18_CARD_INPUT_COMPOSITE1
, 1, CX18_AV_COMPOSITE7
},
543 { CX18_CARD_INPUT_COMPONENT1
, 1, CX18_AV_COMPONENT1
},
546 { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO5
, 0 },
547 { CX18_CARD_INPUT_LINE_IN1
, CX18_AV_AUDIO_SERIAL1
, 1 },
551 { .std
= V4L2_STD_ALL
, .tuner
= TUNER_XC2028
},
553 .radio_input
= { CX18_CARD_INPUT_AUD_TUNER
, CX18_AV_AUDIO5
, 2 },
555 /* Pointer to proper DDR config values provided by Terry Wu */
556 .chip_config
= 0x303,
558 .timing1
= 0x24220e83,
563 .gpio_init
.initial_value
= 0x6,
564 .gpio_init
.direction
= 0x7,
565 .gpio_audio_input
= { .mask
= 0x7,
566 .tuner
= 0x6, .linein
= 0x2, .radio
= 0x2 },
568 .pci_list
= cx18_pci_leadtek_dvr3100h
,
569 .i2c
= &cx18_i2c_std
,
572 /* ------------------------------------------------------------------------- */
574 static const struct cx18_card
*cx18_card_list
[] = {
575 &cx18_card_hvr1600_esmt
,
576 &cx18_card_hvr1600_samsung
,
579 &cx18_card_cnxt_raptor_pal
,
580 &cx18_card_toshiba_qosmio_dvbt
,
581 &cx18_card_leadtek_pvr2100
,
582 &cx18_card_leadtek_dvr3100h
,
583 &cx18_card_gotview_dvd3
,
584 &cx18_card_hvr1600_s5h1411
587 const struct cx18_card
*cx18_get_card(u16 index
)
589 if (index
>= ARRAY_SIZE(cx18_card_list
))
591 return cx18_card_list
[index
];
594 int cx18_get_input(struct cx18
*cx
, u16 index
, struct v4l2_input
*input
)
596 const struct cx18_card_video_input
*card_input
=
597 cx
->card
->video_inputs
+ index
;
598 static const char * const input_strs
[] = {
607 if (index
>= cx
->nof_inputs
)
609 input
->index
= index
;
610 strlcpy(input
->name
, input_strs
[card_input
->video_type
- 1],
611 sizeof(input
->name
));
612 input
->type
= (card_input
->video_type
== CX18_CARD_INPUT_VID_TUNER
?
613 V4L2_INPUT_TYPE_TUNER
: V4L2_INPUT_TYPE_CAMERA
);
614 input
->audioset
= (1 << cx
->nof_audio_inputs
) - 1;
615 input
->std
= (input
->type
== V4L2_INPUT_TYPE_TUNER
) ?
616 cx
->tuner_std
: V4L2_STD_ALL
;
620 int cx18_get_audio_input(struct cx18
*cx
, u16 index
, struct v4l2_audio
*audio
)
622 const struct cx18_card_audio_input
*aud_input
=
623 cx
->card
->audio_inputs
+ index
;
624 static const char * const input_strs
[] = {
630 memset(audio
, 0, sizeof(*audio
));
631 if (index
>= cx
->nof_audio_inputs
)
633 strlcpy(audio
->name
, input_strs
[aud_input
->audio_type
- 1],
634 sizeof(audio
->name
));
635 audio
->index
= index
;
636 audio
->capability
= V4L2_AUDCAP_STEREO
;