summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/rc-loopback.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2022-01-15 11:19:11 +0100
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-01-28 19:32:50 +0100
commit68a99f6a0ebfe9101ea79ba5af1c407a5ad4f629 (patch)
treeb69aadd1e508be6ab565b8da568edc3e812e8484 /drivers/media/rc/rc-loopback.c
parent950170d6d2a5d3c0c959696d2440e5c8dfd02896 (diff)
downloadlinux-68a99f6a0ebfe9101ea79ba5af1c407a5ad4f629.tar.bz2
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>
Diffstat (limited to 'drivers/media/rc/rc-loopback.c')
-rw-r--r--drivers/media/rc/rc-loopback.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c
index 6441879fcba1..b356041c5c00 100644
--- a/drivers/media/rc/rc-loopback.c
+++ b/drivers/media/rc/rc-loopback.c
@@ -112,7 +112,11 @@ static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count)
rawir.pulse = i % 2 ? false : true;
rawir.duration = txbuf[i];
- ir_raw_event_store_with_filter(dev, &rawir);
+ /* simulate overflow if ridiculously long pulse was sent */
+ if (rawir.pulse && rawir.duration > MS_TO_US(50))
+ ir_raw_event_overflow(dev);
+ else
+ ir_raw_event_store_with_filter(dev, &rawir);
}
if (lodev->carrierreport) {