This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-dvb.git tree:

Subject: V4L/DVB: ir-nec-decoder: Cleanups
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Sat Apr 3 20:33:00 2010 -0300

Remove dead code and properly name a few constants

Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/IR/ir-nec-decoder.c |   40 +++++++-----------------------------
 1 files changed, 8 insertions(+), 32 deletions(-)

---

http://git.linuxtv.org/v4l-dvb.git?a=commitdiff;h=4d4665f0e9cf083a3ba2d4baa25543d3cd079e9f

diff --git a/drivers/media/IR/ir-nec-decoder.c 
b/drivers/media/IR/ir-nec-decoder.c
index 33b260f..087211c 100644
--- a/drivers/media/IR/ir-nec-decoder.c
+++ b/drivers/media/IR/ir-nec-decoder.c
@@ -14,38 +14,14 @@
 
 #include <media/ir-core.h>
 
+#define NEC_NBITS              32
 #define NEC_UNIT               559979 /* ns */
 #define NEC_HEADER_MARK                (16 * NEC_UNIT)
 #define NEC_HEADER_SPACE       (8 * NEC_UNIT)
 #define NEC_REPEAT_SPACE       (4 * NEC_UNIT)
 #define NEC_MARK               (NEC_UNIT)
-#define NEC_0_SYMBOL           (NEC_UNIT)
-#define NEC_1_SYMBOL           (3 * NEC_UNIT)
-
-/* Start time: 4.5 ms + 560 us of the next pulse */
-#define MIN_START_TIME (3900000 + 560000)
-#define MAX_START_TIME (5100000 + 560000)
-
-/* Bit 1 time: 2.25ms us */
-#define MIN_BIT1_TIME  2050000
-#define MAX_BIT1_TIME  2450000
-
-/* Bit 0 time: 1.12ms us */
-#define MIN_BIT0_TIME  920000
-#define MAX_BIT0_TIME  1320000
-
-/* 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 */
+#define NEC_0_SPACE            (NEC_UNIT)
+#define NEC_1_SPACE            (3 * NEC_UNIT)
 
 /* Used to register nec_decoder clients */
 static LIST_HEAD(decoder_list);
@@ -223,11 +199,11 @@ static int handle_event(struct input_dev *input_dev,
                if (last_bit)
                        goto err;
 
-               if ((ev->delta.tv_nsec >= NEC_0_SYMBOL - NEC_UNIT / 2) &&
-                   (ev->delta.tv_nsec < NEC_0_SYMBOL + NEC_UNIT / 2))
+               if ((ev->delta.tv_nsec >= NEC_0_SPACE - NEC_UNIT / 2) &&
+                   (ev->delta.tv_nsec < NEC_0_SPACE + NEC_UNIT / 2))
                        bit = 0;
-               else if ((ev->delta.tv_nsec >= NEC_1_SYMBOL - NEC_UNIT / 2) &&
-                        (ev->delta.tv_nsec < NEC_1_SYMBOL + NEC_UNIT / 2))
+               else if ((ev->delta.tv_nsec >= NEC_1_SPACE - NEC_UNIT / 2) &&
+                        (ev->delta.tv_nsec < NEC_1_SPACE + NEC_UNIT / 2))
                        bit = 1;
                else {
                        IR_dprintk(1, "Decode failed at %d-th bit (%s) 
@%luus\n",
@@ -256,7 +232,7 @@ static int handle_event(struct input_dev *input_dev,
                                data->nec_code.not_command |= 1 << (shift - 24);
                        }
                }
-               if (++data->count == 32) {
+               if (++data->count == NEC_NBITS) {
                        u32 scancode;
                        /*
                         * Fixme: may need to accept Extended NEC protocol?

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to