From f217e9ebf0be52ccca5d5c93e6d25cfb7609e74f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 5 Mar 2009 16:19:14 -0300 Subject: zoran: auto-select bt866 for AverMedia 6 Eyes From: Mauro Carvalho Chehab AFAIK, the bt866 is only seen on AverMedia 6 Eyes. However, no module selects it. Adds a proper select for this driver. Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/zoran/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/linux/drivers/media/video/zoran/Kconfig b/linux/drivers/media/video/zoran/Kconfig index 925fb5159..fd4120e4c 100644 --- a/linux/drivers/media/video/zoran/Kconfig +++ b/linux/drivers/media/video/zoran/Kconfig @@ -68,6 +68,7 @@ config VIDEO_ZORAN_AVS6EYES tristate "AverMedia 6 Eyes support (EXPERIMENTAL)" depends on VIDEO_ZORAN_ZR36060 && EXPERIMENTAL select VIDEO_BT856 if VIDEO_HELPER_CHIPS_AUTO + select VIDEO_BT866 if VIDEO_HELPER_CHIPS_AUTO select VIDEO_KS0127 if VIDEO_HELPER_CHIPS_AUTO help Support for the AverMedia 6 Eyes video surveillance card. -- cgit v1.2.3 From 100a1887717fba257eb5ad9fd716e4aa4da7187b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 6 Mar 2009 08:06:24 -0300 Subject: Kconfig: Add some missing selects for a required frontends From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/dvb-usb/Kconfig | 1 + linux/drivers/media/video/cx23885/Kconfig | 2 ++ linux/drivers/media/video/saa7134/Kconfig | 1 + 3 files changed, 4 insertions(+) diff --git a/linux/drivers/media/dvb/dvb-usb/Kconfig b/linux/drivers/media/dvb/dvb-usb/Kconfig index bbddc9fb6..3e581409f 100644 --- a/linux/drivers/media/dvb/dvb-usb/Kconfig +++ b/linux/drivers/media/dvb/dvb-usb/Kconfig @@ -108,6 +108,7 @@ config DVB_USB_CXUSB select DVB_MT352 if !DVB_FE_CUSTOMISE select DVB_ZL10353 if !DVB_FE_CUSTOMISE select DVB_DIB7000P if !DVB_FE_CUSTOMISE + select DVB_LGS8GL5 if !DVB_FE_CUSTOMISE select DVB_TUNER_DIB0070 if !DVB_FE_CUSTOMISE select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMIZE diff --git a/linux/drivers/media/video/cx23885/Kconfig b/linux/drivers/media/video/cx23885/Kconfig index b62f16d50..bbd990ff7 100644 --- a/linux/drivers/media/video/cx23885/Kconfig +++ b/linux/drivers/media/video/cx23885/Kconfig @@ -17,6 +17,8 @@ config VIDEO_CX23885 select DVB_ZL10353 if !DVB_FE_CUSTOMISE select DVB_TDA10048 if !DVB_FE_CUSTOMIZE select DVB_LNBP21 if !DVB_FE_CUSTOMIZE + select DVB_STV6110 if !DVB_FE_CUSTOMIZE + select DVB_STV0900 if !DVB_FE_CUSTOMIZE select MEDIA_TUNER_MT2131 if !MEDIA_TUNER_CUSTOMIZE select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMIZE select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE diff --git a/linux/drivers/media/video/saa7134/Kconfig b/linux/drivers/media/video/saa7134/Kconfig index a3470ebad..e69d504ac 100644 --- a/linux/drivers/media/video/saa7134/Kconfig +++ b/linux/drivers/media/video/saa7134/Kconfig @@ -35,6 +35,7 @@ config VIDEO_SAA7134_DVB select DVB_TDA10086 if !DVB_FE_CUSTOMISE select DVB_TDA826X if !DVB_FE_CUSTOMISE select DVB_ISL6421 if !DVB_FE_CUSTOMISE + select DVB_ISL6405 if !DVB_FE_CUSTOMISE select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMIZE select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE select DVB_ZL10036 if !DVB_FE_CUSTOMISE -- cgit v1.2.3 From 3ab3e879ca4a6d8a00f98d751af7890688b4aee4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 6 Mar 2009 08:25:35 -0300 Subject: Kconfig: replace DVB_FE_CUSTOMIZE to DVB_FE_CUSTOMISE From: Mauro Carvalho Chehab The name of the option is DVB_FE_CUSTOMISE. However, on a few places, a wrong name were used, due to a typo (DVB_FE_CUSTOMIZE). Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/au0828/Kconfig | 2 +- linux/drivers/media/video/cx23885/Kconfig | 8 ++++---- linux/drivers/media/video/pvrusb2/Kconfig | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/linux/drivers/media/video/au0828/Kconfig b/linux/drivers/media/video/au0828/Kconfig index 018f72b8e..621ec043f 100644 --- a/linux/drivers/media/video/au0828/Kconfig +++ b/linux/drivers/media/video/au0828/Kconfig @@ -4,7 +4,7 @@ config VIDEO_AU0828 depends on I2C && INPUT && DVB_CORE && USB select I2C_ALGOBIT select VIDEO_TVEEPROM - select DVB_AU8522 if !DVB_FE_CUSTOMIZE + select DVB_AU8522 if !DVB_FE_CUSTOMISE select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE select MEDIA_TUNER_MXL5007T if !DVB_FE_CUSTOMIZE select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE diff --git a/linux/drivers/media/video/cx23885/Kconfig b/linux/drivers/media/video/cx23885/Kconfig index bbd990ff7..4066ca69c 100644 --- a/linux/drivers/media/video/cx23885/Kconfig +++ b/linux/drivers/media/video/cx23885/Kconfig @@ -15,10 +15,10 @@ config VIDEO_CX23885 select DVB_S5H1411 if !DVB_FE_CUSTOMISE select DVB_LGDT330X if !DVB_FE_CUSTOMISE select DVB_ZL10353 if !DVB_FE_CUSTOMISE - select DVB_TDA10048 if !DVB_FE_CUSTOMIZE - select DVB_LNBP21 if !DVB_FE_CUSTOMIZE - select DVB_STV6110 if !DVB_FE_CUSTOMIZE - select DVB_STV0900 if !DVB_FE_CUSTOMIZE + select DVB_TDA10048 if !DVB_FE_CUSTOMISE + select DVB_LNBP21 if !DVB_FE_CUSTOMISE + select DVB_STV6110 if !DVB_FE_CUSTOMISE + select DVB_STV0900 if !DVB_FE_CUSTOMISE select MEDIA_TUNER_MT2131 if !MEDIA_TUNER_CUSTOMIZE select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMIZE select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE diff --git a/linux/drivers/media/video/pvrusb2/Kconfig b/linux/drivers/media/video/pvrusb2/Kconfig index 854c2a885..7f7b05c40 100644 --- a/linux/drivers/media/video/pvrusb2/Kconfig +++ b/linux/drivers/media/video/pvrusb2/Kconfig @@ -40,7 +40,7 @@ config VIDEO_PVRUSB2_DVB select DVB_LGDT330X if !DVB_FE_CUSTOMISE select DVB_S5H1409 if !DVB_FE_CUSTOMISE select DVB_S5H1411 if !DVB_FE_CUSTOMISE - select DVB_TDA10048 if !DVB_FE_CUSTOMIZE + select DVB_TDA10048 if !DVB_FE_CUSTOMISE select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE -- cgit v1.2.3 From 706b9e26b99f3461c34fd3a397d73e0a0d60aafb Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 6 Mar 2009 08:31:39 -0300 Subject: Kconfig: only open the customise menu if selected From: Mauro Carvalho Chehab Instead of asking a lot of questions for the poor users, let's just hide the frontend customise menu, if the user doesn't want to customise. Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/frontends/Kconfig | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/linux/drivers/media/dvb/frontends/Kconfig b/linux/drivers/media/dvb/frontends/Kconfig index 4059d22a1..3205e302d 100644 --- a/linux/drivers/media/dvb/frontends/Kconfig +++ b/linux/drivers/media/dvb/frontends/Kconfig @@ -1,17 +1,21 @@ -menu "Customise DVB Frontends" - depends on DVB_CORE - config DVB_FE_CUSTOMISE bool "Customise the frontend modules to build" + depends on DVB_CORE default N help - This allows the user to deselect frontend drivers unnecessary - for their hardware from the build. Use this option with care - as deselecting frontends which are in fact necessary will result - in DVB devices which cannot be tuned due to lack of driver support. + This allows the user to select/deselect frontend drivers for their + hardware from the build. + + Use this option with care as deselecting frontends which are in fact + necessary will result in DVB devices which cannot be tuned due to lack + of driver support. If unsure say N. +if DVB_FE_CUSTOMISE + +menu "Customise DVB Frontends" + comment "Multistandard (satellite) frontends" depends on DVB_CORE @@ -507,3 +511,5 @@ config DVB_AF9013 help Say Y when you want to support this frontend. endmenu + +endif -- cgit v1.2.3 From 0f150356bedfcbfe38b12f5f70c01c3daff98ed0 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 8 Mar 2009 08:02:53 -0300 Subject: get rid of the other occurrences of DVB_FE_CUSTOMIZE typo From: Mauro Carvalho Chehab Priority: normal Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/au0828/Kconfig | 6 +++--- linux/drivers/media/video/cx23885/Kconfig | 8 ++++---- linux/drivers/media/video/pvrusb2/Kconfig | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/linux/drivers/media/video/au0828/Kconfig b/linux/drivers/media/video/au0828/Kconfig index 621ec043f..deb00e4ac 100644 --- a/linux/drivers/media/video/au0828/Kconfig +++ b/linux/drivers/media/video/au0828/Kconfig @@ -5,9 +5,9 @@ config VIDEO_AU0828 select I2C_ALGOBIT select VIDEO_TVEEPROM select DVB_AU8522 if !DVB_FE_CUSTOMISE - select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE - select MEDIA_TUNER_MXL5007T if !DVB_FE_CUSTOMIZE - select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE + select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMISE + select MEDIA_TUNER_MXL5007T if !DVB_FE_CUSTOMISE + select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMISE ---help--- This is a video4linux driver for Auvitek's USB device. diff --git a/linux/drivers/media/video/cx23885/Kconfig b/linux/drivers/media/video/cx23885/Kconfig index 4066ca69c..28896aa31 100644 --- a/linux/drivers/media/video/cx23885/Kconfig +++ b/linux/drivers/media/video/cx23885/Kconfig @@ -20,10 +20,10 @@ config VIDEO_CX23885 select DVB_STV6110 if !DVB_FE_CUSTOMISE select DVB_STV0900 if !DVB_FE_CUSTOMISE select MEDIA_TUNER_MT2131 if !MEDIA_TUNER_CUSTOMIZE - select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMIZE - select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE - select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE - select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMIZE + select MEDIA_TUNER_XC2028 if !DVB_FE_CUSTOMISE + select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMISE + select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMISE + select MEDIA_TUNER_XC5000 if !DVB_FE_CUSTOMISE ---help--- This is a video4linux driver for Conexant 23885 based TV cards. diff --git a/linux/drivers/media/video/pvrusb2/Kconfig b/linux/drivers/media/video/pvrusb2/Kconfig index 7f7b05c40..bb4271393 100644 --- a/linux/drivers/media/video/pvrusb2/Kconfig +++ b/linux/drivers/media/video/pvrusb2/Kconfig @@ -41,9 +41,9 @@ config VIDEO_PVRUSB2_DVB select DVB_S5H1409 if !DVB_FE_CUSTOMISE select DVB_S5H1411 if !DVB_FE_CUSTOMISE select DVB_TDA10048 if !DVB_FE_CUSTOMISE - select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMIZE + select MEDIA_TUNER_TDA18271 if !DVB_FE_CUSTOMISE select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE - select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMIZE + select MEDIA_TUNER_TDA8290 if !DVB_FE_CUSTOMISE ---help--- This option enables a DVB interface for the pvrusb2 driver. -- cgit v1.2.3 From 195a360c69962832e547fed5fd88bc25c8f79d84 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 8 Mar 2009 11:48:28 -0300 Subject: Add a tool to identify if the frontend selects are fine From: Mauro Carvalho Chehab Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/fix_dvb_customise.pl | 257 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100755 v4l/scripts/fix_dvb_customise.pl diff --git a/v4l/scripts/fix_dvb_customise.pl b/v4l/scripts/fix_dvb_customise.pl new file mode 100755 index 000000000..c4c9c14bd --- /dev/null +++ b/v4l/scripts/fix_dvb_customise.pl @@ -0,0 +1,257 @@ +#!/usr/bin/perl +use strict; +use warnings; +use File::Find; +use Fcntl ':mode'; + +my $debug = 0; + +my $SRC = "../linux"; +my $fname = "$SRC/drivers/media/dvb/frontends/Makefile"; + +#################### +# Get Makefile rules +# +sub get_makefile($) +{ + my $file = shift; + my %rules; + my %composite; + + open IN, $file or die "Can't find $file\n"; + while () { + # Handle line continuations + if (/\\\n$/) { + $_ .= ; + redo; + } + # Eat line continuations in string we will parse + s/\s*\\\n\s*/ /g; + + if (m/(^\s*[[\da-zA-Z-_]+)-objs\s*[\:\+]*\=\s*(.*)\n/) { + my $dep=$1; + my $file = $2; + $file =~ s/\.o / /g; + $file =~ s/\.o$//; + + if ($file eq "") { + die "broken dep on file $file for $dep\n"; + } + + $composite{$dep} = $file; + printf "MULTI: $dep = $file\n" if ($debug > 1); + } + + if (m/^\s*obj\-\$\(CONFIG_([^\)]+)\)\s*[\:\+]*\=\s*(.*)\n/) { + my $rule = $1; + my $file = $2; + + $file =~ s/\.o / /g; + $file =~ s/\.o$//; + + $rules{$rule} = $file; + printf "RULE: $rule = $file\n" if ($debug > 1); + } + } + close IN; + + return (\%rules, \%composite); +} + +########################### +# Seeks header dependencies +# +my %header_deps; + +# For a more complete check, use: +# my $hfiles = "*.c"; +my $hfiles = "av7110_av.c av7110.c av7110_ca.c av7110_hw.c av7110_ipack.c av7110_ir.c av7110_v4l.c budget-patch.c dvb_ringbuffer.c nova-t-usb2.c umt-010.c"; + +sub get_header_deps() +{ + my $file = shift; + my %rules; + my %composite; + + open IN, "gcc -I ../linux/include -I . -DCONFIG_PCI -D__LITTLE_ENDIAN -D_COMPAT_H -DKERNEL_VERSION\\(a,b,c\\) -MM $hfiles|"; + while () { + # Handle line continuations + if (/\\\n$/) { + $_ .= ; + redo; + } + # Eat line continuations in string we will parse + s/\s*\\\n\s*/ /g; + + if (m/^([^\:]+)\s*\:\s*(.*)/) { + my $dep = $1; + my $file = $2; + + $dep =~ s|.*/||; + $dep =~ s/\.o$//; + + my @files = split(/\s/, $file); + foreach my $f (@files) { + $f =~ s|.*/||; + + if (!defined($header_deps{$f})) { + $header_deps{$f} = $dep; + } else { + $header_deps{$f} .= " " . $dep; + } + + } + } + } + close IN; + + if ($debug > 1) { + print "Header deps for: "; + print "$_ " foreach %header_deps; + print "\n"; + } + +print "Header deps for av7110.h: "; +print "$_ " foreach $header_deps{"av7110.h"}; +print "\n"; +} + + +########################### +# Seeks files for Makefiles +# + +my %driver_config; + +sub parse_makefiles() +{ + my $fname = $File::Find::name; + + return if !($fname =~ m|/Makefile$|); + return if ($fname =~ m|drivers/media/dvb/frontends/|); + + + my ($refs, $mult) = get_makefile($fname); + + foreach my $ref (keys %$refs) { + my $file=$$refs{$ref}; + + my @files = split(/\s/, $file); + foreach my $f (@files) { + if (defined($$mult{$f})) { + $file .= " " . $$mult{$f}; + } + } + + $file =~ s|/||g; + + @files = split(/\s/, $file); + foreach my $f (@files) { + $driver_config{$f} = $ref; + } + if ($debug > 1) { + print "$ref = "; + print "$_ " foreach @files; + print "\n"; + } + } +} + + +######################## +# Seeks files for header +# +sub found_ref($$) +{ + my $file = shift; + my $header = shift; + my $found = 0; + my $name = $file; + $name =~ s|.*/||; + + $name =~ s/flexcop-fe-tuner.c/b2c2-flexcop/; + $name =~ s/av7110.c/av7110/; + + if (defined ($header_deps{$name})) { + $name = $header_deps{$name}; + } else { + $name =~ s/\.[ch]$//; + } + + my @files = split(/\s/, $name); + foreach my $n (@files) { + if (defined($driver_config{$n})) { + my $ref = $driver_config{$n}; + printf "$ref needs %s\n", $header; + $found = 1; + } + } + + if (!$found) { + printf "$file needs %s\n", $header; + } +} + +######################## +# Seeks files for header +# + +my %header; + +sub parse_headers() +{ + my $file = $File::Find::name; + + return if !($file =~ m/\.[ch]$/); + return if ($file =~ m|drivers/media/dvb/frontends/|); + + open IN, $file or die "Can't open $file\n"; + while () { + if (m/^\s*\#include\s+\"([^\"]+)\"/) { + if (defined($header{$1})) { + my $head = $header{$1}; + found_ref ($file, $head); + } + } + } + close IN; +} + +##### +#main + +get_header_deps(); + +my ($FEs, $mult) = get_makefile($fname); + +foreach my $fe (keys %$FEs) { + my $file=$$FEs{$fe}; + my $found = 0; + + # Special cases + $file =~ s/tda10021/tda1002x/; + $file =~ s/tda10023/tda1002x/; + $file =~ s/dib3000mb/dib3000/; + + if (defined($$mult{$file})) { + $file .= " ".$$mult{$file}; + } + + my @files = split(/\s/, $file); + foreach my $f (@files) { + if (stat("$f.h")) { + printf "$fe = $f.h\n" if ($debug); + $found = 1; + $header {"$f.h"} = $fe; + last; + } + } + + if (!$found) { + printf "$file.h ($fe) not found in $file\n"; + exit -1; + } +} + +find({wanted => \&parse_makefiles, no_chdir => 1}, $SRC); +find({wanted => \&parse_headers, no_chdir => 1}, $SRC); -- cgit v1.2.3 From 14930d48b7b561c2900d1487500bec01d090d55b Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 8 Mar 2009 12:55:29 -0300 Subject: em28xx-dvb: Remove an unused header From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/em28xx/em28xx-dvb.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/linux/drivers/media/video/em28xx/em28xx-dvb.c b/linux/drivers/media/video/em28xx/em28xx-dvb.c index c76dbc029..edafe9bde 100644 --- a/linux/drivers/media/video/em28xx/em28xx-dvb.c +++ b/linux/drivers/media/video/em28xx/em28xx-dvb.c @@ -30,9 +30,6 @@ #include "lgdt330x.h" #include "zl10353.h" #include "s5h1409.h" -#ifdef EM28XX_DRX397XD_SUPPORT -#include "drx397xD.h" -#endif MODULE_DESCRIPTION("driver for em28xx based DVB cards"); MODULE_AUTHOR("Mauro Carvalho Chehab "); -- cgit v1.2.3 From fc6175ddf0ccad7f5281c08b4981e8a5f26b11f7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 8 Mar 2009 13:10:43 -0300 Subject: Improve script to automatically adjust the Kconfig files From: Mauro Carvalho Chehab There are still some more hacking to do, in order to use this automatically, since more logic is needed for dibcom and av7110 stuff. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/fix_dvb_customise.pl | 89 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 83 insertions(+), 6 deletions(-) diff --git a/v4l/scripts/fix_dvb_customise.pl b/v4l/scripts/fix_dvb_customise.pl index c4c9c14bd..86a6bcf8c 100755 --- a/v4l/scripts/fix_dvb_customise.pl +++ b/v4l/scripts/fix_dvb_customise.pl @@ -110,10 +110,6 @@ sub get_header_deps() print "$_ " foreach %header_deps; print "\n"; } - -print "Header deps for av7110.h: "; -print "$_ " foreach $header_deps{"av7110.h"}; -print "\n"; } @@ -161,6 +157,8 @@ sub parse_makefiles() ######################## # Seeks files for header # +my %select; + sub found_ref($$) { my $file = shift; @@ -170,7 +168,7 @@ sub found_ref($$) $name =~ s|.*/||; $name =~ s/flexcop-fe-tuner.c/b2c2-flexcop/; - $name =~ s/av7110.c/av7110/; + $name =~ s/av7110.c/av7110.h/; if (defined ($header_deps{$name})) { $name = $header_deps{$name}; @@ -182,7 +180,17 @@ sub found_ref($$) foreach my $n (@files) { if (defined($driver_config{$n})) { my $ref = $driver_config{$n}; - printf "$ref needs %s\n", $header; + printf "$ref needs %s\n", $header if ($debug); + + if ($ref =~ m/(PVRUSB2|CX23885|CX88|EM28XX|SAA3134)/) { + $ref .="_DVB"; + } + + if (!defined($select{$ref})) { + $select{$ref} = $header; + } else { + $select{$ref} .= " " . $header; + } $found = 1; } } @@ -217,6 +225,74 @@ sub parse_headers() close IN; } +######################## +# Rewrite Kconfig's +# + +sub parse_kconfigs() +{ + my $file = $File::Find::name; + my $conf; + my $out = ""; + my $tmp = ""; + my $all_sels; + + return if !($file =~ m/Kconfig$/); + return if ($file =~ m|drivers/media/dvb/frontends/|); + + open IN, $file or die "Can't open $file\n"; + while () { + if (m/^config\s([A-Za-z_\-\d]+)/) { + $out .= $tmp; + if (defined($select{$1})) { + $conf = $select{$1}; + $all_sels = " ". $conf. " "; + $tmp = $_; + + printf "$file: rewriting headers for $1. It should select: %s\n", $all_sels if ($debug); + } else { + $conf = ""; + $out .= $_; + $tmp = ""; + } + next; + } + if (!$conf) { + $out .= $_; + next; + } + + if (m/^\s*select\s+([A-Za-z_\-\d]+)/) { + my $op = $1; + + if (!$all_sels =~ m/\s($op)\s/) { + # Drops line + printf "$file: droppingg line $_\n"; + + next; + } else { + $all_sels =~ s/\s($op)\s/ /; + } + } + if (m/^[\s\-]*help/) { + my @sel = split(/\s/, $all_sels); + foreach my $s (@sel) { + if ($s ne "") { + printf "$file: Adding select for $s\n"; + $tmp .= "\tselect $s if !DVB_FE_CUSTOMISE\n"; + } + } + } + $tmp .= $_; + } + close IN; + + $out .=$tmp; + open OUT, ">$file" or die "Can't open $file\n"; + print OUT $out; + close OUT; +} + ##### #main @@ -255,3 +331,4 @@ foreach my $fe (keys %$FEs) { find({wanted => \&parse_makefiles, no_chdir => 1}, $SRC); find({wanted => \&parse_headers, no_chdir => 1}, $SRC); +find({wanted => \&parse_kconfigs, no_chdir => 1}, $SRC); -- cgit v1.2.3 From 33fa4d14a6a7b604b8fc146401a102a08dfce1be Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 8 Mar 2009 13:11:31 -0300 Subject: Adds some missing frontend select for saa7134 and dvb-usb From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/dvb-usb/Kconfig | 1 + linux/drivers/media/video/saa7134/Kconfig | 2 ++ 2 files changed, 3 insertions(+) diff --git a/linux/drivers/media/dvb/dvb-usb/Kconfig b/linux/drivers/media/dvb/dvb-usb/Kconfig index 3e581409f..3763a9c68 100644 --- a/linux/drivers/media/dvb/dvb-usb/Kconfig +++ b/linux/drivers/media/dvb/dvb-usb/Kconfig @@ -96,6 +96,7 @@ config DVB_USB_UMT_010 select DVB_PLL if !DVB_FE_CUSTOMISE select DVB_DIB3000MC select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMIZE + select DVB_MT352 if !DVB_FE_CUSTOMISE help Say Y here to support the HanfTek UMT-010 USB2.0 stick-sized DVB-T receiver. diff --git a/linux/drivers/media/video/saa7134/Kconfig b/linux/drivers/media/video/saa7134/Kconfig index e69d504ac..51f17c82b 100644 --- a/linux/drivers/media/video/saa7134/Kconfig +++ b/linux/drivers/media/video/saa7134/Kconfig @@ -40,6 +40,8 @@ config VIDEO_SAA7134_DVB select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMIZE select DVB_ZL10036 if !DVB_FE_CUSTOMISE select DVB_MT312 if !DVB_FE_CUSTOMISE + select DVB_LNBP21 if !DVB_FE_CUSTOMISE + select DVB_ZL10353 if !DVB_FE_CUSTOMISE ---help--- This adds support for DVB cards based on the Philips saa7134 chip. -- cgit v1.2.3 From 2168a4a14827fc1411174452333f19456cf0ae2a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 28 Feb 2009 14:35:48 +0100 Subject: saa7146: Clean-up i2c error handling From: Oliver Endriss saa7146: Clean-up i2c error handling Simplify i2c error handling and fix incorrect handling of address errors in poll mode. Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/common/saa7146_i2c.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index 68674799b..fa9d4f90a 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -294,7 +294,6 @@ static int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *m int i = 0, count = 0; __le32 *buffer = dev->d_i2c.cpu_addr; int err = 0; - int address_err = 0; int short_delay = 0; if (mutex_lock_interruptible(&dev->i2c_lock)) @@ -334,17 +333,10 @@ static int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *m i2c address probing, however, and address errors indicate that a device is really *not* there. retrying in that case increases the time the device needs to probe greatly, so - it should be avoided. because of the fact, that only - analog based cards use irq based i2c transactions (for dvb - cards, this screwes up other interrupt sources), we bail out - completely for analog cards after an address error and trust - the saa7146 address error detection. */ - if ( -EREMOTEIO == err ) { - if( 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) { - goto out; - } - address_err++; - } + it should be avoided. So we bail out in irq mode after an + address error and trust the saa7146 address error detection. */ + if (-EREMOTEIO == err && 0 != (SAA7146_USE_I2C_IRQ & dev->ext->flags)) + goto out; DEB_I2C(("error while sending message(s). starting again.\n")); break; } @@ -359,10 +351,9 @@ static int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *m } while (err != num && retries--); - /* if every retry had an address error, exit right away */ - if (address_err == retries) { + /* quit if any error occurred */ + if (err != num) goto out; - } /* if any things had to be read, get the results */ if ( 0 != saa7146_i2c_msg_cleanup(msgs, num, buffer)) { -- cgit v1.2.3 From a6d47ce7fbcc080d77c8f2032febc2a39aca13fa Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Thu, 5 Mar 2009 02:52:00 -0800 Subject: compat: Add INIT_DELAYED_WORK From: Trent Piepho Turn it into INIT_WORK for pre 2.6.20. Priority: normal Signed-off-by: Trent Piepho --- v4l/compat.h | 1 + 1 file changed, 1 insertion(+) diff --git a/v4l/compat.h b/v4l/compat.h index 3df844c87..44878ce73 100644 --- a/v4l/compat.h +++ b/v4l/compat.h @@ -11,6 +11,7 @@ * delayed_work in the same context as something named work_struct. */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) #define delayed_work work_struct +#define INIT_DELAYED_WORK(a,b,c) INIT_WORK(a,b,c) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) -- cgit v1.2.3 From 798185861c11b8c26c0494e459d1b7811d2c228e Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Thu, 5 Mar 2009 03:02:05 -0800 Subject: zoran: Change first argument to zoran_v4l2_buffer_status From: Trent Piepho It was a struct file *, but all that function wants is the struct zoran_fh from the file's private data. Since every caller already has this, just pass the zoran_fh instead. Priority: normal Signed-off-by: Trent Piepho --- linux/drivers/media/video/zoran/zoran_driver.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/linux/drivers/media/video/zoran/zoran_driver.c b/linux/drivers/media/video/zoran/zoran_driver.c index 8eda83b06..1560c1e4c 100644 --- a/linux/drivers/media/video/zoran/zoran_driver.c +++ b/linux/drivers/media/video/zoran/zoran_driver.c @@ -1378,11 +1378,10 @@ setup_overlay (struct file *file, /* get the status of a buffer in the clients buffer queue */ static int -zoran_v4l2_buffer_status (struct file *file, +zoran_v4l2_buffer_status (struct zoran_fh *fh, struct v4l2_buffer *buf, int num) { - struct zoran_fh *fh = file->private_data; struct zoran *zr = fh->zr; buf->flags = V4L2_BUF_FLAG_MAPPED; @@ -2502,7 +2501,7 @@ static int zoran_querybuf(struct file *file, void *__fh, struct v4l2_buffer *buf int res; mutex_lock(&zr->resource_lock); - res = zoran_v4l2_buffer_status(file, buf, buf->index); + res = zoran_v4l2_buffer_status(fh, buf, buf->index); mutex_unlock(&zr->resource_lock); return res; @@ -2603,7 +2602,7 @@ static int zoran_dqbuf(struct file *file, void *__fh, struct v4l2_buffer *buf) if (res) goto dqbuf_unlock_and_return; zr->v4l_sync_tail++; - res = zoran_v4l2_buffer_status(file, buf, num); + res = zoran_v4l2_buffer_status(fh, buf, num); break; case ZORAN_MAP_MODE_JPG_REC: @@ -2634,7 +2633,7 @@ static int zoran_dqbuf(struct file *file, void *__fh, struct v4l2_buffer *buf) res = jpg_sync(file, &bs); if (res) goto dqbuf_unlock_and_return; - res = zoran_v4l2_buffer_status(file, buf, bs.frame); + res = zoran_v4l2_buffer_status(fh, buf, bs.frame); break; } -- cgit v1.2.3 From 40cc0407e9304bb9c4c9ea77dc05093a34e9bb55 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 8 Mar 2009 14:30:54 -0300 Subject: Kconfig workaround: enable FE_CUSTOMISE by default From: Mauro Carvalho Chehab Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_kconfig.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index 144325c34..a09c72fb3 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -585,7 +585,7 @@ close OUT; # These options should default to off disable_config('DVB_AV7110_FIRMWARE'); disable_config('DVB_CINERGYT2_TUNING'); -disable_config('DVB_FE_CUSTOMISE'); +#disable_config('DVB_FE_CUSTOMISE'); disable_config('VIDEO_HELPER_CHIPS_AUTO'); disable_config('VIDEO_FIXED_MINOR_RANGES'); -- cgit v1.2.3 From 1bd1aedc7af71728404f5d7b059dd8ca52d01f9f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 8 Mar 2009 14:39:42 -0300 Subject: get rid of disabling DVB_FE_CUSTOMISE on kconfig From: Mauro Carvalho Chehab Since make allmodconfig enables all DVB options, DVB_FE_CUSTOMISE is needed, otherwise the building system gots confused. Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_kconfig.pl | 1 - 1 file changed, 1 deletion(-) diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl index a09c72fb3..57c663c00 100755 --- a/v4l/scripts/make_kconfig.pl +++ b/v4l/scripts/make_kconfig.pl @@ -585,7 +585,6 @@ close OUT; # These options should default to off disable_config('DVB_AV7110_FIRMWARE'); disable_config('DVB_CINERGYT2_TUNING'); -#disable_config('DVB_FE_CUSTOMISE'); disable_config('VIDEO_HELPER_CHIPS_AUTO'); disable_config('VIDEO_FIXED_MINOR_RANGES'); -- cgit v1.2.3 From 78a6eb45bbd3dfed11a9ac8287a6060464eba7ba Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 8 Mar 2009 23:01:08 -0300 Subject: dvb/frontends: fix duplicate 'debug' symbol From: Randy Dunlap Fix dvb frontend debug variable to be static, to avoid linker errors: drivers/built-in.o:(.data+0xf4b0): multiple definition of `debug' arch/x86/kernel/built-in.o:(.kprobes.text+0x90): first defined here ld: Warning: size of symbol `debug' changed from 85 in arch/x86/kernel/built-in.o to 4 in drivers/built-in.o It would also be Good if arch/x86/kernel/entry_32.S didn't have a non-static 'debug' symbol. OTOH, it helps catch things like this one. Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/frontends/stv0900_core.c | 4 ++-- linux/drivers/media/dvb/frontends/stv0900_priv.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux/drivers/media/dvb/frontends/stv0900_core.c b/linux/drivers/media/dvb/frontends/stv0900_core.c index c86c3017e..9ff9744a1 100644 --- a/linux/drivers/media/dvb/frontends/stv0900_core.c +++ b/linux/drivers/media/dvb/frontends/stv0900_core.c @@ -34,8 +34,8 @@ #include "stv0900_priv.h" #include "stv0900_init.h" -int debug = 1; -module_param(debug, int, 0644); +static int stvdebug = 1; +module_param_named(debug, stvdebug, int, 0644); /* internal params node */ struct stv0900_inode { diff --git a/linux/drivers/media/dvb/frontends/stv0900_priv.h b/linux/drivers/media/dvb/frontends/stv0900_priv.h index 28350fbeb..762d5af62 100644 --- a/linux/drivers/media/dvb/frontends/stv0900_priv.h +++ b/linux/drivers/media/dvb/frontends/stv0900_priv.h @@ -62,11 +62,11 @@ #define dmd_choose(a, b) (demod = STV0900_DEMOD_2 ? b : a)) -extern int debug; +static int stvdebug; #define dprintk(args...) \ do { \ - if (debug) \ + if (stvdebug) \ printk(KERN_DEBUG args); \ } while (0) -- cgit v1.2.3