[linux-dvb] hybrid DViCO FusionHDTV5 Lite: dvb-bt8xx + lgdt330x + dvb-pll

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been trying to enable support for DViCO FusionHDTV 5 Lite into 
dvb-bt8xx, using lgdt330x and dvb-pll.  I am pretty sure that I have 
done everything correctly, but I dont have a working 
"lgdt330x_set_ts_param" although I dont think I need one, as the bttv 
has no mpeg chip.  Am I wrong about this?  If so, how can I write this 
function?

Analog functions are working on this board already without a flaw.  The 
video4linux portion of this code can be found in video4linux cvs, bttv 
card 0x87 (135).  However, with dvb, I am getting an error (see all the 
way down below), and the frontend driver does not get detected.  I am 
sure that I have the i2c address correct, and I got my gpio values from 
playing with both regspy and btspy.  Any ideas?

Anyhow, here is my dmesg, first without DVB support enabled in 
bttv-cards.c, and then with DVB support (.has_dvb = 1,) and dvb-bt8xx.  
The file attached is the patch that I made against dvb-kernel cvs.

Linux video capture interface: v1.00
bttv: driver version 0.9.16 loaded
bttv: using 8 buffers with 2080k (520 pages) each for capture
radeonfb: Monitor 1 type CRT found
radeonfb: Monitor 2 type no found
Console: switching to colour frame buffer device 80x30
radeonfb (0000:01:05.0): ATI Radeon X4
bttv: Bt8xx card found (0).
ACPI: PCI Interrupt 0000:02:07.0[A] -> GSI 19 (level, low) -> IRQ 19
bttv0: Bt878 (rev 17) at 0000:02:07.0, irq: 19, latency: 64, mmio: 
0xec200000
bttv0: detected: DVICO FusionHDTV 5 Lite [card=135], PCI subsystem ID is 
18ac:d500
bttv0: using: DVICO FusionHDTV 5 Lite [card=135,autodetected]
bttv0: gpio: en=00000000, out=00000000 in=00ffffff [init]
bttv0: using tuner=64
bttv0: i2c: checking for TDA9887 @ 0x86... found
tda9885/6/7: chip found @ 0x86
tuner 4-0061: chip found @ 0xc2 (bt878 #0 [sw])
tuner 4-0061: type set to 64 (LG TDVS-H062F/TUA6034)
bttv0: registered device video0
bttv0: registered device vbi0
bttv0: unloading
Linux video capture interface: v1.00
bttv: driver version 0.9.16 loaded
bttv: using 8 buffers with 2080k (520 pages) each for capture
bttv: Bt8xx card found (0).
ACPI: PCI Interrupt 0000:02:07.0[A] -> GSI 19 (level, low) -> IRQ 19
bttv0: Bt878 (rev 17) at 0000:02:07.0, irq: 19, latency: 64, mmio: 
0xec200000
bttv0: detected: DVICO FusionHDTV 5 Lite [card=135], PCI subsystem ID is 
18ac:d500
bttv0: using: DVICO FusionHDTV 5 Lite [card=135,autodetected]
bttv0: gpio: en=00000000, out=00000000 in=00ffffff [init]
tda9885/6/7: chip found @ 0x86
tuner 4-0061: chip found @ 0xc2 (bt878 #0 [sw])
bttv0: using tuner=64
tuner 4-0061: type set to 64 (LG TDVS-H062F/TUA6034)
bttv0: registered device video0
bttv0: registered device vbi0
bttv0: add subdevice "dvb0"
bt878: AUDIO driver version 0.0.0 loaded
bt878: Bt878 AUDIO function found (0).
ACPI: PCI Interrupt 0000:02:07.1[A] -> GSI 19 (level, low) -> IRQ 19
bt878(0): Bt878 (rev 17) at 02:07.1, irq: 19, latency: 64, memory: 
0xec201000
DVB: registering new adapter (bttv0).
lgdt330x: i2c_read_demod_bytes: addr 0x0e select 0x02 error (ret == -121)
dvb-bt8xx: A frontend driver was not found for device 109e/0878 
subsystem 18ac/d500

-- 
Michael Krufky



-------------- next part --------------
Index: linux/drivers/media/dvb/bt8xx/Kconfig
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/bt8xx/Kconfig,v
retrieving revision 1.13
diff -u -p -r1.13 Kconfig
--- linux/drivers/media/dvb/bt8xx/Kconfig	17 Aug 2005 04:09:50 -0000	1.13
+++ linux/drivers/media/dvb/bt8xx/Kconfig	19 Aug 2005 04:34:38 -0000
@@ -6,6 +6,7 @@ config DVB_BT8XX
 	select DVB_NXT6000
 	select DVB_CX24110
 	select DVB_OR51211
+	select DVB_LGDT330X
 	help
 	  Support for PCI cards based on the Bt8xx PCI bridge. Examples are
 	  the Nebula cards, the Pinnacle PCTV cards, the Twinhan DST cards,
Index: linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c,v
retrieving revision 1.47
diff -u -p -r1.47 dvb-bt8xx.c
--- linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c	3 Aug 2005 22:56:09 -0000	1.47
+++ linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c	19 Aug 2005 04:34:39 -0000
@@ -34,6 +34,7 @@
 #include "dvb_frontend.h"
 #include "dvb-bt8xx.h"
 #include "bt878.h"
+#include "dvb-pll.h"
 
 static int debug;
 
@@ -546,6 +547,52 @@ static struct mt352_config digitv_alps_t
 	.pll_set = digitv_alps_tded4_pll_set,
 };
 
+static int tdvs_tua6034_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+{
+	struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv;
+	u8 buf[4];
+	struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) };
+	int err;
+
+	dvb_pll_configure(&dvb_pll_tdvs_tua6034, buf, params->frequency, 0);
+	dprintk("%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n",
+		__FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]);
+	if ((err = i2c_transfer(card->i2c_adapter, &msg, 1)) != 1) {
+	        printk(KERN_WARNING "dvb-bt8xx: %s error "
+		        "(addr %02x <- %02x, err = %i)\n",
+		        __FUNCTION__, buf[0], buf[1], err);
+		if (err < 0)
+			return err;
+		else
+			return -EREMOTEIO;
+	}
+
+	return 0;
+}
+
+#if 0
+static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured)
+{
+	/* FIXME */
+	struct bttv *dev = fe->dvb->priv;
+	if (is_punctured)
+		dev->ts_gen_cntrl |= 0x04;
+	else
+		dev->ts_gen_cntrl &= ~0x04;
+	return 0;
+}
+#endif
+
+static struct lgdt330x_config tdvs_tua6034_config = {
+	.demod_address    = 0x0e,
+	.demod_chip       = LGDT3303,
+	.serial_mpeg      = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */
+	.pll_set          = tdvs_tua6034_pll_set,
+#if 0
+	.set_ts_params    = lgdt330x_set_ts_param,
+#endif
+};
+
 static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
 {
 	int ret;
@@ -562,6 +609,14 @@ static void frontend_init(struct dvb_bt8
 		break;
 #endif
 
+#ifdef BTTV_DVICO_FUSIONHDTV_5_LITE
+	case BTTV_DVICO_FUSIONHDTV_5_LITE:
+		card->fe = lgdt330x_attach(&tdvs_tua6034_config, card->i2c_adapter);
+		if (card->fe != NULL)
+			dprintk ("dvb_bt8xx: lgdt330x detected\n");
+		break;
+#endif
+
 #ifdef BTTV_TWINHAN_VP3021
 	case BTTV_TWINHAN_VP3021:
 #else
@@ -763,6 +818,14 @@ static int dvb_bt8xx_probe(struct device
 		 * DA_APP(parallel) */
 		break;
 
+#ifdef BTTV_DVICO_FUSIONHDTV_5_LITE
+	case BTTV_DVICO_FUSIONHDTV_5_LITE:
+#endif
+		card->gpio_mode = 0x00c00007;
+		card->op_sync_orin = 0;
+		card->irq_err_ignore = 0;
+		break;
+
 #ifdef BTTV_TWINHAN_VP3021
 	case BTTV_TWINHAN_VP3021:
 #else
Index: linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h
===================================================================
RCS file: /cvs/linuxtv/dvb-kernel/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h,v
retrieving revision 1.18
diff -u -p -r1.18 dvb-bt8xx.h
--- linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h	17 Jul 2005 20:56:25 -0000	1.18
+++ linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h	19 Aug 2005 04:34:39 -0000
@@ -35,6 +35,7 @@
 #include "nxt6000.h"
 #include "cx24110.h"
 #include "or51211.h"
+#include "lgdt330x.h"
 
 struct dvb_bt8xx_card {
 	struct semaphore lock;

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux