diff options
-rw-r--r-- | v4l/Makefile | 4 | ||||
-rw-r--r-- | v4l/compat.h | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/v4l/Makefile b/v4l/Makefile index 2080aa29e..75e9c50ef 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -157,6 +157,10 @@ CC += -I$(obj) ifeq ($(VERSION).$(PATCHLEVEL),2.6) CPPFLAGS := -I$(SUBDIRS)/../linux/include $(CPPFLAGS) -I$(SUBDIRS)/ + + # Needed for kernel 2.6.24 or upper + KBUILD_CPPFLAGS := -I$(SUBDIRS)/../linux/include $(KBUILD_CPPFLAGS) -I$(SUBDIRS)/ + MYCFLAGS := else MYCFLAGS := CFLAGS="-I../linux/include -D__KERNEL__ -I$(KDIR)/include -DEXPORT_SYMTAB" diff --git a/v4l/compat.h b/v4l/compat.h index ec43d8630..8df5afe2c 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -9,6 +9,11 @@ #define KERN_CONT "" #endif +/* To allow I2C compatibility code to work */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +#include <linux/i2c-dev.h> +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) # define set_freezable() #endif @@ -466,11 +471,9 @@ static inline unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate) } #endif -#ifndef task_pid_nr +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) # define task_pid_nr(current) ((current)->pid) -#endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) # define sg_init_table(a,b) # define sg_page(p) (sg->page) # define sg_set_page(sglist,pg,sz,off) \ |