aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/bt8xx/dvb-bt8xx.c
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@m1k.net>2005-11-09 00:35:12 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:56:01 -0500
commit3cff00d91292e744a510be7256f1c80e1b0be819 (patch)
treebb97c03a216dffa97debd664c2afe5386802bc81 /drivers/media/dvb/bt8xx/dvb-bt8xx.c
parent3765022171874d249535a1c8b8190f408fd85f21 (diff)
[PATCH] dvb: Add ATSC support for DViCO FusionHDTV5 Lite
Added ATSC support for DViCO FusionHDTV5 Lite. Signed-off-by: Michael Krufky <mkrufky@m1k.net> Cc: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb/bt8xx/dvb-bt8xx.c')
-rw-r--r--drivers/media/dvb/bt8xx/dvb-bt8xx.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index c5c7672cd538..96ef35ecab49 100644
--- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -34,6 +34,7 @@
34#include "dvb_frontend.h" 34#include "dvb_frontend.h"
35#include "dvb-bt8xx.h" 35#include "dvb-bt8xx.h"
36#include "bt878.h" 36#include "bt878.h"
37#include "dvb-pll.h"
37 38
38static int debug; 39static int debug;
39 40
@@ -546,6 +547,55 @@ static struct mt352_config digitv_alps_tded4_config = {
546 .pll_set = digitv_alps_tded4_pll_set, 547 .pll_set = digitv_alps_tded4_pll_set,
547}; 548};
548 549
550static int tdvs_tua6034_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
551{
552 struct dvb_bt8xx_card *card = (struct dvb_bt8xx_card *) fe->dvb->priv;
553 u8 buf[4];
554 struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = buf, .len = sizeof(buf) };
555 int err;
556
557 dvb_pll_configure(&dvb_pll_tdvs_tua6034, buf, params->frequency, 0);
558 dprintk("%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n",
559 __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]);
560 if ((err = i2c_transfer(card->i2c_adapter, &msg, 1)) != 1) {
561 printk(KERN_WARNING "dvb-bt8xx: %s error "
562 "(addr %02x <- %02x, err = %i)\n",
563 __FUNCTION__, buf[0], buf[1], err);
564 if (err < 0)
565 return err;
566 else
567 return -EREMOTEIO;
568 }
569
570 /* Set the Auxiliary Byte. */
571 buf[2] &= ~0x20;
572 buf[2] |= 0x18;
573 buf[3] = 0x50;
574 i2c_transfer(card->i2c_adapter, &msg, 1);
575
576 return 0;
577}
578
579static struct lgdt330x_config tdvs_tua6034_config = {
580 .demod_address = 0x0e,
581 .demod_chip = LGDT3303,
582 .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */
583 .pll_set = tdvs_tua6034_pll_set,
584};
585
586static void lgdt330x_reset(struct dvb_bt8xx_card *bt)
587{
588 /* Set pin 27 of the lgdt3303 chip high to reset the frontend */
589
590 /* Pulse the reset line */
591 bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000001); /* High */
592 bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000000); /* Low */
593 msleep(100);
594
595 bttv_write_gpio(bt->bttv_nr, 0x00e00007, 0x00000001); /* High */
596 msleep(100);
597}
598
549static void frontend_init(struct dvb_bt8xx_card *card, u32 type) 599static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
550{ 600{
551 int ret; 601 int ret;
@@ -562,6 +612,15 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
562 break; 612 break;
563#endif 613#endif
564 614
615#ifdef BTTV_DVICO_FUSIONHDTV_5_LITE
616 case BTTV_DVICO_FUSIONHDTV_5_LITE:
617 lgdt330x_reset(card);
618 card->fe = lgdt330x_attach(&tdvs_tua6034_config, card->i2c_adapter);
619 if (card->fe != NULL)
620 dprintk ("dvb_bt8xx: lgdt330x detected\n");
621 break;
622#endif
623
565#ifdef BTTV_TWINHAN_VP3021 624#ifdef BTTV_TWINHAN_VP3021
566 case BTTV_TWINHAN_VP3021: 625 case BTTV_TWINHAN_VP3021:
567#else 626#else
@@ -765,6 +824,14 @@ static int dvb_bt8xx_probe(struct device *dev)
765 * DA_APP(parallel) */ 824 * DA_APP(parallel) */
766 break; 825 break;
767 826
827#ifdef BTTV_DVICO_FUSIONHDTV_5_LITE
828 case BTTV_DVICO_FUSIONHDTV_5_LITE:
829#endif
830 card->gpio_mode = 0x0400c060;
831 card->op_sync_orin = BT878_RISC_SYNC_MASK;
832 card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
833 break;
834
768#ifdef BTTV_TWINHAN_VP3021 835#ifdef BTTV_TWINHAN_VP3021
769 case BTTV_TWINHAN_VP3021: 836 case BTTV_TWINHAN_VP3021:
770#else 837#else