diff options
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/Makefile | 4 | ||||
-rw-r--r-- | v4l/compat.h | 49 | ||||
-rw-r--r-- | v4l/versions.txt | 9 |
3 files changed, 44 insertions, 18 deletions
diff --git a/v4l/Makefile b/v4l/Makefile index b07b592b1..f08143def 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -102,8 +102,12 @@ EXTRA_CFLAGS += -g EXTRA_CFLAGS += $(if $(wildcard $(srctree)/.mm), -DMM_KERNEL) +# Make sure kernel's options are overridden by v4l-dvb options EXTRA_CFLAGS += -include $(obj)/config-compat.h +# Allow kernel version compat tests without adding #include's +EXTRA_CFLAGS += -include linux/version.h + ################################################# # Kernel 2.4/2.6 specific rules diff --git a/v4l/compat.h b/v4l/compat.h index 6ba49e825..2b2de93a7 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -5,23 +5,14 @@ #ifndef _COMPAT_H #define _COMPAT_H -#include <linux/i2c-id.h> -#include <linux/pm.h> -#include <linux/version.h> -#include <linux/utsname.h> -#include <linux/sched.h> - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18) # define minor(x) MINOR(x) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#include <linux/delay.h> +# include <linux/delay.h> # define need_resched() (current->need_resched) - -#define work_struct tq_struct -#else -#include <linux/device.h> +# define work_struct tq_struct #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19) @@ -58,6 +49,10 @@ # define PCI_D0 (0) # define assert_spin_locked(foobar) #endif + +/* Since v4l-dvb now includes it's own copy of linux/i2c-id.h these + are no longer necessary */ +/* #if !defined(I2C_ALGO_SAA7134) #define I2C_ALGO_SAA7134 I2C_HW_B_BT848 #endif @@ -70,15 +65,21 @@ #if !defined(I2C_HW_SAA7146) # define I2C_HW_SAA7146 I2C_ALGO_SAA7146 #endif - #if !defined(I2C_HW_B_EM2820) #define I2C_HW_B_EM2820 0x99 #endif +*/ #ifndef I2C_M_IGNORE_NAK # define I2C_M_IGNORE_NAK 0x1000 #endif +/* v4l-dvb uses an out of kernel copy of i2c-id.h, which does not have + some stuff that previous versions of i2c-id.h defined. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) && defined(LINUX_I2C_ID_H) +# define I2C_ALGO_BIT 0x010000 +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) #define __le32 __u32 #endif @@ -223,6 +224,16 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr) #endif +/* vm_insert_page() was added in 2.6.15 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) && defined(_LINUX_MM_H) +static inline int vm_insert_page(struct vm_area_struct *vma, + unsigned long addr, struct page *page) +{ + return remap_pfn_range(vma, addr, page_to_pfn(page), PAGE_SIZE, + vma->vm_page_prot); +} +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) #ifndef kcalloc #define kcalloc(n,size,flags) \ @@ -236,6 +247,15 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr) #endif #endif +/* try_to_freeze() lost its argument. Must appear after linux/sched.h */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) && defined(_LINUX_SCHED_H) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) +# define try_to_freeze() try_to_freeze(PF_FREEZE) +# else +# define try_to_freeze() (0) +# endif +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) #ifndef kzalloc #define kzalloc(size, flags) \ @@ -282,7 +302,7 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr) #define mutex_trylock(a) down_trylock(a) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) && defined(_LINUX_SCHED_H) static inline signed long __sched schedule_timeout_interruptible(signed long timeout) { @@ -318,7 +338,8 @@ static inline void setup_timer(struct timer_list * timer, 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) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) && \ + defined(__LINUX_USB_H) && defined(_INPUT_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 */ diff --git a/v4l/versions.txt b/v4l/versions.txt index e30a74e85..f29387417 100644 --- a/v4l/versions.txt +++ b/v4l/versions.txt @@ -36,13 +36,9 @@ TUNER_3036 # Changes to usb_input.h, struct input_dev [2.6.15] -USB_KONICAWC -USB_QUICKCAM_MESSENGER # Uses vm_insert_page() [2.6.15] -USB_ZC0301 -USB_ET61X251 [2.6.12] VIDEO_VIVI @@ -215,3 +211,8 @@ RADIO_ZOLTRIX USB_SN9C102 VIDEO_SAA7110 SOUND_ACI_MIXER +USB_KONICAWC +USB_QUICKCAM_MESSENGER +USB_ZC0301 +USB_ET61X251 +USB_ZR364XX |