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 /io-module/mts-io.c | |
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
Diffstat (limited to 'io-module/mts-io.c')
-rw-r--r-- | io-module/mts-io.c | 15 |
1 files changed, 13 insertions, 2 deletions
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); |