Skip to content

Commit

Permalink
media: lirc: always send timeout reports
Browse files Browse the repository at this point in the history
Without timeout reports, it is impossible to decode many protocols since
it is not known when the transmission ends. timeout reports are sent by
default, but can be turned off. There is no reason to turn them off, and
I cannot find any software which does this, so we can safely remove it.

This makes the ioctl LIRC_SET_REC_TIMEOUT_REPORTS a no-op.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
seanyoung authored and mchehab committed Dec 14, 2021
1 parent 9b4d7b5 commit 74747dd
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 62 deletions.
2 changes: 2 additions & 0 deletions Documentation/userspace-api/media/lirc.h.rst.exceptions
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ignore define LIRC_CAN_SET_REC_DUTY_CYCLE
# Obsolete ioctls

ignore ioctl LIRC_GET_LENGTH
ignore ioctl LIRC_SET_REC_TIMEOUT_REPORTS

# rc protocols

Expand Down Expand Up @@ -73,6 +74,7 @@ ignore define PULSE_MASK

ignore define LIRC_MODE2_SPACE
ignore define LIRC_MODE2_PULSE
ignore define LIRC_MODE2_TIMEOUT

ignore define LIRC_VALUE_MASK
ignore define LIRC_MODE2_MASK
Expand Down
8 changes: 3 additions & 5 deletions Documentation/userspace-api/media/rc/lirc-dev-intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,9 @@ on the following table.

``LIRC_MODE2_TIMEOUT``

If timeout reports are enabled with
:ref:`lirc_set_rec_timeout_reports`, when the timeout set with
:ref:`lirc_set_rec_timeout` expires due to no IR being detected,
this packet will be sent, with the number of microseconds with
no IR.
When the timeout set with :ref:`lirc_set_rec_timeout` expires due
to no IR being detected, this packet will be sent, with the number
of microseconds with no IR.

.. _lirc-mode-pulse:

Expand Down
1 change: 0 additions & 1 deletion Documentation/userspace-api/media/rc/lirc-func.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ LIRC Function Reference
lirc-set-rec-carrier-range
lirc-set-send-carrier
lirc-set-transmitter-mask
lirc-set-rec-timeout-reports
lirc-set-measure-carrier-mode
lirc-set-wideband-receiver

This file was deleted.

5 changes: 0 additions & 5 deletions drivers/media/rc/lirc_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ void lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev)

spin_lock_irqsave(&dev->lirc_fh_lock, flags);
list_for_each_entry(fh, &dev->lirc_fh, list) {
if (LIRC_IS_TIMEOUT(sample) && !fh->send_timeout_reports)
continue;
if (kfifo_put(&fh->rawir, sample))
wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM);
}
Expand Down Expand Up @@ -166,7 +164,6 @@ static int lirc_open(struct inode *inode, struct file *file)

fh->send_mode = LIRC_MODE_PULSE;
fh->rc = dev;
fh->send_timeout_reports = true;

if (dev->driver_type == RC_DRIVER_SCANCODE)
fh->rec_mode = LIRC_MODE_SCANCODE;
Expand Down Expand Up @@ -570,8 +567,6 @@ static long lirc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case LIRC_SET_REC_TIMEOUT_REPORTS:
if (dev->driver_type != RC_DRIVER_IR_RAW)
ret = -ENOTTY;
else
fh->send_timeout_reports = !!val;
break;

default:
Expand Down
2 changes: 0 additions & 2 deletions include/media/rc-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ enum rc_filter_type {
* @rc: rcdev for this lirc chardev
* @carrier_low: when setting the carrier range, first the low end must be
* set with an ioctl and then the high end with another ioctl
* @send_timeout_reports: report timeouts in lirc raw IR.
* @rawir: queue for incoming raw IR
* @scancodes: queue for incoming decoded scancodes
* @wait_poll: poll struct for lirc device
Expand All @@ -72,7 +71,6 @@ struct lirc_fh {
struct list_head list;
struct rc_dev *rc;
int carrier_low;
bool send_timeout_reports;
DECLARE_KFIFO_PTR(rawir, unsigned int);
DECLARE_KFIFO_PTR(scancodes, struct lirc_scancode);
wait_queue_head_t wait_poll;
Expand Down

0 comments on commit 74747dd

Please sign in to comment.