aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88')
-rw-r--r--drivers/media/video/cx88/Makefile12
-rw-r--r--drivers/media/video/cx88/cx88-cards.c33
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c104
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c4
-rw-r--r--drivers/media/video/cx88/cx88-video.c4
-rw-r--r--drivers/media/video/cx88/cx88.h3
6 files changed, 119 insertions, 41 deletions
diff --git a/drivers/media/video/cx88/Makefile b/drivers/media/video/cx88/Makefile
index 606d0348da2c..107e48645e3a 100644
--- a/drivers/media/video/cx88/Makefile
+++ b/drivers/media/video/cx88/Makefile
@@ -9,3 +9,15 @@ obj-$(CONFIG_VIDEO_CX88_DVB) += cx88-dvb.o
9EXTRA_CFLAGS += -I$(src)/.. 9EXTRA_CFLAGS += -I$(src)/..
10EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core 10EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core
11EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends 11EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends
12ifneq ($(CONFIG_DVB_CX22702),n)
13 EXTRA_CFLAGS += -DHAVE_CX22702=1
14endif
15ifneq ($(CONFIG_DVB_OR51132),n)
16 EXTRA_CFLAGS += -DHAVE_OR51132=1
17endif
18ifneq ($(CONFIG_DVB_LGDT330X),n)
19 EXTRA_CFLAGS += -DHAVE_LGDT330X=1
20endif
21ifneq ($(CONFIG_DVB_MT352),n)
22 EXTRA_CFLAGS += -DHAVE_MT352=1
23endif
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index 3d0c784b376f..ebf02a7f81e8 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.86 2005/07/14 03:06:43 mchehab Exp $ 2 * $Id: cx88-cards.c,v 1.90 2005/07/28 02:47:42 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.
@@ -90,6 +90,9 @@ struct cx88_board cx88_boards[] = {
90 .input = {{ 90 .input = {{
91 .type = CX88_VMUX_TELEVISION, 91 .type = CX88_VMUX_TELEVISION,
92 .vmux = 0, 92 .vmux = 0,
93 },{
94 .type = CX88_VMUX_SVIDEO,
95 .vmux = 2,
93 }}, 96 }},
94 }, 97 },
95 [CX88_BOARD_PIXELVIEW] = { 98 [CX88_BOARD_PIXELVIEW] = {
@@ -496,6 +499,9 @@ struct cx88_board cx88_boards[] = {
496 .input = {{ 499 .input = {{
497 .type = CX88_VMUX_DVB, 500 .type = CX88_VMUX_DVB,
498 .vmux = 0, 501 .vmux = 0,
502 },{
503 .type = CX88_VMUX_SVIDEO,
504 .vmux = 2,
499 }}, 505 }},
500 .dvb = 1, 506 .dvb = 1,
501 }, 507 },
@@ -753,6 +759,27 @@ struct cx88_board cx88_boards[] = {
753 }}, 759 }},
754 .dvb = 1, 760 .dvb = 1,
755 }, 761 },
762 [CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD] = {
763 .name = "DViCO FusionHDTV 5 Gold",
764 .tuner_type = TUNER_LG_TDVS_H062F,
765 .radio_type = UNSET,
766 .tuner_addr = ADDR_UNSET,
767 .radio_addr = ADDR_UNSET,
768 /* See DViCO FusionHDTV 3 Gold-Q for GPIO documentation. */
769 .input = {{
770 .type = CX88_VMUX_TELEVISION,
771 .vmux = 0,
772 .gpio0 = 0x0f0d,
773 },{
774 .type = CX88_VMUX_COMPOSITE1,
775 .vmux = 1,
776 .gpio0 = 0x0f00,
777 },{
778 .type = CX88_VMUX_SVIDEO,
779 .vmux = 2,
780 .gpio0 = 0x0f00,
781 }},
782 },
756}; 783};
757const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards); 784const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
758 785
@@ -880,6 +907,10 @@ struct cx88_subid cx88_subids[] = {
880 .subvendor = 0x153b, 907 .subvendor = 0x153b,
881 .subdevice = 0x1166, 908 .subdevice = 0x1166,
882 .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1, 909 .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1,
910 },{
911 .subvendor = 0x18ac,
912 .subdevice = 0xd500,
913 .card = CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD,
883 }, 914 },
884}; 915};
885const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids); 916const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 6ad1458ab652..78d223257a68 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.42 2005/07/12 15:44:55 mkrufky Exp $ 2 * $Id: cx88-dvb.c,v 1.58 2005/08/07 09:24:08 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
@@ -29,27 +29,23 @@
29#include <linux/kthread.h> 29#include <linux/kthread.h>
30#include <linux/file.h> 30#include <linux/file.h>
31#include <linux/suspend.h> 31#include <linux/suspend.h>
32 32#include <linux/config.h>
33#define CONFIG_DVB_MT352 1
34#define CONFIG_DVB_CX22702 1
35#define CONFIG_DVB_OR51132 1
36#define CONFIG_DVB_LGDT3302 1
37 33
38#include "cx88.h" 34#include "cx88.h"
39#include "dvb-pll.h" 35#include "dvb-pll.h"
40 36
41#if CONFIG_DVB_MT352 37#ifdef HAVE_MT352
42# include "mt352.h" 38# include "mt352.h"
43# include "mt352_priv.h" 39# include "mt352_priv.h"
44#endif 40#endif
45#if CONFIG_DVB_CX22702 41#ifdef HAVE_CX22702
46# include "cx22702.h" 42# include "cx22702.h"
47#endif 43#endif
48#if CONFIG_DVB_OR51132 44#ifdef HAVE_OR51132
49# include "or51132.h" 45# include "or51132.h"
50#endif 46#endif
51#if CONFIG_DVB_LGDT3302 47#ifdef HAVE_LGDT330X
52# include "lgdt3302.h" 48# include "lgdt330x.h"
53#endif 49#endif
54 50
55MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); 51MODULE_DESCRIPTION("driver for cx2388x based DVB cards");
@@ -107,7 +103,7 @@ static struct videobuf_queue_ops dvb_qops = {
107 103
108/* ------------------------------------------------------------------ */ 104/* ------------------------------------------------------------------ */
109 105
110#if CONFIG_DVB_MT352 106#ifdef HAVE_MT352
111static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe) 107static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe)
112{ 108{
113 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 }; 109 static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
@@ -177,7 +173,7 @@ static struct mt352_config dntv_live_dvbt_config = {
177}; 173};
178#endif 174#endif
179 175
180#if CONFIG_DVB_CX22702 176#ifdef HAVE_CX22702
181static struct cx22702_config connexant_refboard_config = { 177static struct cx22702_config connexant_refboard_config = {
182 .demod_address = 0x43, 178 .demod_address = 0x43,
183 .output_mode = CX22702_SERIAL_OUTPUT, 179 .output_mode = CX22702_SERIAL_OUTPUT,
@@ -193,7 +189,7 @@ static struct cx22702_config hauppauge_novat_config = {
193}; 189};
194#endif 190#endif
195 191
196#if CONFIG_DVB_OR51132 192#ifdef HAVE_OR51132
197static int or51132_set_ts_param(struct dvb_frontend* fe, 193static int or51132_set_ts_param(struct dvb_frontend* fe,
198 int is_punctured) 194 int is_punctured)
199{ 195{
@@ -210,8 +206,45 @@ static struct or51132_config pchdtv_hd3000 = {
210}; 206};
211#endif 207#endif
212 208
213#if CONFIG_DVB_LGDT3302 209#ifdef HAVE_LGDT330X
214static int lgdt3302_set_ts_param(struct dvb_frontend* fe, int is_punctured) 210static int lgdt330x_pll_set(struct dvb_frontend* fe,
211 struct dvb_frontend_parameters* params)
212{
213 struct cx8802_dev *dev= fe->dvb->priv;
214 u8 buf[4];
215 struct i2c_msg msg =
216 { .addr = dev->core->pll_addr, .flags = 0, .buf = buf, .len = 4 };
217 int err;
218
219 dvb_pll_configure(dev->core->pll_desc, buf, params->frequency, 0);
220 dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n",
221 __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]);
222 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
223 printk(KERN_WARNING "cx88-dvb: %s error "
224 "(addr %02x <- %02x, err = %i)\n",
225 __FUNCTION__, buf[0], buf[1], err);
226 if (err < 0)
227 return err;
228 else
229 return -EREMOTEIO;
230 }
231 return 0;
232}
233
234static int lgdt330x_pll_rf_set(struct dvb_frontend* fe, int index)
235{
236 struct cx8802_dev *dev= fe->dvb->priv;
237 struct cx88_core *core = dev->core;
238
239 dprintk(1, "%s: index = %d\n", __FUNCTION__, index);
240 if (index == 0)
241 cx_clear(MO_GP0_IO, 8);
242 else
243 cx_set(MO_GP0_IO, 8);
244 return 0;
245}
246
247static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured)
215{ 248{
216 struct cx8802_dev *dev= fe->dvb->priv; 249 struct cx8802_dev *dev= fe->dvb->priv;
217 if (is_punctured) 250 if (is_punctured)
@@ -221,18 +254,12 @@ static int lgdt3302_set_ts_param(struct dvb_frontend* fe, int is_punctured)
221 return 0; 254 return 0;
222} 255}
223 256
224static struct lgdt3302_config fusionhdtv_3_gold_q = { 257static struct lgdt330x_config fusionhdtv_3_gold = {
225 .demod_address = 0x0e,
226 .pll_address = 0x61,
227 .pll_desc = &dvb_pll_microtune_4042,
228 .set_ts_params = lgdt3302_set_ts_param,
229};
230
231static struct lgdt3302_config fusionhdtv_3_gold_t = {
232 .demod_address = 0x0e, 258 .demod_address = 0x0e,
233 .pll_address = 0x61, 259 .demod_chip = LGDT3302,
234 .pll_desc = &dvb_pll_thomson_dtt7611, 260 .serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */
235 .set_ts_params = lgdt3302_set_ts_param, 261 .pll_set = lgdt330x_pll_set,
262 .set_ts_params = lgdt330x_set_ts_param,
236}; 263};
237#endif 264#endif
238 265
@@ -244,7 +271,7 @@ static int dvb_register(struct cx8802_dev *dev)
244 271
245 /* init frontend */ 272 /* init frontend */
246 switch (dev->core->board) { 273 switch (dev->core->board) {
247#if CONFIG_DVB_CX22702 274#ifdef HAVE_CX22702
248 case CX88_BOARD_HAUPPAUGE_DVB_T1: 275 case CX88_BOARD_HAUPPAUGE_DVB_T1:
249 dev->dvb.frontend = cx22702_attach(&hauppauge_novat_config, 276 dev->dvb.frontend = cx22702_attach(&hauppauge_novat_config,
250 &dev->core->i2c_adap); 277 &dev->core->i2c_adap);
@@ -255,7 +282,7 @@ static int dvb_register(struct cx8802_dev *dev)
255 &dev->core->i2c_adap); 282 &dev->core->i2c_adap);
256 break; 283 break;
257#endif 284#endif
258#if CONFIG_DVB_MT352 285#ifdef HAVE_MT352
259 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: 286 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
260 dev->core->pll_addr = 0x61; 287 dev->core->pll_addr = 0x61;
261 dev->core->pll_desc = &dvb_pll_lg_z201; 288 dev->core->pll_desc = &dvb_pll_lg_z201;
@@ -277,13 +304,13 @@ static int dvb_register(struct cx8802_dev *dev)
277 &dev->core->i2c_adap); 304 &dev->core->i2c_adap);
278 break; 305 break;
279#endif 306#endif
280#if CONFIG_DVB_OR51132 307#ifdef HAVE_OR51132
281 case CX88_BOARD_PCHDTV_HD3000: 308 case CX88_BOARD_PCHDTV_HD3000:
282 dev->dvb.frontend = or51132_attach(&pchdtv_hd3000, 309 dev->dvb.frontend = or51132_attach(&pchdtv_hd3000,
283 &dev->core->i2c_adap); 310 &dev->core->i2c_adap);
284 break; 311 break;
285#endif 312#endif
286#if CONFIG_DVB_LGDT3302 313#ifdef HAVE_LGDT330X
287 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q: 314 case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q:
288 dev->ts_gen_cntrl = 0x08; 315 dev->ts_gen_cntrl = 0x08;
289 { 316 {
@@ -292,9 +319,14 @@ static int dvb_register(struct cx8802_dev *dev)
292 319
293 cx_clear(MO_GP0_IO, 1); 320 cx_clear(MO_GP0_IO, 1);
294 mdelay(100); 321 mdelay(100);
295 cx_set(MO_GP0_IO, 9); // ANT connector too FIXME 322 cx_set(MO_GP0_IO, 1);
296 mdelay(200); 323 mdelay(200);
297 dev->dvb.frontend = lgdt3302_attach(&fusionhdtv_3_gold_q, 324
325 /* Select RF connector callback */
326 fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set;
327 dev->core->pll_addr = 0x61;
328 dev->core->pll_desc = &dvb_pll_microtune_4042;
329 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold,
298 &dev->core->i2c_adap); 330 &dev->core->i2c_adap);
299 } 331 }
300 break; 332 break;
@@ -306,9 +338,11 @@ static int dvb_register(struct cx8802_dev *dev)
306 338
307 cx_clear(MO_GP0_IO, 1); 339 cx_clear(MO_GP0_IO, 1);
308 mdelay(100); 340 mdelay(100);
309 cx_set(MO_GP0_IO, 9); /* ANT connector too FIXME */ 341 cx_set(MO_GP0_IO, 9);
310 mdelay(200); 342 mdelay(200);
311 dev->dvb.frontend = lgdt3302_attach(&fusionhdtv_3_gold_t, 343 dev->core->pll_addr = 0x61;
344 dev->core->pll_desc = &dvb_pll_thomson_dtt7611;
345 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold,
312 &dev->core->i2c_adap); 346 &dev->core->i2c_adap);
313 } 347 }
314 break; 348 break;
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 8403c4e95050..a628a55299c6 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -1,5 +1,5 @@
1/* 1/*
2 $Id: cx88-i2c.c,v 1.28 2005/07/05 17:37:35 nsh Exp $ 2 $Id: cx88-i2c.c,v 1.30 2005/07/25 05:10:13 mkrufky Exp $
3 3
4 cx88-i2c.c -- all the i2c code is here 4 cx88-i2c.c -- all the i2c code is here
5 5
@@ -164,7 +164,7 @@ static struct i2c_client cx8800_i2c_client_template = {
164}; 164};
165 165
166static char *i2c_devs[128] = { 166static char *i2c_devs[128] = {
167 [ 0x1c >> 1 ] = "lgdt3302", 167 [ 0x1c >> 1 ] = "lgdt330x",
168 [ 0x86 >> 1 ] = "tda9887/cx22702", 168 [ 0x86 >> 1 ] = "tda9887/cx22702",
169 [ 0xa0 >> 1 ] = "eeprom", 169 [ 0xa0 >> 1 ] = "eeprom",
170 [ 0xc0 >> 1 ] = "tuner (analog)", 170 [ 0xc0 >> 1 ] = "tuner (analog)",
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 5588a3aeecb4..5f58c103198a 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.80 2005/07/13 08:49:08 mchehab Exp $ 2 * $Id: cx88-video.c,v 1.82 2005/07/22 05:13:34 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
@@ -758,10 +758,10 @@ static int video_open(struct inode *inode, struct file *file)
758 struct cx88_core *core = dev->core; 758 struct cx88_core *core = dev->core;
759 int board = core->board; 759 int board = core->board;
760 dprintk(1,"video_open: setting radio device\n"); 760 dprintk(1,"video_open: setting radio device\n");
761 cx_write(MO_GP3_IO, cx88_boards[board].radio.gpio3);
761 cx_write(MO_GP0_IO, cx88_boards[board].radio.gpio0); 762 cx_write(MO_GP0_IO, cx88_boards[board].radio.gpio0);
762 cx_write(MO_GP1_IO, cx88_boards[board].radio.gpio1); 763 cx_write(MO_GP1_IO, cx88_boards[board].radio.gpio1);
763 cx_write(MO_GP2_IO, cx88_boards[board].radio.gpio2); 764 cx_write(MO_GP2_IO, cx88_boards[board].radio.gpio2);
764 cx_write(MO_GP3_IO, cx88_boards[board].radio.gpio3);
765 dev->core->tvaudio = WW_FM; 765 dev->core->tvaudio = WW_FM;
766 cx88_set_tvaudio(core); 766 cx88_set_tvaudio(core);
767 cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1); 767 cx88_set_stereo(core,V4L2_TUNER_MODE_STEREO,1);
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index b008f7db6dfd..da65dc92787c 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.69 2005/07/13 17:25:25 mchehab Exp $ 2 * $Id: cx88.h,v 1.70 2005/07/24 17:44:09 mkrufky Exp $
3 * 3 *
4 * v4l2 device driver for cx2388x based TV cards 4 * v4l2 device driver for cx2388x based TV cards
5 * 5 *
@@ -171,6 +171,7 @@ extern struct sram_channel cx88_sram_channels[];
171#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 172#define CX88_BOARD_ADSTECH_DVB_T_PCI 29
173#define CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1 30 173#define CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1 30
174#define CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD 31
174 175
175enum cx88_itype { 176enum cx88_itype {
176 CX88_VMUX_COMPOSITE1 = 1, 177 CX88_VMUX_COMPOSITE1 = 1,