blob: 07bd06ccc5f52da14edb9f352b16a4203bcee2bb [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 *
3 * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20#include <linux/init.h>
21#include <linux/list.h>
22#include <linux/module.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#include <linux/kernel.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070024#include <linux/delay.h>
25
Michael Krufky5e453dc2006-01-09 15:32:31 -020026#include <media/v4l2-common.h>
Hans Verkuila2004502013-12-14 08:28:28 -030027#include <media/v4l2-event.h>
28
29#include "saa7134-reg.h"
30#include "saa7134.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
32/* ------------------------------------------------------------------ */
33
34MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
35MODULE_LICENSE("GPL");
36
37static unsigned int empress_nr[] = {[0 ... (SAA7134_MAXBOARDS - 1)] = UNSET };
Mauro Carvalho Chehab674434c2005-12-12 00:37:28 -080038
Linus Torvalds1da177e2005-04-16 15:20:36 -070039module_param_array(empress_nr, int, NULL, 0444);
40MODULE_PARM_DESC(empress_nr,"ts device number");
41
Douglas Schilling Landgrafff699e62008-04-22 14:41:48 -030042static unsigned int debug;
Linus Torvalds1da177e2005-04-16 15:20:36 -070043module_param(debug, int, 0644);
44MODULE_PARM_DESC(debug,"enable debug messages");
45
46#define dprintk(fmt, arg...) if (debug) \
47 printk(KERN_DEBUG "%s/empress: " fmt, dev->name , ## arg)
48
49/* ------------------------------------------------------------------ */
50
51static void ts_reset_encoder(struct saa7134_dev* dev)
52{
53 if (!dev->empress_started)
54 return;
55
56 saa_writeb(SAA7134_SPECIAL_MODE, 0x00);
57 msleep(10);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -080058 saa_writeb(SAA7134_SPECIAL_MODE, 0x01);
Linus Torvalds1da177e2005-04-16 15:20:36 -070059 msleep(100);
60 dev->empress_started = 0;
61}
62
63static int ts_init_encoder(struct saa7134_dev* dev)
64{
Dmitry Belimovf03813e2008-08-26 13:44:40 -030065 u32 leading_null_bytes = 0;
Hans Verkuil86b79d662006-06-18 16:40:10 -030066
Dmitry Belimovf03813e2008-08-26 13:44:40 -030067 /* If more cards start to need this, then this
68 should probably be added to the card definitions. */
69 switch (dev->board) {
70 case SAA7134_BOARD_BEHOLD_M6:
71 case SAA7134_BOARD_BEHOLD_M63:
72 case SAA7134_BOARD_BEHOLD_M6_EXTRA:
73 leading_null_bytes = 1;
74 break;
75 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070076 ts_reset_encoder(dev);
Hans Verkuilfac6986c2009-01-17 12:17:14 -030077 saa_call_all(dev, core, init, leading_null_bytes);
Linus Torvalds1da177e2005-04-16 15:20:36 -070078 dev->empress_started = 1;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -080079 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070080}
81
82/* ------------------------------------------------------------------ */
83
Hans Verkuilbec43662008-12-30 06:58:20 -030084static int ts_open(struct file *file)
Linus Torvalds1da177e2005-04-16 15:20:36 -070085{
Laurent Pinchart50462eb2009-12-10 11:47:13 -020086 struct video_device *vdev = video_devdata(file);
Laurent Pinchart63b0d5a2009-12-10 11:44:04 -020087 struct saa7134_dev *dev = video_drvdata(file);
Hans Verkuilb9f63b22013-12-14 08:28:26 -030088 struct saa7134_fh *fh;
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
Hans Verkuilb9f63b22013-12-14 08:28:26 -030090 /* allocate + initialize per filehandle data */
91 fh = kzalloc(sizeof(*fh), GFP_KERNEL);
Hans Verkuilb9f63b22013-12-14 08:28:26 -030092 if (NULL == fh)
Hans Verkuilce791132013-12-14 08:28:27 -030093 return -ENOMEM;
Hans Verkuilb9f63b22013-12-14 08:28:26 -030094
95 v4l2_fh_init(&fh->fh, vdev);
96 file->private_data = fh;
97 fh->is_empress = true;
98 v4l2_fh_add(&fh->fh);
99
Rafael Bilskib784e522007-06-20 05:37:27 -0300100 /* Unmute audio */
101 saa_writeb(SAA7134_AUDIO_MUTE_CTRL,
102 saa_readb(SAA7134_AUDIO_MUTE_CTRL) & ~(1 << 6));
103
Hans Verkuilce791132013-12-14 08:28:27 -0300104 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105}
106
Hans Verkuilbec43662008-12-30 06:58:20 -0300107static int ts_release(struct file *file)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108{
Hans Verkuilb9f63b22013-12-14 08:28:26 -0300109 struct saa7134_dev *dev = video_drvdata(file);
110 struct saa7134_fh *fh = file->private_data;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111
Hans Verkuilce791132013-12-14 08:28:27 -0300112 if (res_check(fh, RESOURCE_EMPRESS)) {
113 videobuf_stop(&dev->empress_tsq);
114 videobuf_mmap_free(&dev->empress_tsq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115
Hans Verkuilce791132013-12-14 08:28:27 -0300116 /* stop the encoder */
117 ts_reset_encoder(dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118
Hans Verkuilce791132013-12-14 08:28:27 -0300119 /* Mute audio */
120 saa_writeb(SAA7134_AUDIO_MUTE_CTRL,
121 saa_readb(SAA7134_AUDIO_MUTE_CTRL) | (1 << 6));
122 }
Arjan van de Vena1789872008-06-22 17:03:02 -0300123
Hans Verkuilb9f63b22013-12-14 08:28:26 -0300124 v4l2_fh_del(&fh->fh);
125 v4l2_fh_exit(&fh->fh);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126 return 0;
127}
128
129static ssize_t
130ts_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
131{
Hans Verkuilb9f63b22013-12-14 08:28:26 -0300132 struct saa7134_dev *dev = video_drvdata(file);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133
Hans Verkuilce791132013-12-14 08:28:27 -0300134 if (res_locked(dev, RESOURCE_EMPRESS))
135 return -EBUSY;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136 if (!dev->empress_started)
137 ts_init_encoder(dev);
138
139 return videobuf_read_stream(&dev->empress_tsq,
140 data, count, ppos, 0,
141 file->f_flags & O_NONBLOCK);
142}
143
144static unsigned int
145ts_poll(struct file *file, struct poll_table_struct *wait)
146{
Hans Verkuila2004502013-12-14 08:28:28 -0300147 unsigned long req_events = poll_requested_events(wait);
Hans Verkuilb9f63b22013-12-14 08:28:26 -0300148 struct saa7134_dev *dev = video_drvdata(file);
Hans Verkuila2004502013-12-14 08:28:28 -0300149 struct saa7134_fh *fh = file->private_data;
150 unsigned int rc = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151
Hans Verkuila2004502013-12-14 08:28:28 -0300152 if (v4l2_event_pending(&fh->fh))
153 rc = POLLPRI;
154 else if (req_events & POLLPRI)
155 poll_wait(file, &fh->fh.wait, wait);
156 return rc | videobuf_poll_stream(file, &dev->empress_tsq, wait);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157}
158
159
160static int
161ts_mmap(struct file *file, struct vm_area_struct * vma)
162{
Hans Verkuilb9f63b22013-12-14 08:28:26 -0300163 struct saa7134_dev *dev = video_drvdata(file);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
165 return videobuf_mmap_mapper(&dev->empress_tsq, vma);
166}
167
Hans Verkuil78b526a2008-05-28 12:16:41 -0300168static int empress_enum_fmt_vid_cap(struct file *file, void *priv,
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300169 struct v4l2_fmtdesc *f)
170{
171 if (f->index != 0)
172 return -EINVAL;
173
174 strlcpy(f->description, "MPEG TS", sizeof(f->description));
175 f->pixelformat = V4L2_PIX_FMT_MPEG;
Hans Verkuilcabc6502013-06-01 10:02:38 -0300176 f->flags = V4L2_FMT_FLAG_COMPRESSED;
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300177 return 0;
178}
179
Hans Verkuil78b526a2008-05-28 12:16:41 -0300180static int empress_g_fmt_vid_cap(struct file *file, void *priv,
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300181 struct v4l2_format *f)
182{
Hans Verkuilb9f63b22013-12-14 08:28:26 -0300183 struct saa7134_dev *dev = video_drvdata(file);
Hans Verkuil31bf95f2010-05-09 09:41:41 -0300184 struct v4l2_mbus_framefmt mbus_fmt;
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300185
Hans Verkuil31bf95f2010-05-09 09:41:41 -0300186 saa_call_all(dev, video, g_mbus_fmt, &mbus_fmt);
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300187
Hans Verkuil31bf95f2010-05-09 09:41:41 -0300188 v4l2_fill_pix_format(&f->fmt.pix, &mbus_fmt);
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300189 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
190 f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets;
Hans Verkuilcabc6502013-06-01 10:02:38 -0300191 f->fmt.pix.bytesperline = 0;
192 f->fmt.pix.priv = 0;
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300193
194 return 0;
195}
196
Hans Verkuil78b526a2008-05-28 12:16:41 -0300197static int empress_s_fmt_vid_cap(struct file *file, void *priv,
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300198 struct v4l2_format *f)
199{
Hans Verkuilb9f63b22013-12-14 08:28:26 -0300200 struct saa7134_dev *dev = video_drvdata(file);
Hans Verkuil31bf95f2010-05-09 09:41:41 -0300201 struct v4l2_mbus_framefmt mbus_fmt;
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300202
Hans Verkuil31bf95f2010-05-09 09:41:41 -0300203 v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, V4L2_MBUS_FMT_FIXED);
204 saa_call_all(dev, video, s_mbus_fmt, &mbus_fmt);
205 v4l2_fill_pix_format(&f->fmt.pix, &mbus_fmt);
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300206
207 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
208 f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets;
Hans Verkuilcabc6502013-06-01 10:02:38 -0300209 f->fmt.pix.bytesperline = 0;
210 f->fmt.pix.priv = 0;
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300211
212 return 0;
213}
214
Dmitri Belimov6b6b7542009-05-28 01:58:57 -0300215static int empress_try_fmt_vid_cap(struct file *file, void *priv,
216 struct v4l2_format *f)
217{
Hans Verkuilb9f63b22013-12-14 08:28:26 -0300218 struct saa7134_dev *dev = video_drvdata(file);
Hans Verkuilcabc6502013-06-01 10:02:38 -0300219 struct v4l2_mbus_framefmt mbus_fmt;
220
221 v4l2_fill_mbus_format(&mbus_fmt, &f->fmt.pix, V4L2_MBUS_FMT_FIXED);
222 saa_call_all(dev, video, try_mbus_fmt, &mbus_fmt);
223 v4l2_fill_pix_format(&f->fmt.pix, &mbus_fmt);
Dmitri Belimov6b6b7542009-05-28 01:58:57 -0300224
225 f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
226 f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets;
Hans Verkuilcabc6502013-06-01 10:02:38 -0300227 f->fmt.pix.bytesperline = 0;
228 f->fmt.pix.priv = 0;
Dmitri Belimov6b6b7542009-05-28 01:58:57 -0300229
230 return 0;
231}
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300232
Hans Verkuilbec43662008-12-30 06:58:20 -0300233static const struct v4l2_file_operations ts_fops =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234{
235 .owner = THIS_MODULE,
236 .open = ts_open,
237 .release = ts_release,
238 .read = ts_read,
239 .poll = ts_poll,
240 .mmap = ts_mmap,
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300241 .ioctl = video_ioctl2,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242};
243
Hans Verkuila3998102008-07-21 02:57:38 -0300244static const struct v4l2_ioctl_ops ts_ioctl_ops = {
Hans Verkuilb93a18d2013-12-14 08:28:25 -0300245 .vidioc_querycap = saa7134_querycap,
Hans Verkuil78b526a2008-05-28 12:16:41 -0300246 .vidioc_enum_fmt_vid_cap = empress_enum_fmt_vid_cap,
Dmitri Belimov6b6b7542009-05-28 01:58:57 -0300247 .vidioc_try_fmt_vid_cap = empress_try_fmt_vid_cap,
Hans Verkuil78b526a2008-05-28 12:16:41 -0300248 .vidioc_s_fmt_vid_cap = empress_s_fmt_vid_cap,
249 .vidioc_g_fmt_vid_cap = empress_g_fmt_vid_cap,
Hans Verkuilce791132013-12-14 08:28:27 -0300250 .vidioc_reqbufs = saa7134_reqbufs,
251 .vidioc_querybuf = saa7134_querybuf,
252 .vidioc_qbuf = saa7134_qbuf,
253 .vidioc_dqbuf = saa7134_dqbuf,
254 .vidioc_streamon = saa7134_streamon,
255 .vidioc_streamoff = saa7134_streamoff,
Hans Verkuilb93a18d2013-12-14 08:28:25 -0300256 .vidioc_g_frequency = saa7134_g_frequency,
257 .vidioc_s_frequency = saa7134_s_frequency,
258 .vidioc_g_tuner = saa7134_g_tuner,
259 .vidioc_s_tuner = saa7134_s_tuner,
260 .vidioc_enum_input = saa7134_enum_input,
261 .vidioc_g_input = saa7134_g_input,
262 .vidioc_s_input = saa7134_s_input,
263 .vidioc_s_std = saa7134_s_std,
264 .vidioc_g_std = saa7134_g_std,
Hans Verkuila2004502013-12-14 08:28:28 -0300265 .vidioc_log_status = v4l2_ctrl_log_status,
266 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
267 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
Hans Verkuila3998102008-07-21 02:57:38 -0300268};
269
270/* ----------------------------------------------------------- */
271
272static struct video_device saa7134_empress_template = {
273 .name = "saa7134-empress",
Hans Verkuila3998102008-07-21 02:57:38 -0300274 .fops = &ts_fops,
Hans Verkuila3998102008-07-21 02:57:38 -0300275 .ioctl_ops = &ts_ioctl_ops,
Mauro Carvalho Chehab2c10e8a2007-12-11 12:56:23 -0300276
277 .tvnorms = SAA7134_NORMS,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700278};
279
David Howellsc4028952006-11-22 14:57:56 +0000280static void empress_signal_update(struct work_struct *work)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281{
David Howellsc4028952006-11-22 14:57:56 +0000282 struct saa7134_dev* dev =
283 container_of(work, struct saa7134_dev, empress_workqueue);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284
285 if (dev->nosignal) {
286 dprintk("no video signal\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287 } else {
288 dprintk("video signal acquired\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289 }
290}
291
292static void empress_signal_change(struct saa7134_dev *dev)
293{
294 schedule_work(&dev->empress_workqueue);
295}
296
Hans Verkuil718bde12013-12-14 08:28:24 -0300297static bool empress_ctrl_filter(const struct v4l2_ctrl *ctrl)
298{
299 switch (ctrl->id) {
300 case V4L2_CID_BRIGHTNESS:
301 case V4L2_CID_HUE:
302 case V4L2_CID_CONTRAST:
303 case V4L2_CID_SATURATION:
304 case V4L2_CID_AUDIO_MUTE:
305 case V4L2_CID_AUDIO_VOLUME:
306 case V4L2_CID_PRIVATE_INVERT:
307 case V4L2_CID_PRIVATE_AUTOMUTE:
308 return true;
309 default:
310 return false;
311 }
312}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313
314static int empress_init(struct saa7134_dev *dev)
315{
Hans Verkuil718bde12013-12-14 08:28:24 -0300316 struct v4l2_ctrl_handler *hdl = &dev->empress_ctrl_handler;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317 int err;
318
Harvey Harrison50163812008-04-08 23:20:00 -0300319 dprintk("%s: %s\n",dev->name,__func__);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320 dev->empress_dev = video_device_alloc();
321 if (NULL == dev->empress_dev)
322 return -ENOMEM;
323 *(dev->empress_dev) = saa7134_empress_template;
Hans Verkuild481c582013-06-20 10:57:10 -0300324 dev->empress_dev->v4l2_dev = &dev->v4l2_dev;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325 dev->empress_dev->release = video_device_release;
326 snprintf(dev->empress_dev->name, sizeof(dev->empress_dev->name),
327 "%s empress (%s)", dev->name,
328 saa7134_boards[dev->board].name);
Hans Verkuilce791132013-12-14 08:28:27 -0300329 set_bit(V4L2_FL_USE_FH_PRIO, &dev->empress_dev->flags);
Hans Verkuil718bde12013-12-14 08:28:24 -0300330 v4l2_ctrl_handler_init(hdl, 21);
331 v4l2_ctrl_add_handler(hdl, &dev->ctrl_handler, empress_ctrl_filter);
332 if (dev->empress_sd)
333 v4l2_ctrl_add_handler(hdl, dev->empress_sd->ctrl_handler, NULL);
334 if (hdl->error) {
335 video_device_release(dev->empress_dev);
336 return hdl->error;
337 }
338 dev->empress_dev->ctrl_handler = hdl;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339
David Howellsc4028952006-11-22 14:57:56 +0000340 INIT_WORK(&dev->empress_workqueue, empress_signal_update);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341
Laurent Pinchart63b0d5a2009-12-10 11:44:04 -0200342 video_set_drvdata(dev->empress_dev, dev);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 err = video_register_device(dev->empress_dev,VFL_TYPE_GRABBER,
344 empress_nr[dev->nr]);
345 if (err < 0) {
346 printk(KERN_INFO "%s: can't register video device\n",
347 dev->name);
348 video_device_release(dev->empress_dev);
349 dev->empress_dev = NULL;
350 return err;
351 }
Laurent Pinchart38c7c032009-11-27 13:57:15 -0300352 printk(KERN_INFO "%s: registered device %s [mpeg]\n",
353 dev->name, video_device_node_name(dev->empress_dev));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354
Guennadi Liakhovetski07051352008-04-22 14:42:13 -0300355 videobuf_queue_sg_init(&dev->empress_tsq, &saa7134_ts_qops,
356 &dev->pci->dev, &dev->slock,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700357 V4L2_BUF_TYPE_VIDEO_CAPTURE,
358 V4L2_FIELD_ALTERNATE,
359 sizeof(struct saa7134_buf),
Hans Verkuil08bff032010-09-20 17:39:46 -0300360 dev, NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361
David Howellsc4028952006-11-22 14:57:56 +0000362 empress_signal_update(&dev->empress_workqueue);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363 return 0;
364}
365
366static int empress_fini(struct saa7134_dev *dev)
367{
Harvey Harrison50163812008-04-08 23:20:00 -0300368 dprintk("%s: %s\n",dev->name,__func__);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369
370 if (NULL == dev->empress_dev)
371 return 0;
Tejun Heo43829732012-08-20 14:51:24 -0700372 flush_work(&dev->empress_workqueue);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373 video_unregister_device(dev->empress_dev);
Hans Verkuil718bde12013-12-14 08:28:24 -0300374 v4l2_ctrl_handler_free(&dev->empress_ctrl_handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375 dev->empress_dev = NULL;
376 return 0;
377}
378
379static struct saa7134_mpeg_ops empress_ops = {
380 .type = SAA7134_MPEG_EMPRESS,
381 .init = empress_init,
382 .fini = empress_fini,
383 .signal_change = empress_signal_change,
384};
385
386static int __init empress_register(void)
387{
388 return saa7134_ts_register(&empress_ops);
389}
390
391static void __exit empress_unregister(void)
392{
393 saa7134_ts_unregister(&empress_ops);
394}
395
396module_init(empress_register);
397module_exit(empress_unregister);