Skip to contentSkip to conversation

Improve LIRC documentation

PATCH In review Mauro Carvalho Chehab 2 participants 28 messages Jul 12, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Improve LIRC documentation

The LIRC documentation doesn't follow the remaining of the media book.

There's just a single page with all ioctls inside, and, IMHO, not very clear. Also, the LIRC_CAN flags were not described.

This patchset address these. Also, it removes some LIRC ioctls that aren't used.

Mauro Carvalho Chehab (20):
[media] doc-rst: Document ioctl LIRC_GET_FEATURES
[media] doc-rst: add media/uapi/rc/lirc-header.rst [media] lirc.h: remove several unused ioctls
[media] doc-rst: remove not used ioctls from documentation [media] doc-rst: Fix LIRC_GET_FEATURES references
[media] doc-rst: document ioctl LIRC_GET_SEND_MODE [media] doc-rst: fix some lirc cross-references
[media] doc-rst: document ioctl LIRC_GET_REC_MODE
[media] doc-rst: document LIRC_GET_REC_RESOLUTION
[media] doc-rst: document LIRC_SET_SEND_DUTY_CYCLE [media] doc-rst: document LIRC_GET_*_TIMEOUT ioctls [media] doc-rst: Document LIRC_GET_LENGTH ioctl
[media] doc-rst: document LIRC set carrier ioctls
[media] doc-rst: document LIRC_SET_TRANSMITTER_MASK [media] doc-rst: document LIRC_SET_REC_TIMEOUT
[media] doc-rst: document LIRC_SET_REC_TIMEOUT_REPORTS [media] doc-rst: add documentation for LIRC_SET_MEASURE_CARRIER_MODE [media] doc-rst: document LIRC_SET_WIDEBAND_RECEIVER [media] doc-rst: Document LIRC set mode ioctls
[media] doc-rst: reorganize LIRC ReST files

 Documentation/media/lirc.h.rst.exceptions          |  39 +--
 .../rc/{lirc_dev_intro.rst => lirc-dev-intro.rst}  |  34 +++
 .../rc/{lirc_device_interface.rst => lirc-dev.rst} |   7 +-
 Documentation/media/uapi/rc/lirc-func.rst          |  28 +++
 Documentation/media/uapi/rc/lirc-get-features.rst  | 181 ++++++++++++++
 Documentation/media/uapi/rc/lirc-get-length.rst    |  45 ++++
 Documentation/media/uapi/rc/lirc-get-rec-mode.rst  |  45 ++++
 .../media/uapi/rc/lirc-get-rec-resolution.rst      |  49 ++++
 Documentation/media/uapi/rc/lirc-get-send-mode.rst |  45 ++++
 Documentation/media/uapi/rc/lirc-get-timeout.rst   |  55 +++++
 Documentation/media/uapi/rc/lirc-header.rst        |  10 +
 .../media/uapi/rc/{lirc_read.rst => lirc-read.rst} |  10 +-
 .../uapi/rc/lirc-set-measure-carrier-mode.rst      |  48 ++++
 .../media/uapi/rc/lirc-set-rec-carrier-range.rst   |  49 ++++
 .../media/uapi/rc/lirc-set-rec-carrier.rst         |  48 ++++
 .../media/uapi/rc/lirc-set-rec-timeout-reports.rst |  49 ++++
 .../media/uapi/rc/lirc-set-rec-timeout.rst         |  52 ++++
 .../media/uapi/rc/lirc-set-send-carrier.rst        |  43 ++++
 .../media/uapi/rc/lirc-set-send-duty-cycle.rst     |  49 ++++
 .../media/uapi/rc/lirc-set-transmitter-mask.rst    |  53 ++++
 .../media/uapi/rc/lirc-set-wideband-receiver.rst   |  56 +++++
 .../uapi/rc/{lirc_write.rst => lirc-write.rst}     |   4 +-
 Documentation/media/uapi/rc/lirc_ioctl.rst         | 270 ---------------------
 Documentation/media/uapi/rc/remote_controllers.rst |   3 +-
 include/uapi/linux/lirc.h                          |  39 +--
 25 files changed, 956 insertions(+), 355 deletions(-)
 rename Documentation/media/uapi/rc/{lirc_dev_intro.rst => lirc-dev-intro.rst} (52%)
 rename Documentation/media/uapi/rc/{lirc_device_interface.rst => lirc-dev.rst} (67%)
 create mode 100644 Documentation/media/uapi/rc/lirc-func.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-get-features.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-get-length.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-get-rec-mode.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-get-rec-resolution.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-get-send-mode.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-get-timeout.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-header.rst
 rename Documentation/media/uapi/rc/{lirc_read.rst => lirc-read.rst} (83%)
 create mode 100644 Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-set-rec-carrier.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-set-rec-timeout.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-set-send-carrier.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst
 rename Documentation/media/uapi/rc/{lirc_write.rst => lirc-write.rst} (94%)
 delete mode 100644 Documentation/media/uapi/rc/lirc_ioctl.rst
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/20 doc-rst: Document ioctl LIRC_GET_FEATURES

The documentation for this ioctl was really crappy.

Add a better documentation, using the lirc.4 man pages as a reference, plus what was written originally at the lirc-ioctl.

---
 Documentation/media/lirc.h.rst.exceptions          |  35 -----
 Documentation/media/uapi/rc/lirc-get-features.rst  | 168 +++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |   1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         |   8 -
 4 files changed, 169 insertions(+), 43 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-get-features.rst
Documentation/media/lirc.h.rst.exceptions +0 -35
index 58439ef3b9d7..17f6e7e9550d 100644
@@ -37,38 +37,3 @@ ignore define LIRC_VALUE_MASK
 ignore define LIRC_MODE2_MASK
 
 ignore define LIRC_MODE_RAW
-
-ignore define LIRC_CAN_SEND_RAW
-ignore define LIRC_CAN_SEND_PULSE
-ignore define LIRC_CAN_SEND_MODE2
-ignore define LIRC_CAN_SEND_LIRCCODE
-
-ignore define LIRC_CAN_SEND_MASK
-
-ignore define LIRC_CAN_SET_SEND_CARRIER
-ignore define LIRC_CAN_SET_SEND_DUTY_CYCLE
-ignore define LIRC_CAN_SET_TRANSMITTER_MASK
-
-ignore define LIRC_CAN_REC_RAW
-ignore define LIRC_CAN_REC_PULSE
-ignore define LIRC_CAN_REC_MODE2
-ignore define LIRC_CAN_REC_LIRCCODE
-
-ignore define LIRC_CAN_REC_MASK
-
-ignore define LIRC_CAN_SET_REC_CARRIER
-ignore define LIRC_CAN_SET_REC_DUTY_CYCLE
-
-ignore define LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE
-ignore define LIRC_CAN_SET_REC_CARRIER_RANGE
-ignore define LIRC_CAN_GET_REC_RESOLUTION
-ignore define LIRC_CAN_SET_REC_TIMEOUT
-ignore define LIRC_CAN_SET_REC_FILTER
-
-ignore define LIRC_CAN_MEASURE_CARRIER
-ignore define LIRC_CAN_USE_WIDEBAND_RECEIVER
-
-ignore define LIRC_CAN_SEND(x)
-ignore define LIRC_CAN_REC(x)
-
-ignore define LIRC_CAN_NOTIFY_DECODE
Documentation/media/uapi/rc/lirc-get-features.rst new file +168 -0

168 lines not on this page · raw message

Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index a0c27ed5ad73..fe13f7d65d30 100644
@@ -12,4 +12,5 @@ LIRC Device Interface
     lirc_dev_intro
     lirc_read
     lirc_write
+    lirc-get-features
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -8
index 77f39d11e226..b35c1953dc60 100644
@@ -50,14 +50,6 @@ I/O control requests
 ====================
 
 
-.. _LIRC_GET_FEATURES:
-
-``LIRC_GET_FEATURES``
-
-    Obviously, get the underlying hardware device's features. If a
-    driver does not announce support of certain features, calling of the
-    corresponding ioctls is undefined.
-
 .. _LIRC_GET_SEND_MODE:
 .. _lirc-mode-pulse:
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/20 doc-rst: add media/uapi/rc/lirc-header.rst

In reply to Mauro Carvalho Chehab

changeset 68cd5e0bed99 ("[media] doc-rst: add LIRC header to the book") did everything but adding the lirc-reader.rst :-p

My fault: I forgot to do a git add for this guy on such changeset.

---
 Documentation/media/uapi/rc/lirc-header.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 Documentation/media/uapi/rc/lirc-header.rst
Documentation/media/uapi/rc/lirc-header.rst new file +10 -0
new file mode 100644
index 000000000000..487fe00e5517
@@ -0,0 +1,10 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_header:
+
+****************
+LIRC Header File
+****************
+
+.. kernel-include:: $BUILDDIR/lirc.h.rst
+
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/20 lirc.h: remove several unused ioctls

In reply to Mauro Carvalho Chehab

While reviewing the documentation gaps on LIRC, it was noticed that several ioctls aren't used by any LIRC drivers (nor at staging or mainstream).

It doesn't make sense to document them, as they're not used anywhere. So, let's remove those from the lirc header.

---
 include/uapi/linux/lirc.h | 39 ++-------------------------------------
 1 file changed, 2 insertions(+), 37 deletions(-)
include/uapi/linux/lirc.h +2 -37
index 4b3ab2966b5a..991ab4570b8e 100644
@@ -90,20 +90,11 @@
 
 #define LIRC_GET_SEND_MODE             _IOR('i', 0x00000001, __u32)
 #define LIRC_GET_REC_MODE              _IOR('i', 0x00000002, __u32)
-#define LIRC_GET_SEND_CARRIER          _IOR('i', 0x00000003, __u32)
-#define LIRC_GET_REC_CARRIER           _IOR('i', 0x00000004, __u32)
-#define LIRC_GET_SEND_DUTY_CYCLE       _IOR('i', 0x00000005, __u32)
-#define LIRC_GET_REC_DUTY_CYCLE        _IOR('i', 0x00000006, __u32)
 #define LIRC_GET_REC_RESOLUTION        _IOR('i', 0x00000007, __u32)
 
 #define LIRC_GET_MIN_TIMEOUT           _IOR('i', 0x00000008, __u32)
 #define LIRC_GET_MAX_TIMEOUT           _IOR('i', 0x00000009, __u32)
 
-#define LIRC_GET_MIN_FILTER_PULSE      _IOR('i', 0x0000000a, __u32)
-#define LIRC_GET_MAX_FILTER_PULSE      _IOR('i', 0x0000000b, __u32)
-#define LIRC_GET_MIN_FILTER_SPACE      _IOR('i', 0x0000000c, __u32)
-#define LIRC_GET_MAX_FILTER_SPACE      _IOR('i', 0x0000000d, __u32)
-
 /* code length in bits, currently only for LIRC_MODE_LIRCCODE */
 #define LIRC_GET_LENGTH                _IOR('i', 0x0000000f, __u32)
 
@@ -113,7 +104,6 @@
 #define LIRC_SET_SEND_CARRIER          _IOW('i', 0x00000013, __u32)
 #define LIRC_SET_REC_CARRIER           _IOW('i', 0x00000014, __u32)
 #define LIRC_SET_SEND_DUTY_CYCLE       _IOW('i', 0x00000015, __u32)
-#define LIRC_SET_REC_DUTY_CYCLE        _IOW('i', 0x00000016, __u32)
 #define LIRC_SET_TRANSMITTER_MASK      _IOW('i', 0x00000017, __u32)
 
 /*
@@ -127,42 +117,17 @@
 #define LIRC_SET_REC_TIMEOUT_REPORTS   _IOW('i', 0x00000019, __u32)
 
 /*
- * pulses shorter than this are filtered out by hardware (software
- * emulation in lirc_dev?)
- */
-#define LIRC_SET_REC_FILTER_PULSE      _IOW('i', 0x0000001a, __u32)
-/*
- * spaces shorter than this are filtered out by hardware (software
- * emulation in lirc_dev?)
- */
-#define LIRC_SET_REC_FILTER_SPACE      _IOW('i', 0x0000001b, __u32)
-/*
- * if filter cannot be set independently for pulse/space, this should
- * be used
- */
-#define LIRC_SET_REC_FILTER            _IOW('i', 0x0000001c, __u32)
-
-/*
  * if enabled from the next key press on the driver will send
  * LIRC_MODE2_FREQUENCY packets
  */
 #define LIRC_SET_MEASURE_CARRIER_MODE	_IOW('i', 0x0000001d, __u32)
 
 /*
- * to set a range use
- * LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_RANGE with the
- * lower bound first and later
- * LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound
+ * to set a range use LIRC_SET_REC_CARRIER_RANGE with the
+ * lower bound first and later LIRC_SET_REC_CARRIER with the upper bound
  */
-
-#define LIRC_SET_REC_DUTY_CYCLE_RANGE  _IOW('i', 0x0000001e, __u32)
 #define LIRC_SET_REC_CARRIER_RANGE     _IOW('i', 0x0000001f, __u32)
 
-#define LIRC_NOTIFY_DECODE             _IO('i', 0x00000020)
-
-#define LIRC_SETUP_START               _IO('i', 0x00000021)
-#define LIRC_SETUP_END                 _IO('i', 0x00000022)
-
 #define LIRC_SET_WIDEBAND_RECEIVER     _IOW('i', 0x00000023, __u32)
 
 #endif
Signature · 1 line
2.7.4
maintainer
#4 lore raw

Re: [PATCH 03/20] [media] lirc.h: remove several unused ioctls

Quoted 6 lines · Mauro Carvalho Chehab

While reviewing the documentation gaps on LIRC, it was noticed that several ioctls aren't used by any LIRC drivers (nor at staging or mainstream).

It doesn't make sense to document them, as they're not used anywhere. So, let's remove those from the lirc header.

Good to see these go.

Quoted 32 lines
---
 include/uapi/linux/lirc.h | 39 ++-------------------------------------
 1 file changed, 2 insertions(+), 37 deletions(-)
include/uapi/linux/lirc.h +0 -9
index 4b3ab2966b5a..991ab4570b8e 100644
@@ -90,20 +90,11 @@
 
 #define LIRC_GET_SEND_MODE             _IOR('i', 0x00000001, __u32)
 #define LIRC_GET_REC_MODE              _IOR('i', 0x00000002, __u32)
-#define LIRC_GET_SEND_CARRIER          _IOR('i', 0x00000003, __u32)
-#define LIRC_GET_REC_CARRIER           _IOR('i', 0x00000004, __u32)
-#define LIRC_GET_SEND_DUTY_CYCLE       _IOR('i', 0x00000005, __u32)
-#define LIRC_GET_REC_DUTY_CYCLE        _IOR('i', 0x00000006, __u32)
 #define LIRC_GET_REC_RESOLUTION        _IOR('i', 0x00000007, __u32)
 
 #define LIRC_GET_MIN_TIMEOUT           _IOR('i', 0x00000008, __u32)
 #define LIRC_GET_MAX_TIMEOUT           _IOR('i', 0x00000009, __u32)
 
-#define LIRC_GET_MIN_FILTER_PULSE      _IOR('i', 0x0000000a, __u32)
-#define LIRC_GET_MAX_FILTER_PULSE      _IOR('i', 0x0000000b, __u32)
-#define LIRC_GET_MIN_FILTER_SPACE      _IOR('i', 0x0000000c, __u32)
-#define LIRC_GET_MAX_FILTER_SPACE      _IOR('i', 0x0000000d, __u32)
-
 /* code length in bits, currently only for LIRC_MODE_LIRCCODE */
 #define LIRC_GET_LENGTH                _IOR('i', 0x0000000f, __u32)
 

include/uapi/linux/lirc.h line 116

Quoted 4 lines
include/uapi/linux/lirc.h +0 -1
@@ -113,7 +104,6 @@
 #define LIRC_SET_SEND_CARRIER          _IOW('i', 0x00000013, __u32)
 #define LIRC_SET_REC_CARRIER           _IOW('i', 0x00000014, __u32)
 #define LIRC_SET_SEND_DUTY_CYCLE       _IOW('i', 0x00000015, __u32)
-#define LIRC_SET_REC_DUTY_CYCLE        _IOW('i', 0x00000016, __u32)

Also remove LIRC_CAN_SET_REC_DUTY_CYCLE and
LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE.

Quoted 11 lines
include/uapi/linux/lirc.h +0 -4
 #define LIRC_SET_TRANSMITTER_MASK      _IOW('i', 0x00000017, __u32)
 
 /*
@@ -127,42 +117,17 @@
 #define LIRC_SET_REC_TIMEOUT_REPORTS   _IOW('i', 0x00000019, __u32)
 
 /*
- * pulses shorter than this are filtered out by hardware (software
- * emulation in lirc_dev?)
- */
-#define LIRC_SET_REC_FILTER_PULSE      _IOW('i', 0x0000001a, __u32)

include/uapi/linux/lirc.h line 143

Quoted 10 lines
include/uapi/linux/lirc.h +0 -10
-/*
- * spaces shorter than this are filtered out by hardware (software
- * emulation in lirc_dev?)
- */
-#define LIRC_SET_REC_FILTER_SPACE      _IOW('i', 0x0000001b, __u32)
-/*
- * if filter cannot be set independently for pulse/space, this should
- * be used
- */
-#define LIRC_SET_REC_FILTER            _IOW('i', 0x0000001c, __u32)

Also remove LIRC_CAN_SET_REC_FILTER.

Quoted 10 lines
include/uapi/linux/lirc.h +0 -4
-
-/*
  * if enabled from the next key press on the driver will send
  * LIRC_MODE2_FREQUENCY packets
  */
 #define LIRC_SET_MEASURE_CARRIER_MODE	_IOW('i', 0x0000001d, __u32)
 
 /*
- * to set a range use
- * LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_RANGE with the

include/uapi/linux/lirc.h line 161

Quoted 10 lines
include/uapi/linux/lirc.h +2 -5
- * lower bound first and later
- * LIRC_SET_REC_DUTY_CYCLE/LIRC_SET_REC_CARRIER with the upper bound
+ * to set a range use LIRC_SET_REC_CARRIER_RANGE with the
+ * lower bound first and later LIRC_SET_REC_CARRIER with the upper bound
  */
-
-#define LIRC_SET_REC_DUTY_CYCLE_RANGE  _IOW('i', 0x0000001e, __u32)
 #define LIRC_SET_REC_CARRIER_RANGE     _IOW('i', 0x0000001f, __u32)
 
-#define LIRC_NOTIFY_DECODE             _IO('i', 0x00000020)

Also remove LIRC_CAN_NOTIFY_DECODE.

include/uapi/linux/lirc.h line 133

Quoted 7 lines
include/uapi/linux/lirc.h +0 -4
-
-#define LIRC_SETUP_START               _IO('i', 0x00000021)
-#define LIRC_SETUP_END                 _IO('i', 0x00000022)
-
 #define LIRC_SET_WIDEBAND_RECEIVER     _IOW('i', 0x00000023, __u32)
 
 #endif

Sean

#5 lore raw

Re: [PATCH 03/20] [media] lirc.h: remove several unused ioctls

Em Tue, 12 Jul 2016 14:14:06 +0100
Sean Young <[email protected]> escreveu:

Quoted 40 lines · Mauro Carvalho Chehab
Quoted 6 lines

While reviewing the documentation gaps on LIRC, it was noticed that several ioctls aren't used by any LIRC drivers (nor at staging or mainstream).

It doesn't make sense to document them, as they're not used anywhere. So, let's remove those from the lirc header.

Good to see these go.

Quoted 31 lines
---
 include/uapi/linux/lirc.h | 39 ++-------------------------------------
 1 file changed, 2 insertions(+), 37 deletions(-)
include/uapi/linux/lirc.h +0 -9
index 4b3ab2966b5a..991ab4570b8e 100644
@@ -90,20 +90,11 @@
 
 #define LIRC_GET_SEND_MODE             _IOR('i', 0x00000001, __u32)
 #define LIRC_GET_REC_MODE              _IOR('i', 0x00000002, __u32)
-#define LIRC_GET_SEND_CARRIER          _IOR('i', 0x00000003, __u32)
-#define LIRC_GET_REC_CARRIER           _IOR('i', 0x00000004, __u32)
-#define LIRC_GET_SEND_DUTY_CYCLE       _IOR('i', 0x00000005, __u32)
-#define LIRC_GET_REC_DUTY_CYCLE        _IOR('i', 0x00000006, __u32)
 #define LIRC_GET_REC_RESOLUTION        _IOR('i', 0x00000007, __u32)
 
 #define LIRC_GET_MIN_TIMEOUT           _IOR('i', 0x00000008, __u32)
 #define LIRC_GET_MAX_TIMEOUT           _IOR('i', 0x00000009, __u32)
 
-#define LIRC_GET_MIN_FILTER_PULSE      _IOR('i', 0x0000000a, __u32)
-#define LIRC_GET_MAX_FILTER_PULSE      _IOR('i', 0x0000000b, __u32)
-#define LIRC_GET_MIN_FILTER_SPACE      _IOR('i', 0x0000000c, __u32)
-#define LIRC_GET_MAX_FILTER_SPACE      _IOR('i', 0x0000000d, __u32)
-
 /* code length in bits, currently only for LIRC_MODE_LIRCCODE */
 #define LIRC_GET_LENGTH                _IOR('i', 0x0000000f, __u32)
 
Quoted 8 lines

include/uapi/linux/lirc.h line 116

Quoted 5 lines
include/uapi/linux/lirc.h +0 -1
@@ -113,7 +104,6 @@
 #define LIRC_SET_SEND_CARRIER          _IOW('i', 0x00000013, __u32)
 #define LIRC_SET_REC_CARRIER           _IOW('i', 0x00000014, __u32)
 #define LIRC_SET_SEND_DUTY_CYCLE       _IOW('i', 0x00000015, __u32)
-#define LIRC_SET_REC_DUTY_CYCLE        _IOW('i', 0x00000016, __u32)  

Also remove LIRC_CAN_SET_REC_DUTY_CYCLE and
LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE.

Removing the "LIRC_CAN" macros can break userspace, as some app could be using it to print the LIRC features. That's why I opted to keep them, but to document that those features are unused - this is at the next patch (04/20).

Thanks,
Mauro

maintainer
#6 lore raw

Re: [PATCH 03/20] [media] lirc.h: remove several unused ioctls

Quoted 3 lines · Mauro Carvalho Chehab

Em Tue, 12 Jul 2016 14:14:06 +0100
Sean Young <[email protected]> escreveu:

Quoted 1 line · Mauro Carvalho Chehab

-snip-

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

-#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32)

Also remove LIRC_CAN_SET_REC_DUTY_CYCLE and
LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE.

Removing the "LIRC_CAN" macros can break userspace, as some app could be using it to print the LIRC features. That's why I opted to keep them, but to document that those features are unused - this is at the next patch (04/20).

How is that different from removing the ioctls? Might as well go the whole hog.

Also note that LIRC_CAN_SET_REC_DUTY_CYCLE has the same value as LIRC_CAN_MEASURE_CARRIER, so if some userspace program uses this it might end up in the mistaken belief its supports LIRC_CAN_SET_REC_DUTY_CYCLE.

Sean

maintainer
#7 lore raw

Re: [PATCH 03/20] [media] lirc.h: remove several unused ioctls

Quoted 10 lines · Sean Young
Quoted 3 lines · Mauro Carvalho Chehab

Em Tue, 12 Jul 2016 14:14:06 +0100
Sean Young <[email protected]> escreveu:

Quoted 1 line · Mauro Carvalho Chehab

-snip-

Quoted 5 lines
Quoted 4 lines
Quoted 1 line

-#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32)

Also remove LIRC_CAN_SET_REC_DUTY_CYCLE and
LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE.

Quoted 7 lines
Quoted 4 lines

Removing the "LIRC_CAN" macros can break userspace, as some app could be using it to print the LIRC features. That's why I opted to keep them, but to document that those features are unused - this is at the next patch (04/20).

How is that different from removing the ioctls? Might as well go the whole hog.

Ah you meant that if someone later adds a new feature then we might reuse an existing bit. Oops, sorry.

Quoted 3 lines

Also note that LIRC_CAN_SET_REC_DUTY_CYCLE has the same value as LIRC_CAN_MEASURE_CARRIER, so if some userspace program uses this it might end up in the mistaken belief its supports LIRC_CAN_SET_REC_DUTY_CYCLE.

So there is an argument for removing LIRC_CAN_SET_REC_DUTY_CYCLE, but that should be a separate patch.

Sean

#8 lore raw

Re: [PATCH 03/20] [media] lirc.h: remove several unused ioctls

Em Tue, 12 Jul 2016 14:54:38 +0100
Sean Young <[email protected]> escreveu:

Quoted 11 lines · Sean Young
Quoted 10 lines · Mauro Carvalho Chehab
Quoted 3 lines

Em Tue, 12 Jul 2016 14:14:06 +0100
Sean Young <[email protected]> escreveu:

Quoted 1 line · Mauro Carvalho Chehab

-snip-

Quoted 5 lines
Quoted 4 lines
Quoted 1 line

-#define LIRC_SET_REC_DUTY_CYCLE _IOW('i', 0x00000016, __u32)

Also remove LIRC_CAN_SET_REC_DUTY_CYCLE and
LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

Removing the "LIRC_CAN" macros can break userspace, as some app could be using it to print the LIRC features. That's why I opted to keep them, but to document that those features are unused - this is at the next patch (04/20).

How is that different from removing the ioctls? Might as well go the whole hog.

If someone implemented LIRC_GET_FEATURES and handled all flags, such program would break, as the API change.

Quoted 3 lines

Ah you meant that if someone later adds a new feature then we might reuse an existing bit. Oops, sorry.

Yes, this is another possibility. In such case, the ABI will also break, with is more severe than a pure API change.

Removing the ioctl declarations will still work for compiled programs, as they'll still receive an error code when the ioctl is issued.

Quoted 7 lines
Quoted 4 lines

Also note that LIRC_CAN_SET_REC_DUTY_CYCLE has the same value as LIRC_CAN_MEASURE_CARRIER, so if some userspace program uses this it might end up in the mistaken belief its supports LIRC_CAN_SET_REC_DUTY_CYCLE.

So there is an argument for removing LIRC_CAN_SET_REC_DUTY_CYCLE, but that should be a separate patch.

Yes. Yet, IMHO, the best would be to put those unused LIRC_CAN into a:

#ifndef __KERNEL

macro block, to:

1) avoid the risk of breaking userspace;
2) be clear that those are deprecated stuff and should not be used on newer programs;
3) Reserve the bits for not be used, to avoid possible conflicts.

Regards,
Mauro

#9 lore raw

PATCH 4/20 doc-rst: remove not used ioctls from documentation

In reply to Mauro Carvalho Chehab

As we removed those ioctls from the header file, do the same at the documentation side.

---
 Documentation/media/uapi/rc/lirc-get-features.rst |  9 +--
 Documentation/media/uapi/rc/lirc_ioctl.rst        | 74 ++---------------------
 2 files changed, 9 insertions(+), 74 deletions(-)
Documentation/media/uapi/rc/lirc-get-features.rst +3 -6
index 6850f804a96c..04ba9567053a 100644
@@ -91,8 +91,7 @@ LIRC features
 .. _LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE:
 
 ``LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE``
-    The driver supports
-    :ref:`LIRC_SET_REC_DUTY_CYCLE_RANGE.`
+    Unused. Kept just to avoid breaking uAPI.
 
 .. _LIRC_CAN_SET_REC_CARRIER_RANGE:
 
@@ -115,8 +114,7 @@ LIRC features
 .. _LIRC_CAN_SET_REC_FILTER:
 
 ``LIRC_CAN_SET_REC_FILTER``
-    The driver supports
-    :ref:`LIRC_SET_REC_FILTER.`
+    Unused. Kept just to avoid breaking uAPI.
 
 .. _LIRC_CAN_MEASURE_CARRIER:
 
@@ -133,8 +131,7 @@ LIRC features
 .. _LIRC_CAN_NOTIFY_DECODE:
 
 ``LIRC_CAN_NOTIFY_DECODE``
-    The driver supports
-    :ref:`LIRC_NOTIFY_DECODE.`
+    Unused. Kept just to avoid breaking uAPI.
 
 .. _LIRC_CAN_SEND_RAW:
 
Documentation/media/uapi/rc/lirc_ioctl.rst +6 -68

108 lines not on this page · raw message

Signature · 1 line
2.7.4
#10 lore raw

PATCH 5/20 doc-rst: Fix LIRC_GET_FEATURES references

In reply to Mauro Carvalho Chehab

The references pointed by LIRC_GET_FEATURES ioctl are broken.

Fix them.

---
 Documentation/media/lirc.h.rst.exceptions         |  4 +
 Documentation/media/uapi/rc/lirc-get-features.rst | 95 +++++++++++++----------
 2 files changed, 60 insertions(+), 39 deletions(-)
Documentation/media/lirc.h.rst.exceptions +4 -0
index 17f6e7e9550d..246c850151d7 100644
@@ -24,6 +24,10 @@ ignore define LIRC_REC2MODE
 ignore define LIRC_CAN_SEND
 ignore define LIRC_CAN_REC
 
+ignore define LIRC_CAN_SEND_MASK
+ignore define LIRC_CAN_REC_MASK
+ignore define LIRC_CAN_SET_REC_DUTY_CYCLE
+
 # Undocumented macros
 
 ignore define PULSE_BIT
Documentation/media/uapi/rc/lirc-get-features.rst +56 -39

176 lines not on this page · raw message

Signature · 1 line
2.7.4
#11 lore raw

PATCH 6/20 doc-rst: document ioctl LIRC_GET_SEND_MODE

In reply to Mauro Carvalho Chehab

Move the documentation of this ioctl from lirc_ioctl to its own file, and add a short description about the pulse mode used by IR TX.

---
 Documentation/media/uapi/rc/lirc-get-send-mode.rst | 48 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         |  9 ----
 3 files changed, 49 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-get-send-mode.rst
Documentation/media/uapi/rc/lirc-get-send-mode.rst new file +48 -0
new file mode 100644
index 000000000000..f58f0953851c
@@ -0,0 +1,48 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_get_send_mode:
+
+************************
+ioctl LIRC_GET_SEND_MODE
+************************
+
+Name
+====
+
+LIRC_GET_SEND_MODE - Get supported transmit mode.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *tx_modes )
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_GET_SEND_MODE
+
+``tx_modes``
+    Bitmask with the supported transmit modes.
+
+
+Description
+===========
+
+Get supported transmit mode.
+
+.. _lirc-mode-pulse:
+
+Currently, only ``LIRC_MODE_PULSE`` is supported by lircd on TX. On
+puse mode, a sequence of pulse/space integer values are written to the
+lirc device using ``write()``.
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index fe13f7d65d30..f6ebf09cca60 100644
@@ -13,4 +13,5 @@ LIRC Device Interface
     lirc_read
     lirc_write
     lirc-get-features
+    lirc-get-send-mode
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -9
index 345e927e9d5d..8e9809a03b8f 100644
@@ -49,15 +49,6 @@ device can rely on working with the default settings initially.
 I/O control requests
 ====================
 
-
-.. _LIRC_GET_SEND_MODE:
-.. _lirc-mode-pulse:
-
-``LIRC_GET_SEND_MODE``
-
-    Get supported transmit mode. Only ``LIRC_MODE_PULSE`` is supported by
-    lircd.
-
 .. _LIRC_GET_REC_MODE:
 .. _lirc-mode-mode2:
 .. _lirc-mode-lirccode:
Signature · 1 line
2.7.4
#12 lore raw

PATCH 7/20 doc-rst: fix some lirc cross-references

In reply to Mauro Carvalho Chehab

Some references were broken. It was also mentioning LIRC_MODE_RAW, with it is not implemented on current LIRC drivers.

So, fix the references.

---
 Documentation/media/uapi/rc/lirc-get-features.rst  | 5 ++---
 Documentation/media/uapi/rc/lirc-get-send-mode.rst | 2 +-
 Documentation/media/uapi/rc/lirc_read.rst          | 2 +-
 Documentation/media/uapi/rc/lirc_write.rst         | 4 ++--
 4 files changed, 6 insertions(+), 7 deletions(-)
Documentation/media/uapi/rc/lirc-get-features.rst +2 -3
index d89712190d43..e763ebfb2cb1 100644
@@ -44,8 +44,7 @@ LIRC features
 
 ``LIRC_CAN_REC_RAW``
 
-    The driver is capable of receiving using
-    :ref:`LIRC_MODE_RAW <lirc-mode-raw>`.
+    Unused. Kept just to avoid breaking uAPI.
 
 .. _LIRC-CAN-REC-PULSE:
 
@@ -153,7 +152,7 @@ LIRC features
 
 ``LIRC_CAN_SEND_RAW``
 
-    The driver supports sending using :ref:`LIRC_MODE_RAW <lirc-mode-raw>`.
+    Unused. Kept just to avoid breaking uAPI.
 
 .. _LIRC-CAN-SEND-PULSE:
 
Documentation/media/uapi/rc/lirc-get-send-mode.rst +1 -1
index f58f0953851c..f3fd310a8d7c 100644
@@ -38,7 +38,7 @@ Get supported transmit mode.
 
 Currently, only ``LIRC_MODE_PULSE`` is supported by lircd on TX. On
 puse mode, a sequence of pulse/space integer values are written to the
-lirc device using ``write()``.
+lirc device using :Ref:`lirc-write`.
 
 Return Value
 ============
Documentation/media/uapi/rc/lirc_read.rst +1 -1
index 37f164f7526a..a8f1b446c294 100644
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _lirc_read:
+.. _lirc-read:
 
 ***********
 LIRC read()
Documentation/media/uapi/rc/lirc_write.rst +2 -2
index e27bda30afcc..dcba3b1bee6e 100644
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _lirc_write:
+.. _lirc-write:
 
 ************
 LIRC write()
@@ -36,7 +36,7 @@ Arguments
 Description
 ===========
 
-:ref:`write() <func-write>` writes up to ``count`` bytes to the device
+:ref:`write() <lirc-write>` writes up to ``count`` bytes to the device
 referenced by the file descriptor ``fd`` from the buffer starting at
 ``buf``.
 
Signature · 1 line
2.7.4
#13 lore raw

PATCH 8/20 doc-rst: document ioctl LIRC_GET_REC_MODE

In reply to Mauro Carvalho Chehab

Move the documentation of this ioctl from lirc_ioctl to its own file, and add a short description about the pulse mode used by IR RX.

---
 Documentation/media/uapi/rc/lirc-get-rec-mode.rst  | 59 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         |  9 ----
 3 files changed, 60 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-get-rec-mode.rst
Documentation/media/uapi/rc/lirc-get-rec-mode.rst new file +59 -0
new file mode 100644
index 000000000000..d46a488594c9
@@ -0,0 +1,59 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_get_rec_mode:
+
+***********************
+ioctl LIRC_GET_REC_MODE
+***********************
+
+Name
+====
+
+LIRC_GET_REC_MODE - Get supported receive modes.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 rx_modes)
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_GET_REC_MODE
+
+``rx_modes``
+    Bitmask with the supported transmit modes.
+
+Description
+===========
+
+Get supported receive modes.
+
+Supported receive modes
+=======================
+
+.. _lirc-mode-mode2:
+
+``LIRC_MODE_MODE2``
+
+    The driver returns a sequence of pulse and space codes to userspace.
+
+.. _lirc-mode-lirccode:
+
+``LIRC_MODE_LIRCCODE``
+
+    The IR signal is decoded internally by the receiver. The LIRC interface
+    returns the scancode as an integer value. This is the usual mode used
+    by several TV media cards.
+
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index f6ebf09cca60..34044b0c8f9c 100644
@@ -14,4 +14,5 @@ LIRC Device Interface
     lirc_write
     lirc-get-features
     lirc-get-send-mode
+    lirc-get-rec-mode
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -9
index 8e9809a03b8f..4656e30a5b5a 100644
@@ -49,15 +49,6 @@ device can rely on working with the default settings initially.
 I/O control requests
 ====================
 
-.. _LIRC_GET_REC_MODE:
-.. _lirc-mode-mode2:
-.. _lirc-mode-lirccode:
-
-``LIRC_GET_REC_MODE``
-
-    Get supported receive modes. Only ``LIRC_MODE_MODE2`` and
-    ``LIRC_MODE_LIRCCODE`` are supported by lircd.
-
 .. _LIRC_SET_SEND_DUTY_CYCLE:
 
 ``LIRC_SET_SEND_DUTY_CYCLE``
Signature · 1 line
2.7.4
maintainer
#14 lore raw

Re: [PATCH 08/20] [media] doc-rst: document ioctl LIRC_GET_REC_MODE

Quoted 59 lines · Mauro Carvalho Chehab

Move the documentation of this ioctl from lirc_ioctl to its own file, and add a short description about the pulse mode used by IR RX.

---
 Documentation/media/uapi/rc/lirc-get-rec-mode.rst  | 59 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         |  9 ----
 3 files changed, 60 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-get-rec-mode.rst
Documentation/media/uapi/rc/lirc-get-rec-mode.rst new file +41 -0
new file mode 100644
index 000000000000..d46a488594c9
@@ -0,0 +1,59 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_get_rec_mode:
+
+***********************
+ioctl LIRC_GET_REC_MODE
+***********************
+
+Name
+====
+
+LIRC_GET_REC_MODE - Get supported receive modes.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 rx_modes)
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_GET_REC_MODE
+
+``rx_modes``
+    Bitmask with the supported transmit modes.
+
+Description
+===========
+
+Get supported receive modes.
+
+Supported receive modes
+=======================
+
+.. _lirc-mode-mode2:
+
+``LIRC_MODE_MODE2``

Documentation/media/uapi/rc/lirc-get-rec-mode.rst line 51

Quoted 10 lines
Documentation/media/uapi/rc/lirc-get-rec-mode.rst new file +10 -0
+
+    The driver returns a sequence of pulse and space codes to userspace.
+
+.. _lirc-mode-lirccode:
+
+``LIRC_MODE_LIRCCODE``
+
+    The IR signal is decoded internally by the receiver. The LIRC interface
+    returns the scancode as an integer value. This is the usual mode used
+    by several TV media cards.

Actually rc devices that produce scancodes (rather than raw IR) do have not have an associated lirc device so no LIRC_MODE_LIRCCODE there. The exception to this is the lirc_sasem and lirc_zilog drivers in staging; those two are the only drivers that use LIRC_MODE_LIRCCODE at all.

The lirc_sasem driver should be ported to rc-core, but I've never been able to find the hardware for it. When it is ported it won't need LIRCCODE any more.

The lirc_zilog driver is just for sending and also should be ported to rc-core. The hardware supports sending raw IR, I just do not know how so I can't port it.

Sean

#15 lore raw

Re: [PATCH 08/20] [media] doc-rst: document ioctl LIRC_GET_REC_MODE

Em Tue, 12 Jul 2016 14:01:59 +0100
Sean Young <[email protected]> escreveu:

Quoted 65 lines · Mauro Carvalho Chehab
Quoted 64 lines

Move the documentation of this ioctl from lirc_ioctl to its own file, and add a short description about the pulse mode used by IR RX.

---
 Documentation/media/uapi/rc/lirc-get-rec-mode.rst  | 59 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         |  9 ----
 3 files changed, 60 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-get-rec-mode.rst
Documentation/media/uapi/rc/lirc-get-rec-mode.rst new file +46 -0
new file mode 100644
index 000000000000..d46a488594c9
@@ -0,0 +1,59 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_get_rec_mode:
+
+***********************
+ioctl LIRC_GET_REC_MODE
+***********************
+
+Name
+====
+
+LIRC_GET_REC_MODE - Get supported receive modes.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 rx_modes)
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_GET_REC_MODE
+
+``rx_modes``
+    Bitmask with the supported transmit modes.
+
+Description
+===========
+
+Get supported receive modes.
+
+Supported receive modes
+=======================
+
+.. _lirc-mode-mode2:
+
+``LIRC_MODE_MODE2``
+
+    The driver returns a sequence of pulse and space codes to userspace.
+
+.. _lirc-mode-lirccode:
+
Quoted 8 lines

Documentation/media/uapi/rc/lirc-get-rec-mode.rst line 51

Quoted 5 lines
Documentation/media/uapi/rc/lirc-get-rec-mode.rst new file +5 -0
+``LIRC_MODE_LIRCCODE``
+
+    The IR signal is decoded internally by the receiver. The LIRC interface
+    returns the scancode as an integer value. This is the usual mode used
+    by several TV media cards.  

Actually rc devices that produce scancodes (rather than raw IR) do have not have an associated lirc device so no LIRC_MODE_LIRCCODE there.

Yeah, I noticed. Yet, the core reports feature = LIRC_MODE_LIRCCODE if the driver doesn't set features.

Quoted 11 lines

The exception
to this is the lirc_sasem and lirc_zilog drivers in staging; those two are the only drivers that use LIRC_MODE_LIRCCODE at all.

The lirc_sasem driver should be ported to rc-core, but I've never been able to find the hardware for it. When it is ported it won't need LIRCCODE any more.

The lirc_zilog driver is just for sending and also should be ported to rc-core. The hardware supports sending raw IR, I just do not know how so I can't port it.

Still, it makes sense to have LIRC_MODE_LIRCCODE supported for IR send, in order to support HDMI CEC. That's why I opted to keep it documented.

Regards,
Mauro

#16 lore raw

PATCH 9/20 doc-rst: document LIRC_GET_REC_RESOLUTION

In reply to Mauro Carvalho Chehab

Improve the documentation for this ioctl, adding it to a separate file, in order to look like the rest of the book, and to later allow to generate a man page for this ioctl.

---
 .../media/uapi/rc/lirc-get-rec-resolution.rst      | 49 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         | 10 -----
 3 files changed, 50 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-get-rec-resolution.rst
Documentation/media/uapi/rc/lirc-get-rec-resolution.rst new file +49 -0
new file mode 100644
index 000000000000..6ef1723878b4
@@ -0,0 +1,49 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_get_rec_resolution:
+
+*****************************
+ioctl LIRC_GET_REC_RESOLUTION
+*****************************
+
+Name
+====
+
+LIRC_GET_REC_RESOLUTION - Obtain the value of receive resolution, in microseconds.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *microseconds)
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_GET_REC_RESOLUTION
+
+``microseconds``
+    Resolution, in microseconds.
+
+
+Description
+===========
+
+Some receivers have maximum resolution which is defined by internal
+sample rate or data format limitations. E.g. it's common that
+signals can only be reported in 50 microsecond steps.
+
+This ioctl returns the integer value with such resolution, with can be
+used by userspace applications like lircd to automatically adjust the
+tolerance value.
+
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index 34044b0c8f9c..532f4e92d1e9 100644
@@ -15,4 +15,5 @@ LIRC Device Interface
     lirc-get-features
     lirc-get-send-mode
     lirc-get-rec-mode
+    lirc-get-rec-resolution
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -10
index 4656e30a5b5a..347b86d368b4 100644
@@ -58,16 +58,6 @@ I/O control requests
     could be used to switch off carrier generation in the future, so
     these values should be reserved.
 
-.. _LIRC_GET_REC_RESOLUTION:
-
-``LIRC_GET_REC_RESOLUTION``
-
-    Some receiver have maximum resolution which is defined by internal
-    sample rate or data format limitations. E.g. it's common that
-    signals can only be reported in 50 microsecond steps. This integer
-    value is used by lircd to automatically adjust the aeps tolerance
-    value in the lircd config file.
-
 .. _LIRC_GET_MIN_TIMEOUT:
 .. _LIRC_GET_MAX_TIMEOUT:
 
Signature · 1 line
2.7.4
#17 lore raw

PATCH 10/20 doc-rst: document LIRC_SET_SEND_DUTY_CYCLE

In reply to Mauro Carvalho Chehab

Add a separate page for this ioctl.

---
 .../media/uapi/rc/lirc-set-send-duty-cycle.rst     | 49 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         |  9 ----
 3 files changed, 50 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst
Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst new file +49 -0
new file mode 100644
index 000000000000..48e7bb15fb69
@@ -0,0 +1,49 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_set_send_duty_cycle:
+
+******************************
+ioctl LIRC_SET_SEND_DUTY_CYCLE
+******************************
+
+Name
+====
+
+LIRC_SET_SEND_DUTY_CYCLE - Set the duty cycle of the carrier signal for
+IR transmit.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *duty_cycle)
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_SET_SEND_DUTY_CYCLE
+
+``duty_cycle``
+    Duty cicle, describing the pulse width in percent (from 1 to 99) of
+    the total cycle. Values 0 and 100 are reserved.
+
+
+Description
+===========
+
+Get/set the duty cycle of the carrier signal for IR transmit.
+
+Currently, no special meaning is defined for 0 or 100, but this
+could be used to switch off carrier generation in the future, so
+these values should be reserved.
+
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index 532f4e92d1e9..56f2d6122238 100644
@@ -16,4 +16,5 @@ LIRC Device Interface
     lirc-get-send-mode
     lirc-get-rec-mode
     lirc-get-rec-resolution
+    lirc-set-send-duty-cycle
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -9
index 347b86d368b4..c486703b95b8 100644
@@ -49,15 +49,6 @@ device can rely on working with the default settings initially.
 I/O control requests
 ====================
 
-.. _LIRC_SET_SEND_DUTY_CYCLE:
-
-``LIRC_SET_SEND_DUTY_CYCLE``
-
-    Set the duty cycle (from 0 to 100) of the carrier signal.
-    Currently, no special meaning is defined for 0 or 100, but this
-    could be used to switch off carrier generation in the future, so
-    these values should be reserved.
-
 .. _LIRC_GET_MIN_TIMEOUT:
 .. _LIRC_GET_MAX_TIMEOUT:
 
Signature · 1 line
2.7.4
#18 lore raw

PATCH 11/20 doc-rst: document LIRC_GET_*_TIMEOUT ioctls

In reply to Mauro Carvalho Chehab

Improve the documentation for those ioctls, adding them to a separate file, in order to look like the rest of the book, and to later allow to generate a man page for those ioctls.

---
 Documentation/media/uapi/rc/lirc-get-timeout.rst   | 55 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         | 13 -----
 3 files changed, 56 insertions(+), 13 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-get-timeout.rst
Documentation/media/uapi/rc/lirc-get-timeout.rst new file +55 -0
new file mode 100644
index 000000000000..6b8238f1f30e
@@ -0,0 +1,55 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_get_min_timeout:
+.. _lirc_get_max_timeout:
+
+****************************************************
+ioctls LIRC_GET_MIN_TIMEOUT and LIRC_GET_MAX_TIMEOUT
+****************************************************
+
+Name
+====
+
+LIRC_GET_MIN_TIMEOUT / LIRC_GET_MAX_TIMEOUT - Obtain the possible timeout
+range for IR receive.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *timeout)
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_GET_MIN_TIMEOUT or LIRC_GET_MAX_TIMEOUT
+
+``timeout``
+    Timeout, in microseconds.
+
+
+Description
+===========
+
+Some devices have internal timers that can be used to detect when
+there's no IR activity for a long time. This can help lircd in
+detecting that a IR signal is finished and can speed up the decoding
+process. Returns an integer value with the minimum/maximum timeout
+that can be set.
+
+.. note::
+
+   Some devices have a fixed timeout, in that case
+   both ioctls will return the same value even though the timeout
+   cannot be changed via :ref:`LIRC_SET_REC_TIMEOUT`.
+
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index 56f2d6122238..197173f9ece5 100644
@@ -17,4 +17,5 @@ LIRC Device Interface
     lirc-get-rec-mode
     lirc-get-rec-resolution
     lirc-set-send-duty-cycle
+    lirc-get-timeout
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -13
index c486703b95b8..0a16659e9dad 100644
@@ -49,19 +49,6 @@ device can rely on working with the default settings initially.
 I/O control requests
 ====================
 
-.. _LIRC_GET_MIN_TIMEOUT:
-.. _LIRC_GET_MAX_TIMEOUT:
-
-``LIRC_GET_M{IN,AX}_TIMEOUT``
-
-    Some devices have internal timers that can be used to detect when
-    there's no IR activity for a long time. This can help lircd in
-    detecting that a IR signal is finished and can speed up the decoding
-    process. Returns an integer value with the minimum/maximum timeout
-    that can be set. Some devices have a fixed timeout, in that case
-    both ioctls will return the same value even though the timeout
-    cannot be changed.
-
 .. _LIRC_GET_LENGTH:
 
 ``LIRC_GET_LENGTH``
Signature · 1 line
2.7.4
#19 lore raw

PATCH 12/20 doc-rst: Document LIRC_GET_LENGTH ioctl

In reply to Mauro Carvalho Chehab

Put documentation for this ioctl on its own page.

---
 Documentation/media/uapi/rc/lirc-get-length.rst    | 45 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         | 11 ------
 3 files changed, 46 insertions(+), 11 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-get-length.rst
Documentation/media/uapi/rc/lirc-get-length.rst new file +45 -0
new file mode 100644
index 000000000000..d11c3d3f2c06
@@ -0,0 +1,45 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_get_length:
+
+*********************
+ioctl LIRC_GET_LENGTH
+*********************
+
+Name
+====
+
+LIRC_GET_LENGTH - Retrieves the code length in bits.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *length )
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_GET_LENGTH
+
+``length``
+    length, in bits
+
+
+Description
+===========
+
+Retrieves the code length in bits (only for ``LIRC-MODE-LIRCCODE``).
+Reads on the device must be done in blocks matching the bit count.
+The bit could should be rounded up so that it matches full bytes.
+
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index 197173f9ece5..f8a619e233c0 100644
@@ -18,4 +18,5 @@ LIRC Device Interface
     lirc-get-rec-resolution
     lirc-set-send-duty-cycle
     lirc-get-timeout
+    lirc-get-length
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -11
index 0a16659e9dad..93531c37fd27 100644
@@ -46,17 +46,6 @@ device can rely on working with the default settings initially.
 
 .. _lirc-request:
 
-I/O control requests
-====================
-
-.. _LIRC_GET_LENGTH:
-
-``LIRC_GET_LENGTH``
-
-    Retrieves the code length in bits (only for ``LIRC_MODE_LIRCCODE).``
-    Reads on the device must be done in blocks matching the bit count.
-    The bit could should be rounded up so that it matches full bytes.
-
 .. _LIRC_SET_SEND_MODE:
 .. _LIRC_SET_REC_MODE:
 
Signature · 1 line
2.7.4
#20 lore raw

PATCH 13/20 doc-rst: document LIRC set carrier ioctls

In reply to Mauro Carvalho Chehab

Put each ioctl on its own page and improve documentation, adding cross-references for LIRC_SET_REC_CARRIER_RANGE and LIRC_SET_REC_CARRIER, with can be used together to set a carrier frequency range.

---
 .../media/uapi/rc/lirc-set-rec-carrier-range.rst   | 49 ++++++++++++++++++++++
 .../media/uapi/rc/lirc-set-rec-carrier.rst         | 48 +++++++++++++++++++++
 .../media/uapi/rc/lirc-set-send-carrier.rst        | 43 +++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  3 ++
 Documentation/media/uapi/rc/lirc_ioctl.rst         | 18 --------
 5 files changed, 143 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-set-rec-carrier.rst
 create mode 100644 Documentation/media/uapi/rc/lirc-set-send-carrier.rst
Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst new file +49 -0
new file mode 100644
index 000000000000..7cce9c8ba361
@@ -0,0 +1,49 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_set_rec_carrier_range:
+
+********************************
+ioctl LIRC_SET_REC_CARRIER_RANGE
+********************************
+
+Name
+====
+
+LIRC_SET_REC_CARRIER_RANGE - Set lower bond of the carrier used to modulate
+IR receive.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *frequency )
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_SET_REC_CARRIER_RANGE
+
+``frequency``
+    Frequency of the carrier that modulates PWM data, in Hz.
+
+Description
+===========
+
+This ioctl sets the upper range of carrier frequency that will be recognized
+by the IR receiver.
+
+.. note::
+
+   To set a range use :ref:`LIRC_SET_REC_CARRIER_RANGE
+   <LIRC_SET_REC_CARRIER_RANGE>` with the lower bound first and later call
+   :ref:`LIRC_SET_REC_CARRIER <LIRC_SET_REC_CARRIER>` with the upper bound.
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc-set-rec-carrier.rst new file +48 -0

48 lines not on this page · raw message

Documentation/media/uapi/rc/lirc-set-send-carrier.rst new file +43 -0

43 lines not on this page · raw message

Documentation/media/uapi/rc/lirc_device_interface.rst +3 -0
index f8a619e233c0..06257caa82db 100644
@@ -19,4 +19,7 @@ LIRC Device Interface
     lirc-set-send-duty-cycle
     lirc-get-timeout
     lirc-get-length
+    lirc-set-rec-carrier
+    lirc-set-rec-carrier-range
+    lirc-set-send-carrier
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -18
index 93531c37fd27..b1cca1465997 100644
@@ -54,13 +54,6 @@ device can rely on working with the default settings initially.
     Set send/receive mode. Largely obsolete for send, as only
     ``LIRC_MODE_PULSE`` is supported.
 
-.. _LIRC_SET_SEND_CARRIER:
-.. _LIRC_SET_REC_CARRIER:
-
-``LIRC_SET_{SEND,REC}_CARRIER``
-
-    Set send/receive carrier (in Hz).
-
 .. _LIRC_SET_TRANSMITTER_MASK:
 
 ``LIRC_SET_TRANSMITTER_MASK``
@@ -99,17 +92,6 @@ device can rely on working with the default settings initially.
     press on, the driver will send ``LIRC_MODE2_FREQUENCY`` packets. By
     default this should be turned off.
 
-
-.. _LIRC_SET_REC_CARRIER_RANGE:
-
-``LIRC_SET_REC_CARRIER_RANGE``
-
-    To set a range use
-    ``LIRC_SET_REC_CARRIER_RANGE``
-    with the lower bound first and later
-    ``LIRC_SET_REC_CARRIER`` with the upper
-    bound.
-
 .. _LIRC_SET_WIDEBAND_RECEIVER:
 
 ``LIRC_SET_WIDEBAND_RECEIVER``
Signature · 1 line
2.7.4
#21 lore raw

PATCH 14/20 doc-rst: document LIRC_SET_TRANSMITTER_MASK

In reply to Mauro Carvalho Chehab

Add proper documentation for this ioctl, providing some additional information about its usage.

---
 .../media/uapi/rc/lirc-set-transmitter-mask.rst    | 53 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         | 10 ----
 3 files changed, 54 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst
Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst new file +53 -0
new file mode 100644
index 000000000000..2b35e21b9bb9
@@ -0,0 +1,53 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_set_transmitter_mask:
+
+*******************************
+ioctl LIRC_SET_TRANSMITTER_MASK
+*******************************
+
+Name
+====
+
+LIRC_SET_TRANSMITTER_MASK - Enables send codes on a given set of transmitters
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *mask )
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_SET_TRANSMITTER_MASK
+
+``mask``
+    Mask with channels to enable tx. Channel 0 is the least significant bit.
+
+
+Description
+===========
+
+Some IR TX devices have multiple output channels, in such case,
+:ref:`LIRC_CAN_SET_TRANSMITTER_MASK <LIRC-CAN-SET-TRANSMITTER-MASK>` is
+returned via :ref:`LIRC_GET_FEATURES` and this ioctl sets what channels will
+send IR codes.
+
+This ioctl enables the given set of transmitters. The first transmitter is
+encoded by the least significant bit and so on.
+
+When an invalid bit mask is given, i.e. a bit is set, even though the device
+does not have so many transitters, then this ioctl returns the number of
+available transitters and does nothing otherwise.
+
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index 06257caa82db..96765eccaa69 100644
@@ -22,4 +22,5 @@ LIRC Device Interface
     lirc-set-rec-carrier
     lirc-set-rec-carrier-range
     lirc-set-send-carrier
+    lirc-set-transmitter-mask
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -10
index b1cca1465997..86bd70dba290 100644
@@ -54,16 +54,6 @@ device can rely on working with the default settings initially.
     Set send/receive mode. Largely obsolete for send, as only
     ``LIRC_MODE_PULSE`` is supported.
 
-.. _LIRC_SET_TRANSMITTER_MASK:
-
-``LIRC_SET_TRANSMITTER_MASK``
-
-    This enables the given set of transmitters. The first transmitter is
-    encoded by the least significant bit, etc. When an invalid bit mask
-    is given, i.e. a bit is set, even though the device does not have so
-    many transitters, then this ioctl returns the number of available
-    transitters and does nothing otherwise.
-
 .. _LIRC_SET_REC_TIMEOUT:
 
 ``LIRC_SET_REC_TIMEOUT``
Signature · 1 line
2.7.4
#22 lore raw

PATCH 15/20 doc-rst: document LIRC_SET_REC_TIMEOUT

In reply to Mauro Carvalho Chehab

Add a separate page for this ioctl and adds the cross-references.

---
 .../media/uapi/rc/lirc-set-rec-timeout.rst         | 52 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         | 11 -----
 3 files changed, 53 insertions(+), 11 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-set-rec-timeout.rst
Documentation/media/uapi/rc/lirc-set-rec-timeout.rst new file +52 -0
new file mode 100644
index 000000000000..ffc88f9fcd52
@@ -0,0 +1,52 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_set_rec_timeout:
+
+**************************
+ioctl LIRC_SET_REC_TIMEOUT
+**************************
+
+Name
+====
+
+LIRC_SET_REC_TIMEOUT - sets the integer value for IR inactivity timeout.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *timeout )
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_SET_REC_TIMEOUT
+
+``timeout``
+    Timeout, in microseconds.
+
+
+Description
+===========
+
+Sets the integer value for IR inactivity timeout.
+
+If supported by the hardware, setting it to 0  disables all hardware timeouts
+and data should be reported as soon as possible. If the exact value
+cannot be set, then the next possible value _greater_ than the
+given value should be set.
+
+.. note::
+
+   The range of supported timeout is given by :ref:`LIRC_GET_MIN_TIMEOUT`.
+
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index 96765eccaa69..df576d90c73a 100644
@@ -18,6 +18,7 @@ LIRC Device Interface
     lirc-get-rec-resolution
     lirc-set-send-duty-cycle
     lirc-get-timeout
+    lirc-set-rec-timeout
     lirc-get-length
     lirc-set-rec-carrier
     lirc-set-rec-carrier-range
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -11
index 86bd70dba290..26544a5fc946 100644
@@ -54,17 +54,6 @@ device can rely on working with the default settings initially.
     Set send/receive mode. Largely obsolete for send, as only
     ``LIRC_MODE_PULSE`` is supported.
 
-.. _LIRC_SET_REC_TIMEOUT:
-
-``LIRC_SET_REC_TIMEOUT``
-
-    Sets the integer value for IR inactivity timeout (cf.
-    ``LIRC_GET_MIN_TIMEOUT`` and ``LIRC_GET_MAX_TIMEOUT).`` A value of 0
-    (if supported by the hardware) disables all hardware timeouts and
-    data should be reported as soon as possible. If the exact value
-    cannot be set, then the next possible value _greater_ than the
-    given value should be set.
-
 .. _LIRC_SET_REC_TIMEOUT_REPORTS:
 
 ``LIRC_SET_REC_TIMEOUT_REPORTS``
Signature · 1 line
2.7.4
#23 lore raw

PATCH 16/20 doc-rst: document LIRC_SET_REC_TIMEOUT_REPORTS

In reply to Mauro Carvalho Chehab

Add a separate page for this ioctl and improve its documentation.

---
 .../media/uapi/rc/lirc-set-rec-timeout-reports.rst | 49 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         |  8 ----
 3 files changed, 50 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst
Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst new file +49 -0
new file mode 100644
index 000000000000..0c7f85d0ce3b
@@ -0,0 +1,49 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_set_rec_timeout_reports:
+
+**********************************
+ioctl LIRC_SET_REC_TIMEOUT_REPORTS
+**********************************
+
+Name
+====
+
+LIRC_SET_REC_TIMEOUT_REPORTS - enable or disable timeout reports for IR receive
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *enable )
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_SET_REC_TIMEOUT_REPORTS
+
+``enable``
+    enable = 1 means enable timeout report, enable = 0 means disable timeout
+    reports.
+
+
+Description
+===========
+
+Enable or disable timeout reports for IR receive. By default, timeout reports
+should be turned off.
+
+.. note::
+
+   This ioctl is only valid for :ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`.
+
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index df576d90c73a..9e57779ca2a6 100644
@@ -24,4 +24,5 @@ LIRC Device Interface
     lirc-set-rec-carrier-range
     lirc-set-send-carrier
     lirc-set-transmitter-mask
+    lirc-set-rec-timeout-reports
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -8
index 26544a5fc946..d99fa0eeef4c 100644
@@ -54,14 +54,6 @@ device can rely on working with the default settings initially.
     Set send/receive mode. Largely obsolete for send, as only
     ``LIRC_MODE_PULSE`` is supported.
 
-.. _LIRC_SET_REC_TIMEOUT_REPORTS:
-
-``LIRC_SET_REC_TIMEOUT_REPORTS``
-
-    Enable (1) or disable (0) timeout reports in ``LIRC_MODE_MODE2.`` By
-    default, timeout reports should be turned off.
-
-
 .. _LIRC_SET_MEASURE_CARRIER_MODE:
 .. _lirc-mode2-frequency:
 
Signature · 1 line
2.7.4
#24 lore raw

PATCH 17/20 doc-rst: add documentation for LIRC_SET_MEASURE_CARRIER_MODE

In reply to Mauro Carvalho Chehab

Place documentation for this ioctl on its own page.

---
 .../uapi/rc/lirc-set-measure-carrier-mode.rst      | 48 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         |  9 ----
 3 files changed, 49 insertions(+), 9 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst
Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst new file +48 -0
new file mode 100644
index 000000000000..e145d9d1902d
@@ -0,0 +1,48 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_set_measure_carrier_mode:
+
+***********************************
+ioctl LIRC_SET_MEASURE_CARRIER_MODE
+***********************************
+
+Name
+====
+
+LIRC_SET_MEASURE_CARRIER_MODE - enable or disable measure mode
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *enable )
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_SET_MEASURE_CARRIER_MODE
+
+``enable``
+    enable = 1 means enable measure mode, enable = 0 means disable measure
+    mode.
+
+
+Description
+===========
+
+.. _lirc-mode2-frequency:
+
+Enable or disable measure mode. If enabled, from the next key
+press on, the driver will send ``LIRC_MODE2_FREQUENCY`` packets. By
+default this should be turned off.
+
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index 9e57779ca2a6..2810253ba852 100644
@@ -25,4 +25,5 @@ LIRC Device Interface
     lirc-set-send-carrier
     lirc-set-transmitter-mask
     lirc-set-rec-timeout-reports
+    lirc-set-measure-carrier-mode
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -9
index d99fa0eeef4c..d220fc233e6d 100644
@@ -54,15 +54,6 @@ device can rely on working with the default settings initially.
     Set send/receive mode. Largely obsolete for send, as only
     ``LIRC_MODE_PULSE`` is supported.
 
-.. _LIRC_SET_MEASURE_CARRIER_MODE:
-.. _lirc-mode2-frequency:
-
-``LIRC_SET_MEASURE_CARRIER_MODE``
-
-    Enable (1)/disable (0) measure mode. If enabled, from the next key
-    press on, the driver will send ``LIRC_MODE2_FREQUENCY`` packets. By
-    default this should be turned off.
-
 .. _LIRC_SET_WIDEBAND_RECEIVER:
 
 ``LIRC_SET_WIDEBAND_RECEIVER``
Signature · 1 line
2.7.4
#25 lore raw

PATCH 18/20 doc-rst: document LIRC_SET_WIDEBAND_RECEIVER

In reply to Mauro Carvalho Chehab

Put documentation for this ioctl on a separate page and improve it.

---
 .../media/uapi/rc/lirc-set-wideband-receiver.rst   | 56 ++++++++++++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 +
 Documentation/media/uapi/rc/lirc_ioctl.rst         | 19 --------
 3 files changed, 57 insertions(+), 19 deletions(-)
 create mode 100644 Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst
Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst new file +56 -0
new file mode 100644
index 000000000000..cffb01fd1042
@@ -0,0 +1,56 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_set_wideband_receiver:
+
+********************************
+ioctl LIRC_SET_WIDEBAND_RECEIVER
+********************************
+
+Name
+====
+
+LIRC_SET_WIDEBAND_RECEIVER - enable wide band receiver.
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *enable )
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_SET_WIDEBAND_RECEIVER
+
+``enable``
+    enable = 1 means enable wideband receiver, enable = 0 means disable
+    wideband receiver.
+
+
+Description
+===========
+
+Some receivers are equipped with special wide band receiver which is
+intended to be used to learn output of existing remote. This ioctl
+allows enabling or disabling it.
+
+This might be useful of receivers that have otherwise narrow band receiver
+that prevents them to be used with some remotes. Wide band receiver might
+also be more precise. On the other hand its disadvantage it usually
+reduced range of reception.
+
+.. note:: Wide band receiver might be implictly enabled if you enable
+    carrier reports. In that case it will be disabled as soon as you disable
+    carrier reports. Trying to disable wide band receiver while carrier
+    reports are active will do nothing.
+
+
+Return Value
+============
+
+On success 0 is returned, on error -1 and the ``errno`` variable is set
+appropriately. The generic error codes are described at the
+:ref:`Generic Error Codes <gen-errors>` chapter.
Documentation/media/uapi/rc/lirc_device_interface.rst +1 -0
index 2810253ba852..e9cb510349a0 100644
@@ -26,4 +26,5 @@ LIRC Device Interface
     lirc-set-transmitter-mask
     lirc-set-rec-timeout-reports
     lirc-set-measure-carrier-mode
+    lirc-set-wideband-receiver
     lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst +0 -19
index d220fc233e6d..fe5f2719ea77 100644
@@ -54,25 +54,6 @@ device can rely on working with the default settings initially.
     Set send/receive mode. Largely obsolete for send, as only
     ``LIRC_MODE_PULSE`` is supported.
 
-.. _LIRC_SET_WIDEBAND_RECEIVER:
-
-``LIRC_SET_WIDEBAND_RECEIVER``
-
-    Some receivers are equipped with special wide band receiver which is
-    intended to be used to learn output of existing remote. Calling that
-    ioctl with (1) will enable it, and with (0) disable it. This might
-    be useful of receivers that have otherwise narrow band receiver that
-    prevents them to be used with some remotes. Wide band receiver might
-    also be more precise On the other hand its disadvantage it usually
-    reduced range of reception.
-
-    .. note:: Wide band receiver might be
-       implictly enabled if you enable carrier reports. In that case it
-       will be disabled as soon as you disable carrier reports. Trying to
-       disable wide band receiver while carrier reports are active will do
-       nothing.
-
-
 .. _lirc_dev_errors:
 
 Return Value
Signature · 1 line
2.7.4
#26 lore raw

PATCH 19/20 doc-rst: Document LIRC set mode ioctls

In reply to Mauro Carvalho Chehab

Add LIRC_SET_[REC|SEND]_MODE ioctls to the corresponding GET functions, and put all LIRC modes altogether.

As now everything is already documented on its own ioctl pages, get rid of lirc_ioctl.rst.

---
 Documentation/media/uapi/rc/lirc-get-rec-mode.rst  | 32 +++--------
 Documentation/media/uapi/rc/lirc-get-send-mode.rst | 17 +++---
 Documentation/media/uapi/rc/lirc_dev_intro.rst     | 34 ++++++++++++
 .../media/uapi/rc/lirc_device_interface.rst        |  1 -
 Documentation/media/uapi/rc/lirc_ioctl.rst         | 64 ----------------------
 5 files changed, 50 insertions(+), 98 deletions(-)
 delete mode 100644 Documentation/media/uapi/rc/lirc_ioctl.rst
Documentation/media/uapi/rc/lirc-get-rec-mode.rst +9 -23
index d46a488594c9..586860c36791 100644
@@ -1,15 +1,16 @@
 .. -*- coding: utf-8; mode: rst -*-
 
 .. _lirc_get_rec_mode:
+.. _lirc_set_rec_mode:
 
-***********************
-ioctl LIRC_GET_REC_MODE
-***********************
+**********************************************
+ioctls LIRC_GET_REC_MODE and LIRC_SET_REC_MODE
+**********************************************
 
 Name
 ====
 
-LIRC_GET_REC_MODE - Get supported receive modes.
+LIRC_GET_REC_MODE/LIRC_GET_REC_MODE - Get/set supported receive modes.
 
 Synopsis
 ========
@@ -23,7 +24,7 @@ Arguments
     File descriptor returned by open().
 
 ``request``
-    LIRC_GET_REC_MODE
+    LIRC_GET_REC_MODE or LIRC_GET_REC_MODE
 
 ``rx_modes``
     Bitmask with the supported transmit modes.
@@ -31,24 +32,9 @@ Arguments
 Description
 ===========
 
-Get supported receive modes.
-
-Supported receive modes
-=======================
-
-.. _lirc-mode-mode2:
-
-``LIRC_MODE_MODE2``
-
-    The driver returns a sequence of pulse and space codes to userspace.
-
-.. _lirc-mode-lirccode:
-
-``LIRC_MODE_LIRCCODE``
-
-    The IR signal is decoded internally by the receiver. The LIRC interface
-    returns the scancode as an integer value. This is the usual mode used
-    by several TV media cards.
+Get/set supported receive modes. Only :ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`
+and :ref:`LIRC_MODE_LIRCCODE <lirc-mode-lirccode>` are supported for IR
+receive.
 
 
 Return Value
Documentation/media/uapi/rc/lirc-get-send-mode.rst +7 -10
index f3fd310a8d7c..3e1d96122ff2 100644
@@ -1,15 +1,16 @@
 .. -*- coding: utf-8; mode: rst -*-
 
 .. _lirc_get_send_mode:
+.. _lirc_set_send_mode:
 
-************************
-ioctl LIRC_GET_SEND_MODE
-************************
+************************************************
+ioctls LIRC_GET_SEND_MODE and LIRC_SET_SEND_MODE
+************************************************
 
 Name
 ====
 
-LIRC_GET_SEND_MODE - Get supported transmit mode.
+LIRC_GET_SEND_MODE/LIRC_SET_SEND_MODE - Get/set supported transmit mode.
 
 Synopsis
 ========
@@ -32,13 +33,9 @@ Arguments
 Description
 ===========
 
-Get supported transmit mode.
+Get/set supported transmit mode.
 
-.. _lirc-mode-pulse:
-
-Currently, only ``LIRC_MODE_PULSE`` is supported by lircd on TX. On
-puse mode, a sequence of pulse/space integer values are written to the
-lirc device using :Ref:`lirc-write`.
+Only :ref:`LIRC_MODE_PULSE <lirc-mode-pulse>` is supported by for IR send.
 
 Return Value
 ============
Documentation/media/uapi/rc/lirc_dev_intro.rst +34 -0
index 9a784c8fe4ea..ef97e40f2fd8 100644
@@ -26,3 +26,37 @@ What you should see for a chardev:
 
     $ ls -l /dev/lirc*
     crw-rw---- 1 root root 248, 0 Jul 2 22:20 /dev/lirc0
+
+**********
+LIRC modes
+**********
+
+LIRC supports some modes of receiving and sending IR codes, as shown
+on the following table.
+
+.. _lirc-mode-mode2:
+
+``LIRC_MODE_MODE2``
+
+    The driver returns a sequence of pulse and space codes to userspace.
+
+    This mode is used only for IR receive.
+
+.. _lirc-mode-lirccode:
+
+``LIRC_MODE_LIRCCODE``
+
+    The IR signal is decoded internally by the receiver. The LIRC interface
+    returns the scancode as an integer value. This is the usual mode used
+    by several TV media cards.
+
+    This mode is used only for IR receive.
+
+.. _lirc-mode-pulse:
+
+``LIRC_MODE_PULSE``
+
+    On puse mode, a sequence of pulse/space integer values are written to the
+    lirc device using :Ref:`lirc-write`.
+
+    This mode is used only for IR send.
Documentation/media/uapi/rc/lirc_device_interface.rst +0 -1
index e9cb510349a0..a2ad957c96ae 100644
@@ -27,4 +27,3 @@ LIRC Device Interface
     lirc-set-rec-timeout-reports
     lirc-set-measure-carrier-mode
     lirc-set-wideband-receiver
-    lirc_ioctl
Documentation/media/uapi/rc/lirc_ioctl.rst deleted +0 -64

64 lines not on this page · raw message

Signature · 1 line
2.7.4
#27 lore raw

PATCH 20/20 doc-rst: reorganize LIRC ReST files

In reply to Mauro Carvalho Chehab

Reorganize the LIRC rst files, using "-" instead of "_" on their names, and creating a separate chapter for syscalls.

---
 .../uapi/rc/{lirc_dev_intro.rst => lirc-dev-intro.rst}     |  0
 Documentation/media/uapi/rc/lirc-dev.rst                   | 14 ++++++++++++++
 .../uapi/rc/{lirc_device_interface.rst => lirc-func.rst}   | 11 +++++------
 .../media/uapi/rc/{lirc_read.rst => lirc-read.rst}         |  8 ++++----
 .../media/uapi/rc/{lirc_write.rst => lirc-write.rst}       |  0
 Documentation/media/uapi/rc/remote_controllers.rst         |  3 +--
 6 files changed, 24 insertions(+), 12 deletions(-)
 rename Documentation/media/uapi/rc/{lirc_dev_intro.rst => lirc-dev-intro.rst} (100%)
 create mode 100644 Documentation/media/uapi/rc/lirc-dev.rst
 rename Documentation/media/uapi/rc/{lirc_device_interface.rst => lirc-func.rst} (81%)
 rename Documentation/media/uapi/rc/{lirc_read.rst => lirc-read.rst} (83%)
 rename Documentation/media/uapi/rc/{lirc_write.rst => lirc-write.rst} (100%)
Documentation/media/uapi/rc/lirc-dev-intro.rst renamed from Documentation/media/uapi/rc/lirc_dev_intro.rst +0 -0
similarity index 100%
rename from Documentation/media/uapi/rc/lirc_dev_intro.rst
rename to Documentation/media/uapi/rc/lirc-dev-intro.rst
Documentation/media/uapi/rc/lirc-dev.rst new file +14 -0
new file mode 100644
index 000000000000..03cde25f5859
@@ -0,0 +1,14 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_dev:
+
+LIRC Device Interface
+=====================
+
+
+.. toctree::
+    :maxdepth: 1
+
+    lirc-dev-intro
+    lirc-func
+    lirc-header
Documentation/media/uapi/rc/lirc-func.rst renamed from Documentation/media/uapi/rc/lirc_device_interface.rst +5 -6
similarity index 81%
rename from Documentation/media/uapi/rc/lirc_device_interface.rst
rename to Documentation/media/uapi/rc/lirc-func.rst
index a2ad957c96ae..9b5a772ec96c 100644
@@ -1,17 +1,16 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _lirc_dev:
+.. _lirc_func:
 
-LIRC Device Interface
-=====================
+LIRC Function Reference
+=======================
 
 
 .. toctree::
     :maxdepth: 1
 
-    lirc_dev_intro
-    lirc_read
-    lirc_write
+    lirc-read
+    lirc-write
     lirc-get-features
     lirc-get-send-mode
     lirc-get-rec-mode
Documentation/media/uapi/rc/lirc-read.rst renamed from Documentation/media/uapi/rc/lirc_read.rst +4 -4
similarity index 83%
rename from Documentation/media/uapi/rc/lirc_read.rst
rename to Documentation/media/uapi/rc/lirc-read.rst
index a8f1b446c294..8d4e9b6e507d 100644
@@ -44,10 +44,10 @@ is greater than ``SSIZE_MAX``, the result is unspecified.
 The lircd userspace daemon reads raw IR data from the LIRC chardev. The
 exact format of the data depends on what modes a driver supports, and
 what mode has been selected. lircd obtains supported modes and sets the
-active mode via the ioctl interface, detailed at :ref:`lirc_ioctl`.
-The generally preferred mode is LIRC_MODE_MODE2, in which packets
-containing an int value describing an IR signal are read from the
-chardev.
+active mode via the ioctl interface, detailed at :ref:`lirc_func`.
+The generally preferred mode for receive is
+:ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`, in which packets containing an
+int value describing an IR signal are read from the chardev.
 
 See also
 `http://www.lirc.org/html/technical.html <http://www.lirc.org/html/technical.html>`__
Documentation/media/uapi/rc/lirc-write.rst renamed from Documentation/media/uapi/rc/lirc_write.rst +0 -0
similarity index 100%
rename from Documentation/media/uapi/rc/lirc_write.rst
rename to Documentation/media/uapi/rc/lirc-write.rst
Documentation/media/uapi/rc/remote_controllers.rst +1 -2
index 3e9731afedd9..169286501ebb 100644
@@ -23,8 +23,7 @@ Remote Controllers
     rc-sysfs-nodes
     rc-tables
     rc-table-change
-    lirc_device_interface
-    lirc-header
+    lirc-dev
 
 
 **********************
Signature · 1 line
2.7.4