From e6d7b8f1e4a898fcb632e33c15ba44be8059b65c Mon Sep 17 00:00:00 2001 From: Gerd Knorr Date: Fri, 18 Feb 2005 12:28:29 +0000 Subject: - medion 7134 dvb-t support -- first cut, likely doesn't work yet. --- linux/drivers/media/video/saa7134/saa7134-cards.c | 3 +- linux/drivers/media/video/saa7134/saa7134-dvb.c | 53 ++++++++++++++++++++++- 2 files changed, 53 insertions(+), 3 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c index 6f4ba26b8..ebd7aeb51 100644 --- a/linux/drivers/media/video/saa7134/saa7134-cards.c +++ b/linux/drivers/media/video/saa7134/saa7134-cards.c @@ -1,6 +1,6 @@ /* - * $Id: saa7134-cards.c,v 1.52 2005/02/14 16:30:26 kraxel Exp $ + * $Id: saa7134-cards.c,v 1.53 2005/02/18 12:28:29 kraxel Exp $ * * device driver for philips saa7134 based TV cards * card-specific stuff. @@ -478,6 +478,7 @@ struct saa7134_board saa7134_boards[] = { .audio_clock = 0x00187de7, .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, .tda9887_conf = TDA9887_PRESENT, + .mpeg = SAA7134_MPEG_DVB, .inputs = {{ .name = name_tv, .vmux = 1, diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c index 07a98e3eb..9a36835c8 100644 --- a/linux/drivers/media/video/saa7134/saa7134-dvb.c +++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c @@ -1,5 +1,5 @@ /* - * $Id: saa7134-dvb.c,v 1.11 2005/01/24 17:37:23 kraxel Exp $ + * $Id: saa7134-dvb.c,v 1.12 2005/02/18 12:28:29 kraxel Exp $ * * (c) 2004 Gerd Knorr [SuSE Labs] * @@ -33,6 +33,7 @@ #include "dvb-pll.h" #include "mt352.h" #include "mt352_priv.h" /* FIXME */ +#include "tda1004x.h" MODULE_AUTHOR("Gerd Knorr [SuSE Labs]"); MODULE_LICENSE("GPL"); @@ -140,6 +141,48 @@ static struct mt352_config pinnacle_300i = { /* ------------------------------------------------------------------ */ +static int medion_cardbus_init(struct dvb_frontend* fe) +{ + /* anything to do here ??? */ + return 0; +} + +static int medion_cardbus_pll_set(struct dvb_frontend* fe, + struct dvb_frontend_parameters* params) +{ + struct saa7134_dev *dev = fe->dvb->priv; + struct v4l2_frequency f; + + /* + * this instructs tuner.o to set the frequency, the call will + * end up in tuner_command(), VIDIOC_S_FREQUENCY switch. + * tda9887.o will see that as well. + */ + f.tuner = 0; + f.type = V4L2_TUNER_DIGITAL_TV; + f.frequency = params->frequency / 1000 * 16 / 1000; + saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); + return 0; +} + +static int fe_request_firmware(struct dvb_frontend* fe, + const struct firmware **fw, char* name) +{ + struct saa7134_dev *dev = fe->dvb->priv; + return request_firmware(fw, name, &dev->pci->dev); +} + +struct tda1004x_config medion_cardbus = { + .demod_address = 0x08, /* not sure this is correct */ + .invert = 0, + .invert_oclk = 0, + .pll_init = medion_cardbus_init, + .pll_set = medion_cardbus_pll_set, + .request_firmware = fe_request_firmware, +}; + +/* ------------------------------------------------------------------ */ + static int dvb_init(struct saa7134_dev *dev) { /* init struct videobuf_dvb */ @@ -159,6 +202,13 @@ static int dvb_init(struct saa7134_dev *dev) dev->dvb.frontend = mt352_attach(&pinnacle_300i, &dev->i2c_adap); break; + case SAA7134_BOARD_MD7134: + dev->dvb.frontend = tda10046_attach(&medion_cardbus, + &dev->i2c_adap); + if (NULL == dev->dvb.frontend) + printk("%s: Hmm, looks like this is the old MD7134 " + "version without DVB-T support\n",dev->name); + break; default: printk("%s: Huh? unknown DVB card?\n",dev->name); break; @@ -212,6 +262,5 @@ module_exit(dvb_unregister); /* * Local variables: * c-basic-offset: 8 - * compile-command: "make DVB=1" * End: */ -- cgit v1.2.3