media: rc: fix timeout handling after switch to microsecond durations
authorMatthias Reichl <hias@horus.com>
Tue, 5 Jan 2021 09:30:23 +0000 (10:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2021 22:28:38 +0000 (23:28 +0100)
commit8429fee291434b3519fa074a15fa979fc63dbee1
treea311576ddb7eef5f1780a551b9402655cb4dd50c
parent4b5a88b3f45cd0f7a7025c53a4b448f4bab88c00
media: rc: fix timeout handling after switch to microsecond durations

commit 06b831588b639ad9d94e4789b0250562228722c2 upstream.

Commit 528222d853f92 ("media: rc: harmonize infrared durations to
microseconds") missed to switch some timeout calculations from
nanoseconds to microseconds. This resulted in spurious key_up+key_down
events at the last scancode if the rc device uses a long timeout
(eg 100ms on nuvoton-cir) as the device timeout wasn't properly
accounted for in the keyup timeout calculation.

Fix this by applying the proper conversion functions.

Cc: stable@vger.kernel.org
Fixes: 528222d853f92 ("media: rc: harmonize infrared durations to microseconds")
Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/rc/ir-mce_kbd-decoder.c
drivers/media/rc/rc-main.c
drivers/media/rc/serial_ir.c