diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-03 18:05:56 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-03 18:05:56 -0300 |
commit | 628ac96b077ca879a0bfca25f1db0dfd9a07f4ef (patch) | |
tree | e8126b2bd67959b8f1605cecb311c78c9c87f313 /v4l/scripts | |
parent | c28f4567282fa2d2b41a8c30c3c89b95e637b7d0 (diff) | |
download | mediapointer-dvb-s2-628ac96b077ca879a0bfca25f1db0dfd9a07f4ef.tar.gz mediapointer-dvb-s2-628ac96b077ca879a0bfca25f1db0dfd9a07f4ef.tar.bz2 |
Add script to generate CARDLIST.usbvision
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-x | v4l/scripts/cardlist | 3 | ||||
-rwxr-xr-x | v4l/scripts/usbvision.pl | 37 |
2 files changed, 40 insertions, 0 deletions
diff --git a/v4l/scripts/cardlist b/v4l/scripts/cardlist index 901d3fb18..91c32c483 100755 --- a/v4l/scripts/cardlist +++ b/v4l/scripts/cardlist @@ -15,3 +15,6 @@ scripts/tuner.pl ../linux/include/media/tuner.h ../linux/drivers/media/video/tun scripts/saa7134.pl ../linux/drivers/media/video/saa7134/saa7134.h ../linux/drivers/media/video/saa7134/saa7134-cards.c \ | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.saa7134 +scripts/usbvision.pl ../linux/drivers/media/video/usbvision/usbvision-cards.c \ + | perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.usbvision + diff --git a/v4l/scripts/usbvision.pl b/v4l/scripts/usbvision.pl new file mode 100755 index 000000000..5aae512c5 --- /dev/null +++ b/v4l/scripts/usbvision.pl @@ -0,0 +1,37 @@ +#!/usr/bin/perl -w +use strict; + +my $new_entry = -1; +my $nr = 0; +my ($id,$subvendor,$subdevice); +my %data; + +my $cap=0; + +while (<>) { + if (m/usbvision_device_data/) { + $cap=1; + next; + } + if (m/usbvision_table/) { + $cap=0; + next; + } + if ($cap==0) { + next; + } + + if (m/\{0x([0-9a-z]...)\s*\,\s*0x([0-9a-z]...).*\"(.*)\"/) { + $data{$nr}->{nr} = $nr; + $data{$nr}->{name} = $3; + push @{$data{$nr}->{subid}}, "$1:$2"; + $nr++; + } +} + +foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) { + printf("%3d -> %-56s", $data{$item}->{nr}, $data{$item}->{name}); + printf(" [%s]",join(",",@{$data{$item}->{subid}})) + if defined($data{$item}->{subid}); + print "\n"; +} |