diff options
author | Michael Hunold <devnull@localhost> | 2004-10-26 16:46:10 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2004-10-26 16:46:10 +0000 |
commit | 7086c1ee37d2f07aa94d61f22b0a9e2dfb0eee03 (patch) | |
tree | 02fd44d673e9dbf3738987ec48f00755a01f22f0 /linux/drivers/media/common | |
parent | f49b28cb00eca5493b3a155e51da67e145c30d93 (diff) | |
download | mediapointer-dvb-s2-7086c1ee37d2f07aa94d61f22b0a9e2dfb0eee03.tar.gz mediapointer-dvb-s2-7086c1ee37d2f07aa94d61f22b0a9e2dfb0eee03.tar.bz2 |
- add back support for older kernels due to popular demand
Diffstat (limited to 'linux/drivers/media/common')
-rw-r--r-- | linux/drivers/media/common/saa7146_fops.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_vbi.c | 23 | ||||
-rw-r--r-- | linux/drivers/media/common/saa7146_video.c | 31 |
3 files changed, 56 insertions, 2 deletions
diff --git a/linux/drivers/media/common/saa7146_fops.c b/linux/drivers/media/common/saa7146_fops.c index 427372a55..b94dcef03 100644 --- a/linux/drivers/media/common/saa7146_fops.c +++ b/linux/drivers/media/common/saa7146_fops.c @@ -362,7 +362,11 @@ static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait) if (V4L2_BUF_TYPE_VBI_CAPTURE == fh->type) { if( 0 == fh->vbi_q.streaming ) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) + return videobuf_poll_stream(file, &fh->vbi_q, wait); +#else return videobuf_poll_stream(file, file->private_data, &fh->vbi_q, wait); +#endif q = &fh->vbi_q; } else { DEB_D(("using video queue.\n")); diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c index 48afdd0c5..2522762b5 100644 --- a/linux/drivers/media/common/saa7146_vbi.c +++ b/linux/drivers/media/common/saa7146_vbi.c @@ -214,9 +214,14 @@ static int buffer_activate(struct saa7146_dev *dev, return 0; } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) +static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l2_field field) +{ +#else static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field field) { struct file *file = priv; +#endif struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_buf *buf = (struct saa7146_buf *)vb; @@ -266,7 +271,11 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field return err; } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) +static int buffer_setup(struct file *file, unsigned int *count, unsigned int *size) +#else static int buffer_setup(void *priv, unsigned int *count, unsigned int *size) +#endif { int llength,lines; @@ -281,9 +290,14 @@ static int buffer_setup(void *priv, unsigned int *count, unsigned int *size) return 0; } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) +static void buffer_queue(struct file *file, struct videobuf_buffer *vb) +{ +#else static void buffer_queue(void *priv, struct videobuf_buffer *vb) { struct file *file = priv; +#endif struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_vv *vv = dev->vv_data; @@ -293,9 +307,14 @@ static void buffer_queue(void *priv, struct videobuf_buffer *vb) saa7146_buffer_queue(dev,&vv->vbi_q,buf); } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) +static void buffer_release(struct file *file, struct videobuf_buffer *vb) +{ +#else static void buffer_release(void *priv, struct videobuf_buffer *vb) { struct file *file = priv; +#endif struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_buf *buf = (struct saa7146_buf *)vb; @@ -484,8 +503,12 @@ static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff } mod_timer(&fh->vbi_read_timeout, jiffies+BUFFER_TIMEOUT); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) + ret = videobuf_read_stream(file, &fh->vbi_q, data, count, ppos, 1); +#else ret = videobuf_read_stream(file, &fh->vbi_q, data, count, ppos, 1, file->f_flags & O_NONBLOCK); +#endif /* printk("BASE_ODD3: 0x%08x\n", saa7146_read(dev, BASE_ODD3)); printk("BASE_EVEN3: 0x%08x\n", saa7146_read(dev, BASE_EVEN3)); diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index 6f6edcb90..c19d2e043 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -1154,7 +1154,11 @@ int saa7146_video_do_ioctl(struct inode *inode, struct file *file, unsigned int case VIDIOC_DQBUF: { struct v4l2_buffer *buf = arg; int ret = 0; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) + ret = videobuf_dqbuf(file,q,buf); +#else ret = videobuf_dqbuf(file,q,buf,file->f_flags & O_NONBLOCK); +#endif DEB_D(("VIDIOC_DQBUF: ret:%d, index:%d\n",ret,buf->index)); return ret; } @@ -1247,9 +1251,14 @@ static int buffer_activate (struct saa7146_dev *dev, return 0; } -static int buffer_prepare(void *priv, struct videobuf_buffer *vb, enum v4l2_field field) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) +static int buffer_prepare(struct file *file, struct videobuf_buffer *vb,enum v4l2_field field) +{ +#else +static int buffer_prepare(void *priv, struct videobuf_buffer *vb,enum v4l2_field field) { struct file *file = priv; +#endif struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_vv *vv = dev->vv_data; @@ -1330,9 +1339,14 @@ static int buffer_prepare(void *priv, struct videobuf_buffer *vb, enum v4l2_fiel return err; } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) +static int buffer_setup(struct file *file, unsigned int *count, unsigned int *size) +{ +#else static int buffer_setup(void *priv, unsigned int *count, unsigned int *size) { struct file *file = priv; +#endif struct saa7146_fh *fh = file->private_data; if (0 == *count || *count > MAX_SAA7146_CAPTURE_BUFFERS) @@ -1350,9 +1364,14 @@ static int buffer_setup(void *priv, unsigned int *count, unsigned int *size) return 0; } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) +static void buffer_queue(struct file *file, struct videobuf_buffer *vb) +{ +#else static void buffer_queue(void *priv, struct videobuf_buffer *vb) { struct file *file = priv; +#endif struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_vv *vv = dev->vv_data; @@ -1362,10 +1381,14 @@ static void buffer_queue(void *priv, struct videobuf_buffer *vb) saa7146_buffer_queue(fh->dev,&vv->video_q,buf); } - +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) +static void buffer_release(struct file *file, struct videobuf_buffer *vb) +{ +#else static void buffer_release(void *priv, struct videobuf_buffer *vb) { struct file *file = priv; +#endif struct saa7146_fh *fh = file->private_data; struct saa7146_dev *dev = fh->dev; struct saa7146_buf *buf = (struct saa7146_buf *)vb; @@ -1485,8 +1508,12 @@ static ssize_t video_read(struct file *file, char __user *data, size_t count, lo goto out; } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)) + ret = videobuf_read_one(file,&fh->video_q , data, count, ppos); +#else ret = videobuf_read_one(file,&fh->video_q , data, count, ppos, file->f_flags & O_NONBLOCK); +#endif if (ret != 0) { video_end(fh, file); } else { |