diff options
author | John Klug <john.klug@multitech.com> | 2021-12-28 11:15:22 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2021-12-28 11:22:08 -0600 |
commit | 969e42d72045e315196317d08c001433ce04169e (patch) | |
tree | a515a3105afc2e8e97a61e10844761c23017a9ca | |
parent | 7be1736916541d27aff1690dc06523e9154ad298 (diff) | |
download | mts-io-969e42d72045e315196317d08c001433ce04169e.tar.gz mts-io-969e42d72045e315196317d08c001433ce04169e.tar.bz2 mts-io-969e42d72045e315196317d08c001433ce04169e.zip |
Set reset length to 1250mS for new MTCDT-0.2 and MTCDTIP-0.14.8.3
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | io-module/mts-io.c | 15 | ||||
-rw-r--r-- | io-module/version.h | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 249d84a..071ec84 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([mts-io], [4.8.2]) +AC_INIT([mts-io], [4.8.3]) AC_CONFIG_SRCDIR([util/mts_util_lora2_reset.c]) AM_INIT_AUTOMAKE AM_CONFIG_HEADER([config.h]) diff --git a/io-module/mts-io.c b/io-module/mts-io.c index 2ccdab5..79c579f 100644 --- a/io-module/mts-io.c +++ b/io-module/mts-io.c @@ -235,7 +235,9 @@ static ssize_t mts_attr_store_radio_reset(struct device *dev, { int value; /* 0 = normal reset; -1 = forced reset */ int err; + int reset_time; // Time in ms for reset struct gpio_pin *pin; + const char *hw_version; if (sscanf(buf, "%i", &value) != 1) { return -EINVAL; @@ -274,11 +276,20 @@ static ssize_t mts_attr_store_radio_reset(struct device *dev, if (!pin) { return -ENODEV; } + hw_version = mts_get_hw_version(); + if ((strncmp(hw_version,HW_VERSION_MTCDT_0_2,strlen(HW_VERSION_MTCDT_0_2)) == 0) || + (strncmp(hw_version,HW_VERSION_MTCDTIP_0_1,strlen(HW_VERSION_MTCDTIP_0_1)) == 0)) { + dev_dbg(dev, "Using a reset time of 1250mS for USB hub\n"); + reset_time = 1250; + } else { + dev_dbg(dev, "Using a reset time of 250mS\n"); + reset_time = 250; + } mutex_lock(&mts_io_mutex); - // 250ms low reset - err = reset_gpio_pin(pin, 250, 0); + // 250/1250ms low reset + err = reset_gpio_pin(pin, reset_time, 0); mutex_unlock(&mts_io_mutex); diff --git a/io-module/version.h b/io-module/version.h index 001a196..0ecb889 100644 --- a/io-module/version.h +++ b/io-module/version.h @@ -1,7 +1,7 @@ #ifndef __VERSION_H #define __VERSION_H -#define DRIVER_VERSION "v4.8.2" +#define DRIVER_VERSION "v4.8.3" #define DRIVER_AUTHOR "Multitech Systems" #define DRIVER_DESC "MTS-IO Controller" #define DRIVER_NAME "mts-io" |