21 #include <linux/list.h>
22 #include <linux/module.h>
23 #include <linux/kernel.h>
43 static unsigned int debug;
47 #define dprintk(fmt, arg...) if (debug) \
48 printk(KERN_DEBUG "%s/empress: " fmt, dev->name , ## arg)
66 u32 leading_null_bytes = 0;
74 leading_null_bytes = 1;
77 ts_reset_encoder(dev);
85 static int ts_open(
struct file *
file)
91 dprintk(
"open dev=%s\n", video_device_node_name(vdev));
111 static int ts_release(
struct file *file)
119 ts_reset_encoder(dev);
131 ts_read(
struct file *file,
char __user *
data,
size_t count, loff_t *ppos)
136 ts_init_encoder(dev);
139 data, count, ppos, 0,
166 static int empress_querycap(
struct file *file,
void *
priv,
182 static int empress_enum_input(
struct file *file,
void *priv,
194 static int empress_g_input(
struct file *file,
void *priv,
unsigned int *i)
200 static int empress_s_input(
struct file *file,
void *priv,
unsigned int i)
208 static int empress_enum_fmt_vid_cap(
struct file *file,
void *priv,
220 static int empress_g_fmt_vid_cap(
struct file *file,
void *priv,
224 struct v4l2_mbus_framefmt mbus_fmt;
228 v4l2_fill_pix_format(&f->
fmt.
pix, &mbus_fmt);
235 static int empress_s_fmt_vid_cap(
struct file *file,
void *priv,
239 struct v4l2_mbus_framefmt mbus_fmt;
243 v4l2_fill_pix_format(&f->
fmt.
pix, &mbus_fmt);
251 static int empress_try_fmt_vid_cap(
struct file *file,
void *priv,
262 static int empress_reqbufs(
struct file *file,
void *priv,
270 static int empress_querybuf(
struct file *file,
void *priv,
278 static int empress_qbuf(
struct file *file,
void *priv,
struct v4l2_buffer *
b)
285 static int empress_dqbuf(
struct file *file,
void *priv,
struct v4l2_buffer *
b)
293 static int empress_streamon(
struct file *file,
void *priv,
301 static int empress_streamoff(
struct file *file,
void *priv,
309 static int empress_s_ext_ctrls(
struct file *file,
void *priv,
317 if (ctrls->
count == 0)
324 ts_init_encoder(dev);
329 static int empress_g_ext_ctrls(
struct file *file,
void *priv,
339 static int empress_g_ctrl(
struct file *file,
void *priv,
347 static int empress_s_ctrl(
struct file *file,
void *priv,
355 static int empress_queryctrl(
struct file *file,
void *priv,
359 static const u32 user_ctrls[] = {
372 static const u32 mpeg_ctrls[] = {
389 static const u32 *ctrl_classes[] = {
406 static int empress_querymenu(
struct file *file,
void *priv,
416 static int empress_g_chip_ident(
struct file *file,
void *fh,
431 static int empress_s_std(
struct file *file,
void *priv,
v4l2_std_id *
id)
438 static int empress_g_std(
struct file *file,
void *priv,
v4l2_std_id *
id)
450 .release = ts_release,
458 .vidioc_querycap = empress_querycap,
459 .vidioc_enum_fmt_vid_cap = empress_enum_fmt_vid_cap,
460 .vidioc_try_fmt_vid_cap = empress_try_fmt_vid_cap,
461 .vidioc_s_fmt_vid_cap = empress_s_fmt_vid_cap,
462 .vidioc_g_fmt_vid_cap = empress_g_fmt_vid_cap,
463 .vidioc_reqbufs = empress_reqbufs,
464 .vidioc_querybuf = empress_querybuf,
465 .vidioc_qbuf = empress_qbuf,
466 .vidioc_dqbuf = empress_dqbuf,
467 .vidioc_streamon = empress_streamon,
468 .vidioc_streamoff = empress_streamoff,
469 .vidioc_s_ext_ctrls = empress_s_ext_ctrls,
470 .vidioc_g_ext_ctrls = empress_g_ext_ctrls,
471 .vidioc_enum_input = empress_enum_input,
472 .vidioc_g_input = empress_g_input,
473 .vidioc_s_input = empress_s_input,
474 .vidioc_queryctrl = empress_queryctrl,
475 .vidioc_querymenu = empress_querymenu,
476 .vidioc_g_ctrl = empress_g_ctrl,
477 .vidioc_s_ctrl = empress_s_ctrl,
478 .vidioc_g_chip_ident = empress_g_chip_ident,
479 .vidioc_s_std = empress_s_std,
480 .vidioc_g_std = empress_g_std,
486 .name =
"saa7134-empress",
488 .ioctl_ops = &ts_ioctl_ops,
502 dprintk(
"video signal acquired\n");
506 static void empress_signal_change(
struct saa7134_dev *dev)
524 "%s empress (%s)", dev->
name,
531 empress_nr[dev->
nr]);
567 .init = empress_init,
568 .fini = empress_fini,
569 .signal_change = empress_signal_change,
572 static int __init empress_register(
void)
577 static void __exit empress_unregister(
void)