summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-04-24 11:09:17 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-04-24 11:09:17 -0300
commit00ae040d86fe4250f09667bacd62bad2bd970090 (patch)
tree21060857bd52216afd6be2cd668cf2ef3e3b529b /linux/drivers
parent6f290f63b3a7cd010a4bedcd36932b18617b34bb (diff)
downloadmediapointer-dvb-s2-00ae040d86fe4250f09667bacd62bad2bd970090.tar.gz
mediapointer-dvb-s2-00ae040d86fe4250f09667bacd62bad2bd970090.tar.bz2
Fix compilation for sn9c102 on older kernels
From: reinhard schwab <reinhard.schwab@aon.at> Signed-off-by: Reinhard Schwab <reinhard.schwab@aon.at> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/sn9c102/sn9c102.h6
-rw-r--r--linux/drivers/media/video/sn9c102/sn9c102_core.c6
-rw-r--r--linux/drivers/media/video/usbvideo/usbvideo.h10
-rw-r--r--linux/drivers/media/video/usbvideo/vicam.c6
4 files changed, 28 insertions, 0 deletions
diff --git a/linux/drivers/media/video/sn9c102/sn9c102.h b/linux/drivers/media/video/sn9c102/sn9c102.h
index 3f644c63f..1fcb7e73d 100644
--- a/linux/drivers/media/video/sn9c102/sn9c102.h
+++ b/linux/drivers/media/video/sn9c102/sn9c102.h
@@ -34,7 +34,9 @@
#include <linux/types.h>
#include <linux/param.h>
#include <linux/rwsem.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
#include <linux/mutex.h>
+#endif
#include <linux/string.h>
#include <linux/stddef.h>
@@ -146,7 +148,11 @@ struct sn9c102_device {
enum sn9c102_dev_state state;
u8 users;
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
struct mutex dev_mutex, fileop_mutex;
+#else
+ struct semaphore dev_mutex, fileop_mutex;
+#endif
spinlock_t queue_lock;
wait_queue_head_t open, wait_frame, wait_stream;
};
diff --git a/linux/drivers/media/video/sn9c102/sn9c102_core.c b/linux/drivers/media/video/sn9c102/sn9c102_core.c
index ea4394dc9..3add1c79f 100644
--- a/linux/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/linux/drivers/media/video/sn9c102/sn9c102_core.c
@@ -1769,7 +1769,13 @@ static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma)
pos = cam->frame[i].bufmem;
while (size > 0) { /* size is page-aligned */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
+ unsigned long page = vmalloc_to_pfn(pos);
+ if (remap_pfn_range(vma, start, page, PAGE_SIZE,
+ vma->vm_page_prot)) {
+#else
if (vm_insert_page(vma, start, vmalloc_to_page(pos))) {
+#endif
mutex_unlock(&cam->fileop_mutex);
return -EAGAIN;
}
diff --git a/linux/drivers/media/video/usbvideo/usbvideo.h b/linux/drivers/media/video/usbvideo/usbvideo.h
index 0d2066b7d..de266e78a 100644
--- a/linux/drivers/media/video/usbvideo/usbvideo.h
+++ b/linux/drivers/media/video/usbvideo/usbvideo.h
@@ -20,7 +20,9 @@
#include "compat.h"
#include <linux/videodev.h>
#include <linux/usb.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
#include <linux/mutex.h>
+#endif
/* Most helpful debugging aid */
#define assert(expr) ((void) ((expr) ? 0 : (err("assert failed at line %d",__LINE__))))
@@ -215,7 +217,11 @@ struct uvd {
unsigned long flags; /* FLAGS_USBVIDEO_xxx */
unsigned long paletteBits; /* Which palettes we accept? */
unsigned short defaultPalette; /* What palette to use for read() */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
struct mutex lock;
+#else
+ struct semaphore lock;
+#endif
int user; /* user count for exclusive use */
videosize_t videosize; /* Current setting */
@@ -274,7 +280,11 @@ struct usbvideo {
int num_cameras; /* As allocated */
struct usb_driver usbdrv; /* Interface to the USB stack */
char drvName[80]; /* Driver name */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
struct mutex lock; /* Mutex protecting camera structures */
+#else
+ struct semaphore lock;
+#endif
struct usbvideo_cb cb; /* Table of callbacks (virtual methods) */
struct video_device vdt; /* Video device template */
struct uvd *cam; /* Array of camera structures */
diff --git a/linux/drivers/media/video/usbvideo/vicam.c b/linux/drivers/media/video/usbvideo/vicam.c
index 98cb58e89..0ae33d432 100644
--- a/linux/drivers/media/video/usbvideo/vicam.c
+++ b/linux/drivers/media/video/usbvideo/vicam.c
@@ -43,7 +43,9 @@
#include <linux/vmalloc.h>
#include <linux/slab.h>
#include <linux/proc_fs.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
#include <linux/mutex.h>
+#endif
#include "usbvideo.h"
// #define VICAM_DEBUG
@@ -409,7 +411,11 @@ struct vicam_camera {
struct usb_device *udev; // usb device
/* guard against simultaneous accesses to the camera */
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
struct mutex cam_lock;
+#else
+ struct semaphore cam_lock;
+#endif
int is_initialized;
u8 open_count;