From 564d21054d1f61d9448a93b3fa8a254a29713d26 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 25 Nov 2008 09:07:00 -0200 Subject: fix boards for kernels with algo_control From: Mauro Carvalho Chehab changeset 4ecae6da8244 removed algo_control from i2c drivers. However, on older kernels, a dummy function to implement algo_control is required, otherwise, an OOPS is generated. This patch adds a backport for all i2c drivers that defines an i2c_algorithm, except for cafe_ccic, since OLPC hardware only works for kernels newer than 2.6.19. Some of the backported drivers would need also extra changes to work with older kernels, as specified on v4l/versions.txt. Yet, I decided to add the backport for those drivers also, since the lack of algo_control doesn't generate any compilation error, but it is enough to break the driver. So, better to all for all boards than to allow compiling a kernel backported that just generates OOPS. Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/gentree.pl | 1 + v4l/scripts/make_config_compat.pl | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) (limited to 'v4l/scripts') diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl index d84608aa1..1968bb334 100755 --- a/v4l/scripts/gentree.pl +++ b/v4l/scripts/gentree.pl @@ -74,6 +74,7 @@ my %defs = ( '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 3aac7e3b3..3a8bdd81e 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -178,6 +178,25 @@ sub check_pcm_lock() 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 () { + 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(); @@ -189,6 +208,7 @@ sub check_other_dependencies() check_clamp(); check_proc_create(); check_pcm_lock(); + check_algo_control(); } # Do the basic rules -- cgit v1.2.3