summaryrefslogtreecommitdiffstats
path: root/drivers/media/IR/ir-nec-decoder.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2010-04-04 10:44:51 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 12:56:57 -0300
commit587835a4b0ada7d78c4f3300e3ab26b7b2495705 (patch)
treead22f6a0e603f19450227b0cb260b5bb5960dfd5 /drivers/media/IR/ir-nec-decoder.c
parent26d5683d36729f11f5764909ae37c69488596d36 (diff)
V4L-DVB: ir-core: remove the ancillary buffer
Now that the decoders are state machine, there's no need to create an ancillary buffer while decoding the protocol. Just call the decoders code directly, event by event. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/ir-nec-decoder.c')
-rw-r--r--drivers/media/IR/ir-nec-decoder.c32
1 files changed, 3 insertions, 29 deletions
diff --git a/drivers/media/IR/ir-nec-decoder.c b/drivers/media/IR/ir-nec-decoder.c
index 087211c5496a..28d773563556 100644
--- a/drivers/media/IR/ir-nec-decoder.c
+++ b/drivers/media/IR/ir-nec-decoder.c
@@ -125,14 +125,14 @@ static struct attribute_group decoder_attribute_group = {
/**
- * handle_event() - Decode one NEC pulse or space
+ * ir_nec_decode() - Decode one NEC pulse or space
* @input_dev: the struct input_dev descriptor of the device
* @ev: event array with type/duration of pulse/space
*
* This function returns -EINVAL if the pulse violates the state machine
*/
-static int handle_event(struct input_dev *input_dev,
- struct ir_raw_event *ev)
+static int ir_nec_decode(struct input_dev *input_dev,
+ struct ir_raw_event *ev)
{
struct decoder_data *data;
struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
@@ -289,32 +289,6 @@ checksum_err:
return -EINVAL;
}
-/**
- * ir_nec_decode() - Decodes all NEC pulsecodes on a given array
- * @input_dev: the struct input_dev descriptor of the device
- * @evs: event array with type/duration of pulse/space
- * @len: length of the array
- * This function returns the number of decoded pulses
- */
-static int ir_nec_decode(struct input_dev *input_dev,
- struct ir_raw_event *evs,
- int len)
-{
- struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
- struct decoder_data *data;
- int pos = 0;
- int rc = 0;
-
- data = get_decoder_data(ir_dev);
- if (!data || !data->enabled)
- return 0;
-
- for (pos = 0; pos < len; pos++)
- handle_event(input_dev, &evs[pos]);
-
- return rc;
-}
-
static int ir_nec_register(struct input_dev *input_dev)
{
struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);