summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/usbvideo
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-02-19 19:27:58 -0800
committerTrent Piepho <xyzzy@speakeasy.org>2007-02-19 19:27:58 -0800
commitdf6112a72da3840ed73c44ba5bdc8f69228d4393 (patch)
tree11d8df2cb23055daf24c9ea353327d16da745199 /linux/drivers/media/video/usbvideo
parent13aac084f52613baf79f047bdac0b0decc2b37d2 (diff)
downloadmediapointer-dvb-s2-df6112a72da3840ed73c44ba5bdc8f69228d4393.tar.gz
mediapointer-dvb-s2-df6112a72da3840ed73c44ba5bdc8f69228d4393.tar.bz2
compat: input_dev compat code for konicawc and quickcam_messenger
From: Trent Piepho <xyzzy@speakeasy.org> Adjust konicawc and quickcam_messenger to use backward compat code relating to changes in the input layer in 2.6.15. They should now work in 2.6.12. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'linux/drivers/media/video/usbvideo')
-rw-r--r--linux/drivers/media/video/usbvideo/konicawc.c13
-rw-r--r--linux/drivers/media/video/usbvideo/quickcam_messenger.c12
-rw-r--r--linux/drivers/media/video/usbvideo/usbvideo.h2
3 files changed, 18 insertions, 9 deletions
diff --git a/linux/drivers/media/video/usbvideo/konicawc.c b/linux/drivers/media/video/usbvideo/konicawc.c
index 5ab17aaab..8ca93f248 100644
--- a/linux/drivers/media/video/usbvideo/konicawc.c
+++ b/linux/drivers/media/video/usbvideo/konicawc.c
@@ -15,15 +15,16 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
-#include "compat.h"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
-#include <linux/input.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+#include <linux/usb/input.h>
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
#include <linux/usb_input.h>
#else
-#include <linux/usb/input.h>
+#include <linux/input.h>
#endif
#include "usbvideo.h"
+#include "compat.h"
#define MAX_BRIGHTNESS 108
#define MAX_CONTRAST 108
@@ -242,7 +243,11 @@ static void konicawc_register_input(struct konicawc *cam, struct usb_device *dev
input_dev->name = "Konicawc snapshot button";
input_dev->phys = cam->input_physname;
usb_to_input_id(dev, &input_dev->id);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
input_dev->cdev.dev = &dev->dev;
+#else
+ input_dev->dev = &dev->dev;
+#endif
input_dev->evbit[0] = BIT(EV_KEY);
input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0);
diff --git a/linux/drivers/media/video/usbvideo/quickcam_messenger.c b/linux/drivers/media/video/usbvideo/quickcam_messenger.c
index 614c821ed..849f94bab 100644
--- a/linux/drivers/media/video/usbvideo/quickcam_messenger.c
+++ b/linux/drivers/media/video/usbvideo/quickcam_messenger.c
@@ -33,15 +33,15 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/input.h>
-#include "compat.h"
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
-#include <linux/usb_input.h>
-#else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
#include <linux/usb/input.h>
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+#include <linux/usb_input.h>
#endif
#include "usbvideo.h"
#include "quickcam_messenger.h"
+#include "compat.h"
/*
* Version Information
@@ -105,7 +105,11 @@ static void qcm_register_input(struct qcm *cam, struct usb_device *dev)
input_dev->name = "QCM button";
input_dev->phys = cam->input_physname;
usb_to_input_id(dev, &input_dev->id);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
input_dev->cdev.dev = &dev->dev;
+#else
+ input_dev->dev = &dev->dev;
+#endif
input_dev->evbit[0] = BIT(EV_KEY);
input_dev->keybit[LONG(BTN_0)] = BIT(BTN_0);
diff --git a/linux/drivers/media/video/usbvideo/usbvideo.h b/linux/drivers/media/video/usbvideo/usbvideo.h
index aaafce2b5..c1f892825 100644
--- a/linux/drivers/media/video/usbvideo/usbvideo.h
+++ b/linux/drivers/media/video/usbvideo/usbvideo.h
@@ -16,13 +16,13 @@
#ifndef usbvideo_h
#define usbvideo_h
-#include "compat.h"
#include <linux/videodev.h>
#include <media/v4l2-common.h>
#include <linux/usb.h>
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
#include <linux/mutex.h>
#endif
+#include "compat.h"
/* Most helpful debugging aid */
#define assert(expr) ((void) ((expr) ? 0 : (err("assert failed at line %d",__LINE__))))