diff options
author | John Klug <john.klug@multitech.com> | 2016-09-30 17:22:00 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2016-09-30 17:22:00 -0500 |
commit | cf9e2ae0c4193f784138e098c929a36a9aaa8854 (patch) | |
tree | a9b66d291b8d852c4e5ed71b709fdabe7d154322 /io-module/mts_io.c | |
parent | 670c959a9bdfd4aaae25a6d0c30e31d29b6761de (diff) | |
download | mts-io-cf9e2ae0c4193f784138e098c929a36a9aaa8854.tar.gz mts-io-cf9e2ae0c4193f784138e098c929a36a9aaa8854.tar.bz2 mts-io-cf9e2ae0c4193f784138e098c929a36a9aaa8854.zip |
mts-io driver for Lora-H and additional resets
Diffstat (limited to 'io-module/mts_io.c')
-rw-r--r-- | io-module/mts_io.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/io-module/mts_io.c b/io-module/mts_io.c index f3b79d5..1122127 100644 --- a/io-module/mts_io.c +++ b/io-module/mts_io.c @@ -47,7 +47,7 @@ #include "mts_io.h" -#define DRIVER_VERSION "v1.3.3" +#define DRIVER_VERSION "v1.3.3.8" #define DRIVER_AUTHOR "James Maki <jmaki@multitech.com>" #define DRIVER_DESC "MTS-IO Controller" #define DRIVER_NAME "mts-io" @@ -503,7 +503,7 @@ static ssize_t mts_attr_show_radio_reset_backoff_seconds(struct device *dev, if (strcmp(attr->attr.name, "radio-reset-backoff-seconds") == 0) { if (radio_reset_timer_is_start == 1) { - value = sprintf(buf, "%d", (timings_data_stop_seconds - time_now_secs())); + value = sprintf(buf, "%u", (timings_data_stop_seconds - time_now_secs())); } else { value = sprintf(buf, "%d", 0); } @@ -881,9 +881,11 @@ static int __init mts_io_init(void) } for (pin = gpio_pins; *pin->name; pin++) { - ret = gpio_request_one(pin->pin.gpio, pin->pin.flags, pin->pin.label); - if (ret) { - log_debug("could not request pin %s (%d) but it could have already been requested under a different pin name", pin->name, ret); + log_info("MTS: name %s: capability=%x, DEVICE_CAPA=%d",pin->name,pin->capability,id_eeprom.capa[DEVICE_CAPA_INDEX(pin->capability)]); + if (pin->capability == 0 || DEVICE_CAPA(id_eeprom.capa,pin->capability)) { + ret = gpio_request_one(pin->pin.gpio, pin->pin.flags, pin->pin.label); + if (ret) + log_debug("could not request pin %s (%d) but it could have already been requested under a different pin name", pin->name, ret); } } |