add bcm pin descriptions when called as module
[x300-pci] / gpio.pl
diff --git a/gpio.pl b/gpio.pl
index 6c653d0..078e63f 100755 (executable)
--- a/gpio.pl
+++ b/gpio.pl
@@ -22,6 +22,11 @@ foreach my $pin_file ( glob 'pins/bcm-*.tsv' ) {
        warn "# $pin_file ",dump($bcm_desc);
 }
 
+sub add_bcm_desc {
+       my ( $pin, $desc ) = @_;
+       $bcm_desc->{$pin} = $desc;
+}
+
 sub pins {
 
 my @pcf = `gpio -x pcf8591:120:0x48 readall`;