summaryrefslogtreecommitdiff
path: root/v4l/scripts/usbvision.pl
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-04-26 10:40:35 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-04-26 10:40:35 -0300
commit5da5e2ce7dd4b27ccdfd1328f2f9140dd5708f6b (patch)
tree30979e50bc71541b64476993e6c8758c67ccca24 /v4l/scripts/usbvision.pl
parent2a94f8dbe2011b5c5721a9e681a745e25ec3b4e8 (diff)
parent54d44a36f1f7fc565e4a4bedeac90b3e6efbbf97 (diff)
downloadmediapointer-dvb-s2-5da5e2ce7dd4b27ccdfd1328f2f9140dd5708f6b.tar.gz
mediapointer-dvb-s2-5da5e2ce7dd4b27ccdfd1328f2f9140dd5708f6b.tar.bz2
merge: http://linuxtv.org/hg/~hverkuil/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts/usbvision.pl')
-rwxr-xr-xv4l/scripts/usbvision.pl40
1 files changed, 40 insertions, 0 deletions
diff --git a/v4l/scripts/usbvision.pl b/v4l/scripts/usbvision.pl
new file mode 100755
index 000000000..3976e8bd1
--- /dev/null
+++ b/v4l/scripts/usbvision.pl
@@ -0,0 +1,40 @@
+#!/usr/bin/perl -w
+use strict;
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+
+while (<>) {
+ # defines in header file
+ if (/#define\s*(\w+)\s*(\d+)/) {
+ $data{$1}->{nr} = $2;
+ next;
+ }
+ # boards
+ if (/^\s*\[([\w\d_]+)\]\s*=\s*{/) {
+ $id = $1;
+ $data{$id}->{id} = $id;
+ };
+
+ next unless defined($id);
+
+ if (/USB_DEVICE.*0x([0-9a-fA-F]*).*0x([0-9a-fA-F]*).*driver_info\s*=\s*([\w\d_]+)/)
+{
+ $subvendor=$1;
+ $subdevice=$2;
+ push @{$data{$3}->{subid}}, "$subvendor:$subdevice";
+ }
+
+ if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+ $data{$id}->{name} = $1 if (/\.ModelString\s*=\s*\"([^\"]+)\"/);
+ }
+}
+
+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";
+}