X-Git-Url: http://git.rot13.org/?p=linux-gpio-pinout;a=blobdiff_plain;f=gpio.pl;h=44915299efcc75550fa3e8dd1c0f83f7821fdbcd;hp=a2895c163c8b10ae32d9cf42ef53c820dc503a5c;hb=de06eedd1d632efddb05fcb4a5188376bc11f3a2;hpb=ef784274216d689e9a97c6f059a1d4d612a603dd diff --git a/gpio.pl b/gpio.pl index a2895c1..4491529 100755 --- a/gpio.pl +++ b/gpio.pl @@ -40,12 +40,17 @@ my $line_i = 0; my $include = 0; while() { chomp; - if ( m/^#\s*$model/ ) { - $include = 1; + if ( m/^#\s(.+)/ ) { + warn "MODEL [$1] == [$model] ?\n"; + if ( $model =~ m/$1/ ) { + $include = 1; + } else { + $include = 0; + } } elsif ( m/^#\s+/ ) { - $include = 0; + $include = 1; } elsif ( $include ) { - push @{ $pins->{$1} }, $line_i while ( m/\t(P\w\d+)/g ); + push @{ $pins->{$1} }, $line_i while ( m/\t(\w+\d+)/g ); push @lines, $_; @@ -64,7 +69,7 @@ my $pin_function; open(my $fh, '<', '/sys/kernel/debug/pinctrl/pinctrl-handles'); while(<$fh>) { chomp; - if ( m/group: (P\w\d+)\s.+function: (\S+)/ ) { + if ( m/group: (\w+\d+)\s.+function: (\S+)/ ) { my ($pin, $function) = ($1,$2); $pin_function->{$pin} = $function; @@ -88,6 +93,8 @@ warn "XXX $pin $line"; } } +warn "# pin_function = ",dump($pin_function); + my @max_len = ( 0,0,0,0 ); my @line_parts; foreach my $line (@lines) { @@ -231,6 +238,7 @@ my $line_fmt = qq{