Skip to content

Commit

Permalink
Revert "[media] rc: rc-loopback: Add loopback of filter scancodes"
Browse files Browse the repository at this point in the history
This reverts commit 2e4ebde.

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>
  • Loading branch information
David Härdeman authored and Mauro Carvalho Chehab committed Aug 19, 2015
1 parent 23f28f2 commit 8abfebd
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions drivers/media/rc/rc-loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <linux/device.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <media/rc-core.h>

#define DRIVER_NAME "rc-loopback"
Expand Down Expand Up @@ -177,39 +176,6 @@ static int loop_set_carrier_report(struct rc_dev *dev, int enable)
return 0;
}

static int loop_set_wakeup_filter(struct rc_dev *dev,
struct rc_scancode_filter *sc_filter)
{
static const unsigned int max = 512;
struct ir_raw_event *raw;
int ret;
int i;

/* fine to disable filter */
if (!sc_filter->mask)
return 0;

/* encode the specified filter and loop it back */
raw = kmalloc_array(max, sizeof(*raw), GFP_KERNEL);
ret = ir_raw_encode_scancode(dev->enabled_wakeup_protocols, sc_filter,
raw, max);
/* still loop back the partial raw IR even if it's incomplete */
if (ret == -ENOBUFS)
ret = max;
if (ret >= 0) {
/* do the loopback */
for (i = 0; i < ret; ++i)
ir_raw_event_store(dev, &raw[i]);
ir_raw_event_handle(dev);

ret = 0;
}

kfree(raw);

return ret;
}

static int __init loop_init(void)
{
struct rc_dev *rc;
Expand All @@ -229,7 +195,6 @@ static int __init loop_init(void)
rc->map_name = RC_MAP_EMPTY;
rc->priv = &loopdev;
rc->driver_type = RC_DRIVER_IR_RAW;
rc->encode_wakeup = true;
rc->allowed_protocols = RC_BIT_ALL;
rc->timeout = 100 * 1000 * 1000; /* 100 ms */
rc->min_timeout = 1;
Expand All @@ -244,7 +209,6 @@ static int __init loop_init(void)
rc->s_idle = loop_set_idle;
rc->s_learning_mode = loop_set_learning_mode;
rc->s_carrier_report = loop_set_carrier_report;
rc->s_wakeup_filter = loop_set_wakeup_filter;

loopdev.txmask = RXMASK_REGULAR;
loopdev.txcarrier = 36000;
Expand Down

0 comments on commit 8abfebd

Please sign in to comment.