mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
lirc: linux 4.8 fix
This commit is contained in:
parent
af5d3ef4cc
commit
a0cdc3fd45
138
packages/sysutils/lirc/patches/lirc-0006-kernel-4.8.patch
Normal file
138
packages/sysutils/lirc/patches/lirc-0006-kernel-4.8.patch
Normal file
@ -0,0 +1,138 @@
|
||||
From 31fcc8aa39f62c5cbf0e4af19d253764c905e4d4 Mon Sep 17 00:00:00 2001
|
||||
From: Alec Leamas <leamas.alec@gmail.com>
|
||||
Date: Fri, 19 Aug 2016 04:48:02 +0200
|
||||
Subject: [PATCH 1/2] lircd: Remove use of functions killed in kernel 4.8.0
|
||||
|
||||
From 4.8.0 the kernel no longer supports LIRC_NOTIFY_DECODE,
|
||||
LIRC_SETUP_START/LIRC_SETUP_END and several constants related
|
||||
to initiating filters. Remove corresponding calls from lircd.
|
||||
---
|
||||
daemons/lircd.cpp | 51 ++-------------------------------------------------
|
||||
lib/driver.h | 7 +++++++
|
||||
2 files changed, 9 insertions(+), 49 deletions(-)
|
||||
|
||||
diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp
|
||||
index a7dbc94..a50d11f 100644
|
||||
--- a/daemons/lircd.cpp
|
||||
+++ b/daemons/lircd.cpp
|
||||
@@ -464,50 +464,6 @@ static int setup_timeout(void)
|
||||
}
|
||||
|
||||
|
||||
-static int setup_filter(void)
|
||||
-{
|
||||
- int ret1, ret2;
|
||||
- lirc_t min_pulse_supported = 0, max_pulse_supported = 0;
|
||||
- lirc_t min_space_supported = 0, max_space_supported = 0;
|
||||
-
|
||||
- if (!(curr_driver->features & LIRC_CAN_SET_REC_FILTER))
|
||||
- return 1;
|
||||
- if (curr_driver->drvctl_func(LIRC_GET_MIN_FILTER_PULSE,
|
||||
- &min_pulse_supported) == -1 ||
|
||||
- curr_driver->drvctl_func(LIRC_GET_MAX_FILTER_PULSE, &max_pulse_supported) == -1
|
||||
- || curr_driver->drvctl_func(LIRC_GET_MIN_FILTER_SPACE, &min_space_supported) == -1
|
||||
- || curr_driver->drvctl_func(LIRC_GET_MAX_FILTER_SPACE, &max_space_supported) == -1) {
|
||||
- log_error("could not get filter range");
|
||||
- log_perror_err(__func__);
|
||||
- }
|
||||
-
|
||||
- if (setup_min_pulse > max_pulse_supported)
|
||||
- setup_min_pulse = max_pulse_supported;
|
||||
- else if (setup_min_pulse < min_pulse_supported)
|
||||
- setup_min_pulse = 0; /* disable filtering */
|
||||
-
|
||||
- if (setup_min_space > max_space_supported)
|
||||
- setup_min_space = max_space_supported;
|
||||
- else if (setup_min_space < min_space_supported)
|
||||
- setup_min_space = 0; /* disable filtering */
|
||||
-
|
||||
- ret1 = curr_driver->drvctl_func(LIRC_SET_REC_FILTER_PULSE, &setup_min_pulse);
|
||||
- ret2 = curr_driver->drvctl_func(LIRC_SET_REC_FILTER_SPACE, &setup_min_space);
|
||||
- if (ret1 == -1 || ret2 == -1) {
|
||||
- if (curr_driver->
|
||||
- drvctl_func(LIRC_SET_REC_FILTER,
|
||||
- setup_min_pulse < setup_min_space ? &setup_min_pulse : &setup_min_space) == -1) {
|
||||
- log_error("could not set filter");
|
||||
- log_perror_err(__func__);
|
||||
- return 0;
|
||||
- }
|
||||
- }
|
||||
- return 1;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-
|
||||
-
|
||||
static int setup_hardware(void)
|
||||
{
|
||||
int ret = 1;
|
||||
@@ -516,10 +472,7 @@ static int setup_hardware(void)
|
||||
if ((curr_driver->features & LIRC_CAN_SET_REC_CARRIER)
|
||||
|| (curr_driver->features & LIRC_CAN_SET_REC_TIMEOUT)
|
||||
|| (curr_driver->features & LIRC_CAN_SET_REC_FILTER)) {
|
||||
- (void)curr_driver->drvctl_func(LIRC_SETUP_START, NULL);
|
||||
- ret = setup_frequency() && setup_timeout()
|
||||
- && setup_filter();
|
||||
- (void)curr_driver->drvctl_func(LIRC_SETUP_END, NULL);
|
||||
+ ret = setup_frequency() && setup_timeout();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
@@ -2162,7 +2115,7 @@ void loop(void)
|
||||
int reps;
|
||||
|
||||
if (curr_driver->drvctl_func && (curr_driver->features & LIRC_CAN_NOTIFY_DECODE))
|
||||
- curr_driver->drvctl_func(LIRC_NOTIFY_DECODE, NULL);
|
||||
+ curr_driver->drvctl_func(DRVCTL_NOTIFY_DECODE, NULL);
|
||||
|
||||
get_release_data(&remote_name, &button_name, &reps);
|
||||
|
||||
diff --git a/lib/driver.h b/lib/driver.h
|
||||
index c7c4a6a..fc7318e 100644
|
||||
--- a/lib/driver.h
|
||||
+++ b/lib/driver.h
|
||||
@@ -97,6 +97,13 @@ int drv_handle_options(const char* options);
|
||||
/** drvctl cmd: Free memory in argument obtained using DRVCTL_GET_DEVICES. */
|
||||
#define DRVCTL_FREE_DEVICES 6
|
||||
|
||||
+/**
|
||||
+ * The former LIRC_NOTIFY_DECODE, informs drier that signal is successfully
|
||||
+ * decoded e. g., to initiate some visual feedback through a LED.
|
||||
+ */
|
||||
+
|
||||
+#define DRVCTL_NOTIFY_DECODE 7
|
||||
+
|
||||
/** Last well-known command. Remaining is used in driver-specific controls.*/
|
||||
#define DRVCTL_MAX 128
|
||||
|
||||
--
|
||||
2.7.4
|
||||
|
||||
|
||||
From 55cd30e16a46bde49ccbbce1dea8bc734362170d Mon Sep 17 00:00:00 2001
|
||||
From: MilhouseVH <milhouseVH.github@nmacleod.com>
|
||||
Date: Fri, 30 Sep 2016 01:53:50 +0100
|
||||
Subject: [PATCH 2/2] build hack
|
||||
|
||||
Hack to build with 4.8 backport above. Including "driver.h"
|
||||
isn't enough, but this works. Can all be dropped once lirc
|
||||
0.9.5 is released.
|
||||
---
|
||||
daemons/lircd.cpp | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp
|
||||
index a50d11f..8b46bc0 100644
|
||||
--- a/daemons/lircd.cpp
|
||||
+++ b/daemons/lircd.cpp
|
||||
@@ -71,6 +71,7 @@
|
||||
#endif
|
||||
|
||||
#include "lirc_private.h"
|
||||
+#define DRVCTL_NOTIFY_DECODE 7
|
||||
|
||||
#ifdef HAVE_INT_GETGROUPLIST_GROUPS
|
||||
#define lirc_gid int
|
||||
--
|
||||
2.7.4
|
||||
|
Loading…
x
Reference in New Issue
Block a user