Mac Michaels wrote: >2) Chip is being held in the reset state by a GPIO pin. A >likely candidate. In order for the chip to respond the >hardware reset pin 27 must be pulled high to a "1". You >need to figure out where pin 27 of the lgdt3303 chip is >connected to the bt88xx chip. That will be a difficult >since the lgdt3303 chip is inside the tuner's metal box. My >first guess would be gpio[0] just like all the other >FusionHDTV cards. Note that there is also some reset code >in cx88-dvb.c. It must leave the appropriate GPIO pin set >to a 1. > > Finding the reset line wasn't so bad.... Now I have the frontend loaded, and I can get a lock, but no ts yet. I can't scan for channels either. This is (very short) atscscan output: >>> tune to: 111025000:QAM_256 >>> tuning status == 0x01 >>> tuning status == 0x03 >>> tuning status == 0x03 >>> tuning status == 0x07 >>> tuning status == 0x00 >>> tuning status == 0x0f >>> tuning status == 0x07 >>> tuning status == 0x03 >>> tuning status == 0x01 >>> tuning status == 0x00 WARNING: >>> tuning failed!!! >>> tune to: 111025000:QAM_256 (tuning failed) [snip] >>> tune to: 711000000:QAM_256 >>> tuning status == 0x01 >>> tuning status == 0x1f WARNING: filter timeout pid 0x0000 WARNING: filter timeout pid 0x1ffb >>> tune to: 717000000:QAM_256 >>> tuning status == 0x1f WARNING: filter timeout pid 0x0000 WARNING: filter timeout pid 0x1ffb >>> tune to: 723000000:QAM_256 >>> tuning status == 0x1f WARNING: filter timeout pid 0x0000 WARNING: filter timeout pid 0x1ffb Take a look at dmesg, for some reason, when I have bttv compiled with dvb enabled for this card, the tda9887 chip doesn't always get autodetected. However, when I don't set .has_dvb =1 (bttv-cards.c, line ~2410), tda9887 always shows up: 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] 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). DVB: registering frontend 0 (LG Electronics LGDT3303 VSB/QAM Frontend)... ...and that last line makes me wonder how come cx88-dvb wasn't designed to behave the same way. cx88-dvb prints card name instead of frontend name. Anyhow, below is the current patch... I don't feel good about the .serial_mpeg setting in the lgdt330x_config struct. I don't know if that's supposed to stay there or not... I figure it should be chomped, since there is no mpeg chip on board, but it looks like lgdt330x is expecting something to be in there. I have tried both 0x40 and 0x00, neither made a difference. What do u think? -- Michael Krufky -------------- next part -------------- diff -upr dvb-kernel.orig/linux/drivers/media/dvb/bt8xx/Kconfig dvb-kernel/linux/drivers/media/dvb/bt8xx/Kconfig --- dvb-kernel.orig/linux/drivers/media/dvb/bt8xx/Kconfig 2005-08-22 20:27:17.000000000 +0000 +++ dvb-kernel/linux/drivers/media/dvb/bt8xx/Kconfig 2005-08-22 20:31:07.000000000 +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, diff -upr dvb-kernel.orig/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c dvb-kernel/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c --- dvb-kernel.orig/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c 2005-08-22 20:27:17.000000000 +0000 +++ dvb-kernel/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c 2005-08-23 00:37:09.000000000 +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,54 @@ 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; + } + + /* Set the Auxiliary Byte. */ + buf[2] &= ~0x20; + buf[2] |= 0x18; + buf[3] = 0x50; + i2c_transfer(card->i2c_adapter, &msg, 1); + + return 0; +} + +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, +}; + +static void lgdt330x_reset(struct dvb_bt8xx_card *bt) +{ + /* Set pin 27 of the lgdt3303 chip high to reset the frontend */ + + /* Pulse the reset line */ + bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000001); /* High */ + bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000000); /* Low */ + msleep(100); + + bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000001); /* High */ +} + static void frontend_init(struct dvb_bt8xx_card *card, u32 type) { int ret; @@ -562,6 +611,15 @@ static void frontend_init(struct dvb_bt8 break; #endif +#ifdef BTTV_DVICO_FUSIONHDTV_5_LITE + case BTTV_DVICO_FUSIONHDTV_5_LITE: + lgdt330x_reset(card); + 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 +821,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 = 0x00e00007; + card->op_sync_orin = 0; + card->irq_err_ignore = 0; + break; + #ifdef BTTV_TWINHAN_VP3021 case BTTV_TWINHAN_VP3021: #else diff -upr dvb-kernel.orig/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h dvb-kernel/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h --- dvb-kernel.orig/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h 2005-08-22 20:27:17.000000000 +0000 +++ dvb-kernel/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h 2005-08-22 20:31:07.000000000 +0000 @@ -35,6 +35,7 @@ #include "nxt6000.h" #include "cx24110.h" #include "or51211.h" +#include "lgdt330x.h" struct dvb_bt8xx_card { struct semaphore lock;