summaryrefslogtreecommitdiff
path: root/io-module
diff options
context:
space:
mode:
Diffstat (limited to 'io-module')
-rw-r--r--io-module/machine/mtcap3.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/io-module/machine/mtcap3.c b/io-module/machine/mtcap3.c
index 9a81e1c..3c99077 100644
--- a/io-module/machine/mtcap3.c
+++ b/io-module/machine/mtcap3.c
@@ -325,6 +325,27 @@ static ssize_t mts_attr_store_radio_reset_mtcap3(struct device *dev,
return -EINVAL;
}
+ /* check reset timings is enabled */
+ if (value != -1 && NULL != timings_data) {
+ /* check reset timer is started */
+ if (radio_reset_timer_is_start == 1) {
+ log_info("radio reset timer is running.");
+ return count;
+ }
+
+ /* check reset timer available is started */
+ if (radio_reset_available_timer_is_start == 1) {
+ del_timer(&radio_reset_available_timer);
+ radio_reset_available_timer_is_start = 0;
+ }
+
+ /* reset timer not started, start it */
+ mod_timer(&radio_reset_timer, jiffies + msecs_to_jiffies((timings_data[timings_data_index]) * 1000));
+ /* save timings_data_stop_seconds */
+ timings_data_stop_seconds = timings_data[timings_data_index] + time_now_secs();
+ radio_reset_timer_is_start = 1;
+ }
+
reset_radio_udev_discovery();
mutex_lock(&mts_io_mutex);