aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2015-07-20 15:16:36 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-19 06:02:53 -0400
commit8abfebdb00fa8f2acb3923386e3cb1570d2c1d8e (patch)
tree5ecefdf1f0bca2569fd7343646d76a8dacd00736
parent23f28f2adcf608170c9062b1f490c4f0dcc995e3 (diff)
Revert "[media] rc: rc-loopback: Add loopback of filter scancodes"
This reverts commit 2e4ebde269236da2a41183522127715b6d9d80ce. The current code is not mature enough, the API should allow a single protocol to be specified. Also, the current code contains heuristics that will depend on module load order. Signed-off-by: David Härdeman <david@hardeman.nu> Acked-by: Antti Seppälä <a.seppala@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/rc/rc-loopback.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
index d8bdf63ce985..63dace8198b0 100644
--- a/drivers/media/rc/rc-loopback.c
+++ b/drivers/media/rc/rc-loopback.c
@@ -26,7 +26,6 @@
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/sched.h> 28#include <linux/sched.h>
29#include <linux/slab.h>
30#include <media/rc-core.h> 29#include <media/rc-core.h>
31 30
32#define DRIVER_NAME "rc-loopback" 31#define DRIVER_NAME "rc-loopback"
@@ -177,39 +176,6 @@ static int loop_set_carrier_report(struct rc_dev *dev, int enable)
177 return 0; 176 return 0;
178} 177}
179 178
180static int loop_set_wakeup_filter(struct rc_dev *dev,
181 struct rc_scancode_filter *sc_filter)
182{
183 static const unsigned int max = 512;
184 struct ir_raw_event *raw;
185 int ret;
186 int i;
187
188 /* fine to disable filter */
189 if (!sc_filter->mask)
190 return 0;
191
192 /* encode the specified filter and loop it back */
193 raw = kmalloc_array(max, sizeof(*raw), GFP_KERNEL);
194 ret = ir_raw_encode_scancode(dev->enabled_wakeup_protocols, sc_filter,
195 raw, max);
196 /* still loop back the partial raw IR even if it's incomplete */
197 if (ret == -ENOBUFS)
198 ret = max;
199 if (ret >= 0) {
200 /* do the loopback */
201 for (i = 0; i < ret; ++i)
202 ir_raw_event_store(dev, &raw[i]);
203 ir_raw_event_handle(dev);
204
205 ret = 0;
206 }
207
208 kfree(raw);
209
210 return ret;
211}
212
213static int __init loop_init(void) 179static int __init loop_init(void)
214{ 180{
215 struct rc_dev *rc; 181 struct rc_dev *rc;
@@ -229,7 +195,6 @@ static int __init loop_init(void)
229 rc->map_name = RC_MAP_EMPTY; 195 rc->map_name = RC_MAP_EMPTY;
230 rc->priv = &loopdev; 196 rc->priv = &loopdev;
231 rc->driver_type = RC_DRIVER_IR_RAW; 197 rc->driver_type = RC_DRIVER_IR_RAW;
232 rc->encode_wakeup = true;
233 rc->allowed_protocols = RC_BIT_ALL; 198 rc->allowed_protocols = RC_BIT_ALL;
234 rc->timeout = 100 * 1000 * 1000; /* 100 ms */ 199 rc->timeout = 100 * 1000 * 1000; /* 100 ms */
235 rc->min_timeout = 1; 200 rc->min_timeout = 1;
@@ -244,7 +209,6 @@ static int __init loop_init(void)
244 rc->s_idle = loop_set_idle; 209 rc->s_idle = loop_set_idle;
245 rc->s_learning_mode = loop_set_learning_mode; 210 rc->s_learning_mode = loop_set_learning_mode;
246 rc->s_carrier_report = loop_set_carrier_report; 211 rc->s_carrier_report = loop_set_carrier_report;
247 rc->s_wakeup_filter = loop_set_wakeup_filter;
248 212
249 loopdev.txmask = RXMASK_REGULAR; 213 loopdev.txmask = RXMASK_REGULAR;
250 loopdev.txcarrier = 36000; 214 loopdev.txcarrier = 36000;