summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
authorMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2021-01-18 21:46:19 +0200
committerMykyta Dorokhin <mykyta.dorokhin@globallogic.com>2021-01-18 21:46:19 +0200
commit4a8fb99f032ec6b30718893afd6d75bc42645db6 (patch)
treefcf07eac08dbbb703e715f9bcac364cd547ee09a /recipes-bsp
parenta449c7b0dc6ae1ed3397c0c433a2be3fddb79260 (diff)
downloadmeta-multitech-4a8fb99f032ec6b30718893afd6d75bc42645db6.tar.gz
meta-multitech-4a8fb99f032ec6b30718893afd6d75bc42645db6.tar.bz2
meta-multitech-4a8fb99f032ec6b30718893afd6d75bc42645db6.zip
linux 5.4: fix mts-io for the 5.4.81
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/multitech/mts-io.inc5
-rw-r--r--recipes-bsp/multitech/mts-io/0001-linux5.4-fix-kernel-module-build-issues.patch134
2 files changed, 138 insertions, 1 deletions
diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc
index b81e7f0..496d503 100644
--- a/recipes-bsp/multitech/mts-io.inc
+++ b/recipes-bsp/multitech/mts-io.inc
@@ -20,6 +20,7 @@ RDEPENDS_${PN}-noarch_append_mtcap = " mts-io-sysfs i2c-tools"
# git://git.multitech.net/mts-io.git;protocol=git
SRC_URI = " \
git://git@gitlab.multitech.net/mirrors/mts-io;protocol=ssh \
+ file://0001-linux5.4-fix-kernel-module-build-issues.patch \
file://led-status_heartbeat_trigger \
file://lora-led-updater \
file://mts-io.init \
@@ -78,12 +79,14 @@ fakeroot do_install () {
# use cp instead of install so the driver doesn't get stripped
cp ${S}/io-module/mts_io.ko ${D}${base_libdir}/modules/${KERNEL_VERSION}/extra
+ install -Dm0644 ${S}/io-module/Module.symvers ${D}${includedir}/${BPN}/Module.symvers
+
# install headers for kernel modules
install -d ${D}${includedir}/mts-kernel-headers/linux
install -m 0644 ${S}/io-module/mts_io.h ${D}${includedir}/mts-kernel-headers/linux
install -m 0644 ${S}/io-module/mts_eeprom.h ${D}${includedir}/mts-kernel-headers/linux
install -m 0644 ${S}/io-module/at91gpio.h ${D}${includedir}/mts-kernel-headers/linux
-
+
# install same headers for userspace applications
# Note this dupication can be avoided by adding the following into the recipes
# CFLAGS += ${STAGING_INCDIR}/mts-kernel-headers
diff --git a/recipes-bsp/multitech/mts-io/0001-linux5.4-fix-kernel-module-build-issues.patch b/recipes-bsp/multitech/mts-io/0001-linux5.4-fix-kernel-module-build-issues.patch
new file mode 100644
index 0000000..c8d1cdc
--- /dev/null
+++ b/recipes-bsp/multitech/mts-io/0001-linux5.4-fix-kernel-module-build-issues.patch
@@ -0,0 +1,134 @@
+From 332b8d4fb0421d542de87b20b6ee9437c542b1b6 Mon Sep 17 00:00:00 2001
+From: Mykyta Dorokhin <mykyta.dorokhin@globallogic.com>
+Date: Fri, 15 Jan 2021 15:30:13 +0200
+Subject: [PATCH] linux5.4: fix kernel module build issues
+
+---
+ io-module/machine/mt100eocg.c | 1 -
+ io-module/machine/mtcap.c | 2 --
+ io-module/machine/mtcdt.c | 1 -
+ io-module/machine/mtcpm.c | 2 --
+ io-module/machine/mths.c | 3 ---
+ io-module/machine/mtr.c | 1 -
+ io-module/mts-io.c | 15 +++++++++++----
+ 7 files changed, 11 insertions(+), 14 deletions(-)
+
+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..32f7d9c 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
+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/mts-io.c b/io-module/mts-io.c
+index 6c14a74..a20cd39 100644
+--- a/io-module/mts-io.c
++++ b/io-module/mts-io.c
+@@ -42,6 +42,8 @@
+ #include <linux/io.h>
+ #include <linux/module.h>
+ #include <linux/firmware.h>
++
++#include "at91gpio.h"
+ #include "mts_io_module.h"
+ #include "mts_io.h"
+ #include "buttons.h"
+@@ -114,12 +116,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"
+
+@@ -284,10 +286,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)
+@@ -479,8 +485,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);
+ }
+--
+1.9.1
+