diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-14 15:09:59 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-14 15:09:59 -0300 |
commit | 8dc666d4b3b64814dc3a27e476350b94fcdfb232 (patch) | |
tree | f1202f22f3bcfda3c784baf5ee42173eddc16e06 /v4l | |
parent | d04d11092bad04308dbf43464777ce324ff0c6d2 (diff) | |
download | mediapointer-dvb-s2-8dc666d4b3b64814dc3a27e476350b94fcdfb232.tar.gz mediapointer-dvb-s2-8dc666d4b3b64814dc3a27e476350b94fcdfb232.tar.bz2 |
Use a better format to represent usbvision supported boards
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Changed usbvision cards table to allow:
1) Not repeat USB ID on two structs;
2) Not need to specify both usb and card description tables at
the same order, removing some magic;
Some cards had duplicated names. Fixed.
A test for an specific board were doing by using a string comparation.
The comparation were wrong. Also, it is not a good practice to recognize
a board based on his string name.
Acked-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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*\"([^\"]+)\"/); } } |