aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2005-07-07 20:58:36 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:24:03 -0400
commita82decf64d34e79a0cc622997866c754350f18f8 (patch)
tree7841c828bdd03cc476067bf1f9b192613f111ae0 /drivers/media/video/cx88
parenta2f552f5edc13e18b75f11fb1b08bbcad67fd362 (diff)
[PATCH] v4l: cx88 update
- Add support for ADS Tech Instant TV DVB-T PCI. - Remove obsoleted config options. - Fix DViCO Board names - Remove CABLE type setting from DViCO FusionHDTV3 Gold-T. - Fix compilation with gcc4.0. - V4L2_TUNER_CAP_LOW implemented according with V4L2 API for Radio. - radio range is now defined on tuner-core.c. Cleaning up. - Fix a bug on frequency report for cx88 based cards. - Added support for changing radio mode stereo/mono. - Add remove for MSI TV@nywhere. Signed-off-by: Jorik Jonker <jorik@dnd.utwente.nl>. Signed-off-by: Didier Caillaud <mailing.cld@free.fr> Signed-off-by: Benoit Laniel <benoit.laniel@gmail.com>. Signed-off-by: Nickolay V Shmyrev <nshmyrev@yandex.ru> Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r--drivers/media/video/cx88/cx88-cards.c50
-rw-r--r--drivers/media/video/cx88/cx88-core.c19
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c3
-rw-r--r--drivers/media/video/cx88/cx88-input.c96
-rw-r--r--drivers/media/video/cx88/cx88-video.c57
-rw-r--r--drivers/media/video/cx88/cx88.h9
6 files changed, 169 insertions, 65 deletions
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index b3fb04356b71..f9e4cb196874 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-cards.c,v 1.76 2005/06/08 01:28:09 mchehab Exp $ 2 * $Id: cx88-cards.c,v 1.82 2005/06/28 04:33:53 mkrufky Exp $
3 * 3 *
4 * device driver for Conexant 2388x based TV cards 4 * device driver for Conexant 2388x based TV cards
5 * card-specific stuff. 5 * card-specific stuff.
@@ -401,7 +401,7 @@ struct cx88_board cx88_boards[] = {
401 .dvb = 1, 401 .dvb = 1,
402 }, 402 },
403 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = { 403 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
404 .name = "DVICO FusionHDTV DVB-T1", 404 .name = "DViCO FusionHDTV DVB-T1",
405 .tuner_type = TUNER_ABSENT, /* No analog tuner */ 405 .tuner_type = TUNER_ABSENT, /* No analog tuner */
406 .radio_type = UNSET, 406 .radio_type = UNSET,
407 .tuner_addr = ADDR_UNSET, 407 .tuner_addr = ADDR_UNSET,
@@ -445,8 +445,8 @@ struct cx88_board cx88_boards[] = {
445 .gpio0 = 0x000007f8, 445 .gpio0 = 0x000007f8,
446 }, 446 },
447 }, 447 },
448 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD] = { 448 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = {
449 .name = "DViCO - FusionHDTV 3 Gold", 449 .name = "DViCO FusionHDTV 3 Gold-Q",
450 .tuner_type = TUNER_MICROTUNE_4042FI5, 450 .tuner_type = TUNER_MICROTUNE_4042FI5,
451 .radio_type = UNSET, 451 .radio_type = UNSET,
452 .tuner_addr = ADDR_UNSET, 452 .tuner_addr = ADDR_UNSET,
@@ -464,6 +464,9 @@ struct cx88_board cx88_boards[] = {
464 GPIO[3] selects RF input connector on tuner module 464 GPIO[3] selects RF input connector on tuner module
465 0 - RF connector labeled CABLE 465 0 - RF connector labeled CABLE
466 1 - RF connector labeled ANT 466 1 - RF connector labeled ANT
467 GPIO[4] selects high RF for QAM256 mode
468 0 - normal RF
469 1 - high RF
467 */ 470 */
468 .input = {{ 471 .input = {{
469 .type = CX88_VMUX_TELEVISION, 472 .type = CX88_VMUX_TELEVISION,
@@ -520,7 +523,7 @@ struct cx88_board cx88_boards[] = {
520 .blackbird = 1, 523 .blackbird = 1,
521 }, 524 },
522 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = { 525 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
523 .name = "DVICO FusionHDTV DVB-T Plus", 526 .name = "DViCO FusionHDTV DVB-T Plus",
524 .tuner_type = TUNER_ABSENT, /* No analog tuner */ 527 .tuner_type = TUNER_ABSENT, /* No analog tuner */
525 .radio_type = UNSET, 528 .radio_type = UNSET,
526 .tuner_addr = ADDR_UNSET, 529 .tuner_addr = ADDR_UNSET,
@@ -700,21 +703,17 @@ struct cx88_board cx88_boards[] = {
700 }, 703 },
701 }, 704 },
702 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = { 705 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
703 .name = "DViCO - FusionHDTV 3 Gold-T", 706 .name = "DViCO FusionHDTV 3 Gold-T",
704 .tuner_type = TUNER_THOMSON_DTT7611, 707 .tuner_type = TUNER_THOMSON_DTT7611,
705 .radio_type = UNSET, 708 .radio_type = UNSET,
706 .tuner_addr = ADDR_UNSET, 709 .tuner_addr = ADDR_UNSET,
707 .radio_addr = ADDR_UNSET, 710 .radio_addr = ADDR_UNSET,
708 /* See DViCO FusionHDTV 3 Gold for GPIO documentation. */ 711 /* See DViCO FusionHDTV 3 Gold-Q for GPIO documentation. */
709 .input = {{ 712 .input = {{
710 .type = CX88_VMUX_TELEVISION, 713 .type = CX88_VMUX_TELEVISION,
711 .vmux = 0, 714 .vmux = 0,
712 .gpio0 = 0x0f0d, 715 .gpio0 = 0x0f0d,
713 },{ 716 },{
714 .type = CX88_VMUX_CABLE,
715 .vmux = 0,
716 .gpio0 = 0x0f05,
717 },{
718 .type = CX88_VMUX_COMPOSITE1, 717 .type = CX88_VMUX_COMPOSITE1,
719 .vmux = 1, 718 .vmux = 1,
720 .gpio0 = 0x0f00, 719 .gpio0 = 0x0f00,
@@ -724,6 +723,25 @@ struct cx88_board cx88_boards[] = {
724 .gpio0 = 0x0f00, 723 .gpio0 = 0x0f00,
725 }}, 724 }},
726 }, 725 },
726 [CX88_BOARD_ADSTECH_DVB_T_PCI] = {
727 .name = "ADS Tech Instant TV DVB-T PCI",
728 .tuner_type = TUNER_ABSENT,
729 .radio_type = UNSET,
730 .tuner_addr = ADDR_UNSET,
731 .radio_addr = ADDR_UNSET,
732 .input = {{
733 .type = CX88_VMUX_COMPOSITE1,
734 .vmux = 1,
735 .gpio0 = 0x0700,
736 .gpio2 = 0x0101,
737 },{
738 .type = CX88_VMUX_SVIDEO,
739 .vmux = 2,
740 .gpio0 = 0x0700,
741 .gpio2 = 0x0101,
742 }},
743 .dvb = 1,
744 },
727}; 745};
728const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); 746const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
729 747
@@ -794,7 +812,7 @@ struct cx88_subid cx88_subids[] = {
794 },{ 812 },{
795 .subvendor = 0x18ac, 813 .subvendor = 0x18ac,
796 .subdevice = 0xd810, 814 .subdevice = 0xd810,
797 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD, 815 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
798 },{ 816 },{
799 .subvendor = 0x18ac, 817 .subvendor = 0x18ac,
800 .subdevice = 0xd820, 818 .subdevice = 0xd820,
@@ -843,7 +861,11 @@ struct cx88_subid cx88_subids[] = {
843 .subvendor = 0x10fc, 861 .subvendor = 0x10fc,
844 .subdevice = 0xd035, 862 .subdevice = 0xd035,
845 .card = CX88_BOARD_IODATA_GVBCTV7E, 863 .card = CX88_BOARD_IODATA_GVBCTV7E,
846 } 864 },{
865 .subvendor = 0x1421,
866 .subdevice = 0x0334,
867 .card = CX88_BOARD_ADSTECH_DVB_T_PCI,
868 },
847}; 869};
848const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); 870const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
849 871
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index c046a23537d3..96cb0ff33bbd 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-core.c,v 1.28 2005/06/12 04:19:19 mchehab Exp $ 2 * $Id: cx88-core.c,v 1.31 2005/06/22 22:58:04 mchehab Exp $
3 * 3 *
4 * device driver for Conexant 2388x based TV cards 4 * device driver for Conexant 2388x based TV cards
5 * driver core 5 * driver core
@@ -545,12 +545,14 @@ void cx88_sram_channel_dump(struct cx88_core *core,
545 core->name,cx_read(ch->cnt2_reg)); 545 core->name,cx_read(ch->cnt2_reg));
546} 546}
547 547
548/* Used only on cx88-core */
548static char *cx88_pci_irqs[32] = { 549static char *cx88_pci_irqs[32] = {
549 "vid", "aud", "ts", "vip", "hst", "5", "6", "tm1", 550 "vid", "aud", "ts", "vip", "hst", "5", "6", "tm1",
550 "src_dma", "dst_dma", "risc_rd_err", "risc_wr_err", 551 "src_dma", "dst_dma", "risc_rd_err", "risc_wr_err",
551 "brdg_err", "src_dma_err", "dst_dma_err", "ipb_dma_err", 552 "brdg_err", "src_dma_err", "dst_dma_err", "ipb_dma_err",
552 "i2c", "i2c_rack", "ir_smp", "gpio0", "gpio1" 553 "i2c", "i2c_rack", "ir_smp", "gpio0", "gpio1"
553}; 554};
555/* Used only on cx88-video */
554char *cx88_vid_irqs[32] = { 556char *cx88_vid_irqs[32] = {
555 "y_risci1", "u_risci1", "v_risci1", "vbi_risc1", 557 "y_risci1", "u_risci1", "v_risci1", "vbi_risc1",
556 "y_risci2", "u_risci2", "v_risci2", "vbi_risc2", 558 "y_risci2", "u_risci2", "v_risci2", "vbi_risc2",
@@ -558,6 +560,7 @@ char *cx88_vid_irqs[32] = {
558 "y_sync", "u_sync", "v_sync", "vbi_sync", 560 "y_sync", "u_sync", "v_sync", "vbi_sync",
559 "opc_err", "par_err", "rip_err", "pci_abort", 561 "opc_err", "par_err", "rip_err", "pci_abort",
560}; 562};
563/* Used only on cx88-mpeg */
561char *cx88_mpeg_irqs[32] = { 564char *cx88_mpeg_irqs[32] = {
562 "ts_risci1", NULL, NULL, NULL, 565 "ts_risci1", NULL, NULL, NULL,
563 "ts_risci2", NULL, NULL, NULL, 566 "ts_risci2", NULL, NULL, NULL,
@@ -1006,21 +1009,7 @@ int cx88_set_tvnorm(struct cx88_core *core, struct cx88_tvnorm *norm)
1006 set_tvaudio(core); 1009 set_tvaudio(core);
1007 1010
1008 // tell i2c chips 1011 // tell i2c chips
1009#ifdef V4L2_I2C_CLIENTS
1010 cx88_call_i2c_clients(core,VIDIOC_S_STD,&norm->id); 1012 cx88_call_i2c_clients(core,VIDIOC_S_STD,&norm->id);
1011#else
1012 {
1013 struct video_channel c;
1014 memset(&c,0,sizeof(c));
1015 c.channel = core->input;
1016 c.norm = VIDEO_MODE_PAL;
1017 if ((norm->id & (V4L2_STD_NTSC_M|V4L2_STD_NTSC_M_JP)))
1018 c.norm = VIDEO_MODE_NTSC;
1019 if (norm->id & V4L2_STD_SECAM)
1020 c.norm = VIDEO_MODE_SECAM;
1021 cx88_call_i2c_clients(core,VIDIOCSCHAN,&c);
1022 }
1023#endif
1024 1013
1025 // done 1014 // done
1026 return 0; 1015 return 0;
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 1a259c3966cd..82cc1538c105 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-dvb.c,v 1.33 2005/06/12 04:19:19 mchehab Exp $ 2 * $Id: cx88-dvb.c,v 1.36 2005/06/21 06:08:12 mkrufky Exp $
3 * 3 *
4 * device driver for Conexant 2388x based TV cards 4 * device driver for Conexant 2388x based TV cards
5 * MPEG Transport Stream (DVB) routines 5 * MPEG Transport Stream (DVB) routines
@@ -231,6 +231,7 @@ static int dvb_register(struct cx8802_dev *dev)
231 break; 231 break;
232 case CX88_BOARD_KWORLD_DVB_T: 232 case CX88_BOARD_KWORLD_DVB_T:
233 case CX88_BOARD_DNTV_LIVE_DVB_T: 233 case CX88_BOARD_DNTV_LIVE_DVB_T:
234 case CX88_BOARD_ADSTECH_DVB_T_PCI:
234 dev->core->pll_addr = 0x61; 235 dev->core->pll_addr = 0x61;
235 dev->core->pll_desc = &dvb_pll_unknown_1; 236 dev->core->pll_desc = &dvb_pll_unknown_1;
236 dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_config, 237 dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_config,
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c
index dc0dcf249aac..bdc26e75ab5f 100644
--- a/drivers/media/video/cx88/cx88-input.c
+++ b/drivers/media/video/cx88/cx88-input.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-input.c,v 1.11 2005/05/22 20:57:56 nsh Exp $ 2 * $Id: cx88-input.c,v 1.13 2005/06/13 16:07:46 nsh Exp $
3 * 3 *
4 * Device driver for GPIO attached remote control interfaces 4 * Device driver for GPIO attached remote control interfaces
5 * on Conexant 2388x based TV/DVB cards. 5 * on Conexant 2388x based TV/DVB cards.
@@ -125,6 +125,86 @@ static IR_KEYTAB_TYPE ir_codes_iodata_bctv7e[IR_KEYTAB_SIZE] = {
125 125
126/* ---------------------------------------------------------------------- */ 126/* ---------------------------------------------------------------------- */
127 127
128/* ADS Tech Instant TV DVB-T PCI Remote */
129static IR_KEYTAB_TYPE ir_codes_adstech_dvb_t_pci[IR_KEYTAB_SIZE] = {
130 [ 0x5b ] = KEY_POWER,
131 [ 0x5f ] = KEY_MUTE,
132 [ 0x57 ] = KEY_1,
133 [ 0x4f ] = KEY_2,
134 [ 0x53 ] = KEY_3,
135 [ 0x56 ] = KEY_4,
136 [ 0x4e ] = KEY_5,
137 [ 0x5e ] = KEY_6,
138 [ 0x54 ] = KEY_7,
139 [ 0x4c ] = KEY_8,
140 [ 0x5c ] = KEY_9,
141 [ 0x4d ] = KEY_0,
142 [ 0x55 ] = KEY_GOTO,
143 [ 0x5d ] = KEY_SEARCH,
144 [ 0x17 ] = KEY_EPG, // Guide
145 [ 0x1f ] = KEY_MENU,
146 [ 0x0f ] = KEY_UP,
147 [ 0x46 ] = KEY_DOWN,
148 [ 0x16 ] = KEY_LEFT,
149 [ 0x1e ] = KEY_RIGHT,
150 [ 0x0e ] = KEY_SELECT, // Enter
151 [ 0x5a ] = KEY_INFO,
152 [ 0x52 ] = KEY_EXIT,
153 [ 0x59 ] = KEY_PREVIOUS,
154 [ 0x51 ] = KEY_NEXT,
155 [ 0x58 ] = KEY_REWIND,
156 [ 0x50 ] = KEY_FORWARD,
157 [ 0x44 ] = KEY_PLAYPAUSE,
158 [ 0x07 ] = KEY_STOP,
159 [ 0x1b ] = KEY_RECORD,
160 [ 0x13 ] = KEY_TUNER, // Live
161 [ 0x0a ] = KEY_A,
162 [ 0x12 ] = KEY_B,
163 [ 0x03 ] = KEY_PROG1, // 1
164 [ 0x01 ] = KEY_PROG2, // 2
165 [ 0x00 ] = KEY_PROG3, // 3
166 [ 0x06 ] = KEY_DVD,
167 [ 0x48 ] = KEY_AUX, // Photo
168 [ 0x40 ] = KEY_VIDEO,
169 [ 0x19 ] = KEY_AUDIO, // Music
170 [ 0x0b ] = KEY_CHANNELUP,
171 [ 0x08 ] = KEY_CHANNELDOWN,
172 [ 0x15 ] = KEY_VOLUMEUP,
173 [ 0x1c ] = KEY_VOLUMEDOWN,
174};
175
176/* ---------------------------------------------------------------------- */
177
178/* MSI TV@nywhere remote */
179static IR_KEYTAB_TYPE ir_codes_msi_tvanywhere[IR_KEYTAB_SIZE] = {
180 [ 0x00 ] = KEY_0, /* '0' */
181 [ 0x01 ] = KEY_1, /* '1' */
182 [ 0x02 ] = KEY_2, /* '2' */
183 [ 0x03 ] = KEY_3, /* '3' */
184 [ 0x04 ] = KEY_4, /* '4' */
185 [ 0x05 ] = KEY_5, /* '5' */
186 [ 0x06 ] = KEY_6, /* '6' */
187 [ 0x07 ] = KEY_7, /* '7' */
188 [ 0x08 ] = KEY_8, /* '8' */
189 [ 0x09 ] = KEY_9, /* '9' */
190 [ 0x0c ] = KEY_MUTE, /* 'Mute' */
191 [ 0x0f ] = KEY_SCREEN, /* 'Full Screen' */
192 [ 0x10 ] = KEY_F, /* 'Funtion' */
193 [ 0x11 ] = KEY_T, /* 'Time shift' */
194 [ 0x12 ] = KEY_POWER, /* 'Power' */
195 [ 0x13 ] = KEY_MEDIA, /* 'MTS' */
196 [ 0x14 ] = KEY_SLOW, /* 'Slow' */
197 [ 0x16 ] = KEY_REWIND, /* 'backward <<' */
198 [ 0x17 ] = KEY_ENTER, /* 'Return' */
199 [ 0x18 ] = KEY_FASTFORWARD, /* 'forward >>' */
200 [ 0x1a ] = KEY_CHANNELUP, /* 'Channel+' */
201 [ 0x1b ] = KEY_VOLUMEUP, /* 'Volume+' */
202 [ 0x1e ] = KEY_CHANNELDOWN, /* 'Channel-' */
203 [ 0x1f ] = KEY_VOLUMEDOWN, /* 'Volume-' */
204};
205
206/* ---------------------------------------------------------------------- */
207
128struct cx88_IR { 208struct cx88_IR {
129 struct cx88_core *core; 209 struct cx88_core *core;
130 struct input_dev input; 210 struct input_dev input;
@@ -269,6 +349,20 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
269 ir->mask_keyup = 0x80; 349 ir->mask_keyup = 0x80;
270 ir->polling = 1; // ms 350 ir->polling = 1; // ms
271 break; 351 break;
352 case CX88_BOARD_ADSTECH_DVB_T_PCI:
353 ir_codes = ir_codes_adstech_dvb_t_pci;
354 ir->gpio_addr = MO_GP1_IO;
355 ir->mask_keycode = 0xbf;
356 ir->mask_keyup = 0x40;
357 ir->polling = 50; // ms
358 break;
359 case CX88_BOARD_MSI_TVANYWHERE_MASTER:
360 ir_codes = ir_codes_msi_tvanywhere;
361 ir->gpio_addr = MO_GP1_IO;
362 ir->mask_keycode = 0x1f;
363 ir->mask_keyup = 0x40;
364 ir->polling = 1;
365 break;
272 } 366 }
273 367
274 if (NULL == ir_codes) { 368 if (NULL == ir_codes) {
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index e4ca7350df15..cd5c2615d8c5 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88-video.c,v 1.63 2005/06/12 04:19:19 mchehab Exp $ 2 * $Id: cx88-video.c,v 1.70 2005/06/20 03:36:00 mkrufky Exp $
3 * 3 *
4 * device driver for Conexant 2388x based TV cards 4 * device driver for Conexant 2388x based TV cards
5 * video4linux video interface 5 * video4linux video interface
@@ -1351,9 +1351,6 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1351 V4L2_CAP_STREAMING | 1351 V4L2_CAP_STREAMING |
1352 V4L2_CAP_VBI_CAPTURE | 1352 V4L2_CAP_VBI_CAPTURE |
1353#if 0 1353#if 0
1354 V4L2_TUNER_CAP_LOW |
1355#endif
1356#if 0
1357 V4L2_CAP_VIDEO_OVERLAY | 1354 V4L2_CAP_VIDEO_OVERLAY |
1358#endif 1355#endif
1359 0; 1356 0;
@@ -1475,7 +1472,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1475 } 1472 }
1476 break; 1473 break;
1477 case 1: 1474 case 1:
1478 if (CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD == core->board) { 1475 if (CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q == core->board) {
1479 strcpy(a->name,"Line In"); 1476 strcpy(a->name,"Line In");
1480 a->capability = V4L2_AUDCAP_STEREO; 1477 a->capability = V4L2_AUDCAP_STEREO;
1481 return 0; 1478 return 0;
@@ -1588,11 +1585,11 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1588 { 1585 {
1589 struct v4l2_frequency *f = arg; 1586 struct v4l2_frequency *f = arg;
1590 1587
1588 memset(f,0,sizeof(*f));
1589
1591 if (UNSET == core->tuner_type) 1590 if (UNSET == core->tuner_type)
1592 return -EINVAL; 1591 return -EINVAL;
1593 if (f->tuner != 0) 1592
1594 return -EINVAL;
1595 memset(f,0,sizeof(*f));
1596 f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; 1593 f->type = fh->radio ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
1597 f->frequency = dev->freq; 1594 f->frequency = dev->freq;
1598 return 0; 1595 return 0;
@@ -1612,11 +1609,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file,
1612 down(&dev->lock); 1609 down(&dev->lock);
1613 dev->freq = f->frequency; 1610 dev->freq = f->frequency;
1614 cx88_newstation(core); 1611 cx88_newstation(core);
1615#ifdef V4L2_I2C_CLIENTS
1616 cx88_call_i2c_clients(dev->core,VIDIOC_S_FREQUENCY,f); 1612 cx88_call_i2c_clients(dev->core,VIDIOC_S_FREQUENCY,f);
1617#else
1618 cx88_call_i2c_clients(dev->core,VIDIOCSFREQ,&dev->freq);
1619#endif
1620 up(&dev->lock); 1613 up(&dev->lock);
1621 return 0; 1614 return 0;
1622 } 1615 }
@@ -1714,11 +1707,7 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
1714 sizeof(cap->card)); 1707 sizeof(cap->card));
1715 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci)); 1708 sprintf(cap->bus_info,"PCI:%s", pci_name(dev->pci));
1716 cap->version = CX88_VERSION_CODE; 1709 cap->version = CX88_VERSION_CODE;
1717 cap->capabilities = V4L2_CAP_TUNER 1710 cap->capabilities = V4L2_CAP_TUNER;
1718#if 0
1719 | V4L2_TUNER_CAP_LOW
1720#endif
1721 ;
1722 return 0; 1711 return 0;
1723 } 1712 }
1724 case VIDIOC_G_TUNER: 1713 case VIDIOC_G_TUNER:
@@ -1730,19 +1719,8 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
1730 1719
1731 memset(t,0,sizeof(*t)); 1720 memset(t,0,sizeof(*t));
1732 strcpy(t->name, "Radio"); 1721 strcpy(t->name, "Radio");
1733 t->rangelow = (int)(65*16);
1734 t->rangehigh = (int)(108*16);
1735 1722
1736#ifdef V4L2_I2C_CLIENTS
1737 cx88_call_i2c_clients(dev->core,VIDIOC_G_TUNER,t); 1723 cx88_call_i2c_clients(dev->core,VIDIOC_G_TUNER,t);
1738#else
1739 {
1740 struct video_tuner vt;
1741 memset(&vt,0,sizeof(vt));
1742 cx88_call_i2c_clients(dev,VIDIOCGTUNER,&vt);
1743 t->signal = vt.signal;
1744 }
1745#endif
1746 return 0; 1724 return 0;
1747 } 1725 }
1748 case VIDIOC_ENUMINPUT: 1726 case VIDIOC_ENUMINPUT:
@@ -1775,8 +1753,29 @@ static int radio_do_ioctl(struct inode *inode, struct file *file,
1775 *id = 0; 1753 *id = 0;
1776 return 0; 1754 return 0;
1777 } 1755 }
1778 case VIDIOC_S_AUDIO: 1756 case VIDIOCSTUNER:
1757 {
1758 struct video_tuner *v = arg;
1759
1760 if (v->tuner) /* Only tuner 0 */
1761 return -EINVAL;
1762
1763 cx88_call_i2c_clients(dev->core,VIDIOCSTUNER,v);
1764 return 0;
1765 }
1779 case VIDIOC_S_TUNER: 1766 case VIDIOC_S_TUNER:
1767 {
1768 struct v4l2_tuner *t = arg;
1769
1770 if (0 != t->index)
1771 return -EINVAL;
1772
1773 cx88_call_i2c_clients(dev->core,VIDIOC_S_TUNER,t);
1774
1775 return 0;
1776 }
1777
1778 case VIDIOC_S_AUDIO:
1780 case VIDIOC_S_INPUT: 1779 case VIDIOC_S_INPUT:
1781 case VIDIOC_S_STD: 1780 case VIDIOC_S_STD:
1782 return 0; 1781 return 0;
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 867e988a5a93..0c5311f7e624 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: cx88.h,v 1.62 2005/06/12 04:19:19 mchehab Exp $ 2 * $Id: cx88.h,v 1.66 2005/06/22 22:58:04 mchehab Exp $
3 * 3 *
4 * v4l2 device driver for cx2388x based TV cards 4 * v4l2 device driver for cx2388x based TV cards
5 * 5 *
@@ -51,8 +51,6 @@
51/* ----------------------------------------------------------- */ 51/* ----------------------------------------------------------- */
52/* defines and enums */ 52/* defines and enums */
53 53
54#define V4L2_I2C_CLIENTS 1
55
56#define FORMAT_FLAGS_PACKED 0x01 54#define FORMAT_FLAGS_PACKED 0x01
57#define FORMAT_FLAGS_PLANAR 0x02 55#define FORMAT_FLAGS_PLANAR 0x02
58 56
@@ -159,7 +157,7 @@ extern struct sram_channel cx88_sram_channels[];
159#define CX88_BOARD_KWORLD_DVB_T 14 157#define CX88_BOARD_KWORLD_DVB_T 14
160#define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1 15 158#define CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1 15
161#define CX88_BOARD_KWORLD_LTV883 16 159#define CX88_BOARD_KWORLD_LTV883 16
162#define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD 17 160#define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q 17
163#define CX88_BOARD_HAUPPAUGE_DVB_T1 18 161#define CX88_BOARD_HAUPPAUGE_DVB_T1 18
164#define CX88_BOARD_CONEXANT_DVB_T1 19 162#define CX88_BOARD_CONEXANT_DVB_T1 19
165#define CX88_BOARD_PROVIDEO_PV259 20 163#define CX88_BOARD_PROVIDEO_PV259 20
@@ -167,10 +165,11 @@ extern struct sram_channel cx88_sram_channels[];
167#define CX88_BOARD_PCHDTV_HD3000 22 165#define CX88_BOARD_PCHDTV_HD3000 22
168#define CX88_BOARD_DNTV_LIVE_DVB_T 23 166#define CX88_BOARD_DNTV_LIVE_DVB_T 23
169#define CX88_BOARD_HAUPPAUGE_ROSLYN 24 167#define CX88_BOARD_HAUPPAUGE_ROSLYN 24
170#define CX88_BOARD_DIGITALLOGIC_MEC 25 168#define CX88_BOARD_DIGITALLOGIC_MEC 25
171#define CX88_BOARD_IODATA_GVBCTV7E 26 169#define CX88_BOARD_IODATA_GVBCTV7E 26
172#define CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO 27 170#define CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO 27
173#define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28 171#define CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T 28
172#define CX88_BOARD_ADSTECH_DVB_T_PCI 29
174 173
175enum cx88_itype { 174enum cx88_itype {
176 CX88_VMUX_COMPOSITE1 = 1, 175 CX88_VMUX_COMPOSITE1 = 1,