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 },
42 /* Please add new PCI IDs to: http://pci-ids.ucw.cz/
43 This keeps the PCI ID database up to date. Note that the entries
44 must be added under vendor 0x4444 (Conexant) as subsystem IDs.
45 New vendor IDs should still be added to the vendor ID list. */
47 /* Hauppauge HVR-1600 cards */
49 /* Note: for Hauppauge cards the tveeprom information is used instead
51 static const struct cx18_card cx18_card_hvr1600_esmt = {
52 .type = CX18_CARD_HVR_1600_ESMT,
53 .name = "Hauppauge HVR-1600",
54 .comment = "Simultaneous Digital and Analog TV capture supported\n",
55 .v4l2_capabilities = CX18_CAP_ENCODER,
56 .hw_audio_ctrl = CX18_HW_418_AV,
57 .hw_muxer = CX18_HW_CS5345,
58 .hw_all = CX18_HW_TVEEPROM | CX18_HW_418_AV | CX18_HW_TUNER |
59 CX18_HW_CS5345 | CX18_HW_DVB | CX18_HW_GPIO_RESET_CTRL |
60 CX18_HW_Z8F0811_IR_HAUP,
62 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE7 },
63 { CX18_CARD_INPUT_SVIDEO1, 1, CX18_AV_SVIDEO1 },
64 { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE3 },
65 { CX18_CARD_INPUT_SVIDEO2, 2, CX18_AV_SVIDEO2 },
66 { CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE4 },
69 { CX18_CARD_INPUT_AUD_TUNER,
70 CX18_AV_AUDIO8, CS5345_IN_1 | CS5345_MCLK_1_5 },
71 { CX18_CARD_INPUT_LINE_IN1,
72 CX18_AV_AUDIO_SERIAL1, CS5345_IN_2 },
73 { CX18_CARD_INPUT_LINE_IN2,
74 CX18_AV_AUDIO_SERIAL1, CS5345_IN_3 },
76 .radio_input = { CX18_CARD_INPUT_AUD_TUNER,
77 CX18_AV_AUDIO_SERIAL1, CS5345_IN_4 },
79 /* ESMT M13S128324A-5B memory */
82 .timing1 = 0x44220e82,
87 .gpio_init.initial_value = 0x3001,
88 .gpio_init.direction = 0x3001,
89 .gpio_i2c_slave_reset = {
90 .active_lo_mask = 0x3001,
93 .ir_reset_mask = 0x0001,
98 static const struct cx18_card cx18_card_hvr1600_samsung = {
99 .type = CX18_CARD_HVR_1600_SAMSUNG,
100 .name = "Hauppauge HVR-1600 (Preproduction)",
101 .comment = "Simultaneous Digital and Analog TV capture supported\n",
102 .v4l2_capabilities = CX18_CAP_ENCODER,
103 .hw_audio_ctrl = CX18_HW_418_AV,
104 .hw_muxer = CX18_HW_CS5345,
105 .hw_all = CX18_HW_TVEEPROM | CX18_HW_418_AV | CX18_HW_TUNER |
106 CX18_HW_CS5345 | CX18_HW_DVB | CX18_HW_GPIO_RESET_CTRL |
107 CX18_HW_Z8F0811_IR_HAUP,
109 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE7 },
110 { CX18_CARD_INPUT_SVIDEO1, 1, CX18_AV_SVIDEO1 },
111 { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE3 },
112 { CX18_CARD_INPUT_SVIDEO2, 2, CX18_AV_SVIDEO2 },
113 { CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE4 },
116 { CX18_CARD_INPUT_AUD_TUNER,
117 CX18_AV_AUDIO8, CS5345_IN_1 | CS5345_MCLK_1_5 },
118 { CX18_CARD_INPUT_LINE_IN1,
119 CX18_AV_AUDIO_SERIAL1, CS5345_IN_2 },
120 { CX18_CARD_INPUT_LINE_IN2,
121 CX18_AV_AUDIO_SERIAL1, CS5345_IN_3 },
123 .radio_input = { CX18_CARD_INPUT_AUD_TUNER,
124 CX18_AV_AUDIO_SERIAL1, CS5345_IN_4 },
126 /* Samsung K4D263238G-VC33 memory */
127 .chip_config = 0x003,
129 .timing1 = 0x23230b73,
134 .gpio_init.initial_value = 0x3001,
135 .gpio_init.direction = 0x3001,
136 .gpio_i2c_slave_reset = {
137 .active_lo_mask = 0x3001,
138 .msecs_asserted = 10,
139 .msecs_recovery = 40,
140 .ir_reset_mask = 0x0001,
142 .i2c = &cx18_i2c_std,
145 /* ------------------------------------------------------------------------- */
147 /* Compro VideoMate H900: note that this card is analog only! */
149 static const struct cx18_card_pci_info cx18_pci_h900[] = {
150 { PCI_DEVICE_ID_CX23418, CX18_PCI_ID_COMPRO, 0xe100 },
154 static const struct cx18_card cx18_card_h900 = {
155 .type = CX18_CARD_COMPRO_H900,
156 .name = "Compro VideoMate H900",
157 .comment = "Analog TV capture supported\n",
158 .v4l2_capabilities = CX18_CAP_ENCODER,
159 .hw_audio_ctrl = CX18_HW_418_AV,
160 .hw_all = CX18_HW_418_AV | CX18_HW_TUNER | CX18_HW_GPIO_RESET_CTRL,
162 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE2 },
163 { CX18_CARD_INPUT_SVIDEO1, 1,
164 CX18_AV_SVIDEO_LUMA3 | CX18_AV_SVIDEO_CHROMA4 },
165 { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE1 },
168 { CX18_CARD_INPUT_AUD_TUNER,
170 { CX18_CARD_INPUT_LINE_IN1,
171 CX18_AV_AUDIO_SERIAL1, 0 },
173 .radio_input = { CX18_CARD_INPUT_AUD_TUNER,
174 CX18_AV_AUDIO_SERIAL1, 0 },
176 { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 },
179 /* EtronTech EM6A9160TS-5G memory */
180 .chip_config = 0x50003,
182 .timing1 = 0x24330e84,
188 .pci_list = cx18_pci_h900,
189 .i2c = &cx18_i2c_std,
192 /* ------------------------------------------------------------------------- */
194 /* Yuan MPC718: not working at the moment! */
196 static const struct cx18_card_pci_info cx18_pci_mpc718[] = {
197 { PCI_DEVICE_ID_CX23418, CX18_PCI_ID_YUAN, 0x0718 },
201 static const struct cx18_card cx18_card_mpc718 = {
202 .type = CX18_CARD_YUAN_MPC718,
203 .name = "Yuan MPC718 MiniPCI DVB-T/Analog",
204 .comment = "Experimenters needed for device to work well.\n"
205 "\tTo help, mail the ivtv-devel list (www.ivtvdriver.org).\n",
206 .v4l2_capabilities = CX18_CAP_ENCODER,
207 .hw_audio_ctrl = CX18_HW_418_AV,
208 .hw_muxer = CX18_HW_GPIO_MUX,
209 .hw_all = CX18_HW_TVEEPROM | CX18_HW_418_AV | CX18_HW_TUNER |
210 CX18_HW_GPIO_MUX | CX18_HW_DVB | CX18_HW_GPIO_RESET_CTRL,
212 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE2 },
213 { CX18_CARD_INPUT_SVIDEO1, 1,
214 CX18_AV_SVIDEO_LUMA3 | CX18_AV_SVIDEO_CHROMA4 },
215 { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE1 },
216 { CX18_CARD_INPUT_SVIDEO2, 2,
217 CX18_AV_SVIDEO_LUMA7 | CX18_AV_SVIDEO_CHROMA8 },
218 { CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE6 },
221 { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 0 },
222 { CX18_CARD_INPUT_LINE_IN1, CX18_AV_AUDIO_SERIAL1, 1 },
223 { CX18_CARD_INPUT_LINE_IN2, CX18_AV_AUDIO_SERIAL2, 1 },
227 { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 },
229 /* FIXME - the FM radio is just a guess and driver doesn't use SIF */
230 .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 2 },
232 /* Hynix HY5DU283222B DDR RAM */
233 .chip_config = 0x303,
235 .timing1 = 0x36320966,
240 .gpio_init.initial_value = 0x1,
241 .gpio_init.direction = 0x3,
242 /* FIXME - these GPIO's are just guesses */
243 .gpio_audio_input = { .mask = 0x3,
248 .pci_list = cx18_pci_mpc718,
249 .i2c = &cx18_i2c_std,
252 /* ------------------------------------------------------------------------- */
256 static const struct cx18_card_pci_info cx18_pci_gotview_dvd3[] = {
257 { PCI_DEVICE_ID_CX23418, CX18_PCI_ID_GOTVIEW, 0x3343 },
261 static const struct cx18_card cx18_card_gotview_dvd3 = {
262 .type = CX18_CARD_GOTVIEW_PCI_DVD3,
263 .name = "GoTView PCI DVD3 Hybrid",
264 .comment = "Experimenters needed for device to work well.\n"
265 "\tTo help, mail the ivtv-devel list (www.ivtvdriver.org).\n",
266 .v4l2_capabilities = CX18_CAP_ENCODER,
267 .hw_audio_ctrl = CX18_HW_418_AV,
268 .hw_muxer = CX18_HW_GPIO_MUX,
269 .hw_all = CX18_HW_TVEEPROM | CX18_HW_418_AV | CX18_HW_TUNER |
270 CX18_HW_GPIO_MUX | CX18_HW_DVB | CX18_HW_GPIO_RESET_CTRL,
272 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE2 },
273 { CX18_CARD_INPUT_SVIDEO1, 1,
274 CX18_AV_SVIDEO_LUMA3 | CX18_AV_SVIDEO_CHROMA4 },
275 { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE1 },
276 { CX18_CARD_INPUT_SVIDEO2, 2,
277 CX18_AV_SVIDEO_LUMA7 | CX18_AV_SVIDEO_CHROMA8 },
278 { CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE6 },
281 { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 0 },
282 { CX18_CARD_INPUT_LINE_IN1, CX18_AV_AUDIO_SERIAL1, 1 },
283 { CX18_CARD_INPUT_LINE_IN2, CX18_AV_AUDIO_SERIAL2, 1 },
287 { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 },
289 /* FIXME - the FM radio is just a guess and driver doesn't use SIF */
290 .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 2 },
292 /* Hynix HY5DU283222B DDR RAM */
293 .chip_config = 0x303,
295 .timing1 = 0x36320966,
300 .gpio_init.initial_value = 0x1,
301 .gpio_init.direction = 0x3,
303 .gpio_audio_input = { .mask = 0x3,
308 .pci_list = cx18_pci_gotview_dvd3,
309 .i2c = &cx18_i2c_std,
312 /* ------------------------------------------------------------------------- */
314 /* Conexant Raptor PAL/SECAM: note that this card is analog only! */
316 static const struct cx18_card_pci_info cx18_pci_cnxt_raptor_pal[] = {
317 { PCI_DEVICE_ID_CX23418, CX18_PCI_ID_CONEXANT, 0x0009 },
321 static const struct cx18_card cx18_card_cnxt_raptor_pal = {
322 .type = CX18_CARD_CNXT_RAPTOR_PAL,
323 .name = "Conexant Raptor PAL/SECAM",
324 .comment = "Analog TV capture supported\n",
325 .v4l2_capabilities = CX18_CAP_ENCODER,
326 .hw_audio_ctrl = CX18_HW_418_AV,
327 .hw_muxer = CX18_HW_GPIO_MUX,
328 .hw_all = CX18_HW_418_AV | CX18_HW_TUNER | CX18_HW_GPIO_MUX,
330 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE2 },
331 { CX18_CARD_INPUT_SVIDEO1, 1,
332 CX18_AV_SVIDEO_LUMA3 | CX18_AV_SVIDEO_CHROMA4 },
333 { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE1 },
334 { CX18_CARD_INPUT_SVIDEO2, 2,
335 CX18_AV_SVIDEO_LUMA7 | CX18_AV_SVIDEO_CHROMA8 },
336 { CX18_CARD_INPUT_COMPOSITE2, 2, CX18_AV_COMPOSITE6 },
339 { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 0 },
340 { CX18_CARD_INPUT_LINE_IN1, CX18_AV_AUDIO_SERIAL1, 1 },
341 { CX18_CARD_INPUT_LINE_IN2, CX18_AV_AUDIO_SERIAL2, 1 },
344 { .std = V4L2_STD_PAL_SECAM, .tuner = TUNER_PHILIPS_FM1216ME_MK3 },
346 .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO_SERIAL1, 2 },
348 /* MT 46V16M16 memory */
349 .chip_config = 0x50306,
351 .timing1 = 0x33220953,
356 .gpio_init.initial_value = 0x1002,
357 .gpio_init.direction = 0xf002,
358 .gpio_audio_input = { .mask = 0xf002,
359 .tuner = 0x1002, /* LED D1 Tuner AF */
360 .linein = 0x2000, /* LED D2 Line In 1 */
361 .radio = 0x4002 }, /* LED D3 Tuner AF */
362 .pci_list = cx18_pci_cnxt_raptor_pal,
363 .i2c = &cx18_i2c_std,
366 /* ------------------------------------------------------------------------- */
368 /* Toshiba Qosmio laptop internal DVB-T/Analog Hybrid Tuner */
370 static const struct cx18_card_pci_info cx18_pci_toshiba_qosmio_dvbt[] = {
371 { PCI_DEVICE_ID_CX23418, CX18_PCI_ID_TOSHIBA, 0x0110 },
375 static const struct cx18_card cx18_card_toshiba_qosmio_dvbt = {
376 .type = CX18_CARD_TOSHIBA_QOSMIO_DVBT,
377 .name = "Toshiba Qosmio DVB-T/Analog",
378 .comment = "Experimenters and photos needed for device to work well.\n"
379 "\tTo help, mail the ivtv-devel list (www.ivtvdriver.org).\n",
380 .v4l2_capabilities = CX18_CAP_ENCODER,
381 .hw_audio_ctrl = CX18_HW_418_AV,
382 .hw_all = CX18_HW_418_AV | CX18_HW_TUNER | CX18_HW_GPIO_RESET_CTRL,
384 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE6 },
385 { CX18_CARD_INPUT_SVIDEO1, 1,
386 CX18_AV_SVIDEO_LUMA3 | CX18_AV_SVIDEO_CHROMA4 },
387 { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE1 },
390 { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 0 },
391 { CX18_CARD_INPUT_LINE_IN1, CX18_AV_AUDIO_SERIAL1, 1 },
394 { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 },
397 .chip_config = 0x202,
399 .timing1 = 0x33320a63,
402 .initial_emrs = 0x42,
405 .pci_list = cx18_pci_toshiba_qosmio_dvbt,
406 .i2c = &cx18_i2c_std,
409 /* ------------------------------------------------------------------------- */
411 /* Leadtek WinFast PVR2100 */
413 static const struct cx18_card_pci_info cx18_pci_leadtek_pvr2100[] = {
414 { PCI_DEVICE_ID_CX23418, CX18_PCI_ID_LEADTEK, 0x6f27 }, /* PVR2100 */
418 static const struct cx18_card cx18_card_leadtek_pvr2100 = {
419 .type = CX18_CARD_LEADTEK_PVR2100,
420 .name = "Leadtek WinFast PVR2100",
421 .comment = "Experimenters and photos needed for device to work well.\n"
422 "\tTo help, mail the ivtv-devel list (www.ivtvdriver.org).\n",
423 .v4l2_capabilities = CX18_CAP_ENCODER,
424 .hw_audio_ctrl = CX18_HW_418_AV,
425 .hw_muxer = CX18_HW_GPIO_MUX,
426 .hw_all = CX18_HW_418_AV | CX18_HW_TUNER | CX18_HW_GPIO_MUX |
427 CX18_HW_GPIO_RESET_CTRL,
429 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE2 },
430 { CX18_CARD_INPUT_SVIDEO1, 1,
431 CX18_AV_SVIDEO_LUMA3 | CX18_AV_SVIDEO_CHROMA4 },
432 { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE7 },
433 { CX18_CARD_INPUT_COMPONENT1, 1, CX18_AV_COMPONENT1 },
436 { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 0 },
437 { CX18_CARD_INPUT_LINE_IN1, CX18_AV_AUDIO_SERIAL1, 1 },
441 { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 },
443 .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 2 },
445 /* Pointer to proper DDR config values provided by Terry Wu */
446 .chip_config = 0x303,
448 .timing1 = 0x24220e83,
453 .gpio_init.initial_value = 0x6,
454 .gpio_init.direction = 0x7,
455 .gpio_audio_input = { .mask = 0x7,
456 .tuner = 0x6, .linein = 0x2, .radio = 0x2 },
458 .pci_list = cx18_pci_leadtek_pvr2100,
459 .i2c = &cx18_i2c_std,
462 /* ------------------------------------------------------------------------- */
464 /* Leadtek WinFast DVR3100 H */
466 static const struct cx18_card_pci_info cx18_pci_leadtek_dvr3100h[] = {
467 { PCI_DEVICE_ID_CX23418, CX18_PCI_ID_LEADTEK, 0x6690 }, /* DVR3100 H */
471 static const struct cx18_card cx18_card_leadtek_dvr3100h = {
472 .type = CX18_CARD_LEADTEK_DVR3100H,
473 .name = "Leadtek WinFast DVR3100 H",
474 .comment = "Simultaneous DVB-T and Analog capture supported,\n"
475 "\texcept when capturing Analog from the antenna input.\n",
476 .v4l2_capabilities = CX18_CAP_ENCODER,
477 .hw_audio_ctrl = CX18_HW_418_AV,
478 .hw_muxer = CX18_HW_GPIO_MUX,
479 .hw_all = CX18_HW_418_AV | CX18_HW_TUNER | CX18_HW_GPIO_MUX |
480 CX18_HW_DVB | CX18_HW_GPIO_RESET_CTRL,
482 { CX18_CARD_INPUT_VID_TUNER, 0, CX18_AV_COMPOSITE2 },
483 { CX18_CARD_INPUT_SVIDEO1, 1,
484 CX18_AV_SVIDEO_LUMA3 | CX18_AV_SVIDEO_CHROMA4 },
485 { CX18_CARD_INPUT_COMPOSITE1, 1, CX18_AV_COMPOSITE7 },
486 { CX18_CARD_INPUT_COMPONENT1, 1, CX18_AV_COMPONENT1 },
489 { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 0 },
490 { CX18_CARD_INPUT_LINE_IN1, CX18_AV_AUDIO_SERIAL1, 1 },
494 { .std = V4L2_STD_ALL, .tuner = TUNER_XC2028 },
496 .radio_input = { CX18_CARD_INPUT_AUD_TUNER, CX18_AV_AUDIO5, 2 },
498 /* Pointer to proper DDR config values provided by Terry Wu */
499 .chip_config = 0x303,
501 .timing1 = 0x24220e83,
506 .gpio_init.initial_value = 0x6,
507 .gpio_init.direction = 0x7,
508 .gpio_audio_input = { .mask = 0x7,
509 .tuner = 0x6, .linein = 0x2, .radio = 0x2 },
511 .pci_list = cx18_pci_leadtek_dvr3100h,
512 .i2c = &cx18_i2c_std,
515 /* ------------------------------------------------------------------------- */
517 static const struct cx18_card *cx18_card_list[] = {
518 &cx18_card_hvr1600_esmt,
519 &cx18_card_hvr1600_samsung,
522 &cx18_card_cnxt_raptor_pal,
523 &cx18_card_toshiba_qosmio_dvbt,
524 &cx18_card_leadtek_pvr2100,
525 &cx18_card_leadtek_dvr3100h,
526 &cx18_card_gotview_dvd3
529 const struct cx18_card *cx18_get_card(u16 index)
531 if (index >= ARRAY_SIZE(cx18_card_list))
533 return cx18_card_list[index];
536 int cx18_get_input(struct cx18 *cx, u16 index, struct v4l2_input *input)
538 const struct cx18_card_video_input *card_input =
539 cx->card->video_inputs + index;
540 static const char * const input_strs[] = {
549 if (index >= cx->nof_inputs)
551 input->index = index;
552 strlcpy(input->name, input_strs[card_input->video_type - 1],
553 sizeof(input->name));
554 input->type = (card_input->video_type == CX18_CARD_INPUT_VID_TUNER ?
555 V4L2_INPUT_TYPE_TUNER : V4L2_INPUT_TYPE_CAMERA);
556 input->audioset = (1 << cx->nof_audio_inputs) - 1;
557 input->std = (input->type == V4L2_INPUT_TYPE_TUNER) ?
558 cx->tuner_std : V4L2_STD_ALL;
562 int cx18_get_audio_input(struct cx18 *cx, u16 index, struct v4l2_audio *audio)
564 const struct cx18_card_audio_input *aud_input =
565 cx->card->audio_inputs + index;
566 static const char * const input_strs[] = {
572 memset(audio, 0, sizeof(*audio));
573 if (index >= cx->nof_audio_inputs)
575 strlcpy(audio->name, input_strs[aud_input->audio_type - 1],
576 sizeof(audio->name));
577 audio->index = index;
578 audio->capability = V4L2_AUDCAP_STEREO;