media: mtk-cir: fix calculation of chk period
authorSean Young <sean@mess.org>
Sun, 29 Nov 2020 17:01:26 +0000 (18:01 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 1 Dec 2020 15:00:51 +0000 (16:00 +0100)
commitd904eb0b351fe5545d9ba5b85844342f49025923
treeb3412a6ca6b59a2d98ded7b334b92586dc0b1de1
parent44f28934af141149959c4e6495bb60c1903bda32
media: mtk-cir: fix calculation of chk period

Since commit 528222d853f9 ("media: rc: harmonize infrared durations to
microseconds"), the calculation of the chk period is wrong. As a result,
all reported IR will have incorrect timings.

Now that the calculations are done in microseconds rather than nanoseconds,
we can fold the calculations in a simpler form with less rounding error.

Tested-by: Frank Wunderlich <frank-w@public-files.de>
Fixes: 528222d853f9 ("media: rc: harmonize infrared durations to microseconds")
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/rc/mtk-cir.c