diff options
Diffstat (limited to 'v4l')
-rwxr-xr-x | v4l/scripts/cardlist | 2 | ||||
-rwxr-xr-x | v4l/scripts/usbvision.pl | 33 |
2 files changed, 19 insertions, 16 deletions
diff --git a/v4l/scripts/cardlist b/v4l/scripts/cardlist index 91c32c483..0225d6ebd 100755 --- a/v4l/scripts/cardlist +++ b/v4l/scripts/cardlist @@ -15,6 +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 \ +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 diff --git a/v4l/scripts/usbvision.pl b/v4l/scripts/usbvision.pl index 5aae512c5..3976e8bd1 100755 --- a/v4l/scripts/usbvision.pl +++ b/v4l/scripts/usbvision.pl @@ -6,26 +6,29 @@ 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; + # defines in header file + if (/#define\s*(\w+)\s*(\d+)/) { + $data{$1}->{nr} = $2; next; } - if ($cap==0) { - 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 (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++; + if (!defined($data{$id}) || !defined($data{$id}->{name})) { + $data{$id}->{name} = $1 if (/\.ModelString\s*=\s*\"([^\"]+)\"/); } } |