summaryrefslogtreecommitdiff
path: root/io-module/mtac_gpiob.c
diff options
context:
space:
mode:
Diffstat (limited to 'io-module/mtac_gpiob.c')
-rw-r--r--io-module/mtac_gpiob.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/io-module/mtac_gpiob.c b/io-module/mtac_gpiob.c
index 3dbd828..17d0ac3 100644
--- a/io-module/mtac_gpiob.c
+++ b/io-module/mtac_gpiob.c
@@ -384,6 +384,7 @@ static bool gpiob_setup(enum ap port) {
char buf[32];
struct kobj_attribute* attr;
struct attribute **attrs;
+ int ipin = 0;
log_info("loading GPIOB accessory card in port %d", port);
@@ -422,6 +423,21 @@ static bool gpiob_setup(enum ap port) {
return false;
}
+ // Change GPIO 1-4 to match older levels of this driver
+ // Substitute pins for this port
+ log_info("Substitute pins");
+ while(*(gpiob[port_index][ipin].name)) {
+ struct gpio_pin *p;
+ p = gpio_pin_by_num(gpiob[port_index][ipin].pin.gpio);
+ if(p) {
+ log_info("GPIOB: Replace name %s with name %s",p->name,gpiob[port_index][ipin].name);
+ log_info("GPIOB: Replace pin number %u with number %u",p->pin.gpio,gpiob[port_index][ipin].pin.gpio);
+ *p = gpiob[port_index][ipin];
+ }
+ ipin++;
+ }
+
+
// add digital inputs
for (i = 0; i < 4; i++) {
sprintf(buf, "din%d", i);