diff options
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-x | v4l/scripts/cardlist | 2 | ||||
-rwxr-xr-x | v4l/scripts/cx23885.pl | 57 | ||||
-rwxr-xr-x | v4l/scripts/hghead.pl | 26 |
3 files changed, 75 insertions, 10 deletions
diff --git a/v4l/scripts/cardlist b/v4l/scripts/cardlist index 0225d6ebd..0f25a4b81 100755 --- a/v4l/scripts/cardlist +++ b/v4l/scripts/cardlist @@ -18,3 +18,5 @@ scripts/saa7134.pl ../linux/drivers/media/video/saa7134/saa7134.h ../linux/drive scripts/usbvision.pl ../linux/drivers/media/video/usbvision/usbvision-cards.h ../linux/drivers/media/video/usbvision/usbvision-cards.c \ | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.usbvision +scripts/cx23885.pl ../linux/drivers/media/video/cx23885/cx23885.h ../linux/drivers/media/video/cx23885/cx23885-cards.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.cx23885 diff --git a/v4l/scripts/cx23885.pl b/v4l/scripts/cx23885.pl new file mode 100755 index 000000000..4b3c57c86 --- /dev/null +++ b/v4l/scripts/cx23885.pl @@ -0,0 +1,57 @@ +#!/usr/bin/perl -w +use strict; + +my %map = ( + "PCI_ANY_ID" => "0", +); + +sub fix_id($) { + my $id = shift; + $id = $map{$id} if defined($map{$id}); + $id =~ s/^0x//; + return $id; +} + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +while (<>) { + # defines in header file + if (/#define\s+(CX23885_BOARD_\w+)\s+(\d+)/) { + $data{$1}->{nr} = $2; + next; + } + # cx88_boards + if (/\[(CX23885_BOARD_\w+)\]/) { + $id = $1; + $data{$id}->{id} = $id; +# $data{$id}->{nr} = $nr++; + }; + next unless defined($id); + + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/); + } + + # cx88_pci_tbl + $subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/); + $subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/); + if (/.card\s*=\s*(\w+),/) { + if (defined($data{$1}) && + defined($subvendor) && $subvendor ne "0" && + defined($subdevice) && $subdevice ne "0") { + push @{$data{$1}->{subid}}, "$subvendor:$subdevice"; + undef $subvendor; + undef $subdevice; + } + } +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-51s", $data{$item}->{nr}, $data{$item}->{name}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl index dd4cedee6..7b3f3106d 100755 --- a/v4l/scripts/hghead.pl +++ b/v4l/scripts/hghead.pl @@ -47,15 +47,22 @@ while ($line = <IN>) { if ($line =~ m/^Date:\s*(.*)/) { my $time = str2time($1); -# my $timestr = gmtime($time); if ($time) { - print "# Date: $time\n"; + print "#Date: $1\n"; } next; } - if ($line =~ m/^From:/) { - if ($line =~ m/^From:[\s\"]*([^\"]*)[\s\"]*<(.*)>/) { + + my $tag=$line; + my $arg=$line; + $tag =~ s/\s*([^\s]+:)(.*)\n/\1/; + $arg =~ s/\s*([^\s]+:)(.*)\n/\2/; + + $tag =~ tr/A-Z/a-z/; + + if ($tag =~ m/^from:/) { + if ($arg =~ m/^[\s\"]*([^\"]*)[\s\"]*<(.*)>/) { if ($1 eq "") { next; } @@ -75,8 +82,8 @@ while ($line = <IN>) { die; } - if ($line =~ m/^Subject:\s*(.*\n)/) { - $subject=$1; + if ($tag =~ m/^subject:/) { + $subject="$arg\n"; next; } @@ -87,7 +94,7 @@ while ($line = <IN>) { next; } - if ($line =~ m/^Signed-off-by:.*/) { + if ($tag =~ m/^signed-off-by:.*/) { $noblank=1; if ($line =~ m/$maintainer_name/) { $maint_ok=1; @@ -110,8 +117,7 @@ while ($line = <IN>) { next; } - - if ($line =~ m/^(Acked-by|Acked-By|acked-by|Thanks-to|cc|CC|Cc):.*/) { + if ($tag =~ m/^(acked-by|thanks-to|reviewed-by|cc):/) { $signed="$signed$line"; next; } @@ -120,7 +126,7 @@ while ($line = <IN>) { if ($line =~ m/Changeset:\s*(.*)\n/) { $num=$1; } -# print "# $line"; + print "# $line"; next; } |