This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / drivers / media / video / saa7134 / saa7134-dvb.c
1 /*
2  * $Id: saa7134-dvb.c,v 1.4 2004/11/07 14:44:59 kraxel Exp $
3  *
4  * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */
20
21 #include <linux/init.h>
22 #include <linux/list.h>
23 #include <linux/module.h>
24 #include <linux/kernel.h>
25 #include <linux/slab.h>
26 #include <linux/delay.h>
27 #include <linux/kthread.h>
28 #include <linux/suspend.h>
29
30 #include "saa7134-reg.h"
31 #include "saa7134.h"
32
33 MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
34 MODULE_LICENSE("GPL");
35
36 /* ------------------------------------------------------------------ */
37
38 static int dvb_init(struct saa7134_dev *dev)
39 {
40         printk("%s: %s\n",dev->name,__FUNCTION__);
41
42         /* init struct videobuf_dvb */
43         dev->dvb.name = dev->name;
44         videobuf_queue_init(&dev->dvb.dvbq, &saa7134_ts_qops,
45                             dev->pci, &dev->slock,
46                             V4L2_BUF_TYPE_VIDEO_CAPTURE,
47                             V4L2_FIELD_TOP,
48                             sizeof(struct saa7134_buf),
49                             dev);
50
51         /* TODO: init frontend */
52         if (NULL == dev->dvb.frontend)
53                 return -1;
54
55         /* register everything else */
56         return videobuf_dvb_register(&dev->dvb);
57 }
58
59 static int dvb_fini(struct saa7134_dev *dev)
60 {
61         printk("%s: %s\n",dev->name,__FUNCTION__);
62         videobuf_dvb_unregister(&dev->dvb);
63         return 0;
64 }
65
66 static struct saa7134_mpeg_ops dvb_ops = {
67         .type          = SAA7134_MPEG_DVB,
68         .init          = dvb_init,
69         .fini          = dvb_fini,
70 };
71
72 static int __init dvb_register(void)
73 {
74         return saa7134_ts_register(&dvb_ops);
75 }
76
77 static void __exit dvb_unregister(void)
78 {
79         saa7134_ts_unregister(&dvb_ops);
80 }
81
82 module_init(dvb_register);
83 module_exit(dvb_unregister);
84
85 /* ------------------------------------------------------------------ */
86 /*
87  * Local variables:
88  * c-basic-offset: 8
89  * compile-command: "make DVB=1"
90  * End:
91  */