diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-02-15 02:15:32 +0000 |
commit | 86464aed71025541805e7b1515541aee89879e33 (patch) | |
tree | e01a457a4912a8553bc65524aa3125d51f29f810 /drivers/char/videodev.c | |
parent | 88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff) |
Merge with Linux 2.2.1.
Diffstat (limited to 'drivers/char/videodev.c')
-rw-r--r-- | drivers/char/videodev.c | 70 |
1 files changed, 62 insertions, 8 deletions
diff --git a/drivers/char/videodev.c b/drivers/char/videodev.c index def6e7039..dd9364ecf 100644 --- a/drivers/char/videodev.c +++ b/drivers/char/videodev.c @@ -15,6 +15,7 @@ */ #include <linux/config.h> +#include <linux/version.h> #include <linux/module.h> #include <linux/types.h> #include <linux/kernel.h> @@ -24,12 +25,12 @@ #include <linux/errno.h> #include <linux/videodev.h> +#if LINUX_VERSION_CODE >= 0x020100 #include <asm/uaccess.h> +#endif #include <asm/system.h> -#ifdef CONFIG_KMOD #include <linux/kmod.h> -#endif #define VIDEO_NUM_DEVICES 256 @@ -68,6 +69,9 @@ extern int fmi_init(struct video_init *); #ifdef CONFIG_RADIO_MIROPCM20 extern int pcm20_init(struct video_init *); #endif +#ifdef CONFIG_RADIO_GEMTEK +extern int gemtek_init(struct video_init *); +#endif #ifdef CONFIG_VIDEO_PMS extern int init_pms_cards(struct video_init *); #endif @@ -100,14 +104,17 @@ static struct video_init video_init_list[]={ #endif #ifdef CONFIG_RADIO_SF16FMI {"SF16FMI", fmi_init}, -#endif +#endif #ifdef CONFIG_RADIO_MIROPCM20 {"PCM20", pcm20_init}, -#endif +#endif +#ifdef CONFIG_RADIO_GEMTEK + {"GemTek", gemtek_init}, +#endif {"end", NULL} }; - +#if LINUX_VERSION_CODE >= 0x020100 /* * Read will do some smarts later on. Buffer pin etc. */ @@ -123,6 +130,7 @@ static ssize_t video_read(struct file *file, } + /* * Write for now does nothing. No reason it shouldnt do overlay setting * for some boards I guess.. @@ -138,7 +146,6 @@ static ssize_t video_write(struct file *file, const char *buf, return 0; } - /* * Poll to see if we're readable, can probably be used for timing on incoming * frames, etc.. @@ -153,6 +160,32 @@ static unsigned int video_poll(struct file *file, poll_table * wait) return 0; } + +#else +static int video_read(struct inode *ino,struct file *file, + char *buf, int count) +{ + int err; + struct video_device *vfl=video_device[MINOR(ino->i_rdev)]; + if (vfl->read) + return vfl->read(vfl, buf, count, file->f_flags&O_NONBLOCK); + else + return -EINVAL; +} + +static int video_write(struct inode *ino,struct file *file, const char *buf, + int count) +{ + int err; + struct video_device *vfl=video_device[MINOR(ino->i_rdev)]; + if (vfl->write) + return vfl->write(vfl, buf, count, file->f_flags&O_NONBLOCK); + else + return 0; +} + +#endif + /* * Open a video device. */ @@ -168,14 +201,12 @@ static int video_open(struct inode *inode, struct file *file) vfl=video_device[minor]; if(vfl==NULL) { -#ifdef CONFIG_KMOD char modname[20]; sprintf (modname, "char-major-%d-%d", VIDEO_MAJOR, minor); request_module(modname); vfl=video_device[minor]; if (vfl==NULL) -#endif return -ENODEV; } if(vfl->busy) @@ -212,11 +243,19 @@ static int video_release(struct inode *inode, struct file *file) * image ? */ +#if LINUX_VERSION_CODE >= 0x020100 static long long video_lseek(struct file * file, long long offset, int origin) { return -ESPIPE; } +#else +static long long video_lseek(struct inode *inode, struct file * file, + long long offset, int origin) +{ + return -ESPIPE; +} +#endif static int video_ioctl(struct inode *inode, struct file *file, @@ -240,9 +279,16 @@ static int video_ioctl(struct inode *inode, struct file *file, */ +#if LINUX_VERSION_CODE >= 0x020100 int video_mmap(struct file *file, struct vm_area_struct *vma) { struct video_device *vfl=video_device[MINOR(file->f_dentry->d_inode->i_rdev)]; +#else +static int video_mmap(struct inode * ino, struct file * file, + struct vm_area_struct * vma) +{ + struct video_device *vfl=video_device[MINOR(ino->i_rdev)]; +#endif if(vfl->mmap) return vfl->mmap(vfl, (char *)vma->vm_start, (unsigned long)(vma->vm_end-vma->vm_start)); @@ -326,11 +372,17 @@ static struct file_operations video_fops= video_read, video_write, NULL, /* readdir */ +#if LINUX_VERSION_CODE >= 0x020100 video_poll, /* poll */ +#else + NULL, +#endif video_ioctl, video_mmap, video_open, +#if LINUX_VERSION_CODE >= 0x020100 NULL, /* flush */ +#endif video_release }; @@ -374,5 +426,7 @@ void cleanup_module(void) #endif +#if LINUX_VERSION_CODE >= 0x020100 EXPORT_SYMBOL(video_register_device); EXPORT_SYMBOL(video_unregister_device); +#endif |