summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2021-02-25 15:58:55 -0500
committerScott Murray <scott.murray@konsulko.com>2021-02-25 16:30:57 -0500
commitcf0a26324ed91ec292b2294ecc73ac6f5436eebe (patch)
tree6fefe4009af0d11c7fe76586406d9695ae91fa26
parent83e08d62a81dcdcfe9e7bb7bea1bd8469478cd69 (diff)
most: add patch to enable building against newer kernels
Add patch to enable building the standalone MOST driver against kernels 5.7 or newer. Bug-AGL: SPEC-3819 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I6d8e2f68e3f1e73e1901e07d12a8569fb65996e9
-rw-r--r--recipes-kernel/most/files/0013-Fix-build-with-5.7-kernel.patch54
-rw-r--r--recipes-kernel/most/most.bbappend1
2 files changed, 55 insertions, 0 deletions
diff --git a/recipes-kernel/most/files/0013-Fix-build-with-5.7-kernel.patch b/recipes-kernel/most/files/0013-Fix-build-with-5.7-kernel.patch
new file mode 100644
index 00000000..85e38857
--- /dev/null
+++ b/recipes-kernel/most/files/0013-Fix-build-with-5.7-kernel.patch
@@ -0,0 +1,54 @@
+Fix building against 5.7 or newer kernels
+
+VFL_TYPE_GRABBER was renamed VFL_TYPE_VIDEO in 5.7. Marking as
+inappropriate for upstream for now, as it seems the standalone
+version of the driver has been superceded by the version in the
+staging tree in the mainline kernel, and there are no obvious
+signs of maintenance.
+
+Upstream-Status: Inappropriate [no upstream]
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+
+---
+diff --git a/aim-v4l2/video.c b/aim-v4l2/video.c
+index db75d4d..fbf7139 100644
+--- a/aim-v4l2/video.c
++++ b/aim-v4l2/video.c
+@@ -14,6 +14,7 @@
+ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+ #include <linux/module.h>
++#include <linux/version.h>
+ #include <linux/slab.h>
+ #include <linux/init.h>
+ #include <linux/device.h>
+@@ -31,6 +32,11 @@
+
+ #define V4L2_AIM_MAX_INPUT 1
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0)
++/* Handle pre-5.7 naming */
++#define VFL_TYPE_VIDEO VFL_TYPE_GRABBER
++#endif
++
+ static struct most_aim aim_info;
+
+ struct most_video_dev {
+@@ -82,7 +88,7 @@ static int aim_vdev_open(struct file *filp)
+ v4l2_info(&mdev->v4l2_dev, "aim_vdev_open()\n");
+
+ switch (vdev->vfl_type) {
+- case VFL_TYPE_GRABBER:
++ case VFL_TYPE_VIDEO:
+ break;
+ default:
+ return -EINVAL;
+@@ -461,7 +467,7 @@ static int aim_register_videodev(struct most_video_dev *mdev)
+
+ /* Register the v4l2 device */
+ video_set_drvdata(mdev->vdev, mdev);
+- ret = video_register_device(mdev->vdev, VFL_TYPE_GRABBER, -1);
++ ret = video_register_device(mdev->vdev, VFL_TYPE_VIDEO, -1);
+ if (ret) {
+ v4l2_err(&mdev->v4l2_dev, "video_register_device failed (%d)\n",
+ ret);
diff --git a/recipes-kernel/most/most.bbappend b/recipes-kernel/most/most.bbappend
index ad422eb5..b5a140f2 100644
--- a/recipes-kernel/most/most.bbappend
+++ b/recipes-kernel/most/most.bbappend
@@ -12,4 +12,5 @@ SRC_URI_append = " \
file://0010-backport-usb-setup-timer.patch \
file://0011-handle-snd_pcm_lib_mmap_vmalloc-removal.patch \
file://0012-Fix-build-with-5.4-kernel.patch \
+ file://0013-Fix-build-with-5.7-kernel.patch \
"