diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-09-05 15:59:09 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-09-05 15:59:42 -0300 |
commit | abc1453dfe89f244dccd3460d8e1a2e3091cbadb (patch) | |
tree | 48870dd1102a61659c9e4559af6a7bdeaa30bb9c /contrib | |
parent | 85891c6e9c71cf79f9869ab91d2e084c883a8985 (diff) |
parse_cx231xx.pl: improve and fix GPIO handling
The logic there is incomplete and broken. Fix it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/cx231xx/parse_cx231xx.pl | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/cx231xx/parse_cx231xx.pl b/contrib/cx231xx/parse_cx231xx.pl index 6f402020..f6975bf7 100755 --- a/contrib/cx231xx/parse_cx231xx.pl +++ b/contrib/cx231xx/parse_cx231xx.pl @@ -112,19 +112,21 @@ sub parse_gpio($$$$$$) my $type; if ($req == 8) { - $type .= "GET gpio"; - } elsif ($req == 9) { $type .= "SET gpio"; + } elsif ($req == 9) { + $type .= "GET gpio"; } elsif ($req == 0xa) { $type .= "SET gpie"; } elsif ($req == 0xb) { - $type .= "SET gpie"; + $type .= "GET gpie"; } - my $gpio_bit = $wvalue << 16 & $windex; + my $gpio_bit = ($wvalue << 16) | $windex; + + $payload =~ s/([a-f\d].)\s([a-f\d].)\s([a-f\d].)\s([a-f\d].)/0x$4$3$2$1/; - printf("$type: Reqtype %3d Req %3d 0x%04x len %d val = %s\n", - $reqtype, $req, $gpio_bit, $wlen, $payload); + printf("$type: Reqtype %3d Req %3d len %d wvalue 0x%04x windex 0x%02x => direction=0x%04x val = %s\n", + $reqtype, $req, $wlen, $wvalue, $windex, $gpio_bit, $payload); } while (<>) { |