/* ir-raw.c - handle IR pulse/space events
*
* Copyright (C) 2010 by Mauro Carvalho Chehab <mchehab@redhat.com>
+ * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
ktime_t now;
s64 delta; /* ns */
DEFINE_IR_RAW_EVENT(ev);
+ DEFINE_IR_RAW_EVENT(drop_ev);
int rc = 0;
int delay;
+ bool flag = false;
if (!dev->raw)
return -EINVAL;
*/
if (delta > delay || !dev->raw->last_type)
type |= IR_START_EVENT;
- else
+ else {
ev.duration = delta;
+ if (dev->allowed_protos & RC_BIT_NEC) {
+ if (type == dev->raw->last_type) {
+ drop_ev.duration = 0;
+ if (type == IR_PULSE) {
+ flag = true;
+ drop_ev.pulse = false;
+ drop_ev.duration = 562500;
+ } else if (type == IR_SPACE) {
+ flag = true;
+ drop_ev.pulse = true;
+ drop_ev.duration = 562500;
+ }
+
+ ev.duration = ev.duration - drop_ev.duration;
+ }
+ }
+ }
+
if (type & IR_START_EVENT)
ir_raw_event_reset(dev);
else if (dev->raw->last_type & IR_SPACE) {
} else
return 0;
+ if (flag)
+ rc = ir_raw_event_store(dev, &drop_ev);
+
dev->raw->last_event = now;
dev->raw->last_type = type;
return rc;
#define IR_TAB_MAX_SIZE 8192
/* FIXME: IR_KEYPRESS_TIMEOUT should be protocol specific */
-#define IR_KEYPRESS_TIMEOUT 250
+#define IR_KEYPRESS_TIMEOUT 125
/* Used to keep track of known keymaps */
static LIST_HEAD(rc_map_list);