diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-21 15:09:45 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-21 15:09:45 -0300 |
commit | 0b8face2f09a06c0608472c22fe5a704b6dc4c0e (patch) | |
tree | 39d774e364a86e831312c1568cd8438afcd773c8 /v4l | |
parent | 04ef26ec109fff2b6d310da4dabdafc4135ad058 (diff) | |
parent | 85a3fd2b44d6162a4288a264537c287adf79b4f9 (diff) | |
download | mediapointer-dvb-s2-0b8face2f09a06c0608472c22fe5a704b6dc4c0e.tar.gz mediapointer-dvb-s2-0b8face2f09a06c0608472c22fe5a704b6dc4c0e.tar.bz2 |
merge: http://kernellabs.com/hg/~mkrufky/bug-fix
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'v4l')
-rw-r--r-- | v4l/compat.h | 22 | ||||
-rw-r--r--[-rwxr-xr-x] | v4l/scripts/gentree.pl | 16 | ||||
-rwxr-xr-x | v4l/scripts/make_config_compat.pl | 46 | ||||
-rw-r--r-- | v4l/versions.txt | 5 |
4 files changed, 68 insertions, 21 deletions
diff --git a/v4l/compat.h b/v4l/compat.h index 6a40e2a33..6b3504706 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -283,10 +283,14 @@ static inline int dummy_algo_control(struct i2c_adapter *adapter, }) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28) +#ifdef NEED_SND_BUG_ON #define snd_BUG_ON(cond) WARN((cond), "BUG? (%s)\n", __stringify(cond)) #endif +#ifdef NEED_BITOPS +#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) +#endif + #ifndef PCI_DEVICE_ID_MARVELL_88ALP01_CCIC #define PCI_DEVICE_ID_MARVELL_88ALP01_CCIC 0x4102 #endif @@ -454,4 +458,20 @@ static inline int snd_card_create(int idx, const char *id, #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) #endif +/* __fls() was added for generic code in 2.6.29, existed for just 64-bit arches + * since 2.6.26 (v2.6.25-5228-g56a6b1e), and was x86-64 only before then. We + * only want this compat code when __fls doesn't exist, which 2.6.29 or later, + * non x86-64, and non 64-bit that's 2.6.26 or later. */ +#if !(LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) || \ + defined(__x86_64__) || \ + (BITS_PER_LONG == 64 && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26))) +/* This define will prevent breakage if __fls was already defined. */ +#undef __fls +#define __fls v4l_compat_fls +static inline unsigned long v4l_compat_fls(unsigned long x) +{ + return fls(x) - 1; +} +#endif + #endif /* _COMPAT_H */ diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl index 1968bb334..b9053f464 100755..100644 --- a/v4l/scripts/gentree.pl +++ b/v4l/scripts/gentree.pl @@ -22,8 +22,8 @@ # If gentree knows the result of an expression, that directive will be # "processed", otherwise it will be an "other". gentree knows the value # of LINUX_VERSION_CODE, BTTV_VERSION_CODE, the KERNEL_VERSION(x,y,z) -# macro, numeric constants like 0 and 1, and a few defines like MM_KERNEL -# and STV0297_CS2. +# macro, numeric constants like 0 and 1, and a few defines like +# I2C_CLASS_TV_DIGITAL # # An exception is if the comment "/*KEEP*/" appears after the expression, # in which case that directive will be considered an "other" and not @@ -55,22 +55,10 @@ my %defs = ( 'LINUX_VERSION_CODE' => $LINUXCODE, 'BTTV_VERSION_CODE' => $BTTVCODE, '_COMPAT_H' => 0, - 'MM_KERNEL' => ($extra =~ /-mm/)?1:0, - 'BROKEN_XAWTV' => 0, - 'STV0297_CS2' => 0, - 'HAVE_VIDEO_BUF_DVB' => 1, - 'I2C_PEC' => 1, - 'I2C_DF_DUMMY' => 0, - 'CONFIG_XC3028' => 0, - 'HAVE_XC2028'=> 0, - 'HAVE_XC3028' => 0, 'I2C_CLASS_TV_ANALOG' => 1, 'I2C_CLASS_TV_DIGITAL' => 1, 'OLD_XMIT_LOCK' => 0, 'COMPAT_SND_CTL_BOOLEAN_MONO' => 0, - 'CONFIG_VIVI_SCATTER' => 0, - 'CONFIG_BIGPHYS_AREA' => 0, - 'BUZ_USE_HIMEM' => 1, 'NEED_SOUND_DRIVER_H' => 0, 'TTUSB_KERNEL' => 1, 'NO_PCM_LOCK' => 0, diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 3c2b623ca..7c7841459 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -280,9 +280,7 @@ sub check_snd_card_create() sub check_poll_schedule() { - - - my @files = ( "$kdir//include/linux/poll.h" ); + my @files = ( "$kdir/include/linux/poll.h" ); foreach my $file ( @files ) { open IN, "<$file" or die "File not found: $file"; @@ -300,6 +298,46 @@ sub check_poll_schedule() $out.= "\n#define NEED_POLL_SCHEDULE 1\n"; } +sub check_snd_BUG_ON() +{ + my @files = ( "$kdir/include/sound/core.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or die "File not found: $file"; + while (<IN>) { + if (m/snd_BUG_ON/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_SND_BUG_ON 1\n"; +} + +sub check_bitops() +{ + my @files = ( "$kdir/include/linux/bitops.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + while (<IN>) { + if (m/#define\s+BIT\(/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_BITOPS 1\n"; +} + sub check_other_dependencies() { check_spin_lock(); @@ -317,6 +355,8 @@ sub check_other_dependencies() check_pci_ioremap_bar(); check_snd_card_create(); check_poll_schedule(); + check_snd_BUG_ON(); + check_bitops(); } # Do the basic rules diff --git a/v4l/versions.txt b/v4l/versions.txt index eb206b520..7e8e2fa6e 100644 --- a/v4l/versions.txt +++ b/v4l/versions.txt @@ -5,14 +5,13 @@ # Needs defines that are only available from 2.6.29 VIDEO_PXA27x -[2.6.28] -USB_STV06XX - [2.6.26] # Requires struct i2c_device_id VIDEO_TVP514X # requires id_table and new i2c stuff RADIO_TEA5764 +VIDEO_THS7303 +VIDEO_ADV7343 [2.6.25] # Requires gpiolib |