diff options
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); |