Skip to content

Commit 74747dd

Browse files
seanyoungmchehab
authored andcommitted
media: lirc: always send timeout reports
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>
1 parent 9b4d7b5 commit 74747dd

6 files changed

Lines changed: 5 additions & 62 deletions

File tree

‎Documentation/userspace-api/media/lirc.h.rst.exceptions‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ ignore define LIRC_CAN_SET_REC_DUTY_CYCLE
3333
# Obsolete ioctls
3434

3535
ignore ioctl LIRC_GET_LENGTH
36+
ignore ioctl LIRC_SET_REC_TIMEOUT_REPORTS
3637

3738
# rc protocols
3839

@@ -73,6 +74,7 @@ ignore define PULSE_MASK
7374

7475
ignore define LIRC_MODE2_SPACE
7576
ignore define LIRC_MODE2_PULSE
77+
ignore define LIRC_MODE2_TIMEOUT
7678

7779
ignore define LIRC_VALUE_MASK
7880
ignore define LIRC_MODE2_MASK

‎Documentation/userspace-api/media/rc/lirc-dev-intro.rst‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,9 @@ on the following table.
117117

118118
``LIRC_MODE2_TIMEOUT``
119119

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

126124
.. _lirc-mode-pulse:
127125

‎Documentation/userspace-api/media/rc/lirc-func.rst‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ LIRC Function Reference
2222
lirc-set-rec-carrier-range
2323
lirc-set-send-carrier
2424
lirc-set-transmitter-mask
25-
lirc-set-rec-timeout-reports
2625
lirc-set-measure-carrier-mode
2726
lirc-set-wideband-receiver

‎Documentation/userspace-api/media/rc/lirc-set-rec-timeout-reports.rst‎

Lines changed: 0 additions & 49 deletions
This file was deleted.

‎drivers/media/rc/lirc_dev.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ void lirc_raw_event(struct rc_dev *dev, struct ir_raw_event ev)
102102

103103
spin_lock_irqsave(&dev->lirc_fh_lock, flags);
104104
list_for_each_entry(fh, &dev->lirc_fh, list) {
105-
if (LIRC_IS_TIMEOUT(sample) && !fh->send_timeout_reports)
106-
continue;
107105
if (kfifo_put(&fh->rawir, sample))
108106
wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM);
109107
}
@@ -166,7 +164,6 @@ static int lirc_open(struct inode *inode, struct file *file)
166164

167165
fh->send_mode = LIRC_MODE_PULSE;
168166
fh->rc = dev;
169-
fh->send_timeout_reports = true;
170167

171168
if (dev->driver_type == RC_DRIVER_SCANCODE)
172169
fh->rec_mode = LIRC_MODE_SCANCODE;
@@ -570,8 +567,6 @@ static long lirc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
570567
case LIRC_SET_REC_TIMEOUT_REPORTS:
571568
if (dev->driver_type != RC_DRIVER_IR_RAW)
572569
ret = -ENOTTY;
573-
else
574-
fh->send_timeout_reports = !!val;
575570
break;
576571

577572
default:

‎include/media/rc-core.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ enum rc_filter_type {
5959
* @rc: rcdev for this lirc chardev
6060
* @carrier_low: when setting the carrier range, first the low end must be
6161
* set with an ioctl and then the high end with another ioctl
62-
* @send_timeout_reports: report timeouts in lirc raw IR.
6362
* @rawir: queue for incoming raw IR
6463
* @scancodes: queue for incoming decoded scancodes
6564
* @wait_poll: poll struct for lirc device
@@ -72,7 +71,6 @@ struct lirc_fh {
7271
struct list_head list;
7372
struct rc_dev *rc;
7473
int carrier_low;
75-
bool send_timeout_reports;
7674
DECLARE_KFIFO_PTR(rawir, unsigned int);
7775
DECLARE_KFIFO_PTR(scancodes, struct lirc_scancode);
7876
wait_queue_head_t wait_poll;

0 commit comments

Comments
 (0)