* [PATCH 04/37] dvb: Add ATSC support for DViCO FusionHDTV5 Lite
@ 2005-11-01 8:12 Michael Krufky
2005-11-03 2:29 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Michael Krufky @ 2005-11-01 8:12 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-dvb-maintainer
[-- Attachment #1: Type: text/plain, Size: 2 bytes --]
[-- Attachment #2: 2361.patch --]
[-- Type: text/x-patch, Size: 4271 bytes --]
Added ATSC support for DViCO FusionHDTV5 Lite.
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
drivers/media/dvb/bt8xx/Kconfig | 4 +
drivers/media/dvb/bt8xx/dvb-bt8xx.c | 67 +++++++++++++++++++++++++++++++++
drivers/media/dvb/bt8xx/dvb-bt8xx.h | 1
drivers/media/dvb/frontends/lgdt330x.c | 1
4 files changed, 72 insertions(+), 1 deletion(-)
--- linux-2.6.14-git3.orig/drivers/media/dvb/bt8xx/Kconfig
+++ linux-2.6.14-git3/drivers/media/dvb/bt8xx/Kconfig
@@ -6,10 +6,12 @@
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,
- the pcHDTV HD2000 cards, and certain AVerMedia cards.
+ the pcHDTV HD2000 cards, the DViCO FusionHDTV Lite cards, and
+ some AVerMedia cards.
Since these cards have no MPEG decoder onboard, they transmit
only compressed MPEG data over the PCI bus, so you need
--- linux-2.6.14-git3.orig/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ linux-2.6.14-git3/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 @@
.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 @@
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 @@
* 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 = BT878_RISC_SYNC_MASK;
+ card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;
+ break;
+
#ifdef BTTV_TWINHAN_VP3021
case BTTV_TWINHAN_VP3021:
#else
--- linux-2.6.14-git3.orig/drivers/media/dvb/bt8xx/dvb-bt8xx.h
+++ linux-2.6.14-git3/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;
--- linux-2.6.14-git3.orig/drivers/media/dvb/frontends/lgdt330x.c
+++ linux-2.6.14-git3/drivers/media/dvb/frontends/lgdt330x.c
@@ -26,6 +26,7 @@
* DViCO FusionHDTV 3 Gold-Q
* DViCO FusionHDTV 3 Gold-T
* DViCO FusionHDTV 5 Gold
+ * DViCO FusionHDTV 5 Lite
*
* TODO:
* signal strength always returns 0.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 04/37] dvb: Add ATSC support for DViCO FusionHDTV5 Lite
2005-11-01 8:12 [PATCH 04/37] dvb: Add ATSC support for DViCO FusionHDTV5 Lite Michael Krufky
@ 2005-11-03 2:29 ` Andrew Morton
2005-11-03 19:10 ` Alexey Dobriyan
2005-11-04 4:01 ` Michael Krufky
0 siblings, 2 replies; 4+ messages in thread
From: Andrew Morton @ 2005-11-03 2:29 UTC (permalink / raw)
To: Michael Krufky; +Cc: linux-kernel, linux-dvb-maintainer
Michael Krufky <mkrufky@m1k.net> wrote:
>
> +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;
The cast of a void* is unneeded. It's actually undesirable: if someone
were to convert the thing-being-casted to some other scalar type, the cast
would prevent the desired compiler warning.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 04/37] dvb: Add ATSC support for DViCO FusionHDTV5 Lite
2005-11-03 2:29 ` Andrew Morton
@ 2005-11-03 19:10 ` Alexey Dobriyan
2005-11-04 4:01 ` Michael Krufky
1 sibling, 0 replies; 4+ messages in thread
From: Alexey Dobriyan @ 2005-11-03 19:10 UTC (permalink / raw)
To: Andrew Morton; +Cc: Michael Krufky, linux-kernel, linux-dvb-maintainer
On Thu, Nov 03, 2005 at 01:29:14PM +1100, Andrew Morton wrote:
> Michael Krufky <mkrufky@m1k.net> wrote:
> > +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;
[cast from void *]
Please, also
struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
^ ^
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 04/37] dvb: Add ATSC support for DViCO FusionHDTV5 Lite
2005-11-03 2:29 ` Andrew Morton
2005-11-03 19:10 ` Alexey Dobriyan
@ 2005-11-04 4:01 ` Michael Krufky
1 sibling, 0 replies; 4+ messages in thread
From: Michael Krufky @ 2005-11-04 4:01 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-dvb-maintainer, Alexey Dobriyan
Andrew Morton wrote:
>Michael Krufky <mkrufky@m1k.net> wrote:
>
>
>>+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;
>>
>>
>
>The cast of a void* is unneeded. It's actually undesirable: if someone
>were to convert the thing-being-casted to some other scalar type, the cast
>would prevent the desired compiler warning.
>
Alexey Dobriyan wrote:
>Please, also
>
> struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
> ^ ^
>
Both of these problems are all over dvb-kernel... We'll fix it up.
Thanks,
Michael Krufky
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-11-04 4:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01 8:12 [PATCH 04/37] dvb: Add ATSC support for DViCO FusionHDTV5 Lite Michael Krufky
2005-11-03 2:29 ` Andrew Morton
2005-11-03 19:10 ` Alexey Dobriyan
2005-11-04 4:01 ` Michael Krufky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox