media: lirc: report ir receiver overflow

If the driver reports that the hardware had an overflow, report this to
userspace. It would be nice to know when this happens, and not just get
a long space.

This change has been tested with lircd, ir-ctl, and ir-keytable.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Sean Young
2022-01-15 11:19:11 +01:00
committed by Mauro Carvalho Chehab
parent 950170d6d2
commit 68a99f6a0e
5 changed files with 30 additions and 14 deletions

View File

@@ -44,14 +44,13 @@ void lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev)
/* Receiver overflow, data missing */
if (ev.overflow) {
/*
* Userspace expects a long space event before the start of
* the signal to use as a sync. This may be done with repeat
* packets and normal samples. But if an overflow has been sent
* then we assume that a long time has passed, so we send a
* space with the maximum time value.
* Send lirc overflow message. This message is unknown to
* lircd, but it will interpret this as a long space as
* long as the value is set to high value. This resets its
* decoder state.
*/
sample = LIRC_SPACE(LIRC_VALUE_MASK);
dev_dbg(&dev->dev, "delivering overflow space to lirc_dev\n");
sample = LIRC_OVERFLOW(LIRC_VALUE_MASK);
dev_dbg(&dev->dev, "delivering overflow to lirc_dev\n");
/* Carrier reports */
} else if (ev.carrier_report) {