summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-10-20 17:44:23 +0000
committerGerd Knorr <devnull@localhost>2004-10-20 17:44:23 +0000
commitb6e0bc4cf1eebed71e6bd7f67bf1e3e7fc8764c6 (patch)
tree2b92afaa3a49e0128448dd73bbc3099febb15b26 /linux/drivers/media
parent0ccd772fd27e5b6ddb7a5cabe182b5c4128d3dc3 (diff)
downloadmediapointer-dvb-s2-b6e0bc4cf1eebed71e6bd7f67bf1e3e7fc8764c6.tar.gz
mediapointer-dvb-s2-b6e0bc4cf1eebed71e6bd7f67bf1e3e7fc8764c6.tar.bz2
- switch over to "frontend refactored" cvs branch.
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/cx88/cx88-dvb.c69
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-dvb.c28
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-empress.c12
-rw-r--r--linux/drivers/media/video/saa7134/saa7134.h3
-rw-r--r--linux/drivers/media/video/video-buf-dvb.c26
5 files changed, 66 insertions, 72 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-dvb.c b/linux/drivers/media/video/cx88/cx88-dvb.c
index 878d7c19d..87c800399 100644
--- a/linux/drivers/media/video/cx88/cx88-dvb.c
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-dvb.c,v 1.14 2004/10/19 16:02:04 kraxel Exp $
+ * $Id: cx88-dvb.c,v 1.15 2004/10/20 17:44:24 kraxel Exp $
*
* device driver for Conexant 2388x based TV cards
* MPEG Transport Stream (DVB) routines
@@ -32,6 +32,7 @@
#include "cx88.h"
#include "cx22702.h"
+#include "mt352.h"
MODULE_DESCRIPTION("driver for cx2388x based DVB cards");
MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
@@ -87,59 +88,55 @@ struct videobuf_queue_ops dvb_qops = {
/* ------------------------------------------------------------------ */
-static void dvb_unregister(struct cx8802_dev *dev)
+static int dvico_fusionhdtv_init(struct dvb_frontend* fe)
{
- videobuf_dvb_unregister(&dev->dvb);
- if (dev->fe_handle)
- dev->fe_release(dev->fe_handle);
- dvb_unregister_adapter(dev->dvb.adapter);
- return;
+ printk("FIXME: %s\n",__FUNCTION__);
+ return 0;
}
-static int dvb_register(struct cx8802_dev *dev)
+static int dvico_fusionhdtv_pll_set(struct dvb_frontend* fe,
+ struct dvb_frontend_parameters* params,
+ u8* pllbuf)
{
- int result;
+ printk("FIXME: %s\n",__FUNCTION__);
+ return 0;
+}
+
+struct mt352_config dvico_fusionhdtv = {
+ .demod_address = 42,
+ .demod_init = dvico_fusionhdtv_init,
+ .pll_set = dvico_fusionhdtv_pll_set,
+};
+static int dvb_register(struct cx8802_dev *dev)
+{
/* init struct videobuf_dvb */
dev->dvb.priv = dev;
dev->dvb.name = dev->core->name;
- /* register adapter */
- result = dvb_register_adapter(&dev->dvb.adapter, dev->core->name,
- THIS_MODULE);
- if (result < 0) {
- printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
- dev->core->name, result);
- goto fail1;
- }
-
- /* init + register frontend */
+ /* init frontend */
switch (dev->core->board) {
case CX88_BOARD_HAUPPAUGE_DVB_T1:
case CX88_BOARD_CONEXANT_DVB_T1:
- dev->fe_handle = cx22702_create(&dev->core->i2c_adap,
- dev->dvb.adapter,
- dev->core->pll_addr,
- dev->core->pll_type,
- dev->core->demod_addr);
- dev->fe_release = cx22702_destroy;
+ dev->dvb.frontend = cx22702_create(&dev->core->i2c_adap,
+ dev->core->pll_addr,
+ dev->core->pll_type,
+ dev->core->demod_addr);
+ break;
+ case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
+ dev->dvb.frontend = mt352_attach(&dvico_fusionhdtv,
+ &dev->core->i2c_adap);
break;
default:
printk("%s: FIXME: frontend handing not here yet ...\n",
dev->core->name);
break;
}
+ if (NULL == dev->dvb.frontend)
+ return -1;
- /* register everything else */
- result = videobuf_dvb_register(&dev->dvb);
- if (0 != result)
- goto fail2;
- return 0;
-
-fail2:
- dvb_unregister_adapter(dev->dvb.adapter);
-fail1:
- return result;
+ /* register everything */
+ return videobuf_dvb_register(&dev->dvb);
}
/* ----------------------------------------------------------- */
@@ -198,7 +195,7 @@ static void __devexit dvb_remove(struct pci_dev *pci_dev)
struct cx8802_dev *dev = pci_get_drvdata(pci_dev);
/* dvb */
- dvb_unregister(dev);
+ videobuf_dvb_unregister(&dev->dvb);
/* common */
cx8802_fini_common(dev);
diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c
index 662a45c10..685297a9f 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.1 2004/10/19 16:02:05 kraxel Exp $
+ * $Id: saa7134-dvb.c,v 1.2 2004/10/20 17:44:24 kraxel Exp $
*
* (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
*
@@ -37,8 +37,6 @@ MODULE_LICENSE("GPL");
static int dvb_init(struct saa7134_dev *dev)
{
- int err;
-
printk("%s: %s\n",dev->name,__FUNCTION__);
videobuf_queue_init(&dev->dvb.dvbq, &saa7134_ts_qops,
@@ -52,36 +50,18 @@ static int dvb_init(struct saa7134_dev *dev)
dev->dvb.priv = dev;
dev->dvb.name = dev->name;
- /* register adapter */
- err = dvb_register_adapter(&dev->dvb.adapter, dev->name,
- THIS_MODULE);
- if (err < 0) {
- printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
- dev->name, err);
- goto fail1;
- }
-
/* TODO: init + register frontend */
+ if (NULL == dev->dvb.frontend)
+ return -1;
/* register everything else */
- err = videobuf_dvb_register(&dev->dvb);
- if (0 != err)
- goto fail2;
- return 0;
-
-fail2:
- dvb_unregister_adapter(dev->dvb.adapter);
-fail1:
- return err;
+ return videobuf_dvb_register(&dev->dvb);
}
static int dvb_fini(struct saa7134_dev *dev)
{
printk("%s: %s\n",dev->name,__FUNCTION__);
-
videobuf_dvb_unregister(&dev->dvb);
- /* TODO: unregister frontend */
- dvb_unregister_adapter(dev->dvb.adapter);
return 0;
}
diff --git a/linux/drivers/media/video/saa7134/saa7134-empress.c b/linux/drivers/media/video/saa7134/saa7134-empress.c
index e301bec5e..683ef885c 100644
--- a/linux/drivers/media/video/saa7134/saa7134-empress.c
+++ b/linux/drivers/media/video/saa7134/saa7134-empress.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-empress.c,v 1.1 2004/10/19 16:02:05 kraxel Exp $
+ * $Id: saa7134-empress.c,v 1.2 2004/10/20 17:44:24 kraxel Exp $
*
* (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
*
@@ -90,9 +90,9 @@ static int ts_open(struct inode *inode, struct file *file)
if (dev->empress_users)
goto done;
- dev->empress_started = 0;
dev->empress_users++;
file->private_data = dev;
+ ts_init_encoder(dev, NULL);
err = 0;
done:
@@ -112,8 +112,7 @@ static int ts_release(struct inode *inode, struct file *file)
dev->empress_users--;
/* stop the encoder */
- if (dev->empress_started)
- ts_reset_encoder(dev);
+ ts_reset_encoder(dev);
up(&dev->empress_tsq.lock);
return 0;
@@ -124,11 +123,6 @@ ts_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
{
struct saa7134_dev *dev = file->private_data;
- if (!dev->empress_started) {
- ts_init_encoder(dev, NULL);
- dev->empress_started = 1;
- }
-
return videobuf_read_stream(file->private_data, &dev->empress_tsq,
data, count, ppos, 0,
file->f_flags & O_NONBLOCK);
diff --git a/linux/drivers/media/video/saa7134/saa7134.h b/linux/drivers/media/video/saa7134/saa7134.h
index 45fe49c3d..b55aa1b17 100644
--- a/linux/drivers/media/video/saa7134/saa7134.h
+++ b/linux/drivers/media/video/saa7134/saa7134.h
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134.h,v 1.23 2004/10/19 16:02:05 kraxel Exp $
+ * $Id: saa7134.h,v 1.24 2004/10/20 17:44:24 kraxel Exp $
*
* v4l2 device driver for philips saa7134 based TV cards
*
@@ -462,7 +462,6 @@ struct saa7134_dev {
/* SAA7134_MPEG_EMPRESS only */
struct video_device *empress_dev;
struct videobuf_queue empress_tsq;
- int empress_started;
unsigned int empress_users;
/* SAA7134_MPEG_DVB only */
diff --git a/linux/drivers/media/video/video-buf-dvb.c b/linux/drivers/media/video/video-buf-dvb.c
index e8eb03255..9473d430a 100644
--- a/linux/drivers/media/video/video-buf-dvb.c
+++ b/linux/drivers/media/video/video-buf-dvb.c
@@ -1,5 +1,5 @@
/*
- * $Id: video-buf-dvb.c,v 1.2 2004/10/20 09:43:34 kraxel Exp $
+ * $Id: video-buf-dvb.c,v 1.3 2004/10/20 17:44:24 kraxel Exp $
*
* some helper function for simple DVB cards which simply DMA the
* complete transport stream and let the computer sort everything else
@@ -140,6 +140,23 @@ int videobuf_dvb_register(struct videobuf_dvb *dvb)
init_MUTEX(&dvb->lock);
+ /* register adapter */
+ result = dvb_register_adapter(&dvb->adapter, dvb->name, THIS_MODULE);
+ if (result < 0) {
+ printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n",
+ dvb->name, result);
+ goto fail_adapter;
+ }
+
+ /* register frontend */
+ result = dvb_register_frontend(dvb->adapter, dvb->frontend);
+ if (result < 0) {
+ printk(KERN_WARNING "%s: dvb_register_frontend failed (errno = %d)\n",
+ dvb->name, result);
+ goto fail_frontend;
+ }
+
+ /* register demux stuff */
dvb->demux.dmx.capabilities =
DMX_TS_FILTERING | DMX_SECTION_FILTERING |
DMX_MEMORY_BASED_FILTERING;
@@ -188,6 +205,7 @@ int videobuf_dvb_register(struct videobuf_dvb *dvb)
goto fail_fe_conn;
}
+ /* register network adapter */
dvb_net_init(dvb->adapter, &dvb->net, &dvb->demux.dmx);
return 0;
@@ -200,6 +218,10 @@ fail_fe_hw:
fail_dmxdev:
dvb_dmx_release(&dvb->demux);
fail_dmx:
+ dvb_unregister_frontend(dvb->frontend);
+fail_frontend:
+ dvb_unregister_adapter(dvb->adapter);
+fail_adapter:
return result;
}
@@ -210,6 +232,8 @@ void videobuf_dvb_unregister(struct videobuf_dvb *dvb)
dvb->demux.dmx.remove_frontend(&dvb->demux.dmx, &dvb->fe_hw);
dvb_dmxdev_release(&dvb->dmxdev);
dvb_dmx_release(&dvb->demux);
+ dvb_unregister_frontend(dvb->frontend);
+ dvb_unregister_adapter(dvb->adapter);
}
EXPORT_SYMBOL(videobuf_dvb_register);