diff options
Diffstat (limited to 'linux/drivers/media/dvb/av7110/av7110.c')
-rw-r--r-- | linux/drivers/media/dvb/av7110/av7110.c | 69 |
1 files changed, 59 insertions, 10 deletions
diff --git a/linux/drivers/media/dvb/av7110/av7110.c b/linux/drivers/media/dvb/av7110/av7110.c index a18e45f80..5be8265ad 100644 --- a/linux/drivers/media/dvb/av7110/av7110.c +++ b/linux/drivers/media/dvb/av7110/av7110.c @@ -2819,12 +2819,9 @@ void p_to_t(u8 const *buf, long int length, u16 pid, u8 *counter, * V4L SECTION ****************************************************************************/ -static int dvb_do_ioctl (struct inode *inode, struct file *file, - unsigned int cmd, void *arg) +static +int av7110_video_ioctl (struct av7110_s *av7110, unsigned int cmd, void *arg) { - struct video_device *dev = video_devdata (file); - av7110_t *av7110 = dev->priv; - switch (cmd) { case VIDIOCGCAP: { @@ -2832,7 +2829,7 @@ static int dvb_do_ioctl (struct inode *inode, struct file *file, dprintk(KERN_ERR "dvb: VIDIOCGCAP called\n"); - strcpy(b->name, &dev->name[0]); + strcpy(b->name, "DVB Board"); b->type = av7110->video.type; @@ -3124,14 +3121,57 @@ static int dvb_do_ioctl (struct inode *inode, struct file *file, } -static int dvb_ioctl (struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,45) + +static +int dvb_ioctl(struct video_device *dev, unsigned int cmd, void *arg) +{ + return av7110_video_ioctl (dev->priv, cmd, arg); +} + + +#else + + +static +int dvb_do_ioctl (struct inode *inode, struct file *file, + unsigned int cmd, void *arg) +{ + struct video_device *dev = video_devdata (file); + return av7110_video_ioctl (dev->priv, cmd, arg); +} + + +static +int dvb_ioctl (struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { return video_usercopy(inode, file, cmd, arg, dvb_do_ioctl); } +#endif -static int dvb_mmap(struct file* file, struct vm_area_struct *vma) + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,45) +static +int dvb_mmap(struct video_device *dev, const char *adr, unsigned long size) +{ + struct av7110_s *av7110 = dev->priv; + struct vm_area_struct vma; + + vma.vm_start = (unsigned long) adr; + vma.vm_end = vma.vm_start + size; + + if (saacomm(SAA7146_DO_MMAP, &vma)) { + printk(KERN_ERR "av7110: dvb_mmap failed!\n"); + return -1; + } + + return 0; +} +#else +static +int dvb_mmap(struct file* file, struct vm_area_struct *vma) { struct video_device *dev = video_devdata (file); av7110_t *av7110 = dev->priv; @@ -3146,9 +3186,11 @@ static int dvb_mmap(struct file* file, struct vm_area_struct *vma) return 0; } +#endif -static unsigned int dvb_audio_poll(struct file *file, poll_table *wait) +static +unsigned int dvb_audio_poll(struct file *file, poll_table *wait) { struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; av7110_t *av7110=(av7110_t *) dvbdev->priv; @@ -3169,11 +3211,13 @@ static unsigned int dvb_audio_poll(struct file *file, poll_table *wait) } +#if !(LINUX_VERSION_CODE < KERNEL_VERSION(2,5,45)) static struct file_operations dvb_fops = { .ioctl = dvb_ioctl, .mmap = dvb_mmap, .llseek = no_llseek }; +#endif /* template for video_device-structure */ @@ -3187,7 +3231,12 @@ static struct video_device dvb_template = { VID_TYPE_FRAMERAM | VID_TYPE_SCALES, .hardware = VID_HARDWARE_SAA7146, +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,45) + .ioctl = dvb_ioctl, + .mmap = dvb_mmap, +#else .fops = &dvb_fops +#endif }; |