Commit 829bbf26 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: rc: nec decoder should not send both repeat and keycode

When receiving an nec repeat, rc_repeat() is called and then rc_keydown()
with the last decoded scancode. That last call is redundant.

Fixes: 265a2988 ("media: rc-core: consistent use of rc_repeat()")

Cc: <stable@vger.kernel.org> # v4.14
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 2265425f
...@@ -87,8 +87,6 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -87,8 +87,6 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
data->state = STATE_BIT_PULSE; data->state = STATE_BIT_PULSE;
return 0; return 0;
} else if (eq_margin(ev.duration, NEC_REPEAT_SPACE, NEC_UNIT / 2)) { } else if (eq_margin(ev.duration, NEC_REPEAT_SPACE, NEC_UNIT / 2)) {
rc_repeat(dev);
IR_dprintk(1, "Repeat last key\n");
data->state = STATE_TRAILER_PULSE; data->state = STATE_TRAILER_PULSE;
return 0; return 0;
} }
...@@ -151,19 +149,26 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev) ...@@ -151,19 +149,26 @@ static int ir_nec_decode(struct rc_dev *dev, struct ir_raw_event ev)
if (!geq_margin(ev.duration, NEC_TRAILER_SPACE, NEC_UNIT / 2)) if (!geq_margin(ev.duration, NEC_TRAILER_SPACE, NEC_UNIT / 2))
break; break;
if (data->count == NEC_NBITS) {
address = bitrev8((data->bits >> 24) & 0xff); address = bitrev8((data->bits >> 24) & 0xff);
not_address = bitrev8((data->bits >> 16) & 0xff); not_address = bitrev8((data->bits >> 16) & 0xff);
command = bitrev8((data->bits >> 8) & 0xff); command = bitrev8((data->bits >> 8) & 0xff);
not_command = bitrev8((data->bits >> 0) & 0xff); not_command = bitrev8((data->bits >> 0) & 0xff);
scancode = ir_nec_bytes_to_scancode(address, not_address, scancode = ir_nec_bytes_to_scancode(address,
command, not_command, not_address,
command,
not_command,
&rc_proto); &rc_proto);
if (data->is_nec_x) if (data->is_nec_x)
data->necx_repeat = true; data->necx_repeat = true;
rc_keydown(dev, rc_proto, scancode, 0); rc_keydown(dev, rc_proto, scancode, 0);
} else {
rc_repeat(dev);
}
data->state = STATE_INACTIVE; data->state = STATE_INACTIVE;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment