diff options
Diffstat (limited to 'v4l/compat.h')
-rw-r--r-- | v4l/compat.h | 18 |
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: |