-/* Bit 0 space time: 1.12ms-560 us */
-#define MIN_BIT0_TIME 360000
-#define MAX_BIT0_TIME 760000
+/* Total IR code is 110 ms, including the 9 ms for the start pulse */
+#define MAX_NEC_TIME 4000000
+
+/* Total IR code is 110 ms, including the 9 ms for the start pulse */
+#define MIN_REPEAT_TIME 99000000
+#define MAX_REPEAT_TIME 112000000
+
+/* Repeat time: 2.25ms us */
+#define MIN_REPEAT_START_TIME 2050000
+#define MAX_REPEAT_START_TIME 3000000
+
+#define REPEAT_TIME 240 /* ms */
+
+/** is_repeat - Check if it is a NEC repeat event
+ * @input_dev: the struct input_dev descriptor of the device
+ * @pos: the position of the first event
+ * @len: the length of the buffer
+ */
+static int is_repeat(struct ir_raw_event *evs, int len, int pos)
+{
+ if ((evs[pos].delta.tv_nsec < MIN_REPEAT_START_TIME) ||
+ (evs[pos].delta.tv_nsec > MAX_REPEAT_START_TIME))
+ return 0;
+
+ if (++pos >= len)
+ return 0;
+
+ if ((evs[pos].delta.tv_nsec < MIN_REPEAT_TIME) ||
+ (evs[pos].delta.tv_nsec > MAX_REPEAT_TIME))
+ return 0;
+
+ return 1;
+}