summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrii Pientsov <andrii.pientsov@globallogic.com>2021-03-14 14:26:38 +0200
committerAndrii Pientsov <andrii.pientsov@globallogic.com>2021-03-14 14:30:14 +0200
commitee3586431bed0be0cfeba3b906b0f7d32d89e211 (patch)
tree0de0fda50ea07bbcbe1c255a4c94372557c5d97f
parent5f3299b873fb5511caf2dd187253f812ce2e2bbb (diff)
parentccdc21ca4c4977edb64ee593e856b6ac5aa2930f (diff)
downloadmts-io-ee3586431bed0be0cfeba3b906b0f7d32d89e211.tar.gz
mts-io-ee3586431bed0be0cfeba3b906b0f7d32d89e211.tar.bz2
mts-io-ee3586431bed0be0cfeba3b906b0f7d32d89e211.zip
Merge branch 'master' into mtre
-rw-r--r--configure.ac2
-rw-r--r--io-module/machine/mt100eocg.c1
-rw-r--r--io-module/machine/mtcap.c2
-rw-r--r--io-module/machine/mtcdt.c1
-rw-r--r--io-module/machine/mtcpm.c6
-rw-r--r--io-module/machine/mths.c3
-rw-r--r--io-module/machine/mtr.c1
-rw-r--r--io-module/machine/mtre.c1
-rw-r--r--io-module/mts-io.c15
-rw-r--r--io-module/mts_io_module.h2
10 files changed, 15 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index ed8ce66..2811759 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([mts-io], [4.5.1])
+AC_INIT([mts-io], [4.5.2])
AC_CONFIG_SRCDIR([util/mts_util_lora2_reset.c])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config.h])
diff --git a/io-module/machine/mt100eocg.c b/io-module/machine/mt100eocg.c
index c9d2961..ac00143 100644
--- a/io-module/machine/mt100eocg.c
+++ b/io-module/machine/mt100eocg.c
@@ -1,4 +1,3 @@
-#include "at91gpio.h"
/* Used for both MT100EOCG 0.0 */
static struct gpio_pin gpio_pins_mt100eocg_0_0[] = {
{
diff --git a/io-module/machine/mtcap.c b/io-module/machine/mtcap.c
index c2a4687..0d4af0f 100644
--- a/io-module/machine/mtcap.c
+++ b/io-module/machine/mtcap.c
@@ -1,5 +1,3 @@
-#include "at91gpio.h"
-#include "mts_supercap.h"
/* Used for both MTCAP 0.0 and 0.1 */
static struct gpio_pin gpio_pins_mtcap_0_0[] = {
{
diff --git a/io-module/machine/mtcdt.c b/io-module/machine/mtcdt.c
index 575dd1e..aabbc2d 100644
--- a/io-module/machine/mtcdt.c
+++ b/io-module/machine/mtcdt.c
@@ -1,4 +1,3 @@
-#include "at91gpio.h"
/*
* Within a struct gpio_pin, there is only one
* occurrence of each pin, so there is only one
diff --git a/io-module/machine/mtcpm.c b/io-module/machine/mtcpm.c
index 4a55127..8e1c3c2 100644
--- a/io-module/machine/mtcpm.c
+++ b/io-module/machine/mtcpm.c
@@ -1,5 +1,3 @@
-#include "mts_io.h"
-
#define OMAP_GPIO(BANK, GPIO) ((BANK*32)+GPIO)
/*
* Within a struct gpio_pin, there is only one
@@ -116,7 +114,7 @@ static struct gpio_pin gpio_pins_mtcpm[] = {
{
.name = "STATUS_LED",
.pin = {
- .gpio = OMAP_GPIO(0, 20),
+ .gpio = OMAP_GPIO(3, 22),
.flags = GPIOF_OUT_INIT_LOW,
.label = "led-status",
},
@@ -124,7 +122,7 @@ static struct gpio_pin gpio_pins_mtcpm[] = {
{
.name = "CD",
.pin = {
- .gpio = OMAP_GPIO(0, 21),
+ .gpio = OMAP_GPIO(3, 23),
.flags = GPIOF_OUT_INIT_HIGH,
.label = "led-cd",
},
diff --git a/io-module/machine/mths.c b/io-module/machine/mths.c
index c19598d..1922d88 100644
--- a/io-module/machine/mths.c
+++ b/io-module/machine/mths.c
@@ -4,9 +4,6 @@
* Created on: Apr 26, 2018
* Author: leonid
*/
-#include "at91gpio.h"
-#include "buttons.h"
-
static struct gpio_pin gpio_pins_mths_0_0[] = {
{
.name = "RADIO_POWER_MONITOR",
diff --git a/io-module/machine/mtr.c b/io-module/machine/mtr.c
index 8664984..9f00be8 100644
--- a/io-module/machine/mtr.c
+++ b/io-module/machine/mtr.c
@@ -1,4 +1,3 @@
-#include "at91gpio.h"
static struct gpio_pin gpio_pins_mtr_0_0[] = {
{
.name = "ETH_RESET",
diff --git a/io-module/machine/mtre.c b/io-module/machine/mtre.c
index f14862f..e3df31c 100644
--- a/io-module/machine/mtre.c
+++ b/io-module/machine/mtre.c
@@ -1,4 +1,3 @@
-#include "at91gpio.h"
static struct gpio_pin gpio_pins_mtre_0_0[] = {
{
.name = "ETH_RESET",
diff --git a/io-module/mts-io.c b/io-module/mts-io.c
index ac023bb..cb1c48e 100644
--- a/io-module/mts-io.c
+++ b/io-module/mts-io.c
@@ -43,6 +43,8 @@
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/firmware.h>
+
+#include "at91gpio.h"
#include "mts_io_module.h"
#include "mts_io.h"
#include "buttons.h"
@@ -115,12 +117,12 @@ DEFINE_MUTEX(mts_io_mutex);
static unsigned int *timings_data = NULL;
static unsigned int timings_data_size = 0;
static unsigned int timings_data_index = 0;
-static time_t timings_data_stop_seconds = 0;
+static time64_t timings_data_stop_seconds = 0;
static struct timer_list radio_reset_timer;
static volatile int radio_reset_timer_is_start = 0;
static struct timer_list radio_reset_available_timer;
static volatile int radio_reset_available_timer_is_start = 0;
-static time_t time_now_secs(void);
+static time64_t time_now_secs(void);
/* generic GPIO support */
#include "gpio.c"
@@ -285,10 +287,14 @@ static DEVICE_ATTR_MTS(dev_attr_radio_power, "radio-power",
mts_attr_show_gpio_pin, mts_attr_store_gpio_pin);
/* backoff-timers */
-static time_t time_now_secs(void)
+static time64_t time_now_secs(void)
{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)
+ return ktime_get_real_seconds();
+#else
struct timespec ts = current_kernel_time();
return ts.tv_sec;
+#endif
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0)
@@ -480,8 +486,9 @@ static ssize_t mts_attr_show_radio_reset_backoff_seconds(struct device *dev,
ssize_t value;
if (strcmp(attr->attr.name, "radio-reset-backoff-seconds") == 0) {
+
if (radio_reset_timer_is_start == 1) {
- value = sprintf(buf, "%lu", (timings_data_stop_seconds - time_now_secs()));
+ value = sprintf(buf, "%lld", (timings_data_stop_seconds - time_now_secs()));
} else {
value = sprintf(buf, "%d", 0);
}
diff --git a/io-module/mts_io_module.h b/io-module/mts_io_module.h
index b6d642d..44aeade 100644
--- a/io-module/mts_io_module.h
+++ b/io-module/mts_io_module.h
@@ -5,7 +5,7 @@
* MTAC cards.
*/
-#define DRIVER_VERSION "v4.5.1"
+#define DRIVER_VERSION "v4.5.2"
#define DRIVER_AUTHOR "Multitech Systems"
#define DRIVER_DESC "MTS-IO Controller"
#define DRIVER_NAME "mts-io"