aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-11-08 15:35:53 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-11-08 15:35:53 (GMT)
commitbaed6b80173c36ab39ca1caf67436909a273e2ca (patch)
treeb79cab1ca1f27303b2a5e2d07f2c0f27c0ee141a
parent2378cdff7d11d7d1bf97dedb85dc21c24e33fed3 (diff)
Add GPIO decoding logic
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rwxr-xr-xcontrib/cx231xx/parse_cx231xx.pl28
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/cx231xx/parse_cx231xx.pl b/contrib/cx231xx/parse_cx231xx.pl
index ad0ec7c..e6f7905 100755
--- a/contrib/cx231xx/parse_cx231xx.pl
+++ b/contrib/cx231xx/parse_cx231xx.pl
@@ -79,6 +79,31 @@ sub parse_i2c($$$$$$)
printf("$payload\n");
}
+sub parse_gpio($$$$$$)
+{
+ my $reqtype = shift;
+ my $req = shift;
+ my $wvalue = shift;
+ my $windex = shift;
+ my $wlen = shift;
+ my $payload = shift;
+
+ my $type = sprintf "Req %d: ", $req;
+ if ($req == 8) {
+ $type .= "GET gpio";
+ } elsif ($req == 9) {
+ $type .= "SET gpio";
+ } elsif ($req == 0xa) {
+ $type .= "SET gpie";
+ } elsif ($req == 0xb) {
+ $type .= "SET gpie";
+ }
+
+ my $gpio_bit = $wvalue << 16 & $windex;
+
+ printf("$type 0x%04x len %d val = %s\n", $gpio_bit, $wlen, $payload);
+}
+
while (<>) {
tr/A-F/a-f/;
if (m/([4c]0) ([0-9a-f].) ([0-9a-f].) ([0-9a-f].) ([0-9a-f].) ([0-9a-f].) ([0-9a-f].) ([0-9a-f].)[\<\>\s]+(.*)/) {
@@ -94,5 +119,8 @@ while (<>) {
} elsif ($req < 3) {
parse_i2c($reqtype, $req, $wvalue, $windex, $wlen, $payload);
}
+# if ($req >= 8 && $req <= 0xb) {
+ parse_gpio($reqtype, $req, $wvalue, $windex, $wlen, $payload);
+# }
}
}

Privacy Policy