summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Krufky <devnull@localhost>2005-09-10 07:26:02 +0000
committerMichael Krufky <devnull@localhost>2005-09-10 07:26:02 +0000
commit0a808fed23479821a43f44f9a45141f495e01632 (patch)
treee233195a540648003206bec5dd4be17756d4bc8c
parent4854d8c5d3ed297a6a3526272ddadb0b8486036b (diff)
downloadmediapointer-dvb-s2-0a808fed23479821a43f44f9a45141f495e01632.tar.gz
mediapointer-dvb-s2-0a808fed23479821a43f44f9a45141f495e01632.tar.bz2
Added support for DViCO FusionHDTV5 Lite.
This is the first card to use dvb-pll in dvb-bt8xx. IMHO, it would be a good idea to convert the other tuners in this manner, after some testing, of course. This is exactly the same as the patch that I previously posted to the linux-dvb list, using the same DT3303 serial TS transfer setting as cx88-based FusionHDTV5 Gold. The only difference is gpio_mode. Thank you Doug Stevens, for pointing out the correct gpio value. Signed-off-by: Michael Krufky <mkrufky@m1k.net> Signed-off-by: Doug Stevens <ddstevens@gmail.com>
-rw-r--r--linux/drivers/media/dvb/bt8xx/Kconfig1
-rw-r--r--linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c67
-rw-r--r--linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h1
3 files changed, 69 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/bt8xx/Kconfig b/linux/drivers/media/dvb/bt8xx/Kconfig
index 1e85d1649..2922a993d 100644
--- a/linux/drivers/media/dvb/bt8xx/Kconfig
+++ b/linux/drivers/media/dvb/bt8xx/Kconfig
@@ -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 --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index c5c7672cd..ee9bbf1f0 100644
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -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,55 @@ static struct mt352_config digitv_alps_tded4_config = {
.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 */
+ msleep(100);
+}
+
static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
{
int ret;
@@ -562,6 +612,15 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
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
@@ -765,6 +824,14 @@ static int dvb_bt8xx_probe(struct device *dev)
* DA_APP(parallel) */
break;
+#ifdef BTTV_DVICO_FUSIONHDTV_5_LITE
+ case BTTV_DVICO_FUSIONHDTV_5_LITE:
+#endif
+ card->gpio_mode = 0x0400c060;
+ card->op_sync_orin = 0;
+ card->irq_err_ignore = 0;
+ break;
+
#ifdef BTTV_TWINHAN_VP3021
case BTTV_TWINHAN_VP3021:
#else
diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h
index 9ec8e5bd6..cf035a803 100644
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h
@@ -35,6 +35,7 @@
#include "nxt6000.h"
#include "cx24110.h"
#include "or51211.h"
+#include "lgdt330x.h"
struct dvb_bt8xx_card {
struct semaphore lock;