media: rc: extend the margin for nec decoder
Daniel Fu [Tue, 3 Feb 2015 12:21:09 +0000 (12:21 +0000)]
Bug 1601127

Change-Id: If39a358ec0726d06b201b32f6c26872e0c6b7d04
Signed-off-by: Daniel Fu <danifu@nvidia.com>
Reviewed-on: http://git-master/r/680617
(cherry picked from commit 0d7791e368bafaadfd70d08318c040423d32166e)
Reviewed-on: http://git-master/r/816584
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinayak Pane <vpane@nvidia.com>

drivers/media/rc/ir-nec-decoder.c

index 9a90094..822bfbd 100644 (file)
@@ -106,7 +106,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
                if (!ev.pulse)
                        break;
 
-               if (!eq_margin(ev.duration, NEC_BIT_PULSE, NEC_UNIT / 2))
+               if (!eq_margin(ev.duration, NEC_BIT_PULSE, NEC_UNIT))
                        break;
 
                data->state = STATE_BIT_SPACE;
@@ -128,9 +128,9 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
                        data->necx_repeat = false;
 
                data->bits <<= 1;
-               if (eq_margin(ev.duration, NEC_BIT_1_SPACE, NEC_UNIT / 2))
+               if (eq_margin(ev.duration, NEC_BIT_1_SPACE, NEC_UNIT))
                        data->bits |= 1;
-               else if (!eq_margin(ev.duration, NEC_BIT_0_SPACE, NEC_UNIT / 2))
+               else if (!eq_margin(ev.duration, NEC_BIT_0_SPACE, NEC_UNIT))
                        break;
                data->count++;
 
@@ -145,7 +145,7 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
                if (!ev.pulse)
                        break;
 
-               if (!eq_margin(ev.duration, NEC_TRAILER_PULSE, NEC_UNIT / 2))
+               if (!eq_margin(ev.duration, NEC_TRAILER_PULSE, NEC_UNIT))
                        break;
 
                data->state = STATE_TRAILER_SPACE;