diff options
-rw-r--r-- | linux/drivers/media/dvb/frontends/af9013.c | 1 | ||||
-rw-r--r-- | linux/drivers/media/video/mt9t031.c | 8 | ||||
-rw-r--r-- | linux/drivers/media/video/tw9910.c | 8 | ||||
-rw-r--r-- | v4l/compat.h | 61 |
4 files changed, 76 insertions, 2 deletions
diff --git a/linux/drivers/media/dvb/frontends/af9013.c b/linux/drivers/media/dvb/frontends/af9013.c index b2b50fb4c..937715a96 100644 --- a/linux/drivers/media/dvb/frontends/af9013.c +++ b/linux/drivers/media/dvb/frontends/af9013.c @@ -33,6 +33,7 @@ #include "dvb_frontend.h" #include "af9013_priv.h" #include "af9013.h" +#include "compat.h" int af9013_debug; diff --git a/linux/drivers/media/video/mt9t031.c b/linux/drivers/media/video/mt9t031.c index 349d8e365..dd5bd9dd0 100644 --- a/linux/drivers/media/video/mt9t031.c +++ b/linux/drivers/media/video/mt9t031.c @@ -632,8 +632,12 @@ static void mt9t031_video_remove(struct soc_camera_device *icd) soc_camera_video_stop(icd); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) +static int mt9t031_probe(struct i2c_client *client) +#else static int mt9t031_probe(struct i2c_client *client, const struct i2c_device_id *did) +#endif { struct mt9t031 *mt9t031; struct soc_camera_device *icd; @@ -703,19 +707,23 @@ static int mt9t031_remove(struct i2c_client *client) return 0; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) static const struct i2c_device_id mt9t031_id[] = { { "mt9t031", 0 }, { } }; MODULE_DEVICE_TABLE(i2c, mt9t031_id); +#endif static struct i2c_driver mt9t031_i2c_driver = { .driver = { .name = "mt9t031", }, .probe = mt9t031_probe, .remove = mt9t031_remove, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) .id_table = mt9t031_id, +#endif }; static int __init mt9t031_mod_init(void) diff --git a/linux/drivers/media/video/tw9910.c b/linux/drivers/media/video/tw9910.c index 52c0357fa..c670b23a1 100644 --- a/linux/drivers/media/video/tw9910.c +++ b/linux/drivers/media/video/tw9910.c @@ -837,8 +837,12 @@ static struct soc_camera_ops tw9910_ops = { * i2c_driver function */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) +static int tw9910_probe(struct i2c_client *client) +#else static int tw9910_probe(struct i2c_client *client, const struct i2c_device_id *did) +#endif { struct tw9910_priv *priv; @@ -915,19 +919,23 @@ static int tw9910_remove(struct i2c_client *client) return 0; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) static const struct i2c_device_id tw9910_id[] = { { "tw9910", 0 }, { } }; MODULE_DEVICE_TABLE(i2c, tw9910_id); +#endif static struct i2c_driver tw9910_i2c_driver = { .driver = { .name = "tw9910", }, .probe = tw9910_probe, .remove = tw9910_remove, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) .id_table = tw9910_id, +#endif }; /* diff --git a/v4l/compat.h b/v4l/compat.h index 200c21458..c2b805cec 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -280,8 +280,8 @@ static inline int dummy_algo_control(struct i2c_adapter *adapter, #define PCI_DEVICE_ID_MARVELL_88ALP01_CCIC 0x4102 #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) #ifdef __LINUX_USB_H +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) /* * usb_endpoint_* functions * @@ -328,10 +328,67 @@ usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) { return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd); } + +static inline int usb_endpoint_dir_out( + const struct usb_endpoint_descriptor *epd) +{ + return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); +} + +static inline int usb_endpoint_is_bulk_in( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); +} + +static inline int usb_endpoint_is_bulk_out( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); +} + +static inline int usb_endpoint_is_int_out( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); +} + +static inline int usb_endpoint_is_isoc_in( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); +} + +static inline int usb_endpoint_is_isoc_out( + const struct usb_endpoint_descriptor *epd) +{ + return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); +} #endif /* RHEL_HAS_USB_ENDPOINT */ -#endif /* __LINUX_USB_H */ #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) +static inline int usb_endpoint_xfer_control( + const struct usb_endpoint_descriptor *epd) +{ + return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == + USB_ENDPOINT_XFER_CONTROL); +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd) +{ + return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; +} + +static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd) +{ + return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; +} +#endif +#endif /* __LINUX_USB_H */ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) /* * Linked list API |