diff options
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/compat.h | 97 | ||||
-rwxr-xr-x | v4l/scripts/gentree.pl | 2 | ||||
-rwxr-xr-x | v4l/scripts/make_config_compat.pl | 100 | ||||
-rwxr-xr-x | v4l/scripts/make_makefile.pl | 4 | ||||
-rwxr-xr-x | v4l/scripts/release.sh | 2 | ||||
-rw-r--r-- | v4l/versions.txt | 5 |
6 files changed, 200 insertions, 10 deletions
diff --git a/v4l/compat.h b/v4l/compat.h index 3c0c2e345..49c89ea2d 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -27,9 +27,14 @@ #include <sound/driver.h> #endif +#ifdef NEED_ALGO_CONTROL +#include <linux/i2c.h> +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) #define set_freezable() #define cancel_delayed_work_sync cancel_rearming_delayed_work +#define DEFAULT_POLLMASK (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) #endif #ifndef __pure @@ -163,7 +168,8 @@ do { \ #define put_unaligned_le64(r, a) \ put_unaligned(cpu_to_le64(r), ((u64 *)(a))) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) + +#ifdef NEED_PROC_CREATE #ifdef CONFIG_PROC_FS static inline struct proc_dir_entry *proc_create(const char *a, mode_t b, struct proc_dir_entry *c, const struct file_operations *d) @@ -215,19 +221,31 @@ static inline struct proc_dir_entry *proc_create_data(const char *a, typedef unsigned long uintptr_t; #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) -#define div64_u64(a,b) div64_64(a,b) +#ifdef NEED_IS_SINGULAR +static inline int list_is_singular(const struct list_head *head) +{ + return !list_empty(head) && (head->next == head->prev); +} +#endif +#ifdef NEED_CLAMP #define clamp( x, l, h ) max_t( __typeof__( x ), \ ( l ), \ min_t( __typeof__( x ), \ ( h ), \ ( x ) ) ) +#endif -static inline int list_is_singular(const struct list_head *head) +#ifdef NEED_ALGO_CONTROL +static inline int dummy_algo_control(struct i2c_adapter *adapter, + unsigned int cmd, unsigned long arg) { - return !list_empty(head) && (head->next == head->prev); + return 0; } +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) +#define div64_u64(a,b) div64_64(a,b) #define dev_name(dev) ((dev)->bus_id) @@ -252,10 +270,79 @@ static inline int list_is_singular(const struct list_head *head) #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) #define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) + +#define pci_ioremap_bar(pci, a) \ + ioremap_nocache(pci_resource_start(pci, a), \ + pci_resource_len(pci, a)) #endif #ifndef PCI_DEVICE_ID_MARVELL_88ALP01_CCIC #define PCI_DEVICE_ID_MARVELL_88ALP01_CCIC 0x4102 #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) +#ifdef __LINUX_USB_H +/* + * usb_endpoint_* functions + * + * Included in Linux 2.6.19 + * Backported to 2.6.18 in Red Hat Enterprise Linux 5.2 + */ + +#ifdef RHEL_RELEASE_CODE +#if RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(5, 2) +#define RHEL_HAS_USB_ENDPOINT +#endif +#endif + +#ifndef RHEL_HAS_USB_ENDPOINT +static inline int +usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) +{ + return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN; +} + +static inline int +usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd) +{ + return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == + USB_ENDPOINT_XFER_INT; +} + +static inline int +usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd) +{ + return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == + USB_ENDPOINT_XFER_ISOC; +} + +static inline int +usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd) +{ + return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == + USB_ENDPOINT_XFER_BULK; +} + +static inline int +usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd) +{ + return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd); +} +#endif /* RHEL_HAS_USB_ENDPOINT */ +#endif /* __LINUX_USB_H */ +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) +/* + * Linked list API + */ +#define list_first_entry(ptr, type, member) \ + list_entry((ptr)->next, type, member) + +/* + * uninitialized_var() macro + */ +#define uninitialized_var(x) x = x +#endif + #endif diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl index fccaedff4..1968bb334 100755 --- a/v4l/scripts/gentree.pl +++ b/v4l/scripts/gentree.pl @@ -73,6 +73,8 @@ my %defs = ( 'BUZ_USE_HIMEM' => 1, 'NEED_SOUND_DRIVER_H' => 0, 'TTUSB_KERNEL' => 1, + 'NO_PCM_LOCK' => 0, + 'NEED_ALGO_CONTROL' => 0, ); ################################################################# diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index bd34e7193..3a8bdd81e 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -102,6 +102,101 @@ sub check_bool() close INDEP; } +sub check_is_singular() +{ + my $file = "$kdir/include/linux/list.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/list_is_singular/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_IS_SINGULAR 1\n"; + } + close INNET; +} + +sub check_clamp() +{ + my $file = "$kdir/include/linux/kernel.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/define\s+clamp/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_CLAMP 1\n"; + } + close INNET; +} + +sub check_proc_create() +{ + my $file = "$kdir/include/linux/proc_fs.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/proc_create/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_PROC_CREATE 1\n"; + } + close INNET; +} + +sub check_pcm_lock() +{ + my $file = "$kdir/include/sound/pcm.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/pcm_stream_lock/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NO_PCM_LOCK 1\n"; + } + close INNET; +} + +sub check_algo_control() +{ + my $file = "$kdir/include/linux/i2c.h"; + my $need_compat = 0; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/algo_control/) { + $need_compat = 1; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_ALGO_CONTROL 1\n"; + } + close INNET; +} + sub check_other_dependencies() { check_spin_lock(); @@ -109,6 +204,11 @@ sub check_other_dependencies() check_snd_ctl_boolean_mono_info(); check_snd_pcm_rate_to_rate_bit(); check_bool(); + check_is_singular(); + check_clamp(); + check_proc_create(); + check_pcm_lock(); + check_algo_control(); } # Do the basic rules diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl index ce6f00516..43c563d47 100755 --- a/v4l/scripts/make_makefile.pl +++ b/v4l/scripts/make_makefile.pl @@ -166,10 +166,10 @@ sub removeubuntu() my $filelist; while ( my ($dir, $files) = each(%instdir) ) { - $filelist .= join(' ', keys %$files); + $filelist .= ' '. join(' ', keys %$files); } while ( my ($dir, $files) = each(%obsolete) ) { - $filelist .= join(' ', keys %$files); + $filelist .= ' ' . join(' ', keys %$files); } $filelist =~ s/\s+$//; diff --git a/v4l/scripts/release.sh b/v4l/scripts/release.sh index 4e9c810bc..5055675d6 100755 --- a/v4l/scripts/release.sh +++ b/v4l/scripts/release.sh @@ -16,7 +16,7 @@ files_common="$files_v4l $files_tuner $files_i2c doc" files_ir="ir-common.[ch]" files_audio="msp3400.[ch] tvaudio.[ch] tvmixer.[ch]" -files_bttv="bt848.h btcx*.[ch] bttv*.[ch] bt832.[ch] ir-kbd*.c" +files_bttv="bt848.h btcx*.[ch] bttv*.[ch] ir-kbd*.c" files_saa="saa7134*.[ch] saa6752hs.[ch] ir-kbd-i2c.c" files_cx="btcx*.[ch] cx*.[ch]" diff --git a/v4l/versions.txt b/v4l/versions.txt index 2b3ec7638..0393e79b0 100644 --- a/v4l/versions.txt +++ b/v4l/versions.txt @@ -4,6 +4,8 @@ [2.6.26] # Needs camera.h VIDEO_PXA27x +# Requires struct i2c_device_id +VIDEO_TVP514X [2.6.25] # Requires gpiolib @@ -16,8 +18,6 @@ SOC_CAMERA_MT9M001 VIDEO_TCM825X # This driver requires list_first_entry USB_STKWEBCAM -#Initial version for this driver -USB_VIDEO_CLASS # This driver needs div64_64 DVB_DRX397XD # Assumes struct input_dev has a dev field @@ -45,6 +45,7 @@ USB_S2255 VIDEO_USBVISION # Uses supports_autosuspend USB_MR800 +USB_DSBR # Uses remap_vmalloc_range() [2.6.18] |