depending on the underlying hardware.
.PP
Some hardware (typically TV-cards) decodes the IR signal internally
-and provide decoded button presses as scancode values.
+and provides decoded button presses as scancode values.
Drivers for this kind of hardware work in
.BR LIRC_MODE_SCANCODE
mode.
Such hardware usually does not support sending IR signals.
-Furthermore, they can only decode a limited set of IR protocols, usually
-only the protocol of the specific remote which is
+Furthermore, such hardware can only decode a limited set of IR protocols,
+usually only the protocol of the specific remote which is
bundled with, for example, a TV-card.
.PP
Other hardware provides a stream of pulse/space durations.
.BR read (2)
provides 32-bit values representing a space or a pulse duration.
The time of the duration (microseconds) is encoded in the lower 24 bits.
-The upper 8 bit reflects the type of package:
+The upper 8 bits indicate the type of package:
.TP 4
-.BR LIRC_MODE2_SPACE .
+.BR LIRC_MODE2_SPACE
Value reflects a space duration (microseconds).
.TP 4
-.BR LIRC_MODE2_PULSE .
+.BR LIRC_MODE2_PULSE
Value reflects a pulse duration (microseconds).
.TP 4
-.BR LIRC_MODE2_FREQUENCY .
+.BR LIRC_MODE2_FREQUENCY
Value reflects a frequency (Hz); see the
.B LIRC_SET_MEASURE_CARRIER_MODE
ioctl.
.TP 4
-.BR LIRC_MODE2_TIMEOUT .
+.BR LIRC_MODE2_TIMEOUT
Value reflects a space duration (microseconds).
The package reflects a timeout; see the
.B LIRC_SET_REC_TIMEOUT_REPORTS
.BR read (2)
reflects decoded button presses, in the struct \fIlirc_scancode\fR.
The scancode is stored in the \fIscancode\fR field, and the IR protocol
-in \fIrc_proto\fR.
+is stored in \fIrc_proto\fR.
This field has one the values of the \fIenum rc_proto\fR.
.\"
.SS Writing output with the LIRC_MODE_PULSE mode
.SH IOCTL COMMANDS
.PP
The LIRC device's ioctl definition is bound by the ioctl function
-definition of struct file_operations, leaving us with an unsigned
-int for the ioctl command and an unsigned long for the argument.
+definition of
+.IR "struct file_operations" ,
+leaving us with an
+.IR "unsigned int"
+for the ioctl command and an
+.IR "unsigned long"
+for the argument.
For the purposes of ioctl portability across 32-bit and 64-bit architectures,
these values are capped to their 32-bit sizes.
.PP
Unless otherwise stated, these fail with the error \fBENOTTY\fR if the
operation isn't supported, or with the error \fBEINVAL\fR if the operation
failed, or invalid arguments were provided.
-If a driver does not announce support of certain features, calling of
-the corresponding ioctls will return ENOTTY.
+If a driver does not announce support of certain features, invoking
+the corresponding ioctls will fail with the error
+.BR ENOTTY .
.TP
.BR LIRC_GET_REC_MODE " (\fIvoid\fP)"
If the
device has no receiver return
.B ENOTTY,
else return the receive mode, which will be one of:
-.RS 4
+.RS
.TP
.BR LIRC_MODE_MODE2
The driver returns a sequence of pulse/space durations.
.BR LIRC_GET_MIN_TIMEOUT " (\fIvoid\fP)", " "\
LIRC_GET_MAX_TIMEOUT " (\fIvoid\fP)"
Some devices have internal timers that can be used to detect when
-there's no IR activity for a long time.
+there has been no IR activity for a long time.
This can help
.BR lircd (8)
in detecting that an IR signal is finished and can speed up the
.TP
.BR LIRC_GET_REC_TIMEOUT " (\fivoid\fP)"
Return the current inactivity timeout (microseconds).
-Available in kernel release 4.18 and later.
+Available since Linux 4.18.
.TP
.BR LIRC_SET_REC_TIMEOUT_REPORTS " (\fIint\fP)"
Enable
If enabled, from the next key press on, the driver will send
.BR LIRC_MODE2_FREQUENCY
packets.
-By default this should be turned off.
+By default, this should be turned off.
.TP
.BR LIRC_GET_REC_RESOLUTION " (\fIvoid\fP)"
Return the driver resolution (microseconds).
This might be useful for devices that otherwise have narrow band
receivers that prevent them to be used with certain remotes.
Wide band receivers may also be more precise.
-On the other hand its disadvantage usually is reduced range of
+On the other hand, their disadvantage usually is reduced range of
reception.
.IP
Note: wide band receiver may be implicitly enabled if you enable
.\"
.SH FEATURES
.PP
-The features returned by
-The
+the
.BR LIRC_GET_FEATURES
ioctl returns a bit mask describing features of the driver.
The following bits may be returned in the mask: