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_dib0700.pl: parse the remaining messages on dib0700
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Tue Jun 24 14:28:10 2014 -0300

Parse the remaining messages on dib0700, except for the newer
I2C read/write formats.

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

 contrib/dib0700/parse_dib0700.pl |   53 ++++++++++++++++++++++++++++----------
 1 files changed, 39 insertions(+), 14 deletions(-)

---

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

diff --git a/contrib/dib0700/parse_dib0700.pl b/contrib/dib0700/parse_dib0700.pl
index faecc7a..19db058 100755
--- a/contrib/dib0700/parse_dib0700.pl
+++ b/contrib/dib0700/parse_dib0700.pl
@@ -102,24 +102,23 @@ while (<>) {
                        $req = sprintf "0x%02x", $req;
                }
 
-               my $ok = 0;
                if ($req eq "REQUEST_I2C_READ") {
                        my $txlen = ($wvalue >> 8) + 2;
                        my $addr = sprintf "0x%02x >> 1", $wvalue & 0xfe;
                        my $val;
 
                        if ($txlen == 2) {
-                               $ok = 1;
-                               printf("dib0700_i2c_read($addr); /* 
txlen=$txlen, $payload */\n");
+                               printf("dib0700_i2c_read($addr); /* $payload 
*/\n");
+                               next;
                        } elsif ($txlen == 3) {
                                $val = $windex >> 8;
-                               $ok = 1;
-                               printf("dib0700_i2c_read($addr, %d); /* 
txlen=$txlen, $payload */\n", $val);
+                               printf("dib0700_i2c_read($addr, %d); /* 
$payload */\n", $val);
+                               next;
                        } elsif ($txlen == 4) {
                                $val = $windex;
-                               printf("dib0700_i2c_read($addr, %d); /* 
txlen=$txlen, $payload */\n", $val);
-                               $ok = 1;
-                       }                       
+                               printf("dib0700_i2c_read($addr, %d); /* 
$payload */\n", $val);
+                               next;
+                       }
                }
 
                if ($req eq "REQUEST_I2C_WRITE") {
@@ -133,10 +132,10 @@ while (<>) {
                                        $val = sprintf "%d", $bytes[4];
                                }
                                printf("dib0700_i2c_write($addr, $reg, 
$val);\n");
-                               $ok = 1;
+                               next;
                        }
                }
-                       
+
                if ($req eq "REQUEST_SET_GPIO") {
                                my $gpio = $bytes[1];
                                my $v = $bytes[2];
@@ -150,13 +149,39 @@ while (<>) {
                                if (!($v & 0x3f)) {
                                        $gpio = $gpio_map{$gpio} if 
(defined($gpio_map{$gpio}));
                                        printf("dib0700_set_gpio(adap->dev, 
$gpio, $dir, $val);\n");
-                                       $ok = 1;
+                                       next;
                                }
                }
 
-               if (!$ok) {
-                       printf("%s, Req %s, wValue: 0x%04x, wIndex 0x%04x, wlen 
%d: %s\n",
-                               type_req($reqtype), $req, $wvalue, $windex, 
$wlen, $payload);
+               if (($reqtype & 0xf0) == 0xc0) {
+                       my $txlen = ($wvalue >> 8) + 2;
+                       my $addr = $req;
+                       my $val;
+
+                       if ($txlen == 2) {
+                               printf("dib0700_ctrl_rd(adap->dev, $txlen, { 
cmd, $addr }, &buf, $wlen); /* $payload */\n");
+                               next;
+                       } elsif ($txlen == 3) {
+                               $val = $windex >> 8;
+                               printf("dib0700_ctrl_rd(adap->dev, $txlen, { 
cmd, $addr, $val }, &buf, $wlen); /* $payload */\n");
+                               next;
+                       } elsif ($txlen == 4) {
+                               $val = $windex;
+                               printf("dib0700_ctrl_rd(adap->dev, $txlen, { 
cmd, $addr, $val }, &buf, $wlen); /* $payload */\n");
+                               next;
+                       }
                }
+               if ($wvalue == 0 && $windex == 0 && (($reqtype & 0xf0) == 
0x40)) {
+                       my $cmd = $req;
+                       for (my $i = 0; $i < scalar(@bytes); $i++) {
+                               $cmd .= sprintf ", 0x%02x", $bytes[$i];
+                       }
+
+                       printf("dib0700_ctrl_wr(adap->dev, { $cmd }, %d);\n", 
$wlen + 1);
+                       next;
+               }
+
+               printf("%s, Req %s, wValue: 0x%04x, wIndex 0x%04x, wlen %d: 
%s\n",
+                       type_req($reqtype), $req, $wvalue, $windex, $wlen, 
$payload);
        }
 }

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

Reply via email to