dtc: update legal info
[buildroot-gz.git] / package / lirc-tools / 0003-lircd-Remove-use-of-functions-killed-in-kernel-4.8.0.patch
blob9fe5256cebcfce565d7ea4c91204a82b32da7132
1 From 45c590f64dd79e8e1704d5c94ce3456a5cdbfa5f Mon Sep 17 00:00:00 2001
2 From: Alec Leamas <leamas.alec@gmail.com>
3 Date: Fri, 19 Aug 2016 04:48:02 +0200
4 Subject: [PATCH] lircd: Remove use of functions killed in kernel 4.8.0
6 From 4.8.0 the kernel no longer supports LIRC_NOTIFY_DECODE,
7 LIRC_SETUP_START/LIRC_SETUP_END and several constants related
8 to initiating filters. Remove corresponding calls from lircd.
10 [baruch: move DRVCTL_NOTIFY_DECODE into lircd.cpp]
11 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
12 ---
13 Patch status: backported from upstream 31fcc8aa39f62c5c
14 ---
15 daemons/lircd.cpp | 53 ++++-------------------------------------------------
16 1 file changed, 4 insertions(+), 49 deletions(-)
18 diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp
19 index 782b6d3f8342..d778aa19308b 100644
20 --- a/daemons/lircd.cpp
21 +++ b/daemons/lircd.cpp
22 @@ -78,6 +78,8 @@
23 #define lirc_gid gid_t
24 #endif
26 +#define DRVCTL_NOTIFY_DECODE 7
28 #ifdef DARWIN
29 #include <mach/mach_time.h>
30 #define CLOCK_REALTIME 0
31 @@ -462,50 +464,6 @@ static int setup_timeout(void)
35 -static int setup_filter(void)
37 - int ret1, ret2;
38 - lirc_t min_pulse_supported = 0, max_pulse_supported = 0;
39 - lirc_t min_space_supported = 0, max_space_supported = 0;
41 - if (!(curr_driver->features & LIRC_CAN_SET_REC_FILTER))
42 - return 1;
43 - if (curr_driver->drvctl_func(LIRC_GET_MIN_FILTER_PULSE,
44 - &min_pulse_supported) == -1 ||
45 - curr_driver->drvctl_func(LIRC_GET_MAX_FILTER_PULSE, &max_pulse_supported) == -1
46 - || curr_driver->drvctl_func(LIRC_GET_MIN_FILTER_SPACE, &min_space_supported) == -1
47 - || curr_driver->drvctl_func(LIRC_GET_MAX_FILTER_SPACE, &max_space_supported) == -1) {
48 - log_error("could not get filter range");
49 - log_perror_err(__func__);
50 - }
52 - if (setup_min_pulse > max_pulse_supported)
53 - setup_min_pulse = max_pulse_supported;
54 - else if (setup_min_pulse < min_pulse_supported)
55 - setup_min_pulse = 0; /* disable filtering */
57 - if (setup_min_space > max_space_supported)
58 - setup_min_space = max_space_supported;
59 - else if (setup_min_space < min_space_supported)
60 - setup_min_space = 0; /* disable filtering */
62 - ret1 = curr_driver->drvctl_func(LIRC_SET_REC_FILTER_PULSE, &setup_min_pulse);
63 - ret2 = curr_driver->drvctl_func(LIRC_SET_REC_FILTER_SPACE, &setup_min_space);
64 - if (ret1 == -1 || ret2 == -1) {
65 - if (curr_driver->
66 - drvctl_func(LIRC_SET_REC_FILTER,
67 - setup_min_pulse < setup_min_space ? &setup_min_pulse : &setup_min_space) == -1) {
68 - log_error("could not set filter");
69 - log_perror_err(__func__);
70 - return 0;
71 - }
72 - }
73 - return 1;
79 static int setup_hardware(void)
81 int ret = 1;
82 @@ -514,10 +472,7 @@ static int setup_hardware(void)
83 if ((curr_driver->features & LIRC_CAN_SET_REC_CARRIER)
84 || (curr_driver->features & LIRC_CAN_SET_REC_TIMEOUT)
85 || (curr_driver->features & LIRC_CAN_SET_REC_FILTER)) {
86 - (void)curr_driver->drvctl_func(LIRC_SETUP_START, NULL);
87 - ret = setup_frequency() && setup_timeout()
88 - && setup_filter();
89 - (void)curr_driver->drvctl_func(LIRC_SETUP_END, NULL);
90 + ret = setup_frequency() && setup_timeout();
93 return ret;
94 @@ -2162,7 +2117,7 @@ void loop(void)
95 int reps;
97 if (curr_driver->drvctl_func && (curr_driver->features & LIRC_CAN_NOTIFY_DECODE))
98 - curr_driver->drvctl_func(LIRC_NOTIFY_DECODE, NULL);
99 + curr_driver->drvctl_func(DRVCTL_NOTIFY_DECODE, NULL);
101 get_release_data(&remote_name, &button_name, &reps);
104 2.9.3