diff options
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/compat_ioctl32.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/cpia_pp.c | 26 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-input.c | 12 | ||||
-rw-r--r-- | linux/drivers/media/video/ir-kbd-i2c.c | 12 | ||||
-rw-r--r-- | linux/drivers/media/video/msp3400-driver.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-context.c | 22 | ||||
-rw-r--r-- | linux/drivers/media/video/saa6588.c | 12 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7134/saa7134-empress.c | 17 | ||||
-rw-r--r-- | linux/drivers/media/video/tvaudio.c | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/usbvision/usbvision-core.c | 13 | ||||
-rw-r--r-- | linux/drivers/media/video/video-buf-dvb.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/videodev.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/vivi.c | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/zoran_procfs.c | 8 |
14 files changed, 144 insertions, 0 deletions
diff --git a/linux/drivers/media/video/compat_ioctl32.c b/linux/drivers/media/video/compat_ioctl32.c index ea5efbd64..e0d6500f4 100644 --- a/linux/drivers/media/video/compat_ioctl32.c +++ b/linux/drivers/media/video/compat_ioctl32.c @@ -169,7 +169,11 @@ static int native_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ret = file->f_op->unlocked_ioctl(file, cmd, arg); else if (file->f_op->ioctl) { lock_kernel(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ret = file->f_op->ioctl(file->f_dentry->d_inode, file, cmd, arg); +#else + ret = file->f_op->ioctl(file->f_path.dentry->d_inode, file, cmd, arg); +#endif unlock_kernel(); } diff --git a/linux/drivers/media/video/cpia_pp.c b/linux/drivers/media/video/cpia_pp.c index 41f4b8d17..26e7e6d5b 100644 --- a/linux/drivers/media/video/cpia_pp.c +++ b/linux/drivers/media/video/cpia_pp.c @@ -82,6 +82,10 @@ struct pp_cam_entry { struct pardevice *pdev; struct parport *port; struct work_struct cb_task; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + void (*cb_func)(void *cbdata); + void *cb_data; +#endif int open_count; wait_queue_head_t wq_stream; /* image state flags */ @@ -130,6 +134,22 @@ static void cpia_parport_disable_irq( struct parport *port ) { #define PARPORT_CHUNK_SIZE PAGE_SIZE +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) +static void cpia_pp_run_callback(struct work_struct *work) +{ + void (*cb_func)(void *cbdata); + void *cb_data; + struct pp_cam_entry *cam; + + cam = container_of(work, struct pp_cam_entry, cb_task); + cb_func = cam->cb_func; + cb_data = cam->cb_data; + work_release(work); + + cb_func(cb_data); +} + +#endif /**************************************************************************** * * CPiA-specific low-level parport functions for nibble uploads @@ -664,7 +684,13 @@ static int cpia_pp_registerCallback(void *privdata, void (*cb)(void *cbdata), vo int retval = 0; if(cam->port->irq != PARPORT_IRQ_NONE) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&cam->cb_task, cb, cbdata); +#else + cam->cb_func = cb; + cam->cb_data = cbdata; + INIT_WORK_NAR(&cam->cb_task, cpia_pp_run_callback); +#endif } else { retval = -1; } diff --git a/linux/drivers/media/video/cx88/cx88-input.c b/linux/drivers/media/video/cx88/cx88-input.c index a5e4b7b50..6c712ecdd 100644 --- a/linux/drivers/media/video/cx88/cx88-input.c +++ b/linux/drivers/media/video/cx88/cx88-input.c @@ -146,9 +146,17 @@ static void ir_timer(unsigned long data) schedule_work(&ir->work); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void cx88_ir_work(void *data) +#else +static void cx88_ir_work(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct cx88_IR *ir = data; +#else + struct cx88_IR *ir = container_of(work, struct cx88_IR, work); +#endif unsigned long timeout; cx88_ir_handle_key(ir); @@ -159,7 +167,11 @@ static void cx88_ir_work(void *data) static void cx88_ir_start(struct cx88_core *core, struct cx88_IR *ir) { if (ir->polling) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&ir->work, cx88_ir_work, ir); +#else + INIT_WORK(&ir->work, cx88_ir_work); +#endif init_timer(&ir->timer); ir->timer.function = ir_timer; ir->timer.data = (unsigned long)ir; diff --git a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c index a5a0fa83e..95566ff19 100644 --- a/linux/drivers/media/video/ir-kbd-i2c.c +++ b/linux/drivers/media/video/ir-kbd-i2c.c @@ -269,9 +269,17 @@ static void ir_timer(unsigned long data) schedule_work(&ir->work); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void ir_work(void *data) +#else +static void ir_work(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct IR_i2c *ir = data; +#else + struct IR_i2c *ir = container_of(work, struct IR_i2c, work); +#endif ir_key_poll(ir); mod_timer(&ir->timer, jiffies+HZ/10); } @@ -412,7 +420,11 @@ static int ir_attach(struct i2c_adapter *adap, int addr, ir->input->name, ir->input->phys, adap->name); /* start polling via eventd */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&ir->work, ir_work, ir); +#else + INIT_WORK(&ir->work, ir_work); +#endif init_timer(&ir->timer); ir->timer.function = ir_timer; ir->timer.data = (unsigned long)ir; diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index 1105e4257..62383f979 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -58,7 +58,11 @@ #include <media/msp3400.h> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #include <linux/kthread.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #include <linux/suspend.h> +#else +#include <linux/freezer.h> +#endif #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include "i2c-compat.h" diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-context.c b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c index f129f316d..19787dc81 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-context.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c @@ -45,16 +45,33 @@ static void pvr2_context_trigger_poll(struct pvr2_context *mp) } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void pvr2_context_poll(struct pvr2_context *mp) +#else +static void pvr2_context_poll(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + struct pvr2_context *mp = + container_of(work, struct pvr2_context, workpoll); +#endif pvr2_context_enter(mp); do { pvr2_hdw_poll(mp->hdw); } while (0); pvr2_context_exit(mp); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void pvr2_context_setup(struct pvr2_context *mp) +#else +static void pvr2_context_setup(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) + struct pvr2_context *mp = + container_of(work, struct pvr2_context, workinit); + +#endif pvr2_context_enter(mp); do { if (!pvr2_hdw_dev_ok(mp->hdw)) break; pvr2_hdw_setup(mp->hdw); @@ -92,8 +109,13 @@ struct pvr2_context *pvr2_context_create( } mp->workqueue = create_singlethread_workqueue("pvrusb2"); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&mp->workinit,(void (*)(void*))pvr2_context_setup,mp); INIT_WORK(&mp->workpoll,(void (*)(void*))pvr2_context_poll,mp); +#else + INIT_WORK(&mp->workinit, pvr2_context_setup); + INIT_WORK(&mp->workpoll, pvr2_context_poll); +#endif queue_work(mp->workqueue,&mp->workinit); done: return mp; diff --git a/linux/drivers/media/video/saa6588.c b/linux/drivers/media/video/saa6588.c index 4b2375c80..ff6f29eac 100644 --- a/linux/drivers/media/video/saa6588.c +++ b/linux/drivers/media/video/saa6588.c @@ -331,9 +331,17 @@ static void saa6588_timer(unsigned long data) schedule_work(&s->work); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void saa6588_work(void *data) +#else +static void saa6588_work(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct saa6588 *s = (struct saa6588 *)data; +#else + struct saa6588 *s = container_of(work, struct saa6588, work); +#endif saa6588_i2c_poll(s); mod_timer(&s->timer, jiffies + msecs_to_jiffies(20)); @@ -430,7 +438,11 @@ static int saa6588_attach(struct i2c_adapter *adap, int addr, unsigned short fla saa6588_configure(s); /* start polling via eventd */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&s->work, saa6588_work, s); +#else + INIT_WORK(&s->work, saa6588_work); +#endif init_timer(&s->timer); s->timer.function = saa6588_timer; s->timer.data = (unsigned long)s; diff --git a/linux/drivers/media/video/saa7134/saa7134-empress.c b/linux/drivers/media/video/saa7134/saa7134-empress.c index 690891588..8c12c2cc2 100644 --- a/linux/drivers/media/video/saa7134/saa7134-empress.c +++ b/linux/drivers/media/video/saa7134/saa7134-empress.c @@ -353,9 +353,18 @@ static struct video_device saa7134_empress_template = .minor = -1, }; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void empress_signal_update(void* data) +#else +static void empress_signal_update(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct saa7134_dev* dev = (struct saa7134_dev*) data; +#else + struct saa7134_dev* dev = + container_of(work, struct saa7134_dev, empress_workqueue); +#endif if (dev->nosignal) { dprintk("no video signal\n"); @@ -390,7 +399,11 @@ static int empress_init(struct saa7134_dev *dev) "%s empress (%s)", dev->name, saa7134_boards[dev->board].name); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&dev->empress_workqueue, empress_signal_update, (void*) dev); +#else + INIT_WORK(&dev->empress_workqueue, empress_signal_update); +#endif err = video_register_device(dev->empress_dev,VFL_TYPE_GRABBER, empress_nr[dev->nr]); @@ -411,7 +424,11 @@ static int empress_init(struct saa7134_dev *dev) sizeof(struct saa7134_buf), dev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) empress_signal_update(dev); +#else + empress_signal_update(&dev->empress_workqueue); +#endif return 0; } diff --git a/linux/drivers/media/video/tvaudio.c b/linux/drivers/media/video/tvaudio.c index a551af799..e08484fd2 100644 --- a/linux/drivers/media/video/tvaudio.c +++ b/linux/drivers/media/video/tvaudio.c @@ -30,6 +30,9 @@ #include <linux/init.h> #include <linux/smp_lock.h> #include <linux/kthread.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) +#include <linux/freezer.h> +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include "i2c-compat.h" diff --git a/linux/drivers/media/video/usbvision/usbvision-core.c b/linux/drivers/media/video/usbvision/usbvision-core.c index 071b11e75..2d20c809d 100644 --- a/linux/drivers/media/video/usbvision/usbvision-core.c +++ b/linux/drivers/media/video/usbvision/usbvision-core.c @@ -2286,14 +2286,23 @@ int usbvision_power_on(struct usb_usbvision *usbvision) */ // to call usbvision_power_off from task queue +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) static void call_usbvision_power_off(void *_usbvision) +#else +static void call_usbvision_power_off(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct usb_usbvision *usbvision = _usbvision; +#else + struct usb_usbvision *usbvision = container_of(work, struct usb_usbvision, powerOffWork); +#endif PDEBUG(DBG_FUNC, ""); down_interruptible(&usbvision->lock); if(usbvision->user == 0) { usbvision_i2c_usb_del_bus(&usbvision->i2c_adap); + usbvision_power_off(usbvision); usbvision->initialized = 0; } @@ -2310,7 +2319,11 @@ static void usbvision_powerOffTimer(unsigned long data) INIT_TQUEUE(&usbvision->powerOffTask, call_usbvision_power_off, usbvision); (void) schedule_task(&usbvision->powerOffTask); #else +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) INIT_WORK(&usbvision->powerOffWork, call_usbvision_power_off, usbvision); +#else + INIT_WORK(&usbvision->powerOffWork, call_usbvision_power_off); +#endif (void) schedule_work(&usbvision->powerOffWork); #endif diff --git a/linux/drivers/media/video/video-buf-dvb.c b/linux/drivers/media/video/video-buf-dvb.c index b5e472c4d..86993f95a 100644 --- a/linux/drivers/media/video/video-buf-dvb.c +++ b/linux/drivers/media/video/video-buf-dvb.c @@ -22,7 +22,11 @@ #include <linux/fs.h> #include <linux/kthread.h> #include <linux/file.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #include <linux/suspend.h> +#else +#include <linux/freezer.h> +#endif #include <media/video-buf.h> #include <media/video-buf-dvb.h> diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c index 87e93b524..b0009fe0f 100644 --- a/linux/drivers/media/video/videodev.c +++ b/linux/drivers/media/video/videodev.c @@ -120,7 +120,11 @@ static DEFINE_MUTEX(videodev_lock); struct video_device* video_devdata(struct file *file) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) return video_device[iminor(file->f_dentry->d_inode)]; +#else + return video_device[iminor(file->f_path.dentry->d_inode)]; +#endif } /* diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c index 9b1407426..751128368 100644 --- a/linux/drivers/media/video/vivi.c +++ b/linux/drivers/media/video/vivi.c @@ -39,6 +39,9 @@ #include <linux/kthread.h> #endif #include <linux/highmem.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) +#include <linux/freezer.h> +#endif /* Wake up at about 30 fps */ #define WAKE_NUMERATOR 30 diff --git a/linux/drivers/media/video/zoran_procfs.c b/linux/drivers/media/video/zoran_procfs.c index c63752b54..77cbe49c3 100644 --- a/linux/drivers/media/video/zoran_procfs.c +++ b/linux/drivers/media/video/zoran_procfs.c @@ -145,7 +145,11 @@ static int zoran_open(struct inode *inode, struct file *file) static ssize_t zoran_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) struct zoran *zr = PDE(file->f_dentry->d_inode)->data; +#else + struct zoran *zr = PDE(file->f_path.dentry->d_inode)->data; +#endif char *string, *sp; char *line, *ldelim, *varname, *svar, *tdelim; @@ -166,7 +170,11 @@ static ssize_t zoran_write(struct file *file, const char __user *buffer, } string[count] = 0; dprintk(4, KERN_INFO "%s: write_proc: name=%s count=%zu zr=%p\n", +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ZR_DEVNAME(zr), file->f_dentry->d_name.name, count, zr); +#else + ZR_DEVNAME(zr), file->f_path.dentry->d_name.name, count, zr); +#endif ldelim = " \t\n"; tdelim = "="; line = strpbrk(sp, ldelim); |