[linux-dvb] [REVISED -mm PATCH] v4l: add dvb support for dvico
fusionhdtv3 gold-T
Michael Krufky
mkrufky at m1k.net
Tue Jul 5 22:47:28 CEST 2005
The attached patch has been revised to correct the sync byte for MPEG-2
transport stream packets. Detailed changelog is included in the header
of the patch.
Michael Krufky wrote:
> Johannes-
>
> I have not sent the attached patch to Andrew or LKML yet.
>
> I'd like permission to include your sign-off on this, since it changes
> files in both trees (dvb-pll changes have already been committed to
> linuxtv cvs, and all other changes have been committed to v4l cvs). I
> will ask Mauro for his sign-off as well when I see him in irc later on.
>
> This patch depends on:
>
> dvb-frontend-add-driver-for-lgdt3302.patch (added to -mm tree)
> [PATCH] v4l: add DVB support for DViCO FusionHDTV3 Gold-Q (on lkml,
> still pending)
>
> If you wish to test how this applies against -mm, start off with
> 2.6.13-rc1-mm1, then:
>
> 1) apply dvb-frontend-add-driver-for-lgdt3302.patch
> 2) apply [PATCH] v4l: add DVB support for DViCO FusionHDTV3 Gold-Q
> 3) apply [PATCH] v4l: add TerraTec Cinergy 1400 DVB-T (also on lkml)
> 4) apply the patch attached to this email last.
>
> (patch #3 has also been sent to andrew. (still pending) The attached
> patch doesn't depend on this, but in order for everything to apply
> cleanly, apply it in the order listed)
--
Michael Krufky
-------------- next part --------------
- Correct sync byte for MPEG-2 transport stream packets.
- Let Kconfig decide whether to include frontend-specific code in cx88-dvb.
- Add dvb support in v4l for DViCO FusionHDTV3 Gold-T using lgdt3302 frontend.
This adds support for a different board from the previous (Gold-Q) patch.
Signed-off-by: Michael Krufky <mkrufky at m1k.net>
linux/drivers/media/dvb/frontends/dvb-pll.c | 13 ++++
linux/drivers/media/dvb/frontends/dvb-pll.h | 1
linux/drivers/media/video/cx88/cx88-cards.c | 3 -
linux/drivers/media/video/cx88/cx88-dvb.c | 57 ++++++++++++++------
linux/drivers/media/video/cx88/cx88-mpeg.c | 8 +-
5 files changed, 60 insertions(+), 22 deletions(-)
diff -u linux-2.6.13/drivers/media/video/cx88/cx88-cards.c linux/drivers/media/video/cx88/cx88-cards.c
--- linux-2.6.13/drivers/media/video/cx88/cx88-cards.c 2005-07-05 00:35:06.000000000 +0000
+++ linux/drivers/media/video/cx88/cx88-cards.c 2005-07-05 00:47:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-cards.c,v 1.84 2005/07/02 19:42:09 mkrufky Exp $
+ * $Id: cx88-cards.c,v 1.85 2005/07/04 19:35:05 mkrufky Exp $
*
* device driver for Conexant 2388x based TV cards
* card-specific stuff.
@@ -723,6 +723,7 @@
.vmux = 2,
.gpio0 = 0x0f00,
}},
+ .dvb = 1,
},
[CX88_BOARD_ADSTECH_DVB_T_PCI] = {
.name = "ADS Tech Instant TV DVB-T PCI",
diff -u linux-2.6.13/drivers/media/video/cx88/cx88-mpeg.c linux/drivers/media/video/cx88/cx88-mpeg.c
--- linux-2.6.13/drivers/media/video/cx88/cx88-mpeg.c 2005-07-05 00:34:56.000000000 +0000
+++ linux/drivers/media/video/cx88/cx88-mpeg.c 2005-07-05 00:47:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-mpeg.c,v 1.28 2005/06/20 03:36:00 mkrufky Exp $
+ * $Id: cx88-mpeg.c,v 1.30 2005/07/05 19:44:40 mkrufky Exp $
*
* Support for the mpeg transport stream transfers
* PCI function #2 of the cx2388x.
@@ -73,11 +73,11 @@
cx_write(TS_GEN_CNTRL, 0x0040 | dev->ts_gen_cntrl);
udelay(100);
cx_write(MO_PINMUX_IO, 0x00);
- if (core->board == CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q) {
- cx_write(TS_HW_SOP_CNTRL,0x47<<16 | 188<<4 | 0x00);
+ cx_write(TS_HW_SOP_CNTRL,0x47<<16|188<<4|0x01);
+ if ((core->board == CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q) ||
+ (core->board == CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T)) {
cx_write(TS_SOP_STAT, 0<<16 | 0<<14 | 1<<13 | 0<<12);
} else {
- cx_write(TS_HW_SOP_CNTRL,47<<16|188<<4|0x00);
cx_write(TS_SOP_STAT,0x00);
}
cx_write(TS_GEN_CNTRL, dev->ts_gen_cntrl);
diff -u linux-2.6.13/drivers/media/video/cx88/cx88-dvb.c linux/drivers/media/video/cx88/cx88-dvb.c
--- linux-2.6.13/drivers/media/video/cx88/cx88-dvb.c 2005-07-05 00:35:06.000000000 +0000
+++ linux/drivers/media/video/cx88/cx88-dvb.c 2005-07-05 00:47:22.000000000 +0000
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-dvb.c,v 1.39 2005/07/02 20:00:46 mkrufky Exp $
+ * $Id: cx88-dvb.c,v 1.41 2005/07/04 19:35:05 mkrufky Exp $
*
* device driver for Conexant 2388x based TV cards
* MPEG Transport Stream (DVB) routines
@@ -30,22 +30,20 @@
#include <linux/file.h>
#include <linux/suspend.h>
-/* these three frontends need merging via linuxtv cvs ... */
-#define HAVE_CX22702 1
-#define HAVE_OR51132 1
-#define HAVE_LGDT3302 1
-
#include "cx88.h"
#include "dvb-pll.h"
-#include "mt352.h"
-#include "mt352_priv.h"
-#if HAVE_CX22702
+
+#if CONFIG_DVB_MT352
+# include "mt352.h"
+# include "mt352_priv.h"
+#endif
+#if CONFIG_DVB_CX22702
# include "cx22702.h"
#endif
-#if HAVE_OR51132
+#if CONFIG_DVB_OR51132
# include "or51132.h"
#endif
-#if HAVE_LGDT3302
+#if CONFIG_DVB_LGDT3302
# include "lgdt3302.h"
#endif
@@ -104,6 +102,7 @@
/* ------------------------------------------------------------------ */
+#if CONFIG_DVB_MT352
static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe)
{
static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
@@ -171,8 +170,9 @@
.demod_init = dntv_live_dvbt_demod_init,
.pll_set = mt352_pll_set,
};
+#endif
-#if HAVE_CX22702
+#if CONFIG_DVB_CX22702
static struct cx22702_config connexant_refboard_config = {
.demod_address = 0x43,
.pll_address = 0x60,
@@ -186,7 +186,7 @@
};
#endif
-#if HAVE_OR51132
+#if CONFIG_DVB_OR51132
static int or51132_set_ts_param(struct dvb_frontend* fe,
int is_punctured)
{
@@ -203,7 +203,7 @@
};
#endif
-#if HAVE_LGDT3302
+#if CONFIG_DVB_LGDT3302
static int lgdt3302_set_ts_param(struct dvb_frontend* fe, int is_punctured)
{
struct cx8802_dev *dev= fe->dvb->priv;
@@ -220,6 +220,13 @@
.pll_desc = &dvb_pll_microtune_4042,
.set_ts_params = lgdt3302_set_ts_param,
};
+
+static struct lgdt3302_config fusionhdtv_3_gold_t = {
+ .demod_address = 0x0e,
+ .pll_address = 0x61,
+ .pll_desc = &dvb_pll_thomson_dtt7611,
+ .set_ts_params = lgdt3302_set_ts_param,
+};
#endif
static int dvb_register(struct cx8802_dev *dev)
@@ -230,7 +237,7 @@
/* init frontend */
switch (dev->core->board) {
-#if HAVE_CX22702
+#if CONFIG_DVB_CX22702
case CX88_BOARD_HAUPPAUGE_DVB_T1:
dev->dvb.frontend = cx22702_attach(&hauppauge_novat_config,
&dev->core->i2c_adap);
@@ -241,6 +248,7 @@
&dev->core->i2c_adap);
break;
#endif
+#if CONFIG_DVB_MT352
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
dev->core->pll_addr = 0x61;
dev->core->pll_desc = &dvb_pll_lg_z201;
@@ -261,13 +269,14 @@
dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_config,
&dev->core->i2c_adap);
break;
-#if HAVE_OR51132
+#endif
+#if CONFIG_DVB_OR51132
case CX88_BOARD_PCHDTV_HD3000:
dev->dvb.frontend = or51132_attach(&pchdtv_hd3000,
&dev->core->i2c_adap);
break;
#endif
-#if HAVE_LGDT3302
+#if CONFIG_DVB_LGDT3302
case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q:
dev->ts_gen_cntrl = 0x08;
{
@@ -282,6 +291,20 @@
&dev->core->i2c_adap);
}
break;
+ case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T:
+ dev->ts_gen_cntrl = 0x08;
+ {
+ /* Do a hardware reset of chip before using it. */
+ struct cx88_core *core = dev->core;
+
+ cx_clear(MO_GP0_IO, 1);
+ mdelay(100);
+ cx_set(MO_GP0_IO, 9); /* ANT connector too FIXME */
+ mdelay(200);
+ dev->dvb.frontend = lgdt3302_attach(&fusionhdtv_3_gold_t,
+ &dev->core->i2c_adap);
+ }
+ break;
#endif
default:
printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
diff -u linux-2.6.13/drivers/media/dvb/frontends/dvb-pll.c linux/drivers/media/dvb/frontends/dvb-pll.c
--- linux-2.6.13/drivers/media/dvb/frontends/dvb-pll.c 2005-07-05 00:42:14.000000000 +0000
+++ linux/drivers/media/dvb/frontends/dvb-pll.c 2005-07-05 00:47:22.000000000 +0000
@@ -106,6 +106,19 @@
};
EXPORT_SYMBOL(dvb_pll_microtune_4042);
+struct dvb_pll_desc dvb_pll_thomson_dtt7611 = {
+ .name = "Thomson dtt7611",
+ .min = 44000000,
+ .max = 958000000,
+ .count = 3,
+ .entries = {
+ { 157250000, 44000000, 62500, 0x8e, 0x39 },
+ { 454000000, 44000000, 62500, 0x8e, 0x3a },
+ { 999999999, 44000000, 62500, 0x8e, 0x3c },
+ },
+};
+EXPORT_SYMBOL(dvb_pll_thomson_dtt7611);
+
struct dvb_pll_desc dvb_pll_unknown_1 = {
.name = "unknown 1", /* used by dntv live dvb-t */
.min = 174000000,
diff -u linux-2.6.13/drivers/media/dvb/frontends/dvb-pll.h linux/drivers/media/dvb/frontends/dvb-pll.h
--- linux-2.6.13/drivers/media/dvb/frontends/dvb-pll.h 2005-07-05 00:42:14.000000000 +0000
+++ linux/drivers/media/dvb/frontends/dvb-pll.h 2005-07-05 00:47:22.000000000 +0000
@@ -25,6 +25,7 @@
extern struct dvb_pll_desc dvb_pll_thomson_dtt7610;
extern struct dvb_pll_desc dvb_pll_lg_z201;
extern struct dvb_pll_desc dvb_pll_microtune_4042;
+extern struct dvb_pll_desc dvb_pll_thomson_dtt7611;
extern struct dvb_pll_desc dvb_pll_unknown_1;
extern struct dvb_pll_desc dvb_pll_tua6010xs;
More information about the linux-dvb
mailing list