Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sean Young and committed by
Mauro Carvalho Chehab
74747dda 9b4d7b5c

+5 -62
+2
Documentation/userspace-api/media/lirc.h.rst.exceptions
··· 33 33 # Obsolete ioctls 34 34 35 35 ignore ioctl LIRC_GET_LENGTH 36 + ignore ioctl LIRC_SET_REC_TIMEOUT_REPORTS 36 37 37 38 # rc protocols 38 39 ··· 74 73 75 74 ignore define LIRC_MODE2_SPACE 76 75 ignore define LIRC_MODE2_PULSE 76 + ignore define LIRC_MODE2_TIMEOUT 77 77 78 78 ignore define LIRC_VALUE_MASK 79 79 ignore define LIRC_MODE2_MASK
+3 -5
Documentation/userspace-api/media/rc/lirc-dev-intro.rst
··· 117 117 118 118 ``LIRC_MODE2_TIMEOUT`` 119 119 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. 125 123 126 124 .. _lirc-mode-pulse: 127 125
-1
Documentation/userspace-api/media/rc/lirc-func.rst
··· 22 22 lirc-set-rec-carrier-range 23 23 lirc-set-send-carrier 24 24 lirc-set-transmitter-mask 25 - lirc-set-rec-timeout-reports 26 25 lirc-set-measure-carrier-mode 27 26 lirc-set-wideband-receiver
-49
Documentation/userspace-api/media/rc/lirc-set-rec-timeout-reports.rst
··· 1 - .. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later 2 - .. c:namespace:: RC 3 - 4 - .. _lirc_set_rec_timeout_reports: 5 - 6 - ********************************** 7 - ioctl LIRC_SET_REC_TIMEOUT_REPORTS 8 - ********************************** 9 - 10 - Name 11 - ==== 12 - 13 - LIRC_SET_REC_TIMEOUT_REPORTS - enable or disable timeout reports for IR receive 14 - 15 - Synopsis 16 - ======== 17 - 18 - .. c:macro:: LIRC_SET_REC_TIMEOUT_REPORTS 19 - 20 - ``int ioctl(int fd, LIRC_SET_REC_TIMEOUT_REPORTS, __u32 *enable)`` 21 - 22 - Arguments 23 - ========= 24 - 25 - ``fd`` 26 - File descriptor returned by open(). 27 - 28 - ``enable`` 29 - enable = 1 means enable timeout report, enable = 0 means disable timeout 30 - reports. 31 - 32 - Description 33 - =========== 34 - 35 - .. _lirc-mode2-timeout: 36 - 37 - Enable or disable timeout reports for IR receive. By default, timeout reports 38 - should be turned off. 39 - 40 - .. note:: 41 - 42 - This ioctl is only valid for :ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`. 43 - 44 - Return Value 45 - ============ 46 - 47 - On success 0 is returned, on error -1 and the ``errno`` variable is set 48 - appropriately. The generic error codes are described at the 49 - :ref:`Generic Error Codes <gen-errors>` chapter.
-5
drivers/media/rc/lirc_dev.c
··· 102 102 103 103 spin_lock_irqsave(&dev->lirc_fh_lock, flags); 104 104 list_for_each_entry(fh, &dev->lirc_fh, list) { 105 - if (LIRC_IS_TIMEOUT(sample) && !fh->send_timeout_reports) 106 - continue; 107 105 if (kfifo_put(&fh->rawir, sample)) 108 106 wake_up_poll(&fh->wait_poll, EPOLLIN | EPOLLRDNORM); 109 107 } ··· 164 166 165 167 fh->send_mode = LIRC_MODE_PULSE; 166 168 fh->rc = dev; 167 - fh->send_timeout_reports = true; 168 169 169 170 if (dev->driver_type == RC_DRIVER_SCANCODE) 170 171 fh->rec_mode = LIRC_MODE_SCANCODE; ··· 567 570 case LIRC_SET_REC_TIMEOUT_REPORTS: 568 571 if (dev->driver_type != RC_DRIVER_IR_RAW) 569 572 ret = -ENOTTY; 570 - else 571 - fh->send_timeout_reports = !!val; 572 573 break; 573 574 574 575 default:
-2
include/media/rc-core.h
··· 59 59 * @rc: rcdev for this lirc chardev 60 60 * @carrier_low: when setting the carrier range, first the low end must be 61 61 * set with an ioctl and then the high end with another ioctl 62 - * @send_timeout_reports: report timeouts in lirc raw IR. 63 62 * @rawir: queue for incoming raw IR 64 63 * @scancodes: queue for incoming decoded scancodes 65 64 * @wait_poll: poll struct for lirc device ··· 71 72 struct list_head list; 72 73 struct rc_dev *rc; 73 74 int carrier_low; 74 - bool send_timeout_reports; 75 75 DECLARE_KFIFO_PTR(rawir, unsigned int); 76 76 DECLARE_KFIFO_PTR(scancodes, struct lirc_scancode); 77 77 wait_queue_head_t wait_poll;