summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2006-08-27 19:00:09 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2006-08-27 19:00:09 -0700
commit28f08f0ca6a628da637c6219169cf101958ba878 (patch)
tree394219be5ca8d3d9be3fe970890930696d4bcf10 /v4l
parent7d302bb17d4ebe98e2e0cbe76beb2a72b3292843 (diff)
downloadmediapointer-dvb-s2-28f08f0ca6a628da637c6219169cf101958ba878.tar.gz
mediapointer-dvb-s2-28f08f0ca6a628da637c6219169cf101958ba878.tar.bz2
Add compat code for usb_to_input_id() which appeared in 2.6.13
From: Trent Piepho <xyzzy@speakeasy.org> Put static inline usb_to_input_id() inside compat.h for pre 2.6.13. This needs linux/usb.h to be included first! Drivers that need linux/usb_input.h compatibility must include linux/usb.h before they include compat.h. There is just no way around it. linux/usb.h cannot be unconditionally included in compat.h because that will break other, non-usb, drivers. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'v4l')
-rw-r--r--v4l/compat.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 9918f2e46..c1179a8c6 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -293,6 +293,24 @@ schedule_timeout_interruptible(signed long timeout)
#define IRQF_DISABLED SA_INTERRUPT
#endif
+/* linux/usb.h must be included _before_ compat.h for this code to get
+ turned on. We can not just include usb.h here, because there is a
+ lot of code which will not compile if it has usb.h included, due to
+ conflicts with symbol names. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) && defined(__LINUX_USB_H)
+#include <linux/input.h>
+/* Found in linux/usb_input.h in 2.6.13 */
+/* Moved to linux/usb/input.h in 2.6.18 */
+static inline void
+usb_to_input_id(const struct usb_device *dev, struct input_id *id)
+{
+ id->bustype = BUS_USB;
+ id->vendor = le16_to_cpu(dev->descriptor.idVendor);
+ id->product = le16_to_cpu(dev->descriptor.idProduct);
+ id->version = le16_to_cpu(dev->descriptor.bcdDevice);
+}
+#endif
+
#endif
/*
* Local variables: