summaryrefslogtreecommitdiff
path: root/v4l/scripts
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-09-29 14:30:35 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-09-29 14:30:35 +0000
commit8c708bc0c2a9d2a11373a4ca44c45319c654c011 (patch)
treeff5719a014e252973bdfc8d7a4e00e1d546f6b52 /v4l/scripts
parentd4fd93973761eab19082d6f48339cf851a84ebc6 (diff)
downloadmediapointer-dvb-s2-8c708bc0c2a9d2a11373a4ca44c45319c654c011.tar.gz
mediapointer-dvb-s2-8c708bc0c2a9d2a11373a4ca44c45319c654c011.tar.bz2
- cx88 cardlist updated. Now, it also includes PCI subsystem IDs.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'v4l/scripts')
-rw-r--r--v4l/scripts/cx88.pl61
1 files changed, 61 insertions, 0 deletions
diff --git a/v4l/scripts/cx88.pl b/v4l/scripts/cx88.pl
new file mode 100644
index 000000000..459514157
--- /dev/null
+++ b/v4l/scripts/cx88.pl
@@ -0,0 +1,61 @@
+#!/usr/bin/perl -w
+use strict;
+
+my %map = (
+ "PCI_ANY_ID" => "0",
+ "PCI_VENDOR_ID_PHILIPS" => "1131",
+ "PCI_VENDOR_ID_ASUSTEK" => "1043",
+ "PCI_VENDOR_ID_MATROX" => "102B",
+ "PCI_VENDOR_ID_ATI" => "1002",
+);
+
+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+(CX88_BOARD_\w+)\s+(\d+)/) {
+ $data{$1}->{nr} = $2;
+ next;
+ }
+ # cx88_boards
+ if (/\[(CX88_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";
+}