summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
authorAndrew de Quincy <devnull@localhost>2004-11-09 09:54:11 +0000
committerAndrew de Quincy <devnull@localhost>2004-11-09 09:54:11 +0000
commitaef71b24f260b4df387aa15ec2b5a4c5d40499b9 (patch)
tree8d180025d278463de065fe0c0aac4d1117a39e7e /linux/drivers/media/dvb/ttpci
parent32115d6f2fd9c9aea933e8163e30a29c4f5a981f (diff)
downloadmediapointer-dvb-s2-aef71b24f260b4df387aa15ec2b5a4c5d40499b9.tar.gz
mediapointer-dvb-s2-aef71b24f260b4df387aa15ec2b5a4c5d40499b9.tar.bz2
Added support for stv0297 based cards
Diffstat (limited to 'linux/drivers/media/dvb/ttpci')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c66
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.h2
2 files changed, 66 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index 9fa22046c..c2ff00fc7 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -1643,6 +1643,47 @@ static struct sp8870_config alps_tdlb7_config = {
};
+
+static int nexusca_stv0297_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+{
+ struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ u32 div;
+ u8 data[4];
+ struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
+
+ // this calculation does not match the TDA6405TS datasheet!
+ div = (params->frequency + 36150000) / 62500;
+
+ data[0] = (div >> 8) & 0x7f;
+ data[1] = div & 0xff;
+ data[2] = 0xce; // this value does not match the TDA6405TS datasheet!
+
+ if (params->frequency < 45000000)
+ return -EINVAL;
+ else if (params->frequency < 137000000)
+ data[3] = 0x01;
+ else if (params->frequency < 403000000)
+ data[3] = 0x02;
+ else if (params->frequency < 860000000)
+ data[3] = 0x04;
+ else
+ return -EINVAL;
+
+ stv0297_enable_plli2c(fe);
+ if (i2c_transfer (&av7110->i2c_adap, &msg, 1) != 1)
+ return -EIO;
+ msleep(20);
+
+ return 0;
+}
+
+static struct stv0297_config nexusca_stv0297_config = {
+
+ .demod_address = 0x1C,
+ .pll_set = nexusca_stv0297_pll_set,
+};
+
+
static void av7110_fe_lock_fix(struct av7110* av7110, fe_status_t status)
{
msleep (50);
@@ -1815,6 +1856,28 @@ static void frontend_init(struct av7110 *av7110)
if (av7110->fe)
break;
break;
+
+ case 0x000A: { // Hauppauge/TT Nexus-CA rev1.X
+ u8 b = 0x00;
+ u8 revbuf[4];
+ int revision;
+ struct i2c_msg msg[] = { { .addr = 0x50,.flags = 0,.buf = &b,.len = 1 },
+ { .addr = 0x50,.flags = I2C_M_RD,.buf = revbuf,.len = sizeof(revbuf)} };
+
+ // retrieve board revision
+ if (i2c_transfer(&av7110->i2c_adap, msg, 2) != 2)
+ break;
+ printk("revbuf[0] = 0x%x\n", revbuf[0]);
+ printk("revbuf[1] = 0x%x\n", revbuf[1]);
+ printk("revbuf[2] = 0x%x\n", revbuf[2]);
+ printk("revbuf[3] = 0x%x\n", revbuf[3]);
+ revision = revbuf[0] | (revbuf[1] << 8);
+
+ av7110->fe = stv0297_attach(&nexusca_stv0297_config, &av7110->i2c_adap, (revision < 10) ? 0x64 : 0x7b);
+ if (av7110->fe)
+ break;
+ break;
+ }
}
}
@@ -2076,6 +2139,7 @@ static struct saa7146_pci_extension_data x_var = { \
MAKE_AV7110_INFO(tts_1_X, "Technotrend/Hauppauge WinTV DVB-S rev1.X");
MAKE_AV7110_INFO(ttt_1_X, "Technotrend/Hauppauge WinTV DVB-T rev1.X");
+MAKE_AV7110_INFO(ttc_1_X, "Technotrend/Hauppauge WinTV Nexus-CA rev1.X");
MAKE_AV7110_INFO(ttc_2_X, "Technotrend/Hauppauge WinTV DVB-C rev2.X");
MAKE_AV7110_INFO(tts_2_X, "Technotrend/Hauppauge WinTV Nexus-S rev2.X");
MAKE_AV7110_INFO(tts_1_3se, "Technotrend/Hauppauge WinTV Nexus-S rev1.3");
@@ -2088,13 +2152,13 @@ static struct pci_device_id pci_tbl[] = {
MAKE_EXTENSION_PCI(tts_2_X, 0x13c2, 0x0003),
MAKE_EXTENSION_PCI(tts_1_3se, 0x13c2, 0x1002),
MAKE_EXTENSION_PCI(fsc, 0x110a, 0x0000),
+ MAKE_EXTENSION_PCI(ttc_1_X, 0x13c2, 0x000a),
/* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0004), UNDEFINED CARD */ // Galaxis DVB PC-Sat-Carte
/* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0005), UNDEFINED CARD */ // Technisat SkyStar1
/* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0006), UNDEFINED CARD */ // TT/Hauppauge WinTV Nexus-S v????
/* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0008), UNDEFINED CARD */ // TT/Hauppauge WinTV DVB-T v????
/* MAKE_EXTENSION_PCI(???, 0x13c2, 0x0009), UNDEFINED CARD */ // TT/Hauppauge WinTV Nexus-CA v????
-/* MAKE_EXTENSION_PCI(???, 0x13c2, 0x000a), UNDEFINED CARD */ // TT/Hauppauge WinTV Nexus-CA v????
{
.vendor = 0,
diff --git a/linux/drivers/media/dvb/ttpci/av7110.h b/linux/drivers/media/dvb/ttpci/av7110.h
index 5d2da07f8..86752bc91 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.h
+++ b/linux/drivers/media/dvb/ttpci/av7110.h
@@ -30,7 +30,7 @@
#include "stv0299.h"
#include "tda8083.h"
#include "sp8870.h"
-
+#include "stv0297.h"
#include <media/saa7146_vv.h>