This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-utils.git tree:

Subject: parse_sn9c201.pl: Add a handler for register aliases
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Tue Dec 7 13:42:38 2010 -0200

Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 contrib/sn9c201/parse_sn9c201.pl |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=4edcb2e3fdc2f68deac715bf63993d79522ba44b

diff --git a/contrib/sn9c201/parse_sn9c201.pl b/contrib/sn9c201/parse_sn9c201.pl
index 34cbf80..c8aa3f1 100755
--- a/contrib/sn9c201/parse_sn9c201.pl
+++ b/contrib/sn9c201/parse_sn9c201.pl
@@ -26,6 +26,19 @@ use Getopt::Long;
 my $debug = 0;
 GetOptions('d' => \$debug);
 
+# FIXME: How to handle multiple registers being changed at the same time?
+
+my %reg_map = (
+       0x1180 => "SN9C201_R1180_HSTART_LOW",
+       0x1181 => "SN9C201_R1181_HSTART_HIGH",
+       0x1182 => "SN9C201_R1182_VSTART_LOW",
+       0x1183 => "SN9C201_R1183_VSTART_HIGH",
+       0x1184 => "SN9C201_R1184_HSIZE"
+       0x1185 => "SN9C201_R1184_VSIZE"
+       0x11b8 => "SN9C201_R11B8_CLK_CTRL",
+);
+
+
 sub i2c_reg($)
 {
        my %decode;
@@ -173,10 +186,18 @@ while (<>) {
                } else {
                        printf("%s, Req %3d, wValue: 0x%04x, wIndex 0x%04x, 
wlen %d: %s\n",
                                type_req($reqtype), $req, $wvalue, $windex, 
$wlen, $payload) if ($debug);
+
+                       my $reg;
+                       if (defined($reg_map{$wvalue})) {
+                               $reg = $reg_map{$wvalue};
+                       } else {
+                               $reg = sprintf "0x%04x", $wvalue;
+                       }
+
                        if ($reqtype == 0xc1) {
-                               printf "reg_r(gspcadev, 0x%04x);\t/* read 
%s*/\n", $wvalue, $payload;
+                               printf "reg_r(gspcadev, %s);\t/* read %s*/\n", 
$reg, $payload;
                        } elsif ($reqtype == 0x41) {
-                               printf "reg_w(gspcadev, 0x%04x, { %s });*/\n", 
$wvalue, $payload;
+                               printf "reg_w(gspcadev, %s, { %s });*/\n", 
$reg, $payload;
                        }
                }
        }

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to