linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/20] Improve LIRC documentation
@ 2016-07-12 12:41 Mauro Carvalho Chehab
  2016-07-12 12:41 ` [PATCH 01/20] [media] doc-rst: Document ioctl LIRC_GET_FEATURES Mauro Carvalho Chehab
                   ` (19 more replies)
  0 siblings, 20 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:41 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

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

-- 
2.7.4



^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 01/20] [media] doc-rst: Document ioctl LIRC_GET_FEATURES
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
@ 2016-07-12 12:41 ` Mauro Carvalho Chehab
  2016-07-12 12:41 ` [PATCH 02/20] [media] doc-rst: add media/uapi/rc/lirc-header.rst Mauro Carvalho Chehab
                   ` (18 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:41 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 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

diff --git a/Documentation/media/lirc.h.rst.exceptions b/Documentation/media/lirc.h.rst.exceptions
index 58439ef3b9d7..17f6e7e9550d 100644
--- a/Documentation/media/lirc.h.rst.exceptions
+++ b/Documentation/media/lirc.h.rst.exceptions
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc-get-features.rst b/Documentation/media/uapi/rc/lirc-get-features.rst
new file mode 100644
index 000000000000..6850f804a96c
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-features.rst
@@ -0,0 +1,168 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_get_features:
+
+***********************
+ioctl LIRC_GET_FEATURES
+***********************
+
+Name
+====
+
+LIRC_GET_FEATURES - Get the underlying hardware device's features
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *features)
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_GET_FEATURES
+
+``features``
+    Bitmask with the LIRC features.
+
+
+Description
+===========
+
+
+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 features
+=============
+
+.. _LIRC_CAN_REC_RAW:
+
+``LIRC_CAN_REC_RAW``
+    The driver is capable of receiving using
+    :ref:`LIRC_MODE_RAW.`
+
+.. _LIRC_CAN_REC_PULSE:
+
+``LIRC_CAN_REC_PULSE``
+    The driver is capable of receiving using
+    :ref:`LIRC_MODE_PULSE.`
+
+.. _LIRC_CAN_REC_MODE2:
+
+``LIRC_CAN_REC_MODE2``
+    The driver is capable of receiving using
+    :ref:`LIRC_MODE_MODE2.`
+
+.. _LIRC_CAN_REC_LIRCCODE:
+
+``LIRC_CAN_REC_LIRCCODE``
+    The driver is capable of receiving using
+    :ref:`LIRC_MODE_LIRCCODE.`
+
+.. _LIRC_CAN_SET_SEND_CARRIER:
+
+``LIRC_CAN_SET_SEND_CARRIER``
+    The driver supports changing the modulation frequency via
+    :ref:`LIRC_SET_SEND_CARRIER.`
+
+.. _LIRC_CAN_SET_SEND_DUTY_CYCLE:
+
+``LIRC_CAN_SET_SEND_DUTY_CYCLE``
+    The driver supports changing the duty cycle using
+    :ref:`LIRC_SET_SEND_DUTY_CYCLE`.
+
+.. _LIRC_CAN_SET_TRANSMITTER_MASK:
+
+``LIRC_CAN_SET_TRANSMITTER_MASK``
+    The driver supports changing the active transmitter(s) using
+    :ref:`LIRC_SET_TRANSMITTER_MASK.`
+
+.. _LIRC_CAN_SET_REC_CARRIER:
+
+``LIRC_CAN_SET_REC_CARRIER``
+    The driver supports setting the receive carrier frequency using
+    :ref:`LIRC_SET_REC_CARRIER.`
+
+.. _LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE:
+
+``LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE``
+    The driver supports
+    :ref:`LIRC_SET_REC_DUTY_CYCLE_RANGE.`
+
+.. _LIRC_CAN_SET_REC_CARRIER_RANGE:
+
+``LIRC_CAN_SET_REC_CARRIER_RANGE``
+    The driver supports
+    :ref:`LIRC_SET_REC_CARRIER_RANGE.`
+
+.. _LIRC_CAN_GET_REC_RESOLUTION:
+
+``LIRC_CAN_GET_REC_RESOLUTION``
+    The driver supports
+    :ref:`LIRC_GET_REC_RESOLUTION.`
+
+.. _LIRC_CAN_SET_REC_TIMEOUT:
+
+``LIRC_CAN_SET_REC_TIMEOUT``
+    The driver supports
+    :ref:`LIRC_SET_REC_TIMEOUT.`
+
+.. _LIRC_CAN_SET_REC_FILTER:
+
+``LIRC_CAN_SET_REC_FILTER``
+    The driver supports
+    :ref:`LIRC_SET_REC_FILTER.`
+
+.. _LIRC_CAN_MEASURE_CARRIER:
+
+``LIRC_CAN_MEASURE_CARRIER``
+    The driver supports measuring of the modulation frequency using
+    :ref:`LIRC_SET_MEASURE_CARRIER_MODE`.
+
+.. _LIRC_CAN_USE_WIDEBAND_RECEIVER:
+
+``LIRC_CAN_USE_WIDEBAND_RECEIVER``
+    The driver supports learning mode using
+    :ref:`LIRC_SET_WIDEBAND_RECEIVER.`
+
+.. _LIRC_CAN_NOTIFY_DECODE:
+
+``LIRC_CAN_NOTIFY_DECODE``
+    The driver supports
+    :ref:`LIRC_NOTIFY_DECODE.`
+
+.. _LIRC_CAN_SEND_RAW:
+
+``LIRC_CAN_SEND_RAW``
+    The driver supports sending using
+    :ref:`LIRC_MODE_RAW.`
+
+.. _LIRC_CAN_SEND_PULSE:
+
+``LIRC_CAN_SEND_PULSE``
+    The driver supports sending using
+    :ref:`LIRC_MODE_PULSE.`
+
+.. _LIRC_CAN_SEND_MODE2:
+
+``LIRC_CAN_SEND_MODE2``
+    The driver supports sending using
+    :ref:`LIRC_MODE_MODE2.`
+
+.. _LIRC_CAN_SEND_LIRCCODE:
+
+``LIRC_CAN_SEND_LIRCCODE``
+    The driver supports sending codes (also called as IR blasting or IR TX).
+
+
+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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index a0c27ed5ad73..fe13f7d65d30 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -12,4 +12,5 @@ LIRC Device Interface
     lirc_dev_intro
     lirc_read
     lirc_write
+    lirc-get-features
     lirc_ioctl
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index 77f39d11e226..b35c1953dc60 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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:
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 02/20] [media] doc-rst: add media/uapi/rc/lirc-header.rst
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
  2016-07-12 12:41 ` [PATCH 01/20] [media] doc-rst: Document ioctl LIRC_GET_FEATURES Mauro Carvalho Chehab
@ 2016-07-12 12:41 ` Mauro Carvalho Chehab
  2016-07-12 12:41 ` [PATCH 03/20] [media] lirc.h: remove several unused ioctls Mauro Carvalho Chehab
                   ` (17 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:41 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 Documentation/media/uapi/rc/lirc-header.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 Documentation/media/uapi/rc/lirc-header.rst

diff --git a/Documentation/media/uapi/rc/lirc-header.rst b/Documentation/media/uapi/rc/lirc-header.rst
new file mode 100644
index 000000000000..487fe00e5517
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-header.rst
@@ -0,0 +1,10 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_header:
+
+****************
+LIRC Header File
+****************
+
+.. kernel-include:: $BUILDDIR/lirc.h.rst
+
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 03/20] [media] lirc.h: remove several unused ioctls
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
  2016-07-12 12:41 ` [PATCH 01/20] [media] doc-rst: Document ioctl LIRC_GET_FEATURES Mauro Carvalho Chehab
  2016-07-12 12:41 ` [PATCH 02/20] [media] doc-rst: add media/uapi/rc/lirc-header.rst Mauro Carvalho Chehab
@ 2016-07-12 12:41 ` Mauro Carvalho Chehab
  2016-07-12 13:14   ` Sean Young
  2016-07-12 12:41 ` [PATCH 04/20] [media] doc-rst: remove not used ioctls from documentation Mauro Carvalho Chehab
                   ` (16 subsequent siblings)
  19 siblings, 1 reply; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:41 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 include/uapi/linux/lirc.h | 39 ++-------------------------------------
 1 file changed, 2 insertions(+), 37 deletions(-)

diff --git a/include/uapi/linux/lirc.h b/include/uapi/linux/lirc.h
index 4b3ab2966b5a..991ab4570b8e 100644
--- a/include/uapi/linux/lirc.h
+++ b/include/uapi/linux/lirc.h
@@ -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
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 04/20] [media] doc-rst: remove not used ioctls from documentation
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (2 preceding siblings ...)
  2016-07-12 12:41 ` [PATCH 03/20] [media] lirc.h: remove several unused ioctls Mauro Carvalho Chehab
@ 2016-07-12 12:41 ` Mauro Carvalho Chehab
  2016-07-12 12:41 ` [PATCH 05/20] [media] doc-rst: Fix LIRC_GET_FEATURES references Mauro Carvalho Chehab
                   ` (15 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:41 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

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

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 Documentation/media/uapi/rc/lirc-get-features.rst |  9 +--
 Documentation/media/uapi/rc/lirc_ioctl.rst        | 74 ++---------------------
 2 files changed, 9 insertions(+), 74 deletions(-)

diff --git a/Documentation/media/uapi/rc/lirc-get-features.rst b/Documentation/media/uapi/rc/lirc-get-features.rst
index 6850f804a96c..04ba9567053a 100644
--- a/Documentation/media/uapi/rc/lirc-get-features.rst
+++ b/Documentation/media/uapi/rc/lirc-get-features.rst
@@ -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:
 
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index b35c1953dc60..345e927e9d5d 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -67,26 +67,11 @@ I/O control requests
     Get supported receive modes. Only ``LIRC_MODE_MODE2`` and
     ``LIRC_MODE_LIRCCODE`` are supported by lircd.
 
-.. _LIRC_GET_SEND_CARRIER:
-
-``LIRC_GET_SEND_CARRIER``
-
-    Get carrier frequency (in Hz) currently used for transmit.
-
-.. _LIRC_GET_REC_CARRIER:
-
-``LIRC_GET_REC_CARRIER``
-
-    Get carrier frequency (in Hz) currently used for IR reception.
-
-.. _LIRC_GET_SEND_DUTY_CYCLE:
-.. _LIRC_GET_REC_DUTY_CYCLE:
 .. _LIRC_SET_SEND_DUTY_CYCLE:
-.. _LIRC_SET_REC_DUTY_CYCLE:
 
-``LIRC_{G,S}ET_{SEND,REC}_DUTY_CYCLE``
+``LIRC_SET_SEND_DUTY_CYCLE``
 
-    Get/set the duty cycle (from 0 to 100) of the carrier signal.
+    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.
@@ -114,20 +99,6 @@ I/O control requests
     both ioctls will return the same value even though the timeout
     cannot be changed.
 
-.. _LIRC_GET_MIN_FILTER_PULSE:
-.. _LIRC_GET_MAX_FILTER_PULSE:
-.. _LIRC_GET_MIN_FILTER_SPACE:
-.. _LIRC_GET_MAX_FILTER_SPACE:
-
-``LIRC_GET_M{IN,AX}_FILTER_{PULSE,SPACE}``
-
-    Some devices are able to filter out spikes in the incoming signal
-    using given filter rules. These ioctls return the hardware
-    capabilities that describe the bounds of the possible filters.
-    Filter settings depend on the IR protocols that are expected. lircd
-    derives the settings from all protocols definitions found in its
-    config file.
-
 .. _LIRC_GET_LENGTH:
 
 ``LIRC_GET_LENGTH``
@@ -179,16 +150,6 @@ I/O control requests
     Enable (1) or disable (0) timeout reports in ``LIRC_MODE_MODE2.`` By
     default, timeout reports should be turned off.
 
-.. _LIRC_SET_REC_FILTER_PULSE:
-.. _LIRC_SET_REC_FILTER_SPACE:
-.. _LIRC_SET_REC_FILTER:
-
-``LIRC_SET_REC_FILTER_{PULSE,SPACE}``
-
-    Pulses/spaces shorter than this are filtered out by hardware. If
-    filters cannot be set independently for pulse/space, the
-    corresponding ioctls must return an error and ``LIRC_SET_REC_FILTER``
-    shall be used instead.
 
 .. _LIRC_SET_MEASURE_CARRIER_MODE:
 .. _lirc-mode2-frequency:
@@ -199,40 +160,17 @@ I/O control requests
     press on, the driver will send ``LIRC_MODE2_FREQUENCY`` packets. By
     default this should be turned off.
 
-.. _LIRC_SET_REC_DUTY_CYCLE_RANGE:
+
 .. _LIRC_SET_REC_CARRIER_RANGE:
 
-``LIRC_SET_REC_{DUTY_CYCLE,CARRIER}_RANGE``
+``LIRC_SET_REC_CARRIER_RANGE``
 
     To set a range use
-    ``LIRC_SET_REC_DUTY_CYCLE_RANGE/LIRC_SET_REC_CARRIER_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
+    ``LIRC_SET_REC_CARRIER`` with the upper
     bound.
 
-.. _LIRC_NOTIFY_DECODE:
-
-``LIRC_NOTIFY_DECODE``
-
-    This ioctl is called by lircd whenever a successful decoding of an
-    incoming IR signal could be done. This can be used by supporting
-    hardware to give visual feedback to the user e.g. by flashing a LED.
-
-.. _LIRC_SETUP_START:
-.. _LIRC_SETUP_END:
-
-``LIRC_SETUP_{START,END}``
-
-    Setting of several driver parameters can be optimized by
-    encapsulating the according ioctl calls with
-    ``LIRC_SETUP_START/LIRC_SETUP_END.`` When a driver receives a
-    ``LIRC_SETUP_START`` ioctl it can choose to not commit further setting
-    changes to the hardware until a ``LIRC_SETUP_END`` is received. But
-    this is open to the driver implementation and every driver must also
-    handle parameter changes which are not encapsulated by
-    ``LIRC_SETUP_START`` and ``LIRC_SETUP_END.`` Drivers can also choose to
-    ignore these ioctls.
-
 .. _LIRC_SET_WIDEBAND_RECEIVER:
 
 ``LIRC_SET_WIDEBAND_RECEIVER``
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 05/20] [media] doc-rst: Fix LIRC_GET_FEATURES references
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (3 preceding siblings ...)
  2016-07-12 12:41 ` [PATCH 04/20] [media] doc-rst: remove not used ioctls from documentation Mauro Carvalho Chehab
@ 2016-07-12 12:41 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 06/20] [media] doc-rst: document ioctl LIRC_GET_SEND_MODE Mauro Carvalho Chehab
                   ` (14 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:41 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

The references pointed by LIRC_GET_FEATURES ioctl are broken.

Fix them.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 Documentation/media/lirc.h.rst.exceptions         |  4 +
 Documentation/media/uapi/rc/lirc-get-features.rst | 95 +++++++++++++----------
 2 files changed, 60 insertions(+), 39 deletions(-)

diff --git a/Documentation/media/lirc.h.rst.exceptions b/Documentation/media/lirc.h.rst.exceptions
index 17f6e7e9550d..246c850151d7 100644
--- a/Documentation/media/lirc.h.rst.exceptions
+++ b/Documentation/media/lirc.h.rst.exceptions
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc-get-features.rst b/Documentation/media/uapi/rc/lirc-get-features.rst
index 04ba9567053a..d89712190d43 100644
--- a/Documentation/media/uapi/rc/lirc-get-features.rst
+++ b/Documentation/media/uapi/rc/lirc-get-features.rst
@@ -40,120 +40,137 @@ is undefined.
 LIRC features
 =============
 
-.. _LIRC_CAN_REC_RAW:
+.. _LIRC-CAN-REC-RAW:
 
 ``LIRC_CAN_REC_RAW``
+
     The driver is capable of receiving using
-    :ref:`LIRC_MODE_RAW.`
+    :ref:`LIRC_MODE_RAW <lirc-mode-raw>`.
 
-.. _LIRC_CAN_REC_PULSE:
+.. _LIRC-CAN-REC-PULSE:
 
 ``LIRC_CAN_REC_PULSE``
+
     The driver is capable of receiving using
-    :ref:`LIRC_MODE_PULSE.`
+    :ref:`LIRC_MODE_PULSE <lirc-mode-pulse>`.
 
-.. _LIRC_CAN_REC_MODE2:
+.. _LIRC-CAN-REC-MODE2:
 
 ``LIRC_CAN_REC_MODE2``
+
     The driver is capable of receiving using
-    :ref:`LIRC_MODE_MODE2.`
+    :ref:`LIRC_MODE_MODE2 <lirc-mode-MODE2>`.
 
-.. _LIRC_CAN_REC_LIRCCODE:
+.. _LIRC-CAN-REC-LIRCCODE:
 
 ``LIRC_CAN_REC_LIRCCODE``
+
     The driver is capable of receiving using
-    :ref:`LIRC_MODE_LIRCCODE.`
+    :ref:`LIRC_MODE_LIRCCODE <lirc-mode-LIRCCODE>`.
 
-.. _LIRC_CAN_SET_SEND_CARRIER:
+.. _LIRC-CAN-SET-SEND-CARRIER:
 
 ``LIRC_CAN_SET_SEND_CARRIER``
+
     The driver supports changing the modulation frequency via
-    :ref:`LIRC_SET_SEND_CARRIER.`
+    :ref:`ioctl LIRC_SET_SEND_CARRIER <LIRC_SET_SEND_CARRIER>`.
 
-.. _LIRC_CAN_SET_SEND_DUTY_CYCLE:
+.. _LIRC-CAN-SET-SEND-DUTY-CYCLE:
 
 ``LIRC_CAN_SET_SEND_DUTY_CYCLE``
+
     The driver supports changing the duty cycle using
-    :ref:`LIRC_SET_SEND_DUTY_CYCLE`.
+    :ref:`ioctl LIRC_SET_SEND_DUTY_CYCLE <LIRC_SET_SEND_DUTY_CYCLE>`.
 
-.. _LIRC_CAN_SET_TRANSMITTER_MASK:
+.. _LIRC-CAN-SET-TRANSMITTER-MASK:
 
 ``LIRC_CAN_SET_TRANSMITTER_MASK``
+
     The driver supports changing the active transmitter(s) using
-    :ref:`LIRC_SET_TRANSMITTER_MASK.`
+    :ref:`ioctl LIRC_SET_TRANSMITTER_MASK <LIRC_SET_TRANSMITTER_MASK>`.
 
-.. _LIRC_CAN_SET_REC_CARRIER:
+.. _LIRC-CAN-SET-REC-CARRIER:
 
 ``LIRC_CAN_SET_REC_CARRIER``
+
     The driver supports setting the receive carrier frequency using
-    :ref:`LIRC_SET_REC_CARRIER.`
+    :ref:`ioctl LIRC_SET_REC_CARRIER <LIRC_SET_REC_CARRIER>`.
 
-.. _LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE:
+.. _LIRC-CAN-SET-REC-DUTY-CYCLE-RANGE:
 
 ``LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE``
+
     Unused. Kept just to avoid breaking uAPI.
 
-.. _LIRC_CAN_SET_REC_CARRIER_RANGE:
+.. _LIRC-CAN-SET-REC-CARRIER-RANGE:
 
 ``LIRC_CAN_SET_REC_CARRIER_RANGE``
+
     The driver supports
-    :ref:`LIRC_SET_REC_CARRIER_RANGE.`
+    :ref:`ioctl LIRC_SET_REC_CARRIER_RANGE <LIRC_SET_REC_CARRIER_RANGE>`.
 
-.. _LIRC_CAN_GET_REC_RESOLUTION:
+.. _LIRC-CAN-GET-REC-RESOLUTION:
 
 ``LIRC_CAN_GET_REC_RESOLUTION``
+
     The driver supports
-    :ref:`LIRC_GET_REC_RESOLUTION.`
+    :ref:`ioctl LIRC_GET_REC_RESOLUTION <LIRC_GET_REC_RESOLUTION>`.
 
-.. _LIRC_CAN_SET_REC_TIMEOUT:
+.. _LIRC-CAN-SET-REC-TIMEOUT:
 
 ``LIRC_CAN_SET_REC_TIMEOUT``
+
     The driver supports
-    :ref:`LIRC_SET_REC_TIMEOUT.`
+    :ref:`ioctl LIRC_SET_REC_TIMEOUT <LIRC_SET_REC_TIMEOUT>`.
 
-.. _LIRC_CAN_SET_REC_FILTER:
+.. _LIRC-CAN-SET-REC-FILTER:
 
 ``LIRC_CAN_SET_REC_FILTER``
+
     Unused. Kept just to avoid breaking uAPI.
 
-.. _LIRC_CAN_MEASURE_CARRIER:
+.. _LIRC-CAN-MEASURE-CARRIER:
 
 ``LIRC_CAN_MEASURE_CARRIER``
+
     The driver supports measuring of the modulation frequency using
-    :ref:`LIRC_SET_MEASURE_CARRIER_MODE`.
+    :ref:`ioctl LIRC_SET_MEASURE_CARRIER_MODE <LIRC_SET_MEASURE_CARRIER_MODE>`.
 
-.. _LIRC_CAN_USE_WIDEBAND_RECEIVER:
+.. _LIRC-CAN-USE-WIDEBAND-RECEIVER:
 
 ``LIRC_CAN_USE_WIDEBAND_RECEIVER``
+
     The driver supports learning mode using
-    :ref:`LIRC_SET_WIDEBAND_RECEIVER.`
+    :ref:`ioctl LIRC_SET_WIDEBAND_RECEIVER <LIRC_SET_WIDEBAND_RECEIVER>`.
 
-.. _LIRC_CAN_NOTIFY_DECODE:
+.. _LIRC-CAN-NOTIFY-DECODE:
 
 ``LIRC_CAN_NOTIFY_DECODE``
+
     Unused. Kept just to avoid breaking uAPI.
 
-.. _LIRC_CAN_SEND_RAW:
+.. _LIRC-CAN-SEND-RAW:
 
 ``LIRC_CAN_SEND_RAW``
-    The driver supports sending using
-    :ref:`LIRC_MODE_RAW.`
 
-.. _LIRC_CAN_SEND_PULSE:
+    The driver supports sending using :ref:`LIRC_MODE_RAW <lirc-mode-raw>`.
+
+.. _LIRC-CAN-SEND-PULSE:
 
 ``LIRC_CAN_SEND_PULSE``
-    The driver supports sending using
-    :ref:`LIRC_MODE_PULSE.`
 
-.. _LIRC_CAN_SEND_MODE2:
+    The driver supports sending using :ref:`LIRC_MODE_PULSE <lirc-mode-pulse>`.
+
+.. _LIRC-CAN-SEND-MODE2:
 
 ``LIRC_CAN_SEND_MODE2``
-    The driver supports sending using
-    :ref:`LIRC_MODE_MODE2.`
 
-.. _LIRC_CAN_SEND_LIRCCODE:
+    The driver supports sending using :ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>`.
+
+.. _LIRC-CAN-SEND-LIRCCODE:
 
 ``LIRC_CAN_SEND_LIRCCODE``
+
     The driver supports sending codes (also called as IR blasting or IR TX).
 
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 06/20] [media] doc-rst: document ioctl LIRC_GET_SEND_MODE
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (4 preceding siblings ...)
  2016-07-12 12:41 ` [PATCH 05/20] [media] doc-rst: Fix LIRC_GET_FEATURES references Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 07/20] [media] doc-rst: fix some lirc cross-references Mauro Carvalho Chehab
                   ` (13 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 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

diff --git a/Documentation/media/uapi/rc/lirc-get-send-mode.rst b/Documentation/media/uapi/rc/lirc-get-send-mode.rst
new file mode 100644
index 000000000000..f58f0953851c
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-send-mode.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index fe13f7d65d30..f6ebf09cca60 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -13,4 +13,5 @@ LIRC Device Interface
     lirc_read
     lirc_write
     lirc-get-features
+    lirc-get-send-mode
     lirc_ioctl
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index 345e927e9d5d..8e9809a03b8f 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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:
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 07/20] [media] doc-rst: fix some lirc cross-references
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (5 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 06/20] [media] doc-rst: document ioctl LIRC_GET_SEND_MODE Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 08/20] [media] doc-rst: document ioctl LIRC_GET_REC_MODE Mauro Carvalho Chehab
                   ` (12 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 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(-)

diff --git a/Documentation/media/uapi/rc/lirc-get-features.rst b/Documentation/media/uapi/rc/lirc-get-features.rst
index d89712190d43..e763ebfb2cb1 100644
--- a/Documentation/media/uapi/rc/lirc-get-features.rst
+++ b/Documentation/media/uapi/rc/lirc-get-features.rst
@@ -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:
 
diff --git a/Documentation/media/uapi/rc/lirc-get-send-mode.rst b/Documentation/media/uapi/rc/lirc-get-send-mode.rst
index f58f0953851c..f3fd310a8d7c 100644
--- a/Documentation/media/uapi/rc/lirc-get-send-mode.rst
+++ b/Documentation/media/uapi/rc/lirc-get-send-mode.rst
@@ -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
 ============
diff --git a/Documentation/media/uapi/rc/lirc_read.rst b/Documentation/media/uapi/rc/lirc_read.rst
index 37f164f7526a..a8f1b446c294 100644
--- a/Documentation/media/uapi/rc/lirc_read.rst
+++ b/Documentation/media/uapi/rc/lirc_read.rst
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _lirc_read:
+.. _lirc-read:
 
 ***********
 LIRC read()
diff --git a/Documentation/media/uapi/rc/lirc_write.rst b/Documentation/media/uapi/rc/lirc_write.rst
index e27bda30afcc..dcba3b1bee6e 100644
--- a/Documentation/media/uapi/rc/lirc_write.rst
+++ b/Documentation/media/uapi/rc/lirc_write.rst
@@ -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``.
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 08/20] [media] doc-rst: document ioctl LIRC_GET_REC_MODE
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (6 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 07/20] [media] doc-rst: fix some lirc cross-references Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 13:01   ` Sean Young
  2016-07-12 12:42 ` [PATCH 09/20] [media] doc-rst: document LIRC_GET_REC_RESOLUTION Mauro Carvalho Chehab
                   ` (11 subsequent siblings)
  19 siblings, 1 reply; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 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

diff --git a/Documentation/media/uapi/rc/lirc-get-rec-mode.rst b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
new file mode 100644
index 000000000000..d46a488594c9
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index f6ebf09cca60..34044b0c8f9c 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -14,4 +14,5 @@ LIRC Device Interface
     lirc_write
     lirc-get-features
     lirc-get-send-mode
+    lirc-get-rec-mode
     lirc_ioctl
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index 8e9809a03b8f..4656e30a5b5a 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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``
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 09/20] [media] doc-rst: document LIRC_GET_REC_RESOLUTION
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (7 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 08/20] [media] doc-rst: document ioctl LIRC_GET_REC_MODE Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 10/20] [media] doc-rst: document LIRC_SET_SEND_DUTY_CYCLE Mauro Carvalho Chehab
                   ` (10 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 .../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

diff --git a/Documentation/media/uapi/rc/lirc-get-rec-resolution.rst b/Documentation/media/uapi/rc/lirc-get-rec-resolution.rst
new file mode 100644
index 000000000000..6ef1723878b4
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-rec-resolution.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index 34044b0c8f9c..532f4e92d1e9 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -15,4 +15,5 @@ LIRC Device Interface
     lirc-get-features
     lirc-get-send-mode
     lirc-get-rec-mode
+    lirc-get-rec-resolution
     lirc_ioctl
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index 4656e30a5b5a..347b86d368b4 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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:
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 10/20] [media] doc-rst: document LIRC_SET_SEND_DUTY_CYCLE
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (8 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 09/20] [media] doc-rst: document LIRC_GET_REC_RESOLUTION Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 11/20] [media] doc-rst: document LIRC_GET_*_TIMEOUT ioctls Mauro Carvalho Chehab
                   ` (9 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

Add a separate page for this ioctl.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 .../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

diff --git a/Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst b/Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst
new file mode 100644
index 000000000000..48e7bb15fb69
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-send-duty-cycle.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index 532f4e92d1e9..56f2d6122238 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index 347b86d368b4..c486703b95b8 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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:
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 11/20] [media] doc-rst: document LIRC_GET_*_TIMEOUT ioctls
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (9 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 10/20] [media] doc-rst: document LIRC_SET_SEND_DUTY_CYCLE Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 12/20] [media] doc-rst: Document LIRC_GET_LENGTH ioctl Mauro Carvalho Chehab
                   ` (8 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 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

diff --git a/Documentation/media/uapi/rc/lirc-get-timeout.rst b/Documentation/media/uapi/rc/lirc-get-timeout.rst
new file mode 100644
index 000000000000..6b8238f1f30e
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-timeout.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index 56f2d6122238..197173f9ece5 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index c486703b95b8..0a16659e9dad 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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``
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 12/20] [media] doc-rst: Document LIRC_GET_LENGTH ioctl
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (10 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 11/20] [media] doc-rst: document LIRC_GET_*_TIMEOUT ioctls Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 13/20] [media] doc-rst: document LIRC set carrier ioctls Mauro Carvalho Chehab
                   ` (7 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

Put documentation for this ioctl on its own page.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 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

diff --git a/Documentation/media/uapi/rc/lirc-get-length.rst b/Documentation/media/uapi/rc/lirc-get-length.rst
new file mode 100644
index 000000000000..d11c3d3f2c06
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-get-length.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index 197173f9ece5..f8a619e233c0 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -18,4 +18,5 @@ LIRC Device Interface
     lirc-get-rec-resolution
     lirc-set-send-duty-cycle
     lirc-get-timeout
+    lirc-get-length
     lirc_ioctl
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index 0a16659e9dad..93531c37fd27 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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:
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 13/20] [media] doc-rst: document LIRC set carrier ioctls
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (11 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 12/20] [media] doc-rst: Document LIRC_GET_LENGTH ioctl Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 14/20] [media] doc-rst: document LIRC_SET_TRANSMITTER_MASK Mauro Carvalho Chehab
                   ` (6 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 .../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

diff --git a/Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst b/Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst
new file mode 100644
index 000000000000..7cce9c8ba361
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-rec-carrier-range.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc-set-rec-carrier.rst b/Documentation/media/uapi/rc/lirc-set-rec-carrier.rst
new file mode 100644
index 000000000000..17ddb4723caa
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-rec-carrier.rst
@@ -0,0 +1,48 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_set_rec_carrier:
+
+**************************
+ioctl LIRC_SET_REC_CARRIER
+**************************
+
+Name
+====
+
+LIRC_SET_REC_CARRIER - Set 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
+
+``frequency``
+    Frequency of the carrier that modulates PWM data, in Hz.
+
+Description
+===========
+
+Set receive carrier used to modulate IR PWM pulses and spaces.
+
+.. note::
+
+   If called together with :ref:`LIRC_SET_REC_CARRIER_RANGE`, this ioctl
+   sets the upper bound frequency that will be recognized by the device.
+
+
+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.
diff --git a/Documentation/media/uapi/rc/lirc-set-send-carrier.rst b/Documentation/media/uapi/rc/lirc-set-send-carrier.rst
new file mode 100644
index 000000000000..4314d4c86ced
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-send-carrier.rst
@@ -0,0 +1,43 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_set_send_carrier:
+
+***************************
+ioctl LIRC_SET_SEND_CARRIER
+***************************
+
+Name
+====
+
+LIRC_SET_SEND_CARRIER - Set send carrier used to modulate IR TX.
+
+
+Synopsis
+========
+
+.. cpp:function:: int ioctl( int fd, int request, __u32 *frequency )
+
+Arguments
+=========
+
+``fd``
+    File descriptor returned by open().
+
+``request``
+    LIRC_SET_SEND_CARRIER
+
+``frequency``
+    Frequency of the carrier to be modulated, in Hz.
+
+Description
+===========
+
+Set send carrier used to modulate IR PWM pulses and spaces.
+
+
+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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index f8a619e233c0..06257caa82db 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index 93531c37fd27..b1cca1465997 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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``
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 14/20] [media] doc-rst: document LIRC_SET_TRANSMITTER_MASK
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (12 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 13/20] [media] doc-rst: document LIRC set carrier ioctls Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 15/20] [media] doc-rst: document LIRC_SET_REC_TIMEOUT Mauro Carvalho Chehab
                   ` (5 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

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

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 .../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

diff --git a/Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst b/Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst
new file mode 100644
index 000000000000..2b35e21b9bb9
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-transmitter-mask.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index 06257caa82db..96765eccaa69 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index b1cca1465997..86bd70dba290 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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``
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 15/20] [media] doc-rst: document LIRC_SET_REC_TIMEOUT
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (13 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 14/20] [media] doc-rst: document LIRC_SET_TRANSMITTER_MASK Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 16/20] [media] doc-rst: document LIRC_SET_REC_TIMEOUT_REPORTS Mauro Carvalho Chehab
                   ` (4 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

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

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 .../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

diff --git a/Documentation/media/uapi/rc/lirc-set-rec-timeout.rst b/Documentation/media/uapi/rc/lirc-set-rec-timeout.rst
new file mode 100644
index 000000000000..ffc88f9fcd52
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-rec-timeout.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index 96765eccaa69..df576d90c73a 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index 86bd70dba290..26544a5fc946 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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``
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 16/20] [media] doc-rst: document LIRC_SET_REC_TIMEOUT_REPORTS
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (14 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 15/20] [media] doc-rst: document LIRC_SET_REC_TIMEOUT Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 17/20] [media] doc-rst: add documentation for LIRC_SET_MEASURE_CARRIER_MODE Mauro Carvalho Chehab
                   ` (3 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

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

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 .../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

diff --git a/Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst b/Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst
new file mode 100644
index 000000000000..0c7f85d0ce3b
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-rec-timeout-reports.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index df576d90c73a..9e57779ca2a6 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index 26544a5fc946..d99fa0eeef4c 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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:
 
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 17/20] [media] doc-rst: add documentation for LIRC_SET_MEASURE_CARRIER_MODE
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (15 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 16/20] [media] doc-rst: document LIRC_SET_REC_TIMEOUT_REPORTS Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 18/20] [media] doc-rst: document LIRC_SET_WIDEBAND_RECEIVER Mauro Carvalho Chehab
                   ` (2 subsequent siblings)
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

Place documentation for this ioctl on its own page.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 .../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

diff --git a/Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst b/Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst
new file mode 100644
index 000000000000..e145d9d1902d
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-measure-carrier-mode.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index 9e57779ca2a6..2810253ba852 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index d99fa0eeef4c..d220fc233e6d 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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``
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 18/20] [media] doc-rst: document LIRC_SET_WIDEBAND_RECEIVER
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (16 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 17/20] [media] doc-rst: add documentation for LIRC_SET_MEASURE_CARRIER_MODE Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 19/20] [media] doc-rst: Document LIRC set mode ioctls Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 20/20] [media] doc-rst: reorganize LIRC ReST files Mauro Carvalho Chehab
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

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

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 .../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

diff --git a/Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst b/Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst
new file mode 100644
index 000000000000..cffb01fd1042
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-set-wideband-receiver.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index 2810253ba852..e9cb510349a0 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
index d220fc233e6d..fe5f2719ea77 100644
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ b/Documentation/media/uapi/rc/lirc_ioctl.rst
@@ -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
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 19/20] [media] doc-rst: Document LIRC set mode ioctls
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (17 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 18/20] [media] doc-rst: document LIRC_SET_WIDEBAND_RECEIVER Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  2016-07-12 12:42 ` [PATCH 20/20] [media] doc-rst: reorganize LIRC ReST files Mauro Carvalho Chehab
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 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

diff --git a/Documentation/media/uapi/rc/lirc-get-rec-mode.rst b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
index d46a488594c9..586860c36791 100644
--- a/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
+++ b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc-get-send-mode.rst b/Documentation/media/uapi/rc/lirc-get-send-mode.rst
index f3fd310a8d7c..3e1d96122ff2 100644
--- a/Documentation/media/uapi/rc/lirc-get-send-mode.rst
+++ b/Documentation/media/uapi/rc/lirc-get-send-mode.rst
@@ -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
 ============
diff --git a/Documentation/media/uapi/rc/lirc_dev_intro.rst b/Documentation/media/uapi/rc/lirc_dev_intro.rst
index 9a784c8fe4ea..ef97e40f2fd8 100644
--- a/Documentation/media/uapi/rc/lirc_dev_intro.rst
+++ b/Documentation/media/uapi/rc/lirc_dev_intro.rst
@@ -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.
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc_device_interface.rst
index e9cb510349a0..a2ad957c96ae 100644
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc_device_interface.rst
@@ -27,4 +27,3 @@ LIRC Device Interface
     lirc-set-rec-timeout-reports
     lirc-set-measure-carrier-mode
     lirc-set-wideband-receiver
-    lirc_ioctl
diff --git a/Documentation/media/uapi/rc/lirc_ioctl.rst b/Documentation/media/uapi/rc/lirc_ioctl.rst
deleted file mode 100644
index fe5f2719ea77..000000000000
--- a/Documentation/media/uapi/rc/lirc_ioctl.rst
+++ /dev/null
@@ -1,64 +0,0 @@
-.. -*- coding: utf-8; mode: rst -*-
-
-.. _lirc_ioctl:
-
-************
-LIRC ioctl()
-************
-
-
-Name
-====
-
-LIRC ioctl - Sends a I/O control command to a LIRC device
-
-Synopsis
-========
-
-.. cpp:function:: int ioctl( int fd, int request, struct v4l2_capability *argp )
-
-
-Arguments
-=========
-
-``fd``
-    File descriptor returned by ``open()``.
-
-``request``
-    The type of I/O control that will be used. See table :ref:`lirc-request`
-    for details.
-
-``argp``
-    Arguments for the I/O control. They're specific to each request.
-
-
-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 arg. For the purposes
-of ioctl portability across 32-bit and 64-bit, these values are capped
-to their 32-bit sizes.
-
-The ioctls can be used to change specific hardware settings.
-In general each driver should have a default set of settings. The driver
-implementation is expected to re-apply the default settings when the
-device is closed by user-space, so that every application opening the
-device can rely on working with the default settings initially.
-
-.. _lirc-request:
-
-.. _LIRC_SET_SEND_MODE:
-.. _LIRC_SET_REC_MODE:
-
-``LIRC_SET_{SEND,REC}_MODE``
-
-    Set send/receive mode. Largely obsolete for send, as only
-    ``LIRC_MODE_PULSE`` is supported.
-
-.. _lirc_dev_errors:
-
-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.
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* [PATCH 20/20] [media] doc-rst: reorganize LIRC ReST files
  2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
                   ` (18 preceding siblings ...)
  2016-07-12 12:42 ` [PATCH 19/20] [media] doc-rst: Document LIRC set mode ioctls Mauro Carvalho Chehab
@ 2016-07-12 12:42 ` Mauro Carvalho Chehab
  19 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 12:42 UTC (permalink / raw)
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Mauro Carvalho Chehab

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

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 .../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%)

diff --git a/Documentation/media/uapi/rc/lirc_dev_intro.rst b/Documentation/media/uapi/rc/lirc-dev-intro.rst
similarity index 100%
rename from Documentation/media/uapi/rc/lirc_dev_intro.rst
rename to Documentation/media/uapi/rc/lirc-dev-intro.rst
diff --git a/Documentation/media/uapi/rc/lirc-dev.rst b/Documentation/media/uapi/rc/lirc-dev.rst
new file mode 100644
index 000000000000..03cde25f5859
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc-dev.rst
@@ -0,0 +1,14 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _lirc_dev:
+
+LIRC Device Interface
+=====================
+
+
+.. toctree::
+    :maxdepth: 1
+
+    lirc-dev-intro
+    lirc-func
+    lirc-header
diff --git a/Documentation/media/uapi/rc/lirc_device_interface.rst b/Documentation/media/uapi/rc/lirc-func.rst
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
--- a/Documentation/media/uapi/rc/lirc_device_interface.rst
+++ b/Documentation/media/uapi/rc/lirc-func.rst
@@ -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
diff --git a/Documentation/media/uapi/rc/lirc_read.rst b/Documentation/media/uapi/rc/lirc-read.rst
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
--- a/Documentation/media/uapi/rc/lirc_read.rst
+++ b/Documentation/media/uapi/rc/lirc-read.rst
@@ -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>`__
diff --git a/Documentation/media/uapi/rc/lirc_write.rst b/Documentation/media/uapi/rc/lirc-write.rst
similarity index 100%
rename from Documentation/media/uapi/rc/lirc_write.rst
rename to Documentation/media/uapi/rc/lirc-write.rst
diff --git a/Documentation/media/uapi/rc/remote_controllers.rst b/Documentation/media/uapi/rc/remote_controllers.rst
index 3e9731afedd9..169286501ebb 100644
--- a/Documentation/media/uapi/rc/remote_controllers.rst
+++ b/Documentation/media/uapi/rc/remote_controllers.rst
@@ -23,8 +23,7 @@ Remote Controllers
     rc-sysfs-nodes
     rc-tables
     rc-table-change
-    lirc_device_interface
-    lirc-header
+    lirc-dev
 
 
 **********************
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 28+ messages in thread

* Re: [PATCH 08/20] [media] doc-rst: document ioctl LIRC_GET_REC_MODE
  2016-07-12 12:42 ` [PATCH 08/20] [media] doc-rst: document ioctl LIRC_GET_REC_MODE Mauro Carvalho Chehab
@ 2016-07-12 13:01   ` Sean Young
  2016-07-12 13:27     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 28+ messages in thread
From: Sean Young @ 2016-07-12 13:01 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

On Tue, Jul 12, 2016 at 09:42:02AM -0300, Mauro Carvalho Chehab wrote:
> 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.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> ---
>  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
> 
> diff --git a/Documentation/media/uapi/rc/lirc-get-rec-mode.rst b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
> new file mode 100644
> index 000000000000..d46a488594c9
> --- /dev/null
> +++ b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
> @@ -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.

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/20] [media] lirc.h: remove several unused ioctls
  2016-07-12 12:41 ` [PATCH 03/20] [media] lirc.h: remove several unused ioctls Mauro Carvalho Chehab
@ 2016-07-12 13:14   ` Sean Young
  2016-07-12 13:23     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 28+ messages in thread
From: Sean Young @ 2016-07-12 13:14 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

On Tue, Jul 12, 2016 at 09:41:57AM -0300, Mauro Carvalho Chehab wrote:
> 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.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> ---
>  include/uapi/linux/lirc.h | 39 ++-------------------------------------
>  1 file changed, 2 insertions(+), 37 deletions(-)
> 
> diff --git a/include/uapi/linux/lirc.h b/include/uapi/linux/lirc.h
> index 4b3ab2966b5a..991ab4570b8e 100644
> --- a/include/uapi/linux/lirc.h
> +++ b/include/uapi/linux/lirc.h
> @@ -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)

Also remove LIRC_CAN_SET_REC_DUTY_CYCLE and 
LIRC_CAN_SET_REC_DUTY_CYCLE_RANGE.

>  #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)

Also remove LIRC_CAN_SET_REC_FILTER.
> -
> -/*
>   * 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)

Also remove LIRC_CAN_NOTIFY_DECODE.

> -
> -#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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/20] [media] lirc.h: remove several unused ioctls
  2016-07-12 13:14   ` Sean Young
@ 2016-07-12 13:23     ` Mauro Carvalho Chehab
  2016-07-12 13:35       ` Sean Young
  0 siblings, 1 reply; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 13:23 UTC (permalink / raw)
  To: Sean Young; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

Em Tue, 12 Jul 2016 14:14:06 +0100
Sean Young <sean@mess.org> escreveu:

> On Tue, Jul 12, 2016 at 09:41:57AM -0300, Mauro Carvalho Chehab wrote:
> > 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.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> > ---
> >  include/uapi/linux/lirc.h | 39 ++-------------------------------------
> >  1 file changed, 2 insertions(+), 37 deletions(-)
> > 
> > diff --git a/include/uapi/linux/lirc.h b/include/uapi/linux/lirc.h
> > index 4b3ab2966b5a..991ab4570b8e 100644
> > --- a/include/uapi/linux/lirc.h
> > +++ b/include/uapi/linux/lirc.h
> > @@ -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)  
> 
> 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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 08/20] [media] doc-rst: document ioctl LIRC_GET_REC_MODE
  2016-07-12 13:01   ` Sean Young
@ 2016-07-12 13:27     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 13:27 UTC (permalink / raw)
  To: Sean Young; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

Em Tue, 12 Jul 2016 14:01:59 +0100
Sean Young <sean@mess.org> escreveu:

> On Tue, Jul 12, 2016 at 09:42:02AM -0300, Mauro Carvalho Chehab wrote:
> > 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.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> > ---
> >  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
> > 
> > diff --git a/Documentation/media/uapi/rc/lirc-get-rec-mode.rst b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
> > new file mode 100644
> > index 000000000000..d46a488594c9
> > --- /dev/null
> > +++ b/Documentation/media/uapi/rc/lirc-get-rec-mode.rst
> > @@ -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.  
> 
> 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.

> 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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/20] [media] lirc.h: remove several unused ioctls
  2016-07-12 13:23     ` Mauro Carvalho Chehab
@ 2016-07-12 13:35       ` Sean Young
  2016-07-12 13:54         ` Sean Young
  0 siblings, 1 reply; 28+ messages in thread
From: Sean Young @ 2016-07-12 13:35 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

On Tue, Jul 12, 2016 at 10:23:00AM -0300, Mauro Carvalho Chehab wrote:
> Em Tue, 12 Jul 2016 14:14:06 +0100
> Sean Young <sean@mess.org> escreveu:
> > On Tue, Jul 12, 2016 at 09:41:57AM -0300, Mauro Carvalho Chehab wrote:
-snip-
> > > -#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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/20] [media] lirc.h: remove several unused ioctls
  2016-07-12 13:35       ` Sean Young
@ 2016-07-12 13:54         ` Sean Young
  2016-07-12 14:05           ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 28+ messages in thread
From: Sean Young @ 2016-07-12 13:54 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

On Tue, Jul 12, 2016 at 02:35:56PM +0100, Sean Young wrote:
> On Tue, Jul 12, 2016 at 10:23:00AM -0300, Mauro Carvalho Chehab wrote:
> > Em Tue, 12 Jul 2016 14:14:06 +0100
> > Sean Young <sean@mess.org> escreveu:
> > > On Tue, Jul 12, 2016 at 09:41:57AM -0300, Mauro Carvalho Chehab wrote:
> -snip-
> > > > -#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.

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

> 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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/20] [media] lirc.h: remove several unused ioctls
  2016-07-12 13:54         ` Sean Young
@ 2016-07-12 14:05           ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 28+ messages in thread
From: Mauro Carvalho Chehab @ 2016-07-12 14:05 UTC (permalink / raw)
  To: Sean Young; +Cc: Linux Media Mailing List, Mauro Carvalho Chehab

Em Tue, 12 Jul 2016 14:54:38 +0100
Sean Young <sean@mess.org> escreveu:

> On Tue, Jul 12, 2016 at 02:35:56PM +0100, Sean Young wrote:
> > On Tue, Jul 12, 2016 at 10:23:00AM -0300, Mauro Carvalho Chehab wrote:  
> > > Em Tue, 12 Jul 2016 14:14:06 +0100
> > > Sean Young <sean@mess.org> escreveu:  
> > > > On Tue, Jul 12, 2016 at 09:41:57AM -0300, Mauro Carvalho Chehab wrote:  
> > -snip-  
> > > > > -#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.  

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

> 
> 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.

> 
> > 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

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2016-07-12 14:05 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-12 12:41 [PATCH 00/20] Improve LIRC documentation Mauro Carvalho Chehab
2016-07-12 12:41 ` [PATCH 01/20] [media] doc-rst: Document ioctl LIRC_GET_FEATURES Mauro Carvalho Chehab
2016-07-12 12:41 ` [PATCH 02/20] [media] doc-rst: add media/uapi/rc/lirc-header.rst Mauro Carvalho Chehab
2016-07-12 12:41 ` [PATCH 03/20] [media] lirc.h: remove several unused ioctls Mauro Carvalho Chehab
2016-07-12 13:14   ` Sean Young
2016-07-12 13:23     ` Mauro Carvalho Chehab
2016-07-12 13:35       ` Sean Young
2016-07-12 13:54         ` Sean Young
2016-07-12 14:05           ` Mauro Carvalho Chehab
2016-07-12 12:41 ` [PATCH 04/20] [media] doc-rst: remove not used ioctls from documentation Mauro Carvalho Chehab
2016-07-12 12:41 ` [PATCH 05/20] [media] doc-rst: Fix LIRC_GET_FEATURES references Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 06/20] [media] doc-rst: document ioctl LIRC_GET_SEND_MODE Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 07/20] [media] doc-rst: fix some lirc cross-references Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 08/20] [media] doc-rst: document ioctl LIRC_GET_REC_MODE Mauro Carvalho Chehab
2016-07-12 13:01   ` Sean Young
2016-07-12 13:27     ` Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 09/20] [media] doc-rst: document LIRC_GET_REC_RESOLUTION Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 10/20] [media] doc-rst: document LIRC_SET_SEND_DUTY_CYCLE Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 11/20] [media] doc-rst: document LIRC_GET_*_TIMEOUT ioctls Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 12/20] [media] doc-rst: Document LIRC_GET_LENGTH ioctl Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 13/20] [media] doc-rst: document LIRC set carrier ioctls Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 14/20] [media] doc-rst: document LIRC_SET_TRANSMITTER_MASK Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 15/20] [media] doc-rst: document LIRC_SET_REC_TIMEOUT Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 16/20] [media] doc-rst: document LIRC_SET_REC_TIMEOUT_REPORTS Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 17/20] [media] doc-rst: add documentation for LIRC_SET_MEASURE_CARRIER_MODE Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 18/20] [media] doc-rst: document LIRC_SET_WIDEBAND_RECEIVER Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 19/20] [media] doc-rst: Document LIRC set mode ioctls Mauro Carvalho Chehab
2016-07-12 12:42 ` [PATCH 20/20] [media] doc-rst: reorganize LIRC ReST files Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).