All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
@ 2016-10-06  7:20 Markus Heiser
  2016-10-06  7:20 ` [PATCH 1/4] doc-rst: " Markus Heiser
                   ` (4 more replies)
  0 siblings, 5 replies; 32+ messages in thread
From: Markus Heiser @ 2016-10-06  7:20 UTC (permalink / raw)
  To: Jonathan Corbet, Mauro Carvalho Chehab, Jani Nikula
  Cc: Markus Heiser, Linux Media Mailing List, linux-doc

From: Markus Heiser <markus.heiser@darmarIT.de>

Hi Jon, Mauro, and Jani,

with this series a reST-directive kernel-cmd is introduced. The kernel-cmd
directive includes contend from the stdout of a command-line (@mchehab asked
for).

Including content from a command's stdout is a more general solution for other
workarounds like the "kernel_include + parseheaders" solution. This series also
migrates the kernel-include uses to kernel-cmd directives and drops the Makefile
in the media sub-folder. With the last patch, the (no longer needed)
kernel-include directive is removed.

-- Markus --

Markus Heiser (4):
  doc-rst: reST-directive kernel-cmd / include contentent from scripts
  doc-rst: customize RTD theme; literal-block
  doc-rst: migrated media build kernel-cmd directive
  doc-rst: remove the kernel-include directive

 Documentation/Makefile.sphinx                      |   4 +-
 Documentation/conf.py                              |   2 +-
 Documentation/media/Makefile                       |  61 ---
 Documentation/media/audio.h.rst.exceptions         |  20 -
 Documentation/media/ca.h.rst.exceptions            |  24 -
 Documentation/media/cec.h.rst.exceptions           | 492 -------------------
 Documentation/media/dmx.h.rst.exceptions           |  63 ---
 Documentation/media/frontend.h.rst.exceptions      |  47 --
 Documentation/media/lirc.h.rst.exceptions          |  43 --
 Documentation/media/media.h.rst.exceptions         |  30 --
 Documentation/media/net.h.rst.exceptions           |  11 -
 Documentation/media/uapi/cec/cec-header.rst        |   3 +-
 Documentation/media/uapi/cec/cec.h.exceptions      | 492 +++++++++++++++++++
 Documentation/media/uapi/dvb/audio.h.exceptions    |  20 +
 Documentation/media/uapi/dvb/audio_h.rst           |   2 +-
 Documentation/media/uapi/dvb/ca.h.exceptions       |  24 +
 Documentation/media/uapi/dvb/ca_h.rst              |   2 +-
 Documentation/media/uapi/dvb/dmx.h.exceptions      |  63 +++
 Documentation/media/uapi/dvb/dmx_h.rst             |   2 +-
 Documentation/media/uapi/dvb/frontend.h.exceptions |  47 ++
 Documentation/media/uapi/dvb/frontend_h.rst        |   2 +-
 Documentation/media/uapi/dvb/net.h.exceptions      |  11 +
 Documentation/media/uapi/dvb/net_h.rst             |   2 +-
 Documentation/media/uapi/dvb/video.h.exceptions    |  40 ++
 Documentation/media/uapi/dvb/video_h.rst           |   2 +-
 Documentation/media/uapi/mediactl/media-header.rst |   3 +-
 .../media/uapi/mediactl/media.h.exceptions         |  30 ++
 Documentation/media/uapi/rc/lirc-header.rst        |   2 +-
 Documentation/media/uapi/rc/lirc.h.exceptions      |  43 ++
 Documentation/media/uapi/v4l/videodev.rst          |   2 +-
 .../media/uapi/v4l/videodev2.h.exceptions          | 535 +++++++++++++++++++++
 Documentation/media/video.h.rst.exceptions         |  40 --
 Documentation/media/videodev2.h.rst.exceptions     | 535 ---------------------
 Documentation/sphinx-static/theme_overrides.css    |   7 +
 Documentation/sphinx/kernel_cmd.py                 | 206 ++++++++
 Documentation/sphinx/kernel_include.py             | 190 --------
 Documentation/sphinx/parse-headers.pl              |  17 +-
 37 files changed, 1538 insertions(+), 1581 deletions(-)
 delete mode 100644 Documentation/media/Makefile
 delete mode 100644 Documentation/media/audio.h.rst.exceptions
 delete mode 100644 Documentation/media/ca.h.rst.exceptions
 delete mode 100644 Documentation/media/cec.h.rst.exceptions
 delete mode 100644 Documentation/media/dmx.h.rst.exceptions
 delete mode 100644 Documentation/media/frontend.h.rst.exceptions
 delete mode 100644 Documentation/media/lirc.h.rst.exceptions
 delete mode 100644 Documentation/media/media.h.rst.exceptions
 delete mode 100644 Documentation/media/net.h.rst.exceptions
 create mode 100644 Documentation/media/uapi/cec/cec.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/audio.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/ca.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/dmx.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/frontend.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/net.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/video.h.exceptions
 create mode 100644 Documentation/media/uapi/mediactl/media.h.exceptions
 create mode 100644 Documentation/media/uapi/rc/lirc.h.exceptions
 create mode 100644 Documentation/media/uapi/v4l/videodev2.h.exceptions
 delete mode 100644 Documentation/media/video.h.rst.exceptions
 delete mode 100644 Documentation/media/videodev2.h.rst.exceptions
 create mode 100644 Documentation/sphinx/kernel_cmd.py
 delete mode 100755 Documentation/sphinx/kernel_include.py

-- 
2.7.4


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

* [PATCH 1/4] doc-rst: reST-directive kernel-cmd / include contentent from scripts
  2016-10-06  7:20 [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Markus Heiser
@ 2016-10-06  7:20 ` Markus Heiser
  2016-10-17 16:46   ` Mauro Carvalho Chehab
  2016-10-06  7:20 ` [PATCH 2/4] doc-rst: customize RTD theme; literal-block Markus Heiser
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 32+ messages in thread
From: Markus Heiser @ 2016-10-06  7:20 UTC (permalink / raw)
  To: Jonathan Corbet, Mauro Carvalho Chehab, Jani Nikula
  Cc: Markus Heiser, Linux Media Mailing List, linux-doc

From: Markus Heiser <markus.heiser@darmarIT.de>

From: Markus Heiser <markus.heiser@darmarIT.de>

The ``kernel-cmd`` directive includes contend from the stdout of a
command-line. With the ``kernel-cmd`` directive we can include the
output of any (Perl or whatever) script. This is a more general solution
for other workarounds like the "kernel_include + parseheaders" solution.

Overview of directive's argument and options.

.. code-block:: rst

    .. kernel-cmd:: <command line>
        :depends: <list of comma separated file names>
        :code-block: <language>
        :debug:

The argument ``<command line>`` is required, it is a command line to be
executed. The stdout stream of the command is captured and is inserted as
reST content. The command line is executed in a system shell where the PATH
environment is extended with the paths ::

    PATH=$(srctree)/scripts:$(srctree)/Documentation/sphinx:...

A very simple example, which includes the output as ``code-block``::

  .. kernel-cmd:: ls -la $srctree
        :code-block: sh

The ``code-block`` is optional, leaving it will include the output as
pure (hopefully well) formated reST.

.. warning::

   The kernel-cmd directive **executes** commands, whatever poses a risk
   (shell injection) in itself!

   The command might depend on local installations, don't use commands which
   are not available in some OS (be clear about the dependencies).

Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de>
---
 Documentation/conf.py              |   2 +-
 Documentation/sphinx/kernel_cmd.py | 206 +++++++++++++++++++++++++++++++++++++
 2 files changed, 207 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/sphinx/kernel_cmd.py

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 0cc8765..64231e1 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -34,7 +34,7 @@ from load_config import loadConfig
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include', 'cdomain']
+extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include', 'cdomain', 'kernel_cmd']
 
 # The name of the math extension changed on Sphinx 1.4
 if minor > 3:
diff --git a/Documentation/sphinx/kernel_cmd.py b/Documentation/sphinx/kernel_cmd.py
new file mode 100644
index 0000000..ddb2a27
--- /dev/null
+++ b/Documentation/sphinx/kernel_cmd.py
@@ -0,0 +1,206 @@
+# -*- coding: utf-8; mode: python -*-
+u"""
+    kernel-cmd
+    ~~~~~~~~~~
+
+    Implementation of the ``kernel-cmd`` reST-directive.
+
+    :copyright:  Copyright (C) 2016  Markus Heiser
+    :license:    GPL Version 2, June 1991 see Linux/COPYING for details.
+
+    The ``kernel-cmd`` (:py:class:`KernelCmd`) directive includes contend
+    from the stdout of a comand-line.
+
+    Overview of directive's argument and options.
+
+    .. code-block:: rst
+
+        .. kernel-cmd:: <command line>
+            :depends: <list of comma separated file names>
+            :code-block: <language>
+            :debug:
+
+    The argument ``<command line>`` is required, it is a command line to be
+    executed. The stdout stream of the command is captured and is inserted as
+    reST content. The command line is executed in a system shell where the PATH
+    environment is extended with the paths ::
+
+        PATH=$(srctree)/scripts:$(srctree)/Documentation/sphinx:...
+
+    ``depends <list of comma separated file names>``
+
+      If the stdout of the command line depends on files, you can add them as
+      dependency, which means: if one of the listed files is changed, the
+      sphinx-build (environment) is newly build.
+
+    ``code-block <language>``
+
+      If the called script outputs a code-block, use the ``code-block`` option
+      with an *language* as argument.  The valid values for the highlighting
+      language are:
+
+      * none (no highlighting)
+      * guess (let Pygments guess the lexer based on contents, only works
+        with certain well-recognizable languages)
+      * rest
+      * c
+      * and any other lexer alias that `Pygments
+        <http://pygments.org/docs/lexers/>`_ supports.
+
+    ``debug``
+      Inserts a code-block with the *raw* reST. Sometimes it is helpful to see
+      what reST is generated.
+
+    .. warning::
+
+       The kernel-cmd directive **executes** commands, whatever poses a risk
+       (shell injection) in itself!
+
+       The command might depend on local installations, don't use commands which
+       are not available in some OS (be clear about the dependencies).
+
+"""
+
+import sys
+import os
+from os import path
+import subprocess
+
+from sphinx.ext.autodoc import AutodocReporter
+
+from docutils import nodes
+from docutils.parsers.rst import Directive, directives
+from docutils.statemachine import ViewList
+from docutils.utils.error_reporting import ErrorString
+
+
+__version__  = '1.0'
+
+# We can't assume that six is installed
+PY3 = sys.version_info[0] == 3
+PY2 = sys.version_info[0] == 2
+if PY3:
+    # pylint: disable=C0103, W0622
+    unicode     = str
+    basestring  = str
+
+def setup(app):
+
+    app.add_directive("kernel-cmd", KernelCmd)
+    return dict(
+        version = __version__
+        , parallel_read_safe = True
+        , parallel_write_safe = True
+    )
+
+class KernelCmd(Directive):
+
+    u"""KernelCmd (``kernel-cmd``) directive"""
+
+    required_arguments = 1
+    optional_arguments = 0
+    has_content = False
+    final_argument_whitespace = True
+
+    option_spec = {
+        "depends"   : directives.unchanged,
+        "code-block": directives.unchanged,
+        "debug"     : directives.flag
+    }
+
+    def warn(self, message, **replace):
+        replace["fname"]   = self.state.document.current_source
+        replace["line_no"] = replace.get("line_no", self.lineno)
+        message = ("%(fname)s:%(line_no)s: [kernel-cmd WARN] : " + message) % replace
+        self.state.document.settings.env.app.warn(message, prefix="")
+
+    def run(self):
+
+        doc = self.state.document
+        if not doc.settings.file_insertion_enabled:
+            raise self.warning("docutils: file insertion disabled")
+
+        env = doc.settings.env
+        cwd = path.dirname(doc.current_source)
+        cmd = self.arguments[0]
+
+        if "depends" in self.options:
+            dep = self.options.get("depends")
+            dep = ''.join([s.strip() for s in dep.splitlines()])
+            dep = [s.strip() for s in dep.split(",")]
+            for p in dep:
+                env.note_dependency(p)
+
+        srctree = path.abspath(os.environ["srctree"])
+
+        # Since there is no *source* file, we use the command string as
+        # (default) filename
+        fname = cmd
+
+        # extend PATH with $(srctree)/scripts:$(srctree)/Documentation/sphinx
+        path_env = os.pathsep.join([
+            srctree + os.sep + "scripts",
+            srctree + os.sep + "Documentation" + os.sep + "sphinx",
+            os.environ["PATH"]
+        ])
+        shell_env = os.environ.copy()
+        shell_env["PATH"]    = path_env
+        shell_env["srctree"] = srctree
+
+        lines = self.runCmd(cmd, shell=True, cwd=cwd, env=shell_env)
+        nodeList = self.nestedParse(lines, fname)
+        return nodeList
+
+    def runCmd(self, cmd, **kwargs):
+        u"""Run command ``cmd`` and return it's stdout as unicode."""
+
+        try:
+            proc = subprocess.Popen(
+                cmd
+                , stdout = subprocess.PIPE
+                , stderr = subprocess.PIPE
+                , universal_newlines = True
+                , **kwargs
+            )
+            out, err = proc.communicate()
+            if err:
+                self.warn(err)
+            if proc.returncode != 0:
+                raise self.severe(
+                    u"command '%s' failed with return code %d"
+                    % (cmd, proc.returncode)
+                )
+        except OSError as exc:
+            raise self.severe(u"problems with '%s' directive: %s."
+                              % (self.name, ErrorString(exc)))
+        return unicode(out)
+
+    def nestedParse(self, lines, fname):
+        content = ViewList()
+        node    = nodes.section()
+
+        if "code-block" in self.options:
+            code_block = "\n\n.. code-block:: %s\n" % self.options["code-block"]
+            for l in lines.split("\n"):
+                code_block += "\n    " + l
+            lines = code_block + "\n\n"
+
+        if "debug" in self.options:
+            code_block = "\n\n.. code-block:: rst\n    :linenos:\n"
+            for l in lines.split("\n"):
+                code_block += "\n    " + l
+            lines = code_block + "\n\n"
+
+        for c, l in enumerate(lines.split("\n")):
+            content.append(l, fname, c)
+
+        buf  = self.state.memo.title_styles, self.state.memo.section_level, self.state.memo.reporter
+        self.state.memo.title_styles  = []
+        self.state.memo.section_level = 0
+        self.state.memo.reporter      = AutodocReporter(content, self.state.memo.reporter)
+        try:
+            self.state.nested_parse(content, 0, node, match_titles=1)
+        finally:
+            self.state.memo.title_styles, self.state.memo.section_level, self.state.memo.reporter = buf
+        return node.children
+
-- 
2.7.4


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

* [PATCH 2/4] doc-rst: customize RTD theme; literal-block
  2016-10-06  7:20 [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Markus Heiser
  2016-10-06  7:20 ` [PATCH 1/4] doc-rst: " Markus Heiser
@ 2016-10-06  7:20 ` Markus Heiser
  2016-10-06  7:20 ` [PATCH 3/4] doc-rst: migrated media build kernel-cmd directive Markus Heiser
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 32+ messages in thread
From: Markus Heiser @ 2016-10-06  7:20 UTC (permalink / raw)
  To: Jonathan Corbet, Mauro Carvalho Chehab, Jani Nikula
  Cc: Markus Heiser, Linux Media Mailing List, linux-doc

From: Markus Heiser <markus.heiser@darmarIT.de>

From: Markus Heiser <markus.heiser@darmarIT.de>

Format the literal-block like other code-block elements, with 12px and a
line-high of 1.5.

Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de>
---
 Documentation/sphinx-static/theme_overrides.css | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/sphinx-static/theme_overrides.css b/Documentation/sphinx-static/theme_overrides.css
index 8c00f84..47026e4 100644
--- a/Documentation/sphinx-static/theme_overrides.css
+++ b/Documentation/sphinx-static/theme_overrides.css
@@ -69,4 +69,11 @@
     .rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal {
         color: inherit;
     }
+
+    /* literal blocks (e.g. parsed-literal directive) */
+
+    pre.literal-block {
+        font-size: 12px;
+        line-height: 1.5;
+    }
 }
-- 
2.7.4


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

* [PATCH 3/4] doc-rst: migrated media build kernel-cmd directive
  2016-10-06  7:20 [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Markus Heiser
  2016-10-06  7:20 ` [PATCH 1/4] doc-rst: " Markus Heiser
  2016-10-06  7:20 ` [PATCH 2/4] doc-rst: customize RTD theme; literal-block Markus Heiser
@ 2016-10-06  7:20 ` Markus Heiser
  2016-10-06 11:46   ` Mauro Carvalho Chehab
  2016-10-06  7:20 ` [PATCH 4/4] doc-rst: remove the kernel-include directive Markus Heiser
  2016-10-06  8:42 ` [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Jani Nikula
  4 siblings, 1 reply; 32+ messages in thread
From: Markus Heiser @ 2016-10-06  7:20 UTC (permalink / raw)
  To: Jonathan Corbet, Mauro Carvalho Chehab, Jani Nikula
  Cc: Markus Heiser, Linux Media Mailing List, linux-doc

From: Markus Heiser <markus.heiser@darmarIT.de>

From: Markus Heiser <markus.heiser@darmarIT.de>

Remove the media-Makefile and migrate the ``.. kernel-include::``
directive to the new ``.. kernel-cmd::`` directive.

To avoid breaking bisect, this patch includes the required changes to
the implementation (script ``parse-headers.pl``) and the content (*.rst
files).

Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de>
---
 Documentation/Makefile.sphinx                      |   2 +-
 Documentation/media/Makefile                       |  61 ---
 Documentation/media/audio.h.rst.exceptions         |  20 -
 Documentation/media/ca.h.rst.exceptions            |  24 -
 Documentation/media/cec.h.rst.exceptions           | 492 -------------------
 Documentation/media/dmx.h.rst.exceptions           |  63 ---
 Documentation/media/frontend.h.rst.exceptions      |  47 --
 Documentation/media/lirc.h.rst.exceptions          |  43 --
 Documentation/media/media.h.rst.exceptions         |  30 --
 Documentation/media/net.h.rst.exceptions           |  11 -
 Documentation/media/uapi/cec/cec-header.rst        |   3 +-
 Documentation/media/uapi/cec/cec.h.exceptions      | 492 +++++++++++++++++++
 Documentation/media/uapi/dvb/audio.h.exceptions    |  20 +
 Documentation/media/uapi/dvb/audio_h.rst           |   2 +-
 Documentation/media/uapi/dvb/ca.h.exceptions       |  24 +
 Documentation/media/uapi/dvb/ca_h.rst              |   2 +-
 Documentation/media/uapi/dvb/dmx.h.exceptions      |  63 +++
 Documentation/media/uapi/dvb/dmx_h.rst             |   2 +-
 Documentation/media/uapi/dvb/frontend.h.exceptions |  47 ++
 Documentation/media/uapi/dvb/frontend_h.rst        |   2 +-
 Documentation/media/uapi/dvb/net.h.exceptions      |  11 +
 Documentation/media/uapi/dvb/net_h.rst             |   2 +-
 Documentation/media/uapi/dvb/video.h.exceptions    |  40 ++
 Documentation/media/uapi/dvb/video_h.rst           |   2 +-
 Documentation/media/uapi/mediactl/media-header.rst |   3 +-
 .../media/uapi/mediactl/media.h.exceptions         |  30 ++
 Documentation/media/uapi/rc/lirc-header.rst        |   2 +-
 Documentation/media/uapi/rc/lirc.h.exceptions      |  43 ++
 Documentation/media/uapi/v4l/videodev.rst          |   2 +-
 .../media/uapi/v4l/videodev2.h.exceptions          | 535 +++++++++++++++++++++
 Documentation/media/video.h.rst.exceptions         |  40 --
 Documentation/media/videodev2.h.rst.exceptions     | 535 ---------------------
 Documentation/sphinx/parse-headers.pl              |  17 +-
 33 files changed, 1323 insertions(+), 1389 deletions(-)
 delete mode 100644 Documentation/media/Makefile
 delete mode 100644 Documentation/media/audio.h.rst.exceptions
 delete mode 100644 Documentation/media/ca.h.rst.exceptions
 delete mode 100644 Documentation/media/cec.h.rst.exceptions
 delete mode 100644 Documentation/media/dmx.h.rst.exceptions
 delete mode 100644 Documentation/media/frontend.h.rst.exceptions
 delete mode 100644 Documentation/media/lirc.h.rst.exceptions
 delete mode 100644 Documentation/media/media.h.rst.exceptions
 delete mode 100644 Documentation/media/net.h.rst.exceptions
 create mode 100644 Documentation/media/uapi/cec/cec.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/audio.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/ca.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/dmx.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/frontend.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/net.h.exceptions
 create mode 100644 Documentation/media/uapi/dvb/video.h.exceptions
 create mode 100644 Documentation/media/uapi/mediactl/media.h.exceptions
 create mode 100644 Documentation/media/uapi/rc/lirc.h.exceptions
 create mode 100644 Documentation/media/uapi/v4l/videodev2.h.exceptions
 delete mode 100644 Documentation/media/video.h.rst.exceptions
 delete mode 100644 Documentation/media/videodev2.h.rst.exceptions

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 92deea3..2e033e4 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -52,7 +52,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1))
 #    e.g. "media" for the linux-tv book-set at ./Documentation/media
 
 quiet_cmd_sphinx = SPHINX  $@ --> file://$(abspath $(BUILDDIR)/$3/$4);
-      cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media all;\
+      cmd_sphinx = \
 	BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
 	$(SPHINXBUILD) \
 	-b $2 \
diff --git a/Documentation/media/Makefile b/Documentation/media/Makefile
deleted file mode 100644
index a7fb352..0000000
--- a/Documentation/media/Makefile
+++ /dev/null
@@ -1,61 +0,0 @@
-# Generate the *.h.rst files from uAPI headers
-
-PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl
-UAPI = $(srctree)/include/uapi/linux
-KAPI = $(srctree)/include/linux
-SRC_DIR=$(srctree)/Documentation/media
-
-FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
-	  videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst
-
-TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
-
-.PHONY: all
-all: $(BUILDDIR) ${TARGETS}
-
-$(BUILDDIR):
-	$(Q)mkdir -p $@
-
-# Rule to convert a .h file to inline RST documentation
-
-gen_rst = \
-	echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \
-	${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
-
-quiet_gen_rst = echo '  PARSE   $(patsubst $(srctree)/%,%,$<)'; \
-	${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
-
-silent_gen_rst = ${gen_rst}
-
-$(BUILDDIR)/audio.h.rst: ${UAPI}/dvb/audio.h ${PARSER} $(SRC_DIR)/audio.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/dmx.h.rst: ${UAPI}/dvb/dmx.h ${PARSER} $(SRC_DIR)/dmx.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/frontend.h.rst: ${UAPI}/dvb/frontend.h ${PARSER} $(SRC_DIR)/frontend.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} $(SRC_DIR)/net.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/video.h.rst: ${UAPI}/dvb/video.h ${PARSER} $(SRC_DIR)/video.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} $(SRC_DIR)/videodev2.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/media.h.rst: ${UAPI}/media.h ${PARSER} $(SRC_DIR)/media.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/cec.h.rst: ${KAPI}/cec.h ${PARSER} $(SRC_DIR)/cec.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-cleandocs:
-	-rm ${TARGETS}
diff --git a/Documentation/media/audio.h.rst.exceptions b/Documentation/media/audio.h.rst.exceptions
deleted file mode 100644
index 8330edc..0000000
--- a/Documentation/media/audio.h.rst.exceptions
+++ /dev/null
@@ -1,20 +0,0 @@
-# Ignore header name
-ignore define _DVBAUDIO_H_
-
-# Typedef pointing to structs
-replace typedef audio_karaoke_t audio-karaoke
-
-# Undocumented audio caps, as this is a deprecated API anyway
-ignore define AUDIO_CAP_DTS
-ignore define AUDIO_CAP_LPCM
-ignore define AUDIO_CAP_MP1
-ignore define AUDIO_CAP_MP2
-ignore define AUDIO_CAP_MP3
-ignore define AUDIO_CAP_AAC
-ignore define AUDIO_CAP_OGG
-ignore define AUDIO_CAP_SDDS
-ignore define AUDIO_CAP_AC3
-
-# some typedefs should point to struct/enums
-replace typedef audio_mixer_t audio-mixer
-replace typedef audio_status_t audio-status
diff --git a/Documentation/media/ca.h.rst.exceptions b/Documentation/media/ca.h.rst.exceptions
deleted file mode 100644
index 09c13be..0000000
--- a/Documentation/media/ca.h.rst.exceptions
+++ /dev/null
@@ -1,24 +0,0 @@
-# Ignore header name
-ignore define _DVBCA_H_
-
-# struct ca_slot_info defines
-replace define CA_CI ca-slot-info
-replace define CA_CI_LINK ca-slot-info
-replace define CA_CI_PHYS ca-slot-info
-replace define CA_DESCR ca-slot-info
-replace define CA_SC ca-slot-info
-replace define CA_CI_MODULE_PRESENT ca-slot-info
-replace define CA_CI_MODULE_READY ca-slot-info
-
-# struct ca_descr_info defines
-replace define CA_ECD ca-descr-info
-replace define CA_NDS ca-descr-info
-replace define CA_DSS ca-descr-info
-
-# some typedefs should point to struct/enums
-replace typedef ca_pid_t ca-pid
-replace typedef ca_slot_info_t ca-slot-info
-replace typedef ca_descr_info_t ca-descr-info
-replace typedef ca_caps_t ca-caps
-replace typedef ca_msg_t ca-msg
-replace typedef ca_descr_t ca-descr
diff --git a/Documentation/media/cec.h.rst.exceptions b/Documentation/media/cec.h.rst.exceptions
deleted file mode 100644
index b793394..0000000
--- a/Documentation/media/cec.h.rst.exceptions
+++ /dev/null
@@ -1,492 +0,0 @@
-# Ignore header name
-ignore define _CEC_UAPI_H
-
-# Rename some symbols, to avoid namespace conflicts
-replace struct cec_event_state_change cec-event-state-change_s
-replace struct cec_event_lost_msgs cec-event-lost-msgs_s
-replace enum cec_mode_initiator cec-mode-initiator_e
-replace enum cec_mode_follower cec-mode-follower_e
-
-# define macros to ignore
-
-ignore define CEC_MAX_MSG_SIZE
-ignore define CEC_MAX_LOG_ADDRS
-
-ignore define CEC_LOG_ADDR_MASK_TV
-ignore define CEC_LOG_ADDR_MASK_RECORD
-ignore define CEC_LOG_ADDR_MASK_TUNER
-ignore define CEC_LOG_ADDR_MASK_PLAYBACK
-ignore define CEC_LOG_ADDR_MASK_AUDIOSYSTEM
-ignore define CEC_LOG_ADDR_MASK_BACKUP
-ignore define CEC_LOG_ADDR_MASK_SPECIFIC
-ignore define CEC_LOG_ADDR_MASK_UNREGISTERED
-
-# Shouldn't them be documented?
-ignore define CEC_LOG_ADDR_INVALID
-ignore define CEC_PHYS_ADDR_INVALID
-
-ignore define CEC_VENDOR_ID_NONE
-
-ignore define CEC_MODE_INITIATOR_MSK
-ignore define CEC_MODE_FOLLOWER_MSK
-
-ignore define CEC_EVENT_FL_INITIAL_STATE
-
-# Part of CEC 2.0 spec - shouldn't be documented too?
-ignore define CEC_LOG_ADDR_TV
-ignore define CEC_LOG_ADDR_RECORD_1
-ignore define CEC_LOG_ADDR_RECORD_2
-ignore define CEC_LOG_ADDR_TUNER_1
-ignore define CEC_LOG_ADDR_PLAYBACK_1
-ignore define CEC_LOG_ADDR_AUDIOSYSTEM
-ignore define CEC_LOG_ADDR_TUNER_2
-ignore define CEC_LOG_ADDR_TUNER_3
-ignore define CEC_LOG_ADDR_PLAYBACK_2
-ignore define CEC_LOG_ADDR_RECORD_3
-ignore define CEC_LOG_ADDR_TUNER_4
-ignore define CEC_LOG_ADDR_PLAYBACK_3
-ignore define CEC_LOG_ADDR_BACKUP_1
-ignore define CEC_LOG_ADDR_BACKUP_2
-ignore define CEC_LOG_ADDR_SPECIFIC
-ignore define CEC_LOG_ADDR_UNREGISTERED
-ignore define CEC_LOG_ADDR_BROADCAST
-
-# IMHO, those should also be documented
-
-ignore define CEC_MSG_ACTIVE_SOURCE
-ignore define CEC_MSG_IMAGE_VIEW_ON
-ignore define CEC_MSG_TEXT_VIEW_ON
-
-ignore define CEC_MSG_INACTIVE_SOURCE
-ignore define CEC_MSG_REQUEST_ACTIVE_SOURCE
-ignore define CEC_MSG_ROUTING_CHANGE
-ignore define CEC_MSG_ROUTING_INFORMATION
-ignore define CEC_MSG_SET_STREAM_PATH
-
-ignore define CEC_MSG_STANDBY
-
-ignore define CEC_MSG_RECORD_OFF
-ignore define CEC_MSG_RECORD_ON
-
-ignore define CEC_OP_RECORD_SRC_OWN
-ignore define CEC_OP_RECORD_SRC_DIGITAL
-ignore define CEC_OP_RECORD_SRC_ANALOG
-ignore define CEC_OP_RECORD_SRC_EXT_PLUG
-ignore define CEC_OP_RECORD_SRC_EXT_PHYS_ADDR
-
-ignore define CEC_OP_SERVICE_ID_METHOD_BY_DIG_ID
-ignore define CEC_OP_SERVICE_ID_METHOD_BY_CHANNEL
-
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_GEN
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_GEN
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_GEN
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_BS
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_CS
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_T
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_CABLE
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_SAT
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_T
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_C
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_S
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_S2
-ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_T
-
-ignore define CEC_OP_ANA_BCAST_TYPE_CABLE
-ignore define CEC_OP_ANA_BCAST_TYPE_SATELLITE
-ignore define CEC_OP_ANA_BCAST_TYPE_TERRESTRIAL
-
-ignore define CEC_OP_BCAST_SYSTEM_PAL_BG
-ignore define CEC_OP_BCAST_SYSTEM_SECAM_LQ
-ignore define CEC_OP_BCAST_SYSTEM_PAL_M
-ignore define CEC_OP_BCAST_SYSTEM_NTSC_M
-ignore define CEC_OP_BCAST_SYSTEM_PAL_I
-ignore define CEC_OP_BCAST_SYSTEM_SECAM_DK
-ignore define CEC_OP_BCAST_SYSTEM_SECAM_BG
-ignore define CEC_OP_BCAST_SYSTEM_SECAM_L
-ignore define CEC_OP_BCAST_SYSTEM_PAL_DK
-ignore define CEC_OP_BCAST_SYSTEM_OTHER
-
-ignore define CEC_OP_CHANNEL_NUMBER_FMT_1_PART
-ignore define CEC_OP_CHANNEL_NUMBER_FMT_2_PART
-
-ignore define CEC_MSG_RECORD_STATUS
-
-ignore define CEC_OP_RECORD_STATUS_CUR_SRC
-ignore define CEC_OP_RECORD_STATUS_DIG_SERVICE
-ignore define CEC_OP_RECORD_STATUS_ANA_SERVICE
-ignore define CEC_OP_RECORD_STATUS_EXT_INPUT
-ignore define CEC_OP_RECORD_STATUS_NO_DIG_SERVICE
-ignore define CEC_OP_RECORD_STATUS_NO_ANA_SERVICE
-ignore define CEC_OP_RECORD_STATUS_NO_SERVICE
-ignore define CEC_OP_RECORD_STATUS_INVALID_EXT_PLUG
-ignore define CEC_OP_RECORD_STATUS_INVALID_EXT_PHYS_ADDR
-ignore define CEC_OP_RECORD_STATUS_UNSUP_CA
-ignore define CEC_OP_RECORD_STATUS_NO_CA_ENTITLEMENTS
-ignore define CEC_OP_RECORD_STATUS_CANT_COPY_SRC
-ignore define CEC_OP_RECORD_STATUS_NO_MORE_COPIES
-ignore define CEC_OP_RECORD_STATUS_NO_MEDIA
-ignore define CEC_OP_RECORD_STATUS_PLAYING
-ignore define CEC_OP_RECORD_STATUS_ALREADY_RECORDING
-ignore define CEC_OP_RECORD_STATUS_MEDIA_PROT
-ignore define CEC_OP_RECORD_STATUS_NO_SIGNAL
-ignore define CEC_OP_RECORD_STATUS_MEDIA_PROBLEM
-ignore define CEC_OP_RECORD_STATUS_NO_SPACE
-ignore define CEC_OP_RECORD_STATUS_PARENTAL_LOCK
-ignore define CEC_OP_RECORD_STATUS_TERMINATED_OK
-ignore define CEC_OP_RECORD_STATUS_ALREADY_TERM
-ignore define CEC_OP_RECORD_STATUS_OTHER
-
-ignore define CEC_MSG_RECORD_TV_SCREEN
-
-ignore define CEC_MSG_CLEAR_ANALOGUE_TIMER
-
-ignore define CEC_OP_REC_SEQ_SUNDAY
-ignore define CEC_OP_REC_SEQ_MONDAY
-ignore define CEC_OP_REC_SEQ_TUESDAY
-ignore define CEC_OP_REC_SEQ_WEDNESDAY
-ignore define CEC_OP_REC_SEQ_THURSDAY
-ignore define CEC_OP_REC_SEQ_FRIDAY
-ignore define CEC_OP_REC_SEQ_SATERDAY
-ignore define CEC_OP_REC_SEQ_ONCE_ONLY
-
-ignore define CEC_MSG_CLEAR_DIGITAL_TIMER
-
-ignore define CEC_MSG_CLEAR_EXT_TIMER
-
-ignore define CEC_OP_EXT_SRC_PLUG
-ignore define CEC_OP_EXT_SRC_PHYS_ADDR
-
-ignore define CEC_MSG_SET_ANALOGUE_TIMER
-ignore define CEC_MSG_SET_DIGITAL_TIMER
-ignore define CEC_MSG_SET_EXT_TIMER
-
-ignore define CEC_MSG_SET_TIMER_PROGRAM_TITLE
-ignore define CEC_MSG_TIMER_CLEARED_STATUS
-
-ignore define CEC_OP_TIMER_CLR_STAT_RECORDING
-ignore define CEC_OP_TIMER_CLR_STAT_NO_MATCHING
-ignore define CEC_OP_TIMER_CLR_STAT_NO_INFO
-ignore define CEC_OP_TIMER_CLR_STAT_CLEARED
-
-ignore define CEC_MSG_TIMER_STATUS
-
-ignore define CEC_OP_TIMER_OVERLAP_WARNING_NO_OVERLAP
-ignore define CEC_OP_TIMER_OVERLAP_WARNING_OVERLAP
-
-ignore define CEC_OP_MEDIA_INFO_UNPROT_MEDIA
-ignore define CEC_OP_MEDIA_INFO_PROT_MEDIA
-ignore define CEC_OP_MEDIA_INFO_NO_MEDIA
-
-ignore define CEC_OP_PROG_IND_NOT_PROGRAMMED
-ignore define CEC_OP_PROG_IND_PROGRAMMED
-
-ignore define CEC_OP_PROG_INFO_ENOUGH_SPACE
-ignore define CEC_OP_PROG_INFO_NOT_ENOUGH_SPACE
-ignore define CEC_OP_PROG_INFO_MIGHT_NOT_BE_ENOUGH_SPACE
-ignore define CEC_OP_PROG_INFO_NONE_AVAILABLE
-
-ignore define CEC_OP_PROG_ERROR_NO_FREE_TIMER
-ignore define CEC_OP_PROG_ERROR_DATE_OUT_OF_RANGE
-ignore define CEC_OP_PROG_ERROR_REC_SEQ_ERROR
-ignore define CEC_OP_PROG_ERROR_INV_EXT_PLUG
-ignore define CEC_OP_PROG_ERROR_INV_EXT_PHYS_ADDR
-ignore define CEC_OP_PROG_ERROR_CA_UNSUPP
-ignore define CEC_OP_PROG_ERROR_INSUF_CA_ENTITLEMENTS
-ignore define CEC_OP_PROG_ERROR_RESOLUTION_UNSUPP
-ignore define CEC_OP_PROG_ERROR_PARENTAL_LOCK
-ignore define CEC_OP_PROG_ERROR_CLOCK_FAILURE
-ignore define CEC_OP_PROG_ERROR_DUPLICATE
-
-ignore define CEC_MSG_CEC_VERSION
-
-ignore define CEC_OP_CEC_VERSION_1_3A
-ignore define CEC_OP_CEC_VERSION_1_4
-ignore define CEC_OP_CEC_VERSION_2_0
-
-ignore define CEC_MSG_GET_CEC_VERSION
-ignore define CEC_MSG_GIVE_PHYSICAL_ADDR
-ignore define CEC_MSG_GET_MENU_LANGUAGE
-ignore define CEC_MSG_REPORT_PHYSICAL_ADDR
-
-ignore define CEC_OP_PRIM_DEVTYPE_TV
-ignore define CEC_OP_PRIM_DEVTYPE_RECORD
-ignore define CEC_OP_PRIM_DEVTYPE_TUNER
-ignore define CEC_OP_PRIM_DEVTYPE_PLAYBACK
-ignore define CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM
-ignore define CEC_OP_PRIM_DEVTYPE_SWITCH
-ignore define CEC_OP_PRIM_DEVTYPE_PROCESSOR
-
-ignore define CEC_MSG_SET_MENU_LANGUAGE
-ignore define CEC_MSG_REPORT_FEATURES
-
-ignore define CEC_OP_ALL_DEVTYPE_TV
-ignore define CEC_OP_ALL_DEVTYPE_RECORD
-ignore define CEC_OP_ALL_DEVTYPE_TUNER
-ignore define CEC_OP_ALL_DEVTYPE_PLAYBACK
-ignore define CEC_OP_ALL_DEVTYPE_AUDIOSYSTEM
-ignore define CEC_OP_ALL_DEVTYPE_SWITCH
-
-ignore define CEC_OP_FEAT_EXT
-
-ignore define CEC_OP_FEAT_RC_TV_PROFILE_NONE
-ignore define CEC_OP_FEAT_RC_TV_PROFILE_1
-ignore define CEC_OP_FEAT_RC_TV_PROFILE_2
-ignore define CEC_OP_FEAT_RC_TV_PROFILE_3
-ignore define CEC_OP_FEAT_RC_TV_PROFILE_4
-ignore define CEC_OP_FEAT_RC_SRC_HAS_DEV_ROOT_MENU
-ignore define CEC_OP_FEAT_RC_SRC_HAS_DEV_SETUP_MENU
-ignore define CEC_OP_FEAT_RC_SRC_HAS_CONTENTS_MENU
-ignore define CEC_OP_FEAT_RC_SRC_HAS_MEDIA_TOP_MENU
-ignore define CEC_OP_FEAT_RC_SRC_HAS_MEDIA_CONTEXT_MENU
-
-ignore define CEC_OP_FEAT_DEV_HAS_RECORD_TV_SCREEN
-ignore define CEC_OP_FEAT_DEV_HAS_SET_OSD_STRING
-ignore define CEC_OP_FEAT_DEV_HAS_DECK_CONTROL
-ignore define CEC_OP_FEAT_DEV_HAS_SET_AUDIO_RATE
-ignore define CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX
-ignore define CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX
-
-ignore define CEC_MSG_GIVE_FEATURES
-
-ignore define CEC_MSG_DECK_CONTROL
-
-ignore define CEC_OP_DECK_CTL_MODE_SKIP_FWD
-ignore define CEC_OP_DECK_CTL_MODE_SKIP_REV
-ignore define CEC_OP_DECK_CTL_MODE_STOP
-ignore define CEC_OP_DECK_CTL_MODE_EJECT
-
-ignore define CEC_MSG_DECK_STATUS
-
-ignore define CEC_OP_DECK_INFO_PLAY
-ignore define CEC_OP_DECK_INFO_RECORD
-ignore define CEC_OP_DECK_INFO_PLAY_REV
-ignore define CEC_OP_DECK_INFO_STILL
-ignore define CEC_OP_DECK_INFO_SLOW
-ignore define CEC_OP_DECK_INFO_SLOW_REV
-ignore define CEC_OP_DECK_INFO_FAST_FWD
-ignore define CEC_OP_DECK_INFO_FAST_REV
-ignore define CEC_OP_DECK_INFO_NO_MEDIA
-ignore define CEC_OP_DECK_INFO_STOP
-ignore define CEC_OP_DECK_INFO_SKIP_FWD
-ignore define CEC_OP_DECK_INFO_SKIP_REV
-ignore define CEC_OP_DECK_INFO_INDEX_SEARCH_FWD
-ignore define CEC_OP_DECK_INFO_INDEX_SEARCH_REV
-ignore define CEC_OP_DECK_INFO_OTHER
-
-ignore define CEC_MSG_GIVE_DECK_STATUS
-
-ignore define CEC_OP_STATUS_REQ_ON
-ignore define CEC_OP_STATUS_REQ_OFF
-ignore define CEC_OP_STATUS_REQ_ONCE
-
-ignore define CEC_MSG_PLAY
-
-ignore define CEC_OP_PLAY_MODE_PLAY_FWD
-ignore define CEC_OP_PLAY_MODE_PLAY_REV
-ignore define CEC_OP_PLAY_MODE_PLAY_STILL
-ignore define CEC_OP_PLAY_MODE_PLAY_FAST_FWD_MIN
-ignore define CEC_OP_PLAY_MODE_PLAY_FAST_FWD_MED
-ignore define CEC_OP_PLAY_MODE_PLAY_FAST_FWD_MAX
-ignore define CEC_OP_PLAY_MODE_PLAY_FAST_REV_MIN
-ignore define CEC_OP_PLAY_MODE_PLAY_FAST_REV_MED
-ignore define CEC_OP_PLAY_MODE_PLAY_FAST_REV_MAX
-ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_FWD_MIN
-ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_FWD_MED
-ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_FWD_MAX
-ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_REV_MIN
-ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_REV_MED
-ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_REV_MAX
-
-ignore define CEC_MSG_GIVE_TUNER_DEVICE_STATUS
-ignore define CEC_MSG_SELECT_ANALOGUE_SERVICE
-ignore define CEC_MSG_SELECT_DIGITAL_SERVICE
-ignore define CEC_MSG_TUNER_DEVICE_STATUS
-
-ignore define CEC_OP_REC_FLAG_USED
-ignore define CEC_OP_REC_FLAG_NOT_USED
-
-ignore define CEC_OP_TUNER_DISPLAY_INFO_DIGITAL
-ignore define CEC_OP_TUNER_DISPLAY_INFO_NONE
-ignore define CEC_OP_TUNER_DISPLAY_INFO_ANALOGUE
-
-ignore define CEC_MSG_TUNER_STEP_DECREMENT
-ignore define CEC_MSG_TUNER_STEP_INCREMENT
-
-ignore define CEC_MSG_DEVICE_VENDOR_ID
-ignore define CEC_MSG_GIVE_DEVICE_VENDOR_ID
-ignore define CEC_MSG_VENDOR_COMMAND
-ignore define CEC_MSG_VENDOR_COMMAND_WITH_ID
-ignore define CEC_MSG_VENDOR_REMOTE_BUTTON_DOWN
-ignore define CEC_MSG_VENDOR_REMOTE_BUTTON_UP
-
-ignore define CEC_MSG_SET_OSD_STRING
-
-ignore define CEC_OP_DISP_CTL_DEFAULT
-ignore define CEC_OP_DISP_CTL_UNTIL_CLEARED
-ignore define CEC_OP_DISP_CTL_CLEAR
-
-ignore define CEC_MSG_GIVE_OSD_NAME
-ignore define CEC_MSG_SET_OSD_NAME
-
-ignore define CEC_MSG_MENU_REQUEST
-
-ignore define CEC_OP_MENU_REQUEST_ACTIVATE
-ignore define CEC_OP_MENU_REQUEST_DEACTIVATE
-ignore define CEC_OP_MENU_REQUEST_QUERY
-
-ignore define CEC_MSG_MENU_STATUS
-
-ignore define CEC_OP_MENU_STATE_ACTIVATED
-ignore define CEC_OP_MENU_STATE_DEACTIVATED
-
-ignore define CEC_MSG_USER_CONTROL_PRESSED
-
-ignore define CEC_OP_UI_BCAST_TYPE_TOGGLE_ALL
-ignore define CEC_OP_UI_BCAST_TYPE_TOGGLE_DIG_ANA
-ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE
-ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE_T
-ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE_CABLE
-ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE_SAT
-ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL
-ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_T
-ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_CABLE
-ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_SAT
-ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_COM_SAT
-ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_COM_SAT2
-ignore define CEC_OP_UI_BCAST_TYPE_IP
-
-ignore define CEC_OP_UI_SND_PRES_CTL_DUAL_MONO
-ignore define CEC_OP_UI_SND_PRES_CTL_KARAOKE
-ignore define CEC_OP_UI_SND_PRES_CTL_DOWNMIX
-ignore define CEC_OP_UI_SND_PRES_CTL_REVERB
-ignore define CEC_OP_UI_SND_PRES_CTL_EQUALIZER
-ignore define CEC_OP_UI_SND_PRES_CTL_BASS_UP
-ignore define CEC_OP_UI_SND_PRES_CTL_BASS_NEUTRAL
-ignore define CEC_OP_UI_SND_PRES_CTL_BASS_DOWN
-ignore define CEC_OP_UI_SND_PRES_CTL_TREBLE_UP
-ignore define CEC_OP_UI_SND_PRES_CTL_TREBLE_NEUTRAL
-ignore define CEC_OP_UI_SND_PRES_CTL_TREBLE_DOWN
-
-ignore define CEC_MSG_USER_CONTROL_RELEASED
-
-ignore define CEC_MSG_GIVE_DEVICE_POWER_STATUS
-ignore define CEC_MSG_REPORT_POWER_STATUS
-
-ignore define CEC_OP_POWER_STATUS_ON
-ignore define CEC_OP_POWER_STATUS_STANDBY
-ignore define CEC_OP_POWER_STATUS_TO_ON
-ignore define CEC_OP_POWER_STATUS_TO_STANDBY
-
-ignore define CEC_MSG_FEATURE_ABORT
-
-ignore define CEC_OP_ABORT_UNRECOGNIZED_OP
-ignore define CEC_OP_ABORT_INCORRECT_MODE
-ignore define CEC_OP_ABORT_NO_SOURCE
-ignore define CEC_OP_ABORT_INVALID_OP
-ignore define CEC_OP_ABORT_REFUSED
-ignore define CEC_OP_ABORT_UNDETERMINED
-
-ignore define CEC_MSG_ABORT
-
-ignore define CEC_MSG_GIVE_AUDIO_STATUS
-ignore define CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS
-ignore define CEC_MSG_REPORT_AUDIO_STATUS
-
-ignore define CEC_OP_AUD_MUTE_STATUS_OFF
-ignore define CEC_OP_AUD_MUTE_STATUS_ON
-
-ignore define CEC_MSG_REPORT_SHORT_AUDIO_DESCRIPTOR
-ignore define CEC_MSG_REQUEST_SHORT_AUDIO_DESCRIPTOR
-ignore define CEC_MSG_SET_SYSTEM_AUDIO_MODE
-
-ignore define CEC_OP_SYS_AUD_STATUS_OFF
-ignore define CEC_OP_SYS_AUD_STATUS_ON
-
-ignore define CEC_MSG_SYSTEM_AUDIO_MODE_REQUEST
-ignore define CEC_MSG_SYSTEM_AUDIO_MODE_STATUS
-
-ignore define CEC_OP_AUD_FMT_ID_CEA861
-ignore define CEC_OP_AUD_FMT_ID_CEA861_CXT
-
-ignore define CEC_MSG_SET_AUDIO_RATE
-
-ignore define CEC_OP_AUD_RATE_OFF
-ignore define CEC_OP_AUD_RATE_WIDE_STD
-ignore define CEC_OP_AUD_RATE_WIDE_FAST
-ignore define CEC_OP_AUD_RATE_WIDE_SLOW
-ignore define CEC_OP_AUD_RATE_NARROW_STD
-ignore define CEC_OP_AUD_RATE_NARROW_FAST
-ignore define CEC_OP_AUD_RATE_NARROW_SLOW
-
-ignore define CEC_MSG_INITIATE_ARC
-ignore define CEC_MSG_REPORT_ARC_INITIATED
-ignore define CEC_MSG_REPORT_ARC_TERMINATED
-ignore define CEC_MSG_REQUEST_ARC_INITIATION
-ignore define CEC_MSG_REQUEST_ARC_TERMINATION
-ignore define CEC_MSG_TERMINATE_ARC
-
-ignore define CEC_MSG_REQUEST_CURRENT_LATENCY
-ignore define CEC_MSG_REPORT_CURRENT_LATENCY
-
-ignore define CEC_OP_LOW_LATENCY_MODE_OFF
-ignore define CEC_OP_LOW_LATENCY_MODE_ON
-
-ignore define CEC_OP_AUD_OUT_COMPENSATED_NA
-ignore define CEC_OP_AUD_OUT_COMPENSATED_DELAY
-ignore define CEC_OP_AUD_OUT_COMPENSATED_NO_DELAY
-ignore define CEC_OP_AUD_OUT_COMPENSATED_PARTIAL_DELAY
-
-ignore define CEC_MSG_CDC_MESSAGE
-
-ignore define CEC_MSG_CDC_HEC_INQUIRE_STATE
-ignore define CEC_MSG_CDC_HEC_REPORT_STATE
-
-ignore define CEC_OP_HEC_FUNC_STATE_NOT_SUPPORTED
-ignore define CEC_OP_HEC_FUNC_STATE_INACTIVE
-ignore define CEC_OP_HEC_FUNC_STATE_ACTIVE
-ignore define CEC_OP_HEC_FUNC_STATE_ACTIVATION_FIELD
-
-ignore define CEC_OP_HOST_FUNC_STATE_NOT_SUPPORTED
-ignore define CEC_OP_HOST_FUNC_STATE_INACTIVE
-ignore define CEC_OP_HOST_FUNC_STATE_ACTIVE
-
-ignore define CEC_OP_ENC_FUNC_STATE_EXT_CON_NOT_SUPPORTED
-ignore define CEC_OP_ENC_FUNC_STATE_EXT_CON_INACTIVE
-ignore define CEC_OP_ENC_FUNC_STATE_EXT_CON_ACTIVE
-
-ignore define CEC_OP_CDC_ERROR_CODE_NONE
-ignore define CEC_OP_CDC_ERROR_CODE_CAP_UNSUPPORTED
-ignore define CEC_OP_CDC_ERROR_CODE_WRONG_STATE
-ignore define CEC_OP_CDC_ERROR_CODE_OTHER
-
-ignore define CEC_OP_HEC_SUPPORT_NO
-ignore define CEC_OP_HEC_SUPPORT_YES
-
-ignore define CEC_OP_HEC_ACTIVATION_ON
-ignore define CEC_OP_HEC_ACTIVATION_OFF
-
-ignore define CEC_MSG_CDC_HEC_SET_STATE_ADJACENT
-ignore define CEC_MSG_CDC_HEC_SET_STATE
-
-ignore define CEC_OP_HEC_SET_STATE_DEACTIVATE
-ignore define CEC_OP_HEC_SET_STATE_ACTIVATE
-
-ignore define CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION
-ignore define CEC_MSG_CDC_HEC_NOTIFY_ALIVE
-ignore define CEC_MSG_CDC_HEC_DISCOVER
-
-ignore define CEC_MSG_CDC_HPD_SET_STATE
-
-ignore define CEC_OP_HPD_STATE_CP_EDID_DISABLE
-ignore define CEC_OP_HPD_STATE_CP_EDID_ENABLE
-ignore define CEC_OP_HPD_STATE_CP_EDID_DISABLE_ENABLE
-ignore define CEC_OP_HPD_STATE_EDID_DISABLE
-ignore define CEC_OP_HPD_STATE_EDID_ENABLE
-ignore define CEC_OP_HPD_STATE_EDID_DISABLE_ENABLE
-ignore define CEC_MSG_CDC_HPD_REPORT_STATE
-
-ignore define CEC_OP_HPD_ERROR_NONE
-ignore define CEC_OP_HPD_ERROR_INITIATOR_NOT_CAPABLE
-ignore define CEC_OP_HPD_ERROR_INITIATOR_WRONG_STATE
-ignore define CEC_OP_HPD_ERROR_OTHER
-ignore define CEC_OP_HPD_ERROR_NONE_NO_VIDEO
diff --git a/Documentation/media/dmx.h.rst.exceptions b/Documentation/media/dmx.h.rst.exceptions
deleted file mode 100644
index 8200653..0000000
--- a/Documentation/media/dmx.h.rst.exceptions
+++ /dev/null
@@ -1,63 +0,0 @@
-# Ignore header name
-ignore define _UAPI_DVBDMX_H_
-
-# Ignore limit constants
-ignore define DMX_FILTER_SIZE
-
-# dmx-pes-type-t enum symbols
-replace enum dmx_ts_pes dmx-pes-type-t
-replace symbol DMX_PES_AUDIO0 dmx-pes-type-t
-replace symbol DMX_PES_VIDEO0 dmx-pes-type-t
-replace symbol DMX_PES_TELETEXT0 dmx-pes-type-t
-replace symbol DMX_PES_SUBTITLE0 dmx-pes-type-t
-replace symbol DMX_PES_PCR0 dmx-pes-type-t
-replace symbol DMX_PES_AUDIO1 dmx-pes-type-t
-replace symbol DMX_PES_VIDEO1 dmx-pes-type-t
-replace symbol DMX_PES_TELETEXT1 dmx-pes-type-t
-replace symbol DMX_PES_SUBTITLE1 dmx-pes-type-t
-replace symbol DMX_PES_PCR1 dmx-pes-type-t
-replace symbol DMX_PES_AUDIO2 dmx-pes-type-t
-replace symbol DMX_PES_VIDEO2 dmx-pes-type-t
-replace symbol DMX_PES_TELETEXT2 dmx-pes-type-t
-replace symbol DMX_PES_SUBTITLE2 dmx-pes-type-t
-replace symbol DMX_PES_PCR2 dmx-pes-type-t
-replace symbol DMX_PES_AUDIO3 dmx-pes-type-t
-replace symbol DMX_PES_VIDEO3 dmx-pes-type-t
-replace symbol DMX_PES_TELETEXT3 dmx-pes-type-t
-replace symbol DMX_PES_SUBTITLE3 dmx-pes-type-t
-replace symbol DMX_PES_PCR3 dmx-pes-type-t
-replace symbol DMX_PES_OTHER dmx-pes-type-t
-
-# Ignore obsolete symbols
-ignore define DMX_PES_AUDIO
-ignore define DMX_PES_VIDEO
-ignore define DMX_PES_TELETEXT
-ignore define DMX_PES_SUBTITLE
-ignore define DMX_PES_PCR
-
-# dmx_input_t symbols
-replace enum dmx_input dmx-input-t
-replace symbol DMX_IN_FRONTEND dmx-input-t
-replace symbol DMX_IN_DVR dmx-input-t
-
-# dmx_source_t symbols
-replace enum dmx_source dmx-source-t
-replace symbol DMX_SOURCE_FRONT0 dmx-source-t
-replace symbol DMX_SOURCE_FRONT1 dmx-source-t
-replace symbol DMX_SOURCE_FRONT2 dmx-source-t
-replace symbol DMX_SOURCE_FRONT3 dmx-source-t
-replace symbol DMX_SOURCE_DVR0 dmx-source-t
-replace symbol DMX_SOURCE_DVR1 dmx-source-t
-replace symbol DMX_SOURCE_DVR2 dmx-source-t
-replace symbol DMX_SOURCE_DVR3 dmx-source-t
-
-
-# Flags for struct dmx_sct_filter_params
-replace define DMX_CHECK_CRC dmx-sct-filter-params
-replace define DMX_ONESHOT dmx-sct-filter-params
-replace define DMX_IMMEDIATE_START dmx-sct-filter-params
-replace define DMX_KERNEL_CLIENT dmx-sct-filter-params
-
-# some typedefs should point to struct/enums
-replace typedef dmx_caps_t dmx-caps
-replace typedef dmx_filter_t dmx-filter
diff --git a/Documentation/media/frontend.h.rst.exceptions b/Documentation/media/frontend.h.rst.exceptions
deleted file mode 100644
index 60f2cbb..0000000
--- a/Documentation/media/frontend.h.rst.exceptions
+++ /dev/null
@@ -1,47 +0,0 @@
-# Ignore header name
-ignore define _DVBFRONTEND_H_
-
-# Group layer A-C symbols together
-replace define DTV_ISDBT_LAYERA_FEC dtv-isdbt-layer-fec
-replace define DTV_ISDBT_LAYERB_FEC dtv-isdbt-layer-fec
-replace define DTV_ISDBT_LAYERC_FEC dtv-isdbt-layer-fec
-replace define DTV_ISDBT_LAYERA_MODULATION dtv-isdbt-layer-modulation
-replace define DTV_ISDBT_LAYERB_MODULATION dtv-isdbt-layer-modulation
-replace define DTV_ISDBT_LAYERC_MODULATION dtv-isdbt-layer-modulation
-replace define DTV_ISDBT_LAYERA_SEGMENT_COUNT dtv-isdbt-layer-segment-count
-replace define DTV_ISDBT_LAYERB_SEGMENT_COUNT dtv-isdbt-layer-segment-count
-replace define DTV_ISDBT_LAYERC_SEGMENT_COUNT dtv-isdbt-layer-segment-count
-replace define DTV_ISDBT_LAYERA_TIME_INTERLEAVING dtv-isdbt-layer-time-interleaving
-replace define DTV_ISDBT_LAYERB_TIME_INTERLEAVING dtv-isdbt-layer-time-interleaving
-replace define DTV_ISDBT_LAYERC_TIME_INTERLEAVING dtv-isdbt-layer-time-interleaving
-
-# Ignore legacy defines
-ignore define DTV_ISDBS_TS_ID_LEGACY
-ignore define SYS_DVBC_ANNEX_AC
-ignore define SYS_DMBTH
-
-# Ignore limits
-ignore define DTV_MAX_COMMAND
-ignore define MAX_DTV_STATS
-ignore define DTV_IOCTL_MAX_MSGS
-
-# Stats enum is documented altogether
-replace enum fecap_scale_params frontend-stat-properties
-replace symbol FE_SCALE_COUNTER frontend-stat-properties
-replace symbol FE_SCALE_DECIBEL frontend-stat-properties
-replace symbol FE_SCALE_NOT_AVAILABLE frontend-stat-properties
-replace symbol FE_SCALE_RELATIVE frontend-stat-properties
-
-# the same reference is used for both get and set ioctls
-replace ioctl FE_SET_PROPERTY FE_GET_PROPERTY
-
-# Ignore struct used only internally at Kernel
-ignore struct dtv_cmds_h
-
-# Typedefs that use the enum reference
-replace typedef fe_sec_voltage_t fe-sec-voltage
-
-# Replaces for flag constants
-replace define FE_TUNE_MODE_ONESHOT fe_set_frontend_tune_mode
-replace define LNA_AUTO dtv-lna
-replace define NO_STREAM_ID_FILTER dtv-stream-id
diff --git a/Documentation/media/lirc.h.rst.exceptions b/Documentation/media/lirc.h.rst.exceptions
deleted file mode 100644
index 246c850..0000000
--- a/Documentation/media/lirc.h.rst.exceptions
+++ /dev/null
@@ -1,43 +0,0 @@
-# Ignore header name
-ignore define _LINUX_LIRC_H
-
-# Ignore helper macros
-
-ignore define lirc_t
-
-ignore define LIRC_SPACE
-ignore define LIRC_PULSE
-ignore define LIRC_FREQUENCY
-ignore define LIRC_TIMEOUT
-ignore define LIRC_VALUE
-ignore define LIRC_MODE2
-ignore define LIRC_IS_SPACE
-ignore define LIRC_IS_PULSE
-ignore define LIRC_IS_FREQUENCY
-ignore define LIRC_IS_TIMEOUT
-
-ignore define LIRC_MODE2SEND
-ignore define LIRC_SEND2MODE
-ignore define LIRC_MODE2REC
-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
-ignore define PULSE_MASK
-
-ignore define LIRC_MODE2_SPACE
-ignore define LIRC_MODE2_PULSE
-ignore define LIRC_MODE2_TIMEOUT
-
-ignore define LIRC_VALUE_MASK
-ignore define LIRC_MODE2_MASK
-
-ignore define LIRC_MODE_RAW
diff --git a/Documentation/media/media.h.rst.exceptions b/Documentation/media/media.h.rst.exceptions
deleted file mode 100644
index 83d7f7c..0000000
--- a/Documentation/media/media.h.rst.exceptions
+++ /dev/null
@@ -1,30 +0,0 @@
-# Ignore header name
-ignore define __LINUX_MEDIA_H
-
-# Ignore macros
-ignore define MEDIA_API_VERSION
-ignore define MEDIA_ENT_F_BASE
-ignore define MEDIA_ENT_F_OLD_BASE
-ignore define MEDIA_ENT_F_OLD_SUBDEV_BASE
-ignore define MEDIA_INTF_T_DVB_BASE
-ignore define MEDIA_INTF_T_V4L_BASE
-ignore define MEDIA_INTF_T_ALSA_BASE
-
-#ignore legacy entity type macros
-ignore define MEDIA_ENT_TYPE_SHIFT
-ignore define MEDIA_ENT_TYPE_MASK
-ignore define MEDIA_ENT_SUBTYPE_MASK
-ignore define MEDIA_ENT_T_DEVNODE_UNKNOWN
-ignore define MEDIA_ENT_T_DEVNODE
-ignore define MEDIA_ENT_T_DEVNODE_V4L
-ignore define MEDIA_ENT_T_DEVNODE_FB
-ignore define MEDIA_ENT_T_DEVNODE_ALSA
-ignore define MEDIA_ENT_T_DEVNODE_DVB
-ignore define MEDIA_ENT_T_UNKNOWN
-ignore define MEDIA_ENT_T_V4L2_VIDEO
-ignore define MEDIA_ENT_T_V4L2_SUBDEV
-ignore define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR
-ignore define MEDIA_ENT_T_V4L2_SUBDEV_FLASH
-ignore define MEDIA_ENT_T_V4L2_SUBDEV_LENS
-ignore define MEDIA_ENT_T_V4L2_SUBDEV_DECODER
-ignore define MEDIA_ENT_T_V4L2_SUBDEV_TUNER
diff --git a/Documentation/media/net.h.rst.exceptions b/Documentation/media/net.h.rst.exceptions
deleted file mode 100644
index 30a2674..0000000
--- a/Documentation/media/net.h.rst.exceptions
+++ /dev/null
@@ -1,11 +0,0 @@
-# Ignore header name
-ignore define _DVBNET_H_
-
-# Ignore old ioctls/structs
-ignore ioctl __NET_ADD_IF_OLD
-ignore ioctl __NET_GET_IF_OLD
-ignore struct __dvb_net_if_old
-
-# Macros used at struct dvb_net_if
-replace define DVB_NET_FEEDTYPE_MPE dvb-net-if
-replace define DVB_NET_FEEDTYPE_ULE dvb-net-if
diff --git a/Documentation/media/uapi/cec/cec-header.rst b/Documentation/media/uapi/cec/cec-header.rst
index d5a9a28..c50cf7f 100644
--- a/Documentation/media/uapi/cec/cec-header.rst
+++ b/Documentation/media/uapi/cec/cec-header.rst
@@ -6,5 +6,4 @@
 CEC Header File
 ***************
 
-.. kernel-include:: $BUILDDIR/cec.h.rst
-
+.. kernel-cmd:: parse-headers.pl $srctree/include/linux/cec.h  cec.h.exceptions
diff --git a/Documentation/media/uapi/cec/cec.h.exceptions b/Documentation/media/uapi/cec/cec.h.exceptions
new file mode 100644
index 0000000..b793394
--- /dev/null
+++ b/Documentation/media/uapi/cec/cec.h.exceptions
@@ -0,0 +1,492 @@
+# Ignore header name
+ignore define _CEC_UAPI_H
+
+# Rename some symbols, to avoid namespace conflicts
+replace struct cec_event_state_change cec-event-state-change_s
+replace struct cec_event_lost_msgs cec-event-lost-msgs_s
+replace enum cec_mode_initiator cec-mode-initiator_e
+replace enum cec_mode_follower cec-mode-follower_e
+
+# define macros to ignore
+
+ignore define CEC_MAX_MSG_SIZE
+ignore define CEC_MAX_LOG_ADDRS
+
+ignore define CEC_LOG_ADDR_MASK_TV
+ignore define CEC_LOG_ADDR_MASK_RECORD
+ignore define CEC_LOG_ADDR_MASK_TUNER
+ignore define CEC_LOG_ADDR_MASK_PLAYBACK
+ignore define CEC_LOG_ADDR_MASK_AUDIOSYSTEM
+ignore define CEC_LOG_ADDR_MASK_BACKUP
+ignore define CEC_LOG_ADDR_MASK_SPECIFIC
+ignore define CEC_LOG_ADDR_MASK_UNREGISTERED
+
+# Shouldn't them be documented?
+ignore define CEC_LOG_ADDR_INVALID
+ignore define CEC_PHYS_ADDR_INVALID
+
+ignore define CEC_VENDOR_ID_NONE
+
+ignore define CEC_MODE_INITIATOR_MSK
+ignore define CEC_MODE_FOLLOWER_MSK
+
+ignore define CEC_EVENT_FL_INITIAL_STATE
+
+# Part of CEC 2.0 spec - shouldn't be documented too?
+ignore define CEC_LOG_ADDR_TV
+ignore define CEC_LOG_ADDR_RECORD_1
+ignore define CEC_LOG_ADDR_RECORD_2
+ignore define CEC_LOG_ADDR_TUNER_1
+ignore define CEC_LOG_ADDR_PLAYBACK_1
+ignore define CEC_LOG_ADDR_AUDIOSYSTEM
+ignore define CEC_LOG_ADDR_TUNER_2
+ignore define CEC_LOG_ADDR_TUNER_3
+ignore define CEC_LOG_ADDR_PLAYBACK_2
+ignore define CEC_LOG_ADDR_RECORD_3
+ignore define CEC_LOG_ADDR_TUNER_4
+ignore define CEC_LOG_ADDR_PLAYBACK_3
+ignore define CEC_LOG_ADDR_BACKUP_1
+ignore define CEC_LOG_ADDR_BACKUP_2
+ignore define CEC_LOG_ADDR_SPECIFIC
+ignore define CEC_LOG_ADDR_UNREGISTERED
+ignore define CEC_LOG_ADDR_BROADCAST
+
+# IMHO, those should also be documented
+
+ignore define CEC_MSG_ACTIVE_SOURCE
+ignore define CEC_MSG_IMAGE_VIEW_ON
+ignore define CEC_MSG_TEXT_VIEW_ON
+
+ignore define CEC_MSG_INACTIVE_SOURCE
+ignore define CEC_MSG_REQUEST_ACTIVE_SOURCE
+ignore define CEC_MSG_ROUTING_CHANGE
+ignore define CEC_MSG_ROUTING_INFORMATION
+ignore define CEC_MSG_SET_STREAM_PATH
+
+ignore define CEC_MSG_STANDBY
+
+ignore define CEC_MSG_RECORD_OFF
+ignore define CEC_MSG_RECORD_ON
+
+ignore define CEC_OP_RECORD_SRC_OWN
+ignore define CEC_OP_RECORD_SRC_DIGITAL
+ignore define CEC_OP_RECORD_SRC_ANALOG
+ignore define CEC_OP_RECORD_SRC_EXT_PLUG
+ignore define CEC_OP_RECORD_SRC_EXT_PHYS_ADDR
+
+ignore define CEC_OP_SERVICE_ID_METHOD_BY_DIG_ID
+ignore define CEC_OP_SERVICE_ID_METHOD_BY_CHANNEL
+
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_GEN
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_GEN
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_GEN
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_BS
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_CS
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ARIB_T
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_CABLE
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_SAT
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_ATSC_T
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_C
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_S
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_S2
+ignore define CEC_OP_DIG_SERVICE_BCAST_SYSTEM_DVB_T
+
+ignore define CEC_OP_ANA_BCAST_TYPE_CABLE
+ignore define CEC_OP_ANA_BCAST_TYPE_SATELLITE
+ignore define CEC_OP_ANA_BCAST_TYPE_TERRESTRIAL
+
+ignore define CEC_OP_BCAST_SYSTEM_PAL_BG
+ignore define CEC_OP_BCAST_SYSTEM_SECAM_LQ
+ignore define CEC_OP_BCAST_SYSTEM_PAL_M
+ignore define CEC_OP_BCAST_SYSTEM_NTSC_M
+ignore define CEC_OP_BCAST_SYSTEM_PAL_I
+ignore define CEC_OP_BCAST_SYSTEM_SECAM_DK
+ignore define CEC_OP_BCAST_SYSTEM_SECAM_BG
+ignore define CEC_OP_BCAST_SYSTEM_SECAM_L
+ignore define CEC_OP_BCAST_SYSTEM_PAL_DK
+ignore define CEC_OP_BCAST_SYSTEM_OTHER
+
+ignore define CEC_OP_CHANNEL_NUMBER_FMT_1_PART
+ignore define CEC_OP_CHANNEL_NUMBER_FMT_2_PART
+
+ignore define CEC_MSG_RECORD_STATUS
+
+ignore define CEC_OP_RECORD_STATUS_CUR_SRC
+ignore define CEC_OP_RECORD_STATUS_DIG_SERVICE
+ignore define CEC_OP_RECORD_STATUS_ANA_SERVICE
+ignore define CEC_OP_RECORD_STATUS_EXT_INPUT
+ignore define CEC_OP_RECORD_STATUS_NO_DIG_SERVICE
+ignore define CEC_OP_RECORD_STATUS_NO_ANA_SERVICE
+ignore define CEC_OP_RECORD_STATUS_NO_SERVICE
+ignore define CEC_OP_RECORD_STATUS_INVALID_EXT_PLUG
+ignore define CEC_OP_RECORD_STATUS_INVALID_EXT_PHYS_ADDR
+ignore define CEC_OP_RECORD_STATUS_UNSUP_CA
+ignore define CEC_OP_RECORD_STATUS_NO_CA_ENTITLEMENTS
+ignore define CEC_OP_RECORD_STATUS_CANT_COPY_SRC
+ignore define CEC_OP_RECORD_STATUS_NO_MORE_COPIES
+ignore define CEC_OP_RECORD_STATUS_NO_MEDIA
+ignore define CEC_OP_RECORD_STATUS_PLAYING
+ignore define CEC_OP_RECORD_STATUS_ALREADY_RECORDING
+ignore define CEC_OP_RECORD_STATUS_MEDIA_PROT
+ignore define CEC_OP_RECORD_STATUS_NO_SIGNAL
+ignore define CEC_OP_RECORD_STATUS_MEDIA_PROBLEM
+ignore define CEC_OP_RECORD_STATUS_NO_SPACE
+ignore define CEC_OP_RECORD_STATUS_PARENTAL_LOCK
+ignore define CEC_OP_RECORD_STATUS_TERMINATED_OK
+ignore define CEC_OP_RECORD_STATUS_ALREADY_TERM
+ignore define CEC_OP_RECORD_STATUS_OTHER
+
+ignore define CEC_MSG_RECORD_TV_SCREEN
+
+ignore define CEC_MSG_CLEAR_ANALOGUE_TIMER
+
+ignore define CEC_OP_REC_SEQ_SUNDAY
+ignore define CEC_OP_REC_SEQ_MONDAY
+ignore define CEC_OP_REC_SEQ_TUESDAY
+ignore define CEC_OP_REC_SEQ_WEDNESDAY
+ignore define CEC_OP_REC_SEQ_THURSDAY
+ignore define CEC_OP_REC_SEQ_FRIDAY
+ignore define CEC_OP_REC_SEQ_SATERDAY
+ignore define CEC_OP_REC_SEQ_ONCE_ONLY
+
+ignore define CEC_MSG_CLEAR_DIGITAL_TIMER
+
+ignore define CEC_MSG_CLEAR_EXT_TIMER
+
+ignore define CEC_OP_EXT_SRC_PLUG
+ignore define CEC_OP_EXT_SRC_PHYS_ADDR
+
+ignore define CEC_MSG_SET_ANALOGUE_TIMER
+ignore define CEC_MSG_SET_DIGITAL_TIMER
+ignore define CEC_MSG_SET_EXT_TIMER
+
+ignore define CEC_MSG_SET_TIMER_PROGRAM_TITLE
+ignore define CEC_MSG_TIMER_CLEARED_STATUS
+
+ignore define CEC_OP_TIMER_CLR_STAT_RECORDING
+ignore define CEC_OP_TIMER_CLR_STAT_NO_MATCHING
+ignore define CEC_OP_TIMER_CLR_STAT_NO_INFO
+ignore define CEC_OP_TIMER_CLR_STAT_CLEARED
+
+ignore define CEC_MSG_TIMER_STATUS
+
+ignore define CEC_OP_TIMER_OVERLAP_WARNING_NO_OVERLAP
+ignore define CEC_OP_TIMER_OVERLAP_WARNING_OVERLAP
+
+ignore define CEC_OP_MEDIA_INFO_UNPROT_MEDIA
+ignore define CEC_OP_MEDIA_INFO_PROT_MEDIA
+ignore define CEC_OP_MEDIA_INFO_NO_MEDIA
+
+ignore define CEC_OP_PROG_IND_NOT_PROGRAMMED
+ignore define CEC_OP_PROG_IND_PROGRAMMED
+
+ignore define CEC_OP_PROG_INFO_ENOUGH_SPACE
+ignore define CEC_OP_PROG_INFO_NOT_ENOUGH_SPACE
+ignore define CEC_OP_PROG_INFO_MIGHT_NOT_BE_ENOUGH_SPACE
+ignore define CEC_OP_PROG_INFO_NONE_AVAILABLE
+
+ignore define CEC_OP_PROG_ERROR_NO_FREE_TIMER
+ignore define CEC_OP_PROG_ERROR_DATE_OUT_OF_RANGE
+ignore define CEC_OP_PROG_ERROR_REC_SEQ_ERROR
+ignore define CEC_OP_PROG_ERROR_INV_EXT_PLUG
+ignore define CEC_OP_PROG_ERROR_INV_EXT_PHYS_ADDR
+ignore define CEC_OP_PROG_ERROR_CA_UNSUPP
+ignore define CEC_OP_PROG_ERROR_INSUF_CA_ENTITLEMENTS
+ignore define CEC_OP_PROG_ERROR_RESOLUTION_UNSUPP
+ignore define CEC_OP_PROG_ERROR_PARENTAL_LOCK
+ignore define CEC_OP_PROG_ERROR_CLOCK_FAILURE
+ignore define CEC_OP_PROG_ERROR_DUPLICATE
+
+ignore define CEC_MSG_CEC_VERSION
+
+ignore define CEC_OP_CEC_VERSION_1_3A
+ignore define CEC_OP_CEC_VERSION_1_4
+ignore define CEC_OP_CEC_VERSION_2_0
+
+ignore define CEC_MSG_GET_CEC_VERSION
+ignore define CEC_MSG_GIVE_PHYSICAL_ADDR
+ignore define CEC_MSG_GET_MENU_LANGUAGE
+ignore define CEC_MSG_REPORT_PHYSICAL_ADDR
+
+ignore define CEC_OP_PRIM_DEVTYPE_TV
+ignore define CEC_OP_PRIM_DEVTYPE_RECORD
+ignore define CEC_OP_PRIM_DEVTYPE_TUNER
+ignore define CEC_OP_PRIM_DEVTYPE_PLAYBACK
+ignore define CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM
+ignore define CEC_OP_PRIM_DEVTYPE_SWITCH
+ignore define CEC_OP_PRIM_DEVTYPE_PROCESSOR
+
+ignore define CEC_MSG_SET_MENU_LANGUAGE
+ignore define CEC_MSG_REPORT_FEATURES
+
+ignore define CEC_OP_ALL_DEVTYPE_TV
+ignore define CEC_OP_ALL_DEVTYPE_RECORD
+ignore define CEC_OP_ALL_DEVTYPE_TUNER
+ignore define CEC_OP_ALL_DEVTYPE_PLAYBACK
+ignore define CEC_OP_ALL_DEVTYPE_AUDIOSYSTEM
+ignore define CEC_OP_ALL_DEVTYPE_SWITCH
+
+ignore define CEC_OP_FEAT_EXT
+
+ignore define CEC_OP_FEAT_RC_TV_PROFILE_NONE
+ignore define CEC_OP_FEAT_RC_TV_PROFILE_1
+ignore define CEC_OP_FEAT_RC_TV_PROFILE_2
+ignore define CEC_OP_FEAT_RC_TV_PROFILE_3
+ignore define CEC_OP_FEAT_RC_TV_PROFILE_4
+ignore define CEC_OP_FEAT_RC_SRC_HAS_DEV_ROOT_MENU
+ignore define CEC_OP_FEAT_RC_SRC_HAS_DEV_SETUP_MENU
+ignore define CEC_OP_FEAT_RC_SRC_HAS_CONTENTS_MENU
+ignore define CEC_OP_FEAT_RC_SRC_HAS_MEDIA_TOP_MENU
+ignore define CEC_OP_FEAT_RC_SRC_HAS_MEDIA_CONTEXT_MENU
+
+ignore define CEC_OP_FEAT_DEV_HAS_RECORD_TV_SCREEN
+ignore define CEC_OP_FEAT_DEV_HAS_SET_OSD_STRING
+ignore define CEC_OP_FEAT_DEV_HAS_DECK_CONTROL
+ignore define CEC_OP_FEAT_DEV_HAS_SET_AUDIO_RATE
+ignore define CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX
+ignore define CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX
+
+ignore define CEC_MSG_GIVE_FEATURES
+
+ignore define CEC_MSG_DECK_CONTROL
+
+ignore define CEC_OP_DECK_CTL_MODE_SKIP_FWD
+ignore define CEC_OP_DECK_CTL_MODE_SKIP_REV
+ignore define CEC_OP_DECK_CTL_MODE_STOP
+ignore define CEC_OP_DECK_CTL_MODE_EJECT
+
+ignore define CEC_MSG_DECK_STATUS
+
+ignore define CEC_OP_DECK_INFO_PLAY
+ignore define CEC_OP_DECK_INFO_RECORD
+ignore define CEC_OP_DECK_INFO_PLAY_REV
+ignore define CEC_OP_DECK_INFO_STILL
+ignore define CEC_OP_DECK_INFO_SLOW
+ignore define CEC_OP_DECK_INFO_SLOW_REV
+ignore define CEC_OP_DECK_INFO_FAST_FWD
+ignore define CEC_OP_DECK_INFO_FAST_REV
+ignore define CEC_OP_DECK_INFO_NO_MEDIA
+ignore define CEC_OP_DECK_INFO_STOP
+ignore define CEC_OP_DECK_INFO_SKIP_FWD
+ignore define CEC_OP_DECK_INFO_SKIP_REV
+ignore define CEC_OP_DECK_INFO_INDEX_SEARCH_FWD
+ignore define CEC_OP_DECK_INFO_INDEX_SEARCH_REV
+ignore define CEC_OP_DECK_INFO_OTHER
+
+ignore define CEC_MSG_GIVE_DECK_STATUS
+
+ignore define CEC_OP_STATUS_REQ_ON
+ignore define CEC_OP_STATUS_REQ_OFF
+ignore define CEC_OP_STATUS_REQ_ONCE
+
+ignore define CEC_MSG_PLAY
+
+ignore define CEC_OP_PLAY_MODE_PLAY_FWD
+ignore define CEC_OP_PLAY_MODE_PLAY_REV
+ignore define CEC_OP_PLAY_MODE_PLAY_STILL
+ignore define CEC_OP_PLAY_MODE_PLAY_FAST_FWD_MIN
+ignore define CEC_OP_PLAY_MODE_PLAY_FAST_FWD_MED
+ignore define CEC_OP_PLAY_MODE_PLAY_FAST_FWD_MAX
+ignore define CEC_OP_PLAY_MODE_PLAY_FAST_REV_MIN
+ignore define CEC_OP_PLAY_MODE_PLAY_FAST_REV_MED
+ignore define CEC_OP_PLAY_MODE_PLAY_FAST_REV_MAX
+ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_FWD_MIN
+ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_FWD_MED
+ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_FWD_MAX
+ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_REV_MIN
+ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_REV_MED
+ignore define CEC_OP_PLAY_MODE_PLAY_SLOW_REV_MAX
+
+ignore define CEC_MSG_GIVE_TUNER_DEVICE_STATUS
+ignore define CEC_MSG_SELECT_ANALOGUE_SERVICE
+ignore define CEC_MSG_SELECT_DIGITAL_SERVICE
+ignore define CEC_MSG_TUNER_DEVICE_STATUS
+
+ignore define CEC_OP_REC_FLAG_USED
+ignore define CEC_OP_REC_FLAG_NOT_USED
+
+ignore define CEC_OP_TUNER_DISPLAY_INFO_DIGITAL
+ignore define CEC_OP_TUNER_DISPLAY_INFO_NONE
+ignore define CEC_OP_TUNER_DISPLAY_INFO_ANALOGUE
+
+ignore define CEC_MSG_TUNER_STEP_DECREMENT
+ignore define CEC_MSG_TUNER_STEP_INCREMENT
+
+ignore define CEC_MSG_DEVICE_VENDOR_ID
+ignore define CEC_MSG_GIVE_DEVICE_VENDOR_ID
+ignore define CEC_MSG_VENDOR_COMMAND
+ignore define CEC_MSG_VENDOR_COMMAND_WITH_ID
+ignore define CEC_MSG_VENDOR_REMOTE_BUTTON_DOWN
+ignore define CEC_MSG_VENDOR_REMOTE_BUTTON_UP
+
+ignore define CEC_MSG_SET_OSD_STRING
+
+ignore define CEC_OP_DISP_CTL_DEFAULT
+ignore define CEC_OP_DISP_CTL_UNTIL_CLEARED
+ignore define CEC_OP_DISP_CTL_CLEAR
+
+ignore define CEC_MSG_GIVE_OSD_NAME
+ignore define CEC_MSG_SET_OSD_NAME
+
+ignore define CEC_MSG_MENU_REQUEST
+
+ignore define CEC_OP_MENU_REQUEST_ACTIVATE
+ignore define CEC_OP_MENU_REQUEST_DEACTIVATE
+ignore define CEC_OP_MENU_REQUEST_QUERY
+
+ignore define CEC_MSG_MENU_STATUS
+
+ignore define CEC_OP_MENU_STATE_ACTIVATED
+ignore define CEC_OP_MENU_STATE_DEACTIVATED
+
+ignore define CEC_MSG_USER_CONTROL_PRESSED
+
+ignore define CEC_OP_UI_BCAST_TYPE_TOGGLE_ALL
+ignore define CEC_OP_UI_BCAST_TYPE_TOGGLE_DIG_ANA
+ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE
+ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE_T
+ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE_CABLE
+ignore define CEC_OP_UI_BCAST_TYPE_ANALOGUE_SAT
+ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL
+ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_T
+ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_CABLE
+ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_SAT
+ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_COM_SAT
+ignore define CEC_OP_UI_BCAST_TYPE_DIGITAL_COM_SAT2
+ignore define CEC_OP_UI_BCAST_TYPE_IP
+
+ignore define CEC_OP_UI_SND_PRES_CTL_DUAL_MONO
+ignore define CEC_OP_UI_SND_PRES_CTL_KARAOKE
+ignore define CEC_OP_UI_SND_PRES_CTL_DOWNMIX
+ignore define CEC_OP_UI_SND_PRES_CTL_REVERB
+ignore define CEC_OP_UI_SND_PRES_CTL_EQUALIZER
+ignore define CEC_OP_UI_SND_PRES_CTL_BASS_UP
+ignore define CEC_OP_UI_SND_PRES_CTL_BASS_NEUTRAL
+ignore define CEC_OP_UI_SND_PRES_CTL_BASS_DOWN
+ignore define CEC_OP_UI_SND_PRES_CTL_TREBLE_UP
+ignore define CEC_OP_UI_SND_PRES_CTL_TREBLE_NEUTRAL
+ignore define CEC_OP_UI_SND_PRES_CTL_TREBLE_DOWN
+
+ignore define CEC_MSG_USER_CONTROL_RELEASED
+
+ignore define CEC_MSG_GIVE_DEVICE_POWER_STATUS
+ignore define CEC_MSG_REPORT_POWER_STATUS
+
+ignore define CEC_OP_POWER_STATUS_ON
+ignore define CEC_OP_POWER_STATUS_STANDBY
+ignore define CEC_OP_POWER_STATUS_TO_ON
+ignore define CEC_OP_POWER_STATUS_TO_STANDBY
+
+ignore define CEC_MSG_FEATURE_ABORT
+
+ignore define CEC_OP_ABORT_UNRECOGNIZED_OP
+ignore define CEC_OP_ABORT_INCORRECT_MODE
+ignore define CEC_OP_ABORT_NO_SOURCE
+ignore define CEC_OP_ABORT_INVALID_OP
+ignore define CEC_OP_ABORT_REFUSED
+ignore define CEC_OP_ABORT_UNDETERMINED
+
+ignore define CEC_MSG_ABORT
+
+ignore define CEC_MSG_GIVE_AUDIO_STATUS
+ignore define CEC_MSG_GIVE_SYSTEM_AUDIO_MODE_STATUS
+ignore define CEC_MSG_REPORT_AUDIO_STATUS
+
+ignore define CEC_OP_AUD_MUTE_STATUS_OFF
+ignore define CEC_OP_AUD_MUTE_STATUS_ON
+
+ignore define CEC_MSG_REPORT_SHORT_AUDIO_DESCRIPTOR
+ignore define CEC_MSG_REQUEST_SHORT_AUDIO_DESCRIPTOR
+ignore define CEC_MSG_SET_SYSTEM_AUDIO_MODE
+
+ignore define CEC_OP_SYS_AUD_STATUS_OFF
+ignore define CEC_OP_SYS_AUD_STATUS_ON
+
+ignore define CEC_MSG_SYSTEM_AUDIO_MODE_REQUEST
+ignore define CEC_MSG_SYSTEM_AUDIO_MODE_STATUS
+
+ignore define CEC_OP_AUD_FMT_ID_CEA861
+ignore define CEC_OP_AUD_FMT_ID_CEA861_CXT
+
+ignore define CEC_MSG_SET_AUDIO_RATE
+
+ignore define CEC_OP_AUD_RATE_OFF
+ignore define CEC_OP_AUD_RATE_WIDE_STD
+ignore define CEC_OP_AUD_RATE_WIDE_FAST
+ignore define CEC_OP_AUD_RATE_WIDE_SLOW
+ignore define CEC_OP_AUD_RATE_NARROW_STD
+ignore define CEC_OP_AUD_RATE_NARROW_FAST
+ignore define CEC_OP_AUD_RATE_NARROW_SLOW
+
+ignore define CEC_MSG_INITIATE_ARC
+ignore define CEC_MSG_REPORT_ARC_INITIATED
+ignore define CEC_MSG_REPORT_ARC_TERMINATED
+ignore define CEC_MSG_REQUEST_ARC_INITIATION
+ignore define CEC_MSG_REQUEST_ARC_TERMINATION
+ignore define CEC_MSG_TERMINATE_ARC
+
+ignore define CEC_MSG_REQUEST_CURRENT_LATENCY
+ignore define CEC_MSG_REPORT_CURRENT_LATENCY
+
+ignore define CEC_OP_LOW_LATENCY_MODE_OFF
+ignore define CEC_OP_LOW_LATENCY_MODE_ON
+
+ignore define CEC_OP_AUD_OUT_COMPENSATED_NA
+ignore define CEC_OP_AUD_OUT_COMPENSATED_DELAY
+ignore define CEC_OP_AUD_OUT_COMPENSATED_NO_DELAY
+ignore define CEC_OP_AUD_OUT_COMPENSATED_PARTIAL_DELAY
+
+ignore define CEC_MSG_CDC_MESSAGE
+
+ignore define CEC_MSG_CDC_HEC_INQUIRE_STATE
+ignore define CEC_MSG_CDC_HEC_REPORT_STATE
+
+ignore define CEC_OP_HEC_FUNC_STATE_NOT_SUPPORTED
+ignore define CEC_OP_HEC_FUNC_STATE_INACTIVE
+ignore define CEC_OP_HEC_FUNC_STATE_ACTIVE
+ignore define CEC_OP_HEC_FUNC_STATE_ACTIVATION_FIELD
+
+ignore define CEC_OP_HOST_FUNC_STATE_NOT_SUPPORTED
+ignore define CEC_OP_HOST_FUNC_STATE_INACTIVE
+ignore define CEC_OP_HOST_FUNC_STATE_ACTIVE
+
+ignore define CEC_OP_ENC_FUNC_STATE_EXT_CON_NOT_SUPPORTED
+ignore define CEC_OP_ENC_FUNC_STATE_EXT_CON_INACTIVE
+ignore define CEC_OP_ENC_FUNC_STATE_EXT_CON_ACTIVE
+
+ignore define CEC_OP_CDC_ERROR_CODE_NONE
+ignore define CEC_OP_CDC_ERROR_CODE_CAP_UNSUPPORTED
+ignore define CEC_OP_CDC_ERROR_CODE_WRONG_STATE
+ignore define CEC_OP_CDC_ERROR_CODE_OTHER
+
+ignore define CEC_OP_HEC_SUPPORT_NO
+ignore define CEC_OP_HEC_SUPPORT_YES
+
+ignore define CEC_OP_HEC_ACTIVATION_ON
+ignore define CEC_OP_HEC_ACTIVATION_OFF
+
+ignore define CEC_MSG_CDC_HEC_SET_STATE_ADJACENT
+ignore define CEC_MSG_CDC_HEC_SET_STATE
+
+ignore define CEC_OP_HEC_SET_STATE_DEACTIVATE
+ignore define CEC_OP_HEC_SET_STATE_ACTIVATE
+
+ignore define CEC_MSG_CDC_HEC_REQUEST_DEACTIVATION
+ignore define CEC_MSG_CDC_HEC_NOTIFY_ALIVE
+ignore define CEC_MSG_CDC_HEC_DISCOVER
+
+ignore define CEC_MSG_CDC_HPD_SET_STATE
+
+ignore define CEC_OP_HPD_STATE_CP_EDID_DISABLE
+ignore define CEC_OP_HPD_STATE_CP_EDID_ENABLE
+ignore define CEC_OP_HPD_STATE_CP_EDID_DISABLE_ENABLE
+ignore define CEC_OP_HPD_STATE_EDID_DISABLE
+ignore define CEC_OP_HPD_STATE_EDID_ENABLE
+ignore define CEC_OP_HPD_STATE_EDID_DISABLE_ENABLE
+ignore define CEC_MSG_CDC_HPD_REPORT_STATE
+
+ignore define CEC_OP_HPD_ERROR_NONE
+ignore define CEC_OP_HPD_ERROR_INITIATOR_NOT_CAPABLE
+ignore define CEC_OP_HPD_ERROR_INITIATOR_WRONG_STATE
+ignore define CEC_OP_HPD_ERROR_OTHER
+ignore define CEC_OP_HPD_ERROR_NONE_NO_VIDEO
diff --git a/Documentation/media/uapi/dvb/audio.h.exceptions b/Documentation/media/uapi/dvb/audio.h.exceptions
new file mode 100644
index 0000000..8330edc
--- /dev/null
+++ b/Documentation/media/uapi/dvb/audio.h.exceptions
@@ -0,0 +1,20 @@
+# Ignore header name
+ignore define _DVBAUDIO_H_
+
+# Typedef pointing to structs
+replace typedef audio_karaoke_t audio-karaoke
+
+# Undocumented audio caps, as this is a deprecated API anyway
+ignore define AUDIO_CAP_DTS
+ignore define AUDIO_CAP_LPCM
+ignore define AUDIO_CAP_MP1
+ignore define AUDIO_CAP_MP2
+ignore define AUDIO_CAP_MP3
+ignore define AUDIO_CAP_AAC
+ignore define AUDIO_CAP_OGG
+ignore define AUDIO_CAP_SDDS
+ignore define AUDIO_CAP_AC3
+
+# some typedefs should point to struct/enums
+replace typedef audio_mixer_t audio-mixer
+replace typedef audio_status_t audio-status
diff --git a/Documentation/media/uapi/dvb/audio_h.rst b/Documentation/media/uapi/dvb/audio_h.rst
index e00c301..8d9eff2 100644
--- a/Documentation/media/uapi/dvb/audio_h.rst
+++ b/Documentation/media/uapi/dvb/audio_h.rst
@@ -6,4 +6,4 @@
 DVB Audio Header File
 *********************
 
-.. kernel-include:: $BUILDDIR/audio.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/audio.h audio.h.exceptions
diff --git a/Documentation/media/uapi/dvb/ca.h.exceptions b/Documentation/media/uapi/dvb/ca.h.exceptions
new file mode 100644
index 0000000..09c13be
--- /dev/null
+++ b/Documentation/media/uapi/dvb/ca.h.exceptions
@@ -0,0 +1,24 @@
+# Ignore header name
+ignore define _DVBCA_H_
+
+# struct ca_slot_info defines
+replace define CA_CI ca-slot-info
+replace define CA_CI_LINK ca-slot-info
+replace define CA_CI_PHYS ca-slot-info
+replace define CA_DESCR ca-slot-info
+replace define CA_SC ca-slot-info
+replace define CA_CI_MODULE_PRESENT ca-slot-info
+replace define CA_CI_MODULE_READY ca-slot-info
+
+# struct ca_descr_info defines
+replace define CA_ECD ca-descr-info
+replace define CA_NDS ca-descr-info
+replace define CA_DSS ca-descr-info
+
+# some typedefs should point to struct/enums
+replace typedef ca_pid_t ca-pid
+replace typedef ca_slot_info_t ca-slot-info
+replace typedef ca_descr_info_t ca-descr-info
+replace typedef ca_caps_t ca-caps
+replace typedef ca_msg_t ca-msg
+replace typedef ca_descr_t ca-descr
diff --git a/Documentation/media/uapi/dvb/ca_h.rst b/Documentation/media/uapi/dvb/ca_h.rst
index f513592..57d47de 100644
--- a/Documentation/media/uapi/dvb/ca_h.rst
+++ b/Documentation/media/uapi/dvb/ca_h.rst
@@ -6,4 +6,4 @@
 DVB Conditional Access Header File
 **********************************
 
-.. kernel-include:: $BUILDDIR/ca.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/ca.h ca.h.exceptions
diff --git a/Documentation/media/uapi/dvb/dmx.h.exceptions b/Documentation/media/uapi/dvb/dmx.h.exceptions
new file mode 100644
index 0000000..8200653
--- /dev/null
+++ b/Documentation/media/uapi/dvb/dmx.h.exceptions
@@ -0,0 +1,63 @@
+# Ignore header name
+ignore define _UAPI_DVBDMX_H_
+
+# Ignore limit constants
+ignore define DMX_FILTER_SIZE
+
+# dmx-pes-type-t enum symbols
+replace enum dmx_ts_pes dmx-pes-type-t
+replace symbol DMX_PES_AUDIO0 dmx-pes-type-t
+replace symbol DMX_PES_VIDEO0 dmx-pes-type-t
+replace symbol DMX_PES_TELETEXT0 dmx-pes-type-t
+replace symbol DMX_PES_SUBTITLE0 dmx-pes-type-t
+replace symbol DMX_PES_PCR0 dmx-pes-type-t
+replace symbol DMX_PES_AUDIO1 dmx-pes-type-t
+replace symbol DMX_PES_VIDEO1 dmx-pes-type-t
+replace symbol DMX_PES_TELETEXT1 dmx-pes-type-t
+replace symbol DMX_PES_SUBTITLE1 dmx-pes-type-t
+replace symbol DMX_PES_PCR1 dmx-pes-type-t
+replace symbol DMX_PES_AUDIO2 dmx-pes-type-t
+replace symbol DMX_PES_VIDEO2 dmx-pes-type-t
+replace symbol DMX_PES_TELETEXT2 dmx-pes-type-t
+replace symbol DMX_PES_SUBTITLE2 dmx-pes-type-t
+replace symbol DMX_PES_PCR2 dmx-pes-type-t
+replace symbol DMX_PES_AUDIO3 dmx-pes-type-t
+replace symbol DMX_PES_VIDEO3 dmx-pes-type-t
+replace symbol DMX_PES_TELETEXT3 dmx-pes-type-t
+replace symbol DMX_PES_SUBTITLE3 dmx-pes-type-t
+replace symbol DMX_PES_PCR3 dmx-pes-type-t
+replace symbol DMX_PES_OTHER dmx-pes-type-t
+
+# Ignore obsolete symbols
+ignore define DMX_PES_AUDIO
+ignore define DMX_PES_VIDEO
+ignore define DMX_PES_TELETEXT
+ignore define DMX_PES_SUBTITLE
+ignore define DMX_PES_PCR
+
+# dmx_input_t symbols
+replace enum dmx_input dmx-input-t
+replace symbol DMX_IN_FRONTEND dmx-input-t
+replace symbol DMX_IN_DVR dmx-input-t
+
+# dmx_source_t symbols
+replace enum dmx_source dmx-source-t
+replace symbol DMX_SOURCE_FRONT0 dmx-source-t
+replace symbol DMX_SOURCE_FRONT1 dmx-source-t
+replace symbol DMX_SOURCE_FRONT2 dmx-source-t
+replace symbol DMX_SOURCE_FRONT3 dmx-source-t
+replace symbol DMX_SOURCE_DVR0 dmx-source-t
+replace symbol DMX_SOURCE_DVR1 dmx-source-t
+replace symbol DMX_SOURCE_DVR2 dmx-source-t
+replace symbol DMX_SOURCE_DVR3 dmx-source-t
+
+
+# Flags for struct dmx_sct_filter_params
+replace define DMX_CHECK_CRC dmx-sct-filter-params
+replace define DMX_ONESHOT dmx-sct-filter-params
+replace define DMX_IMMEDIATE_START dmx-sct-filter-params
+replace define DMX_KERNEL_CLIENT dmx-sct-filter-params
+
+# some typedefs should point to struct/enums
+replace typedef dmx_caps_t dmx-caps
+replace typedef dmx_filter_t dmx-filter
diff --git a/Documentation/media/uapi/dvb/dmx_h.rst b/Documentation/media/uapi/dvb/dmx_h.rst
index 4fd1704..90f965b 100644
--- a/Documentation/media/uapi/dvb/dmx_h.rst
+++ b/Documentation/media/uapi/dvb/dmx_h.rst
@@ -6,4 +6,4 @@
 DVB Demux Header File
 *********************
 
-.. kernel-include:: $BUILDDIR/dmx.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/dmx.h dmx.h.exceptions
diff --git a/Documentation/media/uapi/dvb/frontend.h.exceptions b/Documentation/media/uapi/dvb/frontend.h.exceptions
new file mode 100644
index 0000000..60f2cbb
--- /dev/null
+++ b/Documentation/media/uapi/dvb/frontend.h.exceptions
@@ -0,0 +1,47 @@
+# Ignore header name
+ignore define _DVBFRONTEND_H_
+
+# Group layer A-C symbols together
+replace define DTV_ISDBT_LAYERA_FEC dtv-isdbt-layer-fec
+replace define DTV_ISDBT_LAYERB_FEC dtv-isdbt-layer-fec
+replace define DTV_ISDBT_LAYERC_FEC dtv-isdbt-layer-fec
+replace define DTV_ISDBT_LAYERA_MODULATION dtv-isdbt-layer-modulation
+replace define DTV_ISDBT_LAYERB_MODULATION dtv-isdbt-layer-modulation
+replace define DTV_ISDBT_LAYERC_MODULATION dtv-isdbt-layer-modulation
+replace define DTV_ISDBT_LAYERA_SEGMENT_COUNT dtv-isdbt-layer-segment-count
+replace define DTV_ISDBT_LAYERB_SEGMENT_COUNT dtv-isdbt-layer-segment-count
+replace define DTV_ISDBT_LAYERC_SEGMENT_COUNT dtv-isdbt-layer-segment-count
+replace define DTV_ISDBT_LAYERA_TIME_INTERLEAVING dtv-isdbt-layer-time-interleaving
+replace define DTV_ISDBT_LAYERB_TIME_INTERLEAVING dtv-isdbt-layer-time-interleaving
+replace define DTV_ISDBT_LAYERC_TIME_INTERLEAVING dtv-isdbt-layer-time-interleaving
+
+# Ignore legacy defines
+ignore define DTV_ISDBS_TS_ID_LEGACY
+ignore define SYS_DVBC_ANNEX_AC
+ignore define SYS_DMBTH
+
+# Ignore limits
+ignore define DTV_MAX_COMMAND
+ignore define MAX_DTV_STATS
+ignore define DTV_IOCTL_MAX_MSGS
+
+# Stats enum is documented altogether
+replace enum fecap_scale_params frontend-stat-properties
+replace symbol FE_SCALE_COUNTER frontend-stat-properties
+replace symbol FE_SCALE_DECIBEL frontend-stat-properties
+replace symbol FE_SCALE_NOT_AVAILABLE frontend-stat-properties
+replace symbol FE_SCALE_RELATIVE frontend-stat-properties
+
+# the same reference is used for both get and set ioctls
+replace ioctl FE_SET_PROPERTY FE_GET_PROPERTY
+
+# Ignore struct used only internally at Kernel
+ignore struct dtv_cmds_h
+
+# Typedefs that use the enum reference
+replace typedef fe_sec_voltage_t fe-sec-voltage
+
+# Replaces for flag constants
+replace define FE_TUNE_MODE_ONESHOT fe_set_frontend_tune_mode
+replace define LNA_AUTO dtv-lna
+replace define NO_STREAM_ID_FILTER dtv-stream-id
diff --git a/Documentation/media/uapi/dvb/frontend_h.rst b/Documentation/media/uapi/dvb/frontend_h.rst
index 15fca04..84a064f 100644
--- a/Documentation/media/uapi/dvb/frontend_h.rst
+++ b/Documentation/media/uapi/dvb/frontend_h.rst
@@ -6,4 +6,4 @@
 DVB Frontend Header File
 ************************
 
-.. kernel-include:: $BUILDDIR/frontend.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/frontend.h frontend.h.exceptions
diff --git a/Documentation/media/uapi/dvb/net.h.exceptions b/Documentation/media/uapi/dvb/net.h.exceptions
new file mode 100644
index 0000000..30a2674
--- /dev/null
+++ b/Documentation/media/uapi/dvb/net.h.exceptions
@@ -0,0 +1,11 @@
+# Ignore header name
+ignore define _DVBNET_H_
+
+# Ignore old ioctls/structs
+ignore ioctl __NET_ADD_IF_OLD
+ignore ioctl __NET_GET_IF_OLD
+ignore struct __dvb_net_if_old
+
+# Macros used at struct dvb_net_if
+replace define DVB_NET_FEEDTYPE_MPE dvb-net-if
+replace define DVB_NET_FEEDTYPE_ULE dvb-net-if
diff --git a/Documentation/media/uapi/dvb/net_h.rst b/Documentation/media/uapi/dvb/net_h.rst
index 7bcf5ba..34ed22b 100644
--- a/Documentation/media/uapi/dvb/net_h.rst
+++ b/Documentation/media/uapi/dvb/net_h.rst
@@ -6,4 +6,4 @@
 DVB Network Header File
 ***********************
 
-.. kernel-include:: $BUILDDIR/net.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/net.h net.h.exceptions
diff --git a/Documentation/media/uapi/dvb/video.h.exceptions b/Documentation/media/uapi/dvb/video.h.exceptions
new file mode 100644
index 0000000..8866145
--- /dev/null
+++ b/Documentation/media/uapi/dvb/video.h.exceptions
@@ -0,0 +1,40 @@
+# Ignore header name
+ignore define _UAPI_DVBVIDEO_H_
+
+# This is a deprecated obscure API. Just ignore things we don't know
+ignore define VIDEO_CMD_PLAY
+ignore define VIDEO_CMD_STOP
+ignore define VIDEO_CMD_FREEZE
+ignore define VIDEO_CMD_CONTINUE
+ignore define VIDEO_CMD_FREEZE_TO_BLACK
+ignore define VIDEO_CMD_STOP_TO_BLACK
+ignore define VIDEO_CMD_STOP_IMMEDIATELY
+ignore define VIDEO_PLAY_FMT_NONE
+ignore define VIDEO_PLAY_FMT_GOP
+ignore define VIDEO_VSYNC_FIELD_UNKNOWN
+ignore define VIDEO_VSYNC_FIELD_ODD
+ignore define VIDEO_VSYNC_FIELD_EVEN
+ignore define VIDEO_VSYNC_FIELD_PROGRESSIVE
+ignore define VIDEO_EVENT_SIZE_CHANGED
+ignore define VIDEO_EVENT_FRAME_RATE_CHANGED
+ignore define VIDEO_EVENT_DECODER_STOPPED
+ignore define VIDEO_EVENT_VSYNC
+ignore define VIDEO_CAP_MPEG1
+ignore define VIDEO_CAP_MPEG2
+ignore define VIDEO_CAP_SYS
+ignore define VIDEO_CAP_PROG
+ignore define VIDEO_CAP_SPU
+ignore define VIDEO_CAP_NAVI
+ignore define VIDEO_CAP_CSS
+
+# some typedefs should point to struct/enums
+replace typedef video_format_t video-format
+replace typedef video_system_t video-system
+replace typedef video_displayformat_t video-displayformat
+replace typedef video_size_t video-size
+replace typedef video_stream_source_t video-stream-source
+replace typedef video_play_state_t video-play-state
+replace typedef video_highlight_t video-highlight
+replace typedef video_spu_t video-spu
+replace typedef video_spu_palette_t video-spu-palette
+replace typedef video_navi_pack_t video-navi-pack
diff --git a/Documentation/media/uapi/dvb/video_h.rst b/Documentation/media/uapi/dvb/video_h.rst
index 3f39b0c..c17b23e 100644
--- a/Documentation/media/uapi/dvb/video_h.rst
+++ b/Documentation/media/uapi/dvb/video_h.rst
@@ -6,4 +6,4 @@
 DVB Video Header File
 *********************
 
-.. kernel-include:: $BUILDDIR/video.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/video.h video.h.exceptions
diff --git a/Documentation/media/uapi/mediactl/media-header.rst b/Documentation/media/uapi/mediactl/media-header.rst
index 96f7b01..27fe91d 100644
--- a/Documentation/media/uapi/mediactl/media-header.rst
+++ b/Documentation/media/uapi/mediactl/media-header.rst
@@ -6,5 +6,4 @@
 Media Controller Header File
 ****************************
 
-.. kernel-include:: $BUILDDIR/media.h.rst
-
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/media.h media.h.exceptions
diff --git a/Documentation/media/uapi/mediactl/media.h.exceptions b/Documentation/media/uapi/mediactl/media.h.exceptions
new file mode 100644
index 0000000..83d7f7c
--- /dev/null
+++ b/Documentation/media/uapi/mediactl/media.h.exceptions
@@ -0,0 +1,30 @@
+# Ignore header name
+ignore define __LINUX_MEDIA_H
+
+# Ignore macros
+ignore define MEDIA_API_VERSION
+ignore define MEDIA_ENT_F_BASE
+ignore define MEDIA_ENT_F_OLD_BASE
+ignore define MEDIA_ENT_F_OLD_SUBDEV_BASE
+ignore define MEDIA_INTF_T_DVB_BASE
+ignore define MEDIA_INTF_T_V4L_BASE
+ignore define MEDIA_INTF_T_ALSA_BASE
+
+#ignore legacy entity type macros
+ignore define MEDIA_ENT_TYPE_SHIFT
+ignore define MEDIA_ENT_TYPE_MASK
+ignore define MEDIA_ENT_SUBTYPE_MASK
+ignore define MEDIA_ENT_T_DEVNODE_UNKNOWN
+ignore define MEDIA_ENT_T_DEVNODE
+ignore define MEDIA_ENT_T_DEVNODE_V4L
+ignore define MEDIA_ENT_T_DEVNODE_FB
+ignore define MEDIA_ENT_T_DEVNODE_ALSA
+ignore define MEDIA_ENT_T_DEVNODE_DVB
+ignore define MEDIA_ENT_T_UNKNOWN
+ignore define MEDIA_ENT_T_V4L2_VIDEO
+ignore define MEDIA_ENT_T_V4L2_SUBDEV
+ignore define MEDIA_ENT_T_V4L2_SUBDEV_SENSOR
+ignore define MEDIA_ENT_T_V4L2_SUBDEV_FLASH
+ignore define MEDIA_ENT_T_V4L2_SUBDEV_LENS
+ignore define MEDIA_ENT_T_V4L2_SUBDEV_DECODER
+ignore define MEDIA_ENT_T_V4L2_SUBDEV_TUNER
diff --git a/Documentation/media/uapi/rc/lirc-header.rst b/Documentation/media/uapi/rc/lirc-header.rst
index 487fe00..923f10f 100644
--- a/Documentation/media/uapi/rc/lirc-header.rst
+++ b/Documentation/media/uapi/rc/lirc-header.rst
@@ -6,5 +6,5 @@
 LIRC Header File
 ****************
 
-.. kernel-include:: $BUILDDIR/lirc.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/lirc.h lirc.h.exceptions
 
diff --git a/Documentation/media/uapi/rc/lirc.h.exceptions b/Documentation/media/uapi/rc/lirc.h.exceptions
new file mode 100644
index 0000000..246c850
--- /dev/null
+++ b/Documentation/media/uapi/rc/lirc.h.exceptions
@@ -0,0 +1,43 @@
+# Ignore header name
+ignore define _LINUX_LIRC_H
+
+# Ignore helper macros
+
+ignore define lirc_t
+
+ignore define LIRC_SPACE
+ignore define LIRC_PULSE
+ignore define LIRC_FREQUENCY
+ignore define LIRC_TIMEOUT
+ignore define LIRC_VALUE
+ignore define LIRC_MODE2
+ignore define LIRC_IS_SPACE
+ignore define LIRC_IS_PULSE
+ignore define LIRC_IS_FREQUENCY
+ignore define LIRC_IS_TIMEOUT
+
+ignore define LIRC_MODE2SEND
+ignore define LIRC_SEND2MODE
+ignore define LIRC_MODE2REC
+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
+ignore define PULSE_MASK
+
+ignore define LIRC_MODE2_SPACE
+ignore define LIRC_MODE2_PULSE
+ignore define LIRC_MODE2_TIMEOUT
+
+ignore define LIRC_VALUE_MASK
+ignore define LIRC_MODE2_MASK
+
+ignore define LIRC_MODE_RAW
diff --git a/Documentation/media/uapi/v4l/videodev.rst b/Documentation/media/uapi/v4l/videodev.rst
index b9ee467..6b36447 100644
--- a/Documentation/media/uapi/v4l/videodev.rst
+++ b/Documentation/media/uapi/v4l/videodev.rst
@@ -6,4 +6,4 @@
 Video For Linux Two Header File
 *******************************
 
-.. kernel-include:: $BUILDDIR/videodev2.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/videodev2.h videodev2.h.exceptions
diff --git a/Documentation/media/uapi/v4l/videodev2.h.exceptions b/Documentation/media/uapi/v4l/videodev2.h.exceptions
new file mode 100644
index 0000000..9bb9a6c
--- /dev/null
+++ b/Documentation/media/uapi/v4l/videodev2.h.exceptions
@@ -0,0 +1,535 @@
+# Ignore header name
+ignore define _UAPI__LINUX_VIDEODEV2_H
+
+#
+# The cross reference valitator for videodev2.h DocBook never cared
+# about enum symbols or defines. Yet, they're all (or almost all?)
+# handled inside V4L API sections. So, for now, it is safe to just
+# ignore. This should be revisited, as validating it helps to avoid
+# having something not documented at the uAPI.
+#
+
+# Those symbols should not be used by uAPI - don't document them
+ignore symbol V4L2_BUF_TYPE_PRIVATE
+ignore symbol V4L2_TUNER_DIGITAL_TV
+ignore symbol V4L2_COLORSPACE_BT878
+
+# Documented enum v4l2_field
+replace symbol V4L2_FIELD_ALTERNATE v4l2-field
+replace symbol V4L2_FIELD_ANY v4l2-field
+replace symbol V4L2_FIELD_BOTTOM v4l2-field
+replace symbol V4L2_FIELD_INTERLACED v4l2-field
+replace symbol V4L2_FIELD_INTERLACED_BT v4l2-field
+replace symbol V4L2_FIELD_INTERLACED_TB v4l2-field
+replace symbol V4L2_FIELD_NONE v4l2-field
+replace symbol V4L2_FIELD_SEQ_BT v4l2-field
+replace symbol V4L2_FIELD_SEQ_TB v4l2-field
+replace symbol V4L2_FIELD_TOP v4l2-field
+
+# Documented enum v4l2_buf_type
+replace symbol V4L2_BUF_TYPE_SDR_CAPTURE v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_SDR_OUTPUT v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_SLICED_VBI_CAPTURE v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_SLICED_VBI_OUTPUT v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_VBI_CAPTURE v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_VBI_OUTPUT v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_VIDEO_CAPTURE v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_VIDEO_OUTPUT v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY v4l2-buf-type
+replace symbol V4L2_BUF_TYPE_VIDEO_OVERLAY v4l2-buf-type
+
+# Documented enum v4l2_tuner_type
+replace symbol V4L2_TUNER_ANALOG_TV v4l2-tuner-type
+replace symbol V4L2_TUNER_RADIO v4l2-tuner-type
+replace symbol V4L2_TUNER_RF v4l2-tuner-type
+replace symbol V4L2_TUNER_SDR v4l2-tuner-type
+
+# Documented enum v4l2_memory
+replace symbol V4L2_MEMORY_DMABUF v4l2-memory
+replace symbol V4L2_MEMORY_MMAP v4l2-memory
+replace symbol V4L2_MEMORY_OVERLAY v4l2-memory
+replace symbol V4L2_MEMORY_USERPTR v4l2-memory
+
+# Documented enum v4l2_colorspace
+replace symbol V4L2_COLORSPACE_470_SYSTEM_BG v4l2-colorspace
+replace symbol V4L2_COLORSPACE_470_SYSTEM_M v4l2-colorspace
+replace symbol V4L2_COLORSPACE_ADOBERGB v4l2-colorspace
+replace symbol V4L2_COLORSPACE_BT2020 v4l2-colorspace
+replace symbol V4L2_COLORSPACE_DCI_P3 v4l2-colorspace
+replace symbol V4L2_COLORSPACE_DEFAULT v4l2-colorspace
+replace symbol V4L2_COLORSPACE_JPEG v4l2-colorspace
+replace symbol V4L2_COLORSPACE_RAW v4l2-colorspace
+replace symbol V4L2_COLORSPACE_REC709 v4l2-colorspace
+replace symbol V4L2_COLORSPACE_SMPTE170M v4l2-colorspace
+replace symbol V4L2_COLORSPACE_SMPTE240M v4l2-colorspace
+replace symbol V4L2_COLORSPACE_SRGB v4l2-colorspace
+
+# Documented enum v4l2_xfer_func
+replace symbol V4L2_XFER_FUNC_709 v4l2-xfer-func
+replace symbol V4L2_XFER_FUNC_ADOBERGB v4l2-xfer-func
+replace symbol V4L2_XFER_FUNC_DCI_P3 v4l2-xfer-func
+replace symbol V4L2_XFER_FUNC_DEFAULT v4l2-xfer-func
+replace symbol V4L2_XFER_FUNC_NONE v4l2-xfer-func
+replace symbol V4L2_XFER_FUNC_SMPTE2084 v4l2-xfer-func
+replace symbol V4L2_XFER_FUNC_SMPTE240M v4l2-xfer-func
+replace symbol V4L2_XFER_FUNC_SRGB v4l2-xfer-func
+
+# Documented enum v4l2_ycbcr_encoding
+replace symbol V4L2_YCBCR_ENC_601 v4l2-ycbcr-encoding
+replace symbol V4L2_YCBCR_ENC_709 v4l2-ycbcr-encoding
+replace symbol V4L2_YCBCR_ENC_BT2020 v4l2-ycbcr-encoding
+replace symbol V4L2_YCBCR_ENC_BT2020_CONST_LUM v4l2-ycbcr-encoding
+replace symbol V4L2_YCBCR_ENC_DEFAULT v4l2-ycbcr-encoding
+replace symbol V4L2_YCBCR_ENC_SYCC v4l2-ycbcr-encoding
+replace symbol V4L2_YCBCR_ENC_XV601 v4l2-ycbcr-encoding
+replace symbol V4L2_YCBCR_ENC_XV709 v4l2-ycbcr-encoding
+replace symbol V4L2_YCBCR_ENC_SMPTE240M v4l2-ycbcr-encoding
+
+# Documented enum v4l2_quantization
+replace symbol V4L2_QUANTIZATION_DEFAULT v4l2-quantization
+replace symbol V4L2_QUANTIZATION_FULL_RANGE v4l2-quantization
+replace symbol V4L2_QUANTIZATION_LIM_RANGE v4l2-quantization
+
+# Documented enum v4l2_priority
+replace symbol V4L2_PRIORITY_BACKGROUND v4l2-priority
+replace symbol V4L2_PRIORITY_DEFAULT v4l2-priority
+replace symbol V4L2_PRIORITY_INTERACTIVE v4l2-priority
+replace symbol V4L2_PRIORITY_RECORD v4l2-priority
+replace symbol V4L2_PRIORITY_UNSET v4l2-priority
+
+# Documented enum v4l2_frmsizetypes
+replace symbol V4L2_FRMSIZE_TYPE_CONTINUOUS v4l2-frmsizetypes
+replace symbol V4L2_FRMSIZE_TYPE_DISCRETE v4l2-frmsizetypes
+replace symbol V4L2_FRMSIZE_TYPE_STEPWISE v4l2-frmsizetypes
+
+# Documented enum frmivaltypes
+replace symbol V4L2_FRMIVAL_TYPE_CONTINUOUS v4l2-frmivaltypes
+replace symbol V4L2_FRMIVAL_TYPE_DISCRETE v4l2-frmivaltypes
+replace symbol V4L2_FRMIVAL_TYPE_STEPWISE v4l2-frmivaltypes
+
+# Documented enum v4l2-ctrl-type
+replace symbol V4L2_CTRL_COMPOUND_TYPES vidioc_queryctrl
+
+replace symbol V4L2_CTRL_TYPE_BITMASK v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_BOOLEAN v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_BUTTON v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_CTRL_CLASS v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_INTEGER v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_INTEGER64 v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_INTEGER_MENU v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_MENU v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_STRING v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_U16 v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_U32 v4l2-ctrl-type
+replace symbol V4L2_CTRL_TYPE_U8 v4l2-ctrl-type
+
+# V4L2 capability defines
+replace define V4L2_CAP_VIDEO_CAPTURE device-capabilities
+replace define V4L2_CAP_VIDEO_CAPTURE_MPLANE device-capabilities
+replace define V4L2_CAP_VIDEO_OUTPUT device-capabilities
+replace define V4L2_CAP_VIDEO_OUTPUT_MPLANE device-capabilities
+replace define V4L2_CAP_VIDEO_M2M device-capabilities
+replace define V4L2_CAP_VIDEO_M2M_MPLANE device-capabilities
+replace define V4L2_CAP_VIDEO_OVERLAY device-capabilities
+replace define V4L2_CAP_VBI_CAPTURE device-capabilities
+replace define V4L2_CAP_VBI_OUTPUT device-capabilities
+replace define V4L2_CAP_SLICED_VBI_CAPTURE device-capabilities
+replace define V4L2_CAP_SLICED_VBI_OUTPUT device-capabilities
+replace define V4L2_CAP_RDS_CAPTURE device-capabilities
+replace define V4L2_CAP_VIDEO_OUTPUT_OVERLAY device-capabilities
+replace define V4L2_CAP_HW_FREQ_SEEK device-capabilities
+replace define V4L2_CAP_RDS_OUTPUT device-capabilities
+replace define V4L2_CAP_TUNER device-capabilities
+replace define V4L2_CAP_AUDIO device-capabilities
+replace define V4L2_CAP_RADIO device-capabilities
+replace define V4L2_CAP_MODULATOR device-capabilities
+replace define V4L2_CAP_SDR_CAPTURE device-capabilities
+replace define V4L2_CAP_EXT_PIX_FORMAT device-capabilities
+replace define V4L2_CAP_SDR_OUTPUT device-capabilities
+replace define V4L2_CAP_READWRITE device-capabilities
+replace define V4L2_CAP_ASYNCIO device-capabilities
+replace define V4L2_CAP_STREAMING device-capabilities
+replace define V4L2_CAP_DEVICE_CAPS device-capabilities
+
+# V4L2 pix flags
+replace define V4L2_PIX_FMT_PRIV_MAGIC v4l2-pix-format
+replace define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA reserved-formats
+
+# V4L2 format flags
+replace define V4L2_FMT_FLAG_COMPRESSED fmtdesc-flags
+replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags
+
+# V4L2 tymecode types
+replace define V4L2_TC_TYPE_24FPS timecode-type
+replace define V4L2_TC_TYPE_25FPS timecode-type
+replace define V4L2_TC_TYPE_30FPS timecode-type
+replace define V4L2_TC_TYPE_50FPS timecode-type
+replace define V4L2_TC_TYPE_60FPS timecode-type
+
+# V4L2 tymecode flags
+replace define V4L2_TC_FLAG_DROPFRAME timecode-flags
+replace define V4L2_TC_FLAG_COLORFRAME timecode-flags
+replace define V4L2_TC_USERBITS_field timecode-flags
+replace define V4L2_TC_USERBITS_USERDEFINED timecode-flags
+replace define V4L2_TC_USERBITS_8BITCHARS timecode-flags
+
+# V4L2 JPEG markers
+replace define V4L2_JPEG_MARKER_DHT jpeg-markers
+replace define V4L2_JPEG_MARKER_DQT jpeg-markers
+replace define V4L2_JPEG_MARKER_DRI jpeg-markers
+replace define V4L2_JPEG_MARKER_COM jpeg-markers
+replace define V4L2_JPEG_MARKER_APP jpeg-markers
+
+# V4L2 framebuffer caps and flags
+
+replace define V4L2_FBUF_CAP_EXTERNOVERLAY framebuffer-cap
+replace define V4L2_FBUF_CAP_CHROMAKEY framebuffer-cap
+replace define V4L2_FBUF_CAP_LIST_CLIPPING framebuffer-cap
+replace define V4L2_FBUF_CAP_BITMAP_CLIPPING framebuffer-cap
+replace define V4L2_FBUF_CAP_LOCAL_ALPHA framebuffer-cap
+replace define V4L2_FBUF_CAP_GLOBAL_ALPHA framebuffer-cap
+replace define V4L2_FBUF_CAP_LOCAL_INV_ALPHA framebuffer-cap
+replace define V4L2_FBUF_CAP_SRC_CHROMAKEY framebuffer-cap
+
+replace define V4L2_FBUF_FLAG_PRIMARY framebuffer-flags
+replace define V4L2_FBUF_FLAG_OVERLAY framebuffer-flags
+replace define V4L2_FBUF_FLAG_CHROMAKEY framebuffer-flags
+replace define V4L2_FBUF_FLAG_LOCAL_ALPHA framebuffer-flags
+replace define V4L2_FBUF_FLAG_GLOBAL_ALPHA framebuffer-flags
+replace define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA framebuffer-flags
+replace define V4L2_FBUF_FLAG_SRC_CHROMAKEY framebuffer-flags
+
+# Used on VIDIOC_G_PARM
+
+replace define V4L2_MODE_HIGHQUALITY parm-flags
+replace define V4L2_CAP_TIMEPERFRAME v4l2-captureparm
+
+# The V4L2_STD_foo are all defined at v4l2_std_id table
+
+replace define V4L2_STD_PAL_B v4l2-std-id
+replace define V4L2_STD_PAL_B1 v4l2-std-id
+replace define V4L2_STD_PAL_G v4l2-std-id
+replace define V4L2_STD_PAL_H v4l2-std-id
+replace define V4L2_STD_PAL_I v4l2-std-id
+replace define V4L2_STD_PAL_D v4l2-std-id
+replace define V4L2_STD_PAL_D1 v4l2-std-id
+replace define V4L2_STD_PAL_K v4l2-std-id
+replace define V4L2_STD_PAL_M v4l2-std-id
+replace define V4L2_STD_PAL_N v4l2-std-id
+replace define V4L2_STD_PAL_Nc v4l2-std-id
+replace define V4L2_STD_PAL_60 v4l2-std-id
+replace define V4L2_STD_NTSC_M v4l2-std-id
+replace define V4L2_STD_NTSC_M_JP v4l2-std-id
+replace define V4L2_STD_NTSC_443 v4l2-std-id
+replace define V4L2_STD_NTSC_M_KR v4l2-std-id
+replace define V4L2_STD_SECAM_B v4l2-std-id
+replace define V4L2_STD_SECAM_D v4l2-std-id
+replace define V4L2_STD_SECAM_G v4l2-std-id
+replace define V4L2_STD_SECAM_H v4l2-std-id
+replace define V4L2_STD_SECAM_K v4l2-std-id
+replace define V4L2_STD_SECAM_K1 v4l2-std-id
+replace define V4L2_STD_SECAM_L v4l2-std-id
+replace define V4L2_STD_SECAM_LC v4l2-std-id
+replace define V4L2_STD_ATSC_8_VSB v4l2-std-id
+replace define V4L2_STD_ATSC_16_VSB v4l2-std-id
+replace define V4L2_STD_NTSC v4l2-std-id
+replace define V4L2_STD_SECAM_DK v4l2-std-id
+replace define V4L2_STD_SECAM v4l2-std-id
+replace define V4L2_STD_PAL_BG v4l2-std-id
+replace define V4L2_STD_PAL_DK v4l2-std-id
+replace define V4L2_STD_PAL v4l2-std-id
+replace define V4L2_STD_B v4l2-std-id
+replace define V4L2_STD_G v4l2-std-id
+replace define V4L2_STD_H v4l2-std-id
+replace define V4L2_STD_L v4l2-std-id
+replace define V4L2_STD_GH v4l2-std-id
+replace define V4L2_STD_DK v4l2-std-id
+replace define V4L2_STD_BG v4l2-std-id
+replace define V4L2_STD_MN v4l2-std-id
+replace define V4L2_STD_MTS v4l2-std-id
+replace define V4L2_STD_525_60 v4l2-std-id
+replace define V4L2_STD_625_50 v4l2-std-id
+replace define V4L2_STD_ATSC v4l2-std-id
+replace define V4L2_STD_UNKNOWN v4l2-std-id
+replace define V4L2_STD_ALL v4l2-std-id
+
+# V4L2 DT BT timings definitions
+
+replace define V4L2_DV_PROGRESSIVE v4l2-bt-timings
+replace define V4L2_DV_INTERLACED v4l2-bt-timings
+
+replace define V4L2_DV_VSYNC_POS_POL v4l2-bt-timings
+replace define V4L2_DV_HSYNC_POS_POL v4l2-bt-timings
+
+replace define V4L2_DV_BT_STD_CEA861 dv-bt-standards
+replace define V4L2_DV_BT_STD_DMT dv-bt-standards
+replace define V4L2_DV_BT_STD_CVT dv-bt-standards
+replace define V4L2_DV_BT_STD_GTF dv-bt-standards
+
+replace define V4L2_DV_FL_REDUCED_BLANKING dv-bt-standards
+replace define V4L2_DV_FL_CAN_REDUCE_FPS dv-bt-standards
+replace define V4L2_DV_FL_REDUCED_FPS dv-bt-standards
+replace define V4L2_DV_FL_HALF_LINE dv-bt-standards
+replace define V4L2_DV_FL_IS_CE_VIDEO dv-bt-standards
+
+replace define V4L2_DV_BT_656_1120 dv-timing-types
+
+replace define V4L2_DV_BT_CAP_INTERLACED framebuffer-cap
+replace define V4L2_DV_BT_CAP_PROGRESSIVE framebuffer-cap
+replace define V4L2_DV_BT_CAP_REDUCED_BLANKING framebuffer-cap
+replace define V4L2_DV_BT_CAP_CUSTOM framebuffer-cap
+
+# V4L2 input
+
+replace define V4L2_INPUT_TYPE_TUNER input-type
+replace define V4L2_INPUT_TYPE_CAMERA input-type
+
+replace define V4L2_IN_ST_NO_POWER input-status
+replace define V4L2_IN_ST_NO_SIGNAL input-status
+replace define V4L2_IN_ST_NO_COLOR input-status
+replace define V4L2_IN_ST_HFLIP input-status
+replace define V4L2_IN_ST_VFLIP input-status
+replace define V4L2_IN_ST_NO_H_LOCK input-status
+replace define V4L2_IN_ST_COLOR_KILL input-status
+replace define V4L2_IN_ST_NO_SYNC input-status
+replace define V4L2_IN_ST_NO_EQU input-status
+replace define V4L2_IN_ST_NO_CARRIER input-status
+replace define V4L2_IN_ST_MACROVISION input-status
+replace define V4L2_IN_ST_NO_ACCESS input-status
+replace define V4L2_IN_ST_VTR input-status
+
+replace define V4L2_IN_CAP_DV_TIMINGS input-capabilities
+replace define V4L2_IN_CAP_STD input-capabilities
+replace define V4L2_IN_CAP_NATIVE_SIZE input-capabilities
+
+# V4L2 output
+
+replace define V4L2_OUTPUT_TYPE_MODULATOR output-type
+replace define V4L2_OUTPUT_TYPE_ANALOG output-type
+replace define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY output-type
+
+replace define V4L2_OUT_CAP_DV_TIMINGS output-capabilities
+replace define V4L2_OUT_CAP_STD output-capabilities
+replace define V4L2_OUT_CAP_NATIVE_SIZE output-capabilities
+
+# V4L2 control flags
+
+replace define V4L2_CTRL_FLAG_DISABLED control-flags
+replace define V4L2_CTRL_FLAG_GRABBED control-flags
+replace define V4L2_CTRL_FLAG_READ_ONLY control-flags
+replace define V4L2_CTRL_FLAG_UPDATE control-flags
+replace define V4L2_CTRL_FLAG_INACTIVE control-flags
+replace define V4L2_CTRL_FLAG_SLIDER control-flags
+replace define V4L2_CTRL_FLAG_WRITE_ONLY control-flags
+replace define V4L2_CTRL_FLAG_VOLATILE control-flags
+replace define V4L2_CTRL_FLAG_HAS_PAYLOAD control-flags
+replace define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE control-flags
+
+replace define V4L2_CTRL_FLAG_NEXT_CTRL control
+replace define V4L2_CTRL_FLAG_NEXT_COMPOUND control
+replace define V4L2_CID_PRIVATE_BASE control
+
+# V4L2 tuner
+
+replace define V4L2_TUNER_CAP_LOW tuner-capability
+replace define V4L2_TUNER_CAP_NORM tuner-capability
+replace define V4L2_TUNER_CAP_HWSEEK_BOUNDED tuner-capability
+replace define V4L2_TUNER_CAP_HWSEEK_WRAP tuner-capability
+replace define V4L2_TUNER_CAP_STEREO tuner-capability
+replace define V4L2_TUNER_CAP_LANG2 tuner-capability
+replace define V4L2_TUNER_CAP_SAP tuner-capability
+replace define V4L2_TUNER_CAP_LANG1 tuner-capability
+replace define V4L2_TUNER_CAP_RDS tuner-capability
+replace define V4L2_TUNER_CAP_RDS_BLOCK_IO tuner-capability
+replace define V4L2_TUNER_CAP_RDS_CONTROLS tuner-capability
+replace define V4L2_TUNER_CAP_FREQ_BANDS tuner-capability
+replace define V4L2_TUNER_CAP_HWSEEK_PROG_LIM tuner-capability
+replace define V4L2_TUNER_CAP_1HZ tuner-capability
+
+replace define V4L2_TUNER_SUB_MONO tuner-rxsubchans
+replace define V4L2_TUNER_SUB_STEREO tuner-rxsubchans
+replace define V4L2_TUNER_SUB_LANG2 tuner-rxsubchans
+replace define V4L2_TUNER_SUB_SAP tuner-rxsubchans
+replace define V4L2_TUNER_SUB_LANG1 tuner-rxsubchans
+replace define V4L2_TUNER_SUB_RDS tuner-rxsubchans
+
+replace define V4L2_TUNER_MODE_MONO tuner-audmode
+replace define V4L2_TUNER_MODE_STEREO tuner-audmode
+replace define V4L2_TUNER_MODE_LANG2 tuner-audmode
+replace define V4L2_TUNER_MODE_SAP tuner-audmode
+replace define V4L2_TUNER_MODE_LANG1 tuner-audmode
+replace define V4L2_TUNER_MODE_LANG1_LANG2 tuner-audmode
+
+replace define V4L2_BAND_MODULATION_VSB band-modulation
+replace define V4L2_BAND_MODULATION_FM band-modulation
+replace define V4L2_BAND_MODULATION_AM band-modulation
+
+replace define V4L2_RDS_BLOCK_MSK v4l2-rds-block
+replace define V4L2_RDS_BLOCK_A v4l2-rds-block
+replace define V4L2_RDS_BLOCK_B v4l2-rds-block
+replace define V4L2_RDS_BLOCK_C v4l2-rds-block
+replace define V4L2_RDS_BLOCK_D v4l2-rds-block
+replace define V4L2_RDS_BLOCK_C_ALT v4l2-rds-block
+replace define V4L2_RDS_BLOCK_INVALID v4l2-rds-block
+replace define V4L2_RDS_BLOCK_CORRECTED v4l2-rds-block
+replace define V4L2_RDS_BLOCK_ERROR v4l2-rds-block
+
+# V4L2 audio
+
+replace define V4L2_AUDCAP_STEREO audio-capability
+replace define V4L2_AUDCAP_AVL audio-capability
+
+replace define V4L2_AUDMODE_AVL audio-mode
+
+# MPEG
+
+replace define V4L2_ENC_IDX_FRAME_I v4l2-enc-idx
+replace define V4L2_ENC_IDX_FRAME_P v4l2-enc-idx
+replace define V4L2_ENC_IDX_FRAME_B v4l2-enc-idx
+replace define V4L2_ENC_IDX_FRAME_MASK v4l2-enc-idx
+replace define V4L2_ENC_IDX_ENTRIES v4l2-enc-idx
+
+replace define V4L2_ENC_CMD_START encoder-cmds
+replace define V4L2_ENC_CMD_STOP encoder-cmds
+replace define V4L2_ENC_CMD_PAUSE encoder-cmds
+replace define V4L2_ENC_CMD_RESUME encoder-cmds
+
+replace define V4L2_ENC_CMD_STOP_AT_GOP_END encoder-flags
+
+replace define V4L2_DEC_CMD_START decoder-cmds
+replace define V4L2_DEC_CMD_STOP decoder-cmds
+replace define V4L2_DEC_CMD_PAUSE decoder-cmds
+replace define V4L2_DEC_CMD_RESUME decoder-cmds
+
+replace define V4L2_DEC_CMD_START_MUTE_AUDIO decoder-cmds
+replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds
+replace define V4L2_DEC_CMD_STOP_TO_BLACK decoder-cmds
+replace define V4L2_DEC_CMD_STOP_IMMEDIATELY decoder-cmds
+
+replace define V4L2_DEC_START_FMT_NONE decoder-cmds
+replace define V4L2_DEC_START_FMT_GOP decoder-cmds
+
+# V4L2 VBI
+
+replace define V4L2_VBI_UNSYNC vbifmt-flags
+replace define V4L2_VBI_INTERLACED vbifmt-flags
+
+replace define V4L2_VBI_ITU_525_F1_START v4l2-vbi-format
+replace define V4L2_VBI_ITU_525_F2_START v4l2-vbi-format
+replace define V4L2_VBI_ITU_625_F1_START v4l2-vbi-format
+replace define V4L2_VBI_ITU_625_F2_START v4l2-vbi-format
+
+
+replace define V4L2_SLICED_TELETEXT_B vbi-services
+replace define V4L2_SLICED_VPS vbi-services
+replace define V4L2_SLICED_CAPTION_525 vbi-services
+replace define V4L2_SLICED_WSS_625 vbi-services
+replace define V4L2_SLICED_VBI_525 vbi-services
+replace define V4L2_SLICED_VBI_625 vbi-services
+
+replace define V4L2_MPEG_VBI_IVTV_TELETEXT_B ITV0-Line-Identifier-Constants
+replace define V4L2_MPEG_VBI_IVTV_CAPTION_525 ITV0-Line-Identifier-Constants
+replace define V4L2_MPEG_VBI_IVTV_WSS_625 ITV0-Line-Identifier-Constants
+replace define V4L2_MPEG_VBI_IVTV_VPS ITV0-Line-Identifier-Constants
+
+replace define V4L2_MPEG_VBI_IVTV_MAGIC0 v4l2-mpeg-vbi-fmt-ivtv-magic
+replace define V4L2_MPEG_VBI_IVTV_MAGIC1 v4l2-mpeg-vbi-fmt-ivtv-magic
+
+# V4L2 events
+
+replace define V4L2_EVENT_ALL event-type
+replace define V4L2_EVENT_VSYNC event-type
+replace define V4L2_EVENT_EOS event-type
+replace define V4L2_EVENT_CTRL event-type
+replace define V4L2_EVENT_FRAME_SYNC event-type
+replace define V4L2_EVENT_SOURCE_CHANGE event-type
+replace define V4L2_EVENT_MOTION_DET event-type
+replace define V4L2_EVENT_PRIVATE_START event-type
+
+replace define V4L2_EVENT_CTRL_CH_VALUE ctrl-changes-flags
+replace define V4L2_EVENT_CTRL_CH_FLAGS ctrl-changes-flags
+replace define V4L2_EVENT_CTRL_CH_RANGE ctrl-changes-flags
+
+replace define V4L2_EVENT_SRC_CH_RESOLUTION src-changes-flags
+
+replace define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ v4l2-event-motion-det
+
+replace define V4L2_EVENT_SUB_FL_SEND_INITIAL event-flags
+replace define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK event-flags
+
+# V4L2 debugging
+replace define V4L2_CHIP_MATCH_BRIDGE vidioc_dbg_g_register
+replace define V4L2_CHIP_MATCH_SUBDEV vidioc_dbg_g_register
+replace define V4L2_CHIP_MATCH_HOST vidioc_dbg_g_register
+replace define V4L2_CHIP_MATCH_I2C_DRIVER vidioc_dbg_g_register
+replace define V4L2_CHIP_MATCH_I2C_ADDR vidioc_dbg_g_register
+replace define V4L2_CHIP_MATCH_AC97 vidioc_dbg_g_register
+
+replace define V4L2_CHIP_FL_READABLE vidioc_dbg_g_register
+replace define V4L2_CHIP_FL_WRITABLE vidioc_dbg_g_register
+
+# Ignore reserved ioctl and ancillary macros
+
+ignore define VIDEO_MAX_FRAME
+ignore define VIDEO_MAX_PLANES
+ignore define v4l2_fourcc
+ignore define v4l2_fourcc_be
+ignore define V4L2_FIELD_HAS_TOP
+ignore define V4L2_FIELD_HAS_BOTTOM
+ignore define V4L2_FIELD_HAS_BOTH
+ignore define V4L2_FIELD_HAS_T_OR_B
+ignore define V4L2_TYPE_IS_MULTIPLANAR
+ignore define V4L2_TYPE_IS_OUTPUT
+ignore define V4L2_TUNER_ADC
+ignore define V4L2_MAP_COLORSPACE_DEFAULT
+ignore define V4L2_MAP_XFER_FUNC_DEFAULT
+ignore define V4L2_MAP_YCBCR_ENC_DEFAULT
+ignore define V4L2_DV_BT_BLANKING_WIDTH
+ignore define V4L2_DV_BT_FRAME_WIDTH
+ignore define V4L2_DV_BT_BLANKING_HEIGHT
+ignore define V4L2_DV_BT_FRAME_HEIGHT
+ignore define V4L2_IN_CAP_CUSTOM_TIMINGS
+ignore define V4L2_CTRL_ID_MASK
+ignore define V4L2_CTRL_ID2CLASS
+ignore define V4L2_CTRL_ID2WHICH
+ignore define V4L2_CTRL_DRIVER_PRIV
+ignore define V4L2_CTRL_MAX_DIMS
+ignore define V4L2_CTRL_WHICH_CUR_VAL
+ignore define V4L2_CTRL_WHICH_DEF_VAL
+ignore define V4L2_OUT_CAP_CUSTOM_TIMINGS
+ignore define V4L2_CID_MAX_CTRLS
+
+ignore ioctl VIDIOC_RESERVED
+ignore define BASE_VIDIOC_PRIVATE
+
+# Associate ioctls with their counterparts
+replace ioctl VIDIOC_DBG_S_REGISTER vidioc_dbg_g_register
+replace ioctl VIDIOC_DQBUF vidioc_qbuf
+replace ioctl VIDIOC_S_AUDOUT vidioc_g_audout
+replace ioctl VIDIOC_S_CROP vidioc_g_crop
+replace ioctl VIDIOC_S_CTRL vidioc_g_ctrl
+replace ioctl VIDIOC_S_DV_TIMINGS vidioc_g_dv_timings
+replace ioctl VIDIOC_S_EDID vidioc_g_edid
+replace ioctl VIDIOC_S_EXT_CTRLS vidioc_g_ext_ctrls
+replace ioctl VIDIOC_S_FBUF vidioc_g_fbuf
+replace ioctl VIDIOC_S_FMT vidioc_g_fmt
+replace ioctl VIDIOC_S_FREQUENCY vidioc_g_frequency
+replace ioctl VIDIOC_S_INPUT vidioc_g_input
+replace ioctl VIDIOC_S_JPEGCOMP vidioc_g_jpegcomp
+replace ioctl VIDIOC_S_MODULATOR vidioc_g_modulator
+replace ioctl VIDIOC_S_OUTPUT vidioc_g_output
+replace ioctl VIDIOC_S_PARM vidioc_g_parm
+replace ioctl VIDIOC_S_PRIORITY vidioc_g_priority
+replace ioctl VIDIOC_S_SELECTION vidioc_g_selection
+replace ioctl VIDIOC_S_STD vidioc_g_std
+replace ioctl VIDIOC_S_AUDIO vidioc_g_audio
+replace ioctl VIDIOC_S_TUNER vidioc_g_tuner
+replace ioctl VIDIOC_TRY_DECODER_CMD vidioc_decoder_cmd
+replace ioctl VIDIOC_TRY_ENCODER_CMD vidioc_encoder_cmd
+replace ioctl VIDIOC_TRY_EXT_CTRLS vidioc_g_ext_ctrls
+replace ioctl VIDIOC_TRY_FMT vidioc_g_fmt
+replace ioctl VIDIOC_STREAMOFF vidioc_streamon
+replace ioctl VIDIOC_QUERY_EXT_CTRL vidioc_queryctrl
+replace ioctl VIDIOC_QUERYMENU vidioc_queryctrl
diff --git a/Documentation/media/video.h.rst.exceptions b/Documentation/media/video.h.rst.exceptions
deleted file mode 100644
index 8866145..0000000
--- a/Documentation/media/video.h.rst.exceptions
+++ /dev/null
@@ -1,40 +0,0 @@
-# Ignore header name
-ignore define _UAPI_DVBVIDEO_H_
-
-# This is a deprecated obscure API. Just ignore things we don't know
-ignore define VIDEO_CMD_PLAY
-ignore define VIDEO_CMD_STOP
-ignore define VIDEO_CMD_FREEZE
-ignore define VIDEO_CMD_CONTINUE
-ignore define VIDEO_CMD_FREEZE_TO_BLACK
-ignore define VIDEO_CMD_STOP_TO_BLACK
-ignore define VIDEO_CMD_STOP_IMMEDIATELY
-ignore define VIDEO_PLAY_FMT_NONE
-ignore define VIDEO_PLAY_FMT_GOP
-ignore define VIDEO_VSYNC_FIELD_UNKNOWN
-ignore define VIDEO_VSYNC_FIELD_ODD
-ignore define VIDEO_VSYNC_FIELD_EVEN
-ignore define VIDEO_VSYNC_FIELD_PROGRESSIVE
-ignore define VIDEO_EVENT_SIZE_CHANGED
-ignore define VIDEO_EVENT_FRAME_RATE_CHANGED
-ignore define VIDEO_EVENT_DECODER_STOPPED
-ignore define VIDEO_EVENT_VSYNC
-ignore define VIDEO_CAP_MPEG1
-ignore define VIDEO_CAP_MPEG2
-ignore define VIDEO_CAP_SYS
-ignore define VIDEO_CAP_PROG
-ignore define VIDEO_CAP_SPU
-ignore define VIDEO_CAP_NAVI
-ignore define VIDEO_CAP_CSS
-
-# some typedefs should point to struct/enums
-replace typedef video_format_t video-format
-replace typedef video_system_t video-system
-replace typedef video_displayformat_t video-displayformat
-replace typedef video_size_t video-size
-replace typedef video_stream_source_t video-stream-source
-replace typedef video_play_state_t video-play-state
-replace typedef video_highlight_t video-highlight
-replace typedef video_spu_t video-spu
-replace typedef video_spu_palette_t video-spu-palette
-replace typedef video_navi_pack_t video-navi-pack
diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/videodev2.h.rst.exceptions
deleted file mode 100644
index 9bb9a6c..0000000
--- a/Documentation/media/videodev2.h.rst.exceptions
+++ /dev/null
@@ -1,535 +0,0 @@
-# Ignore header name
-ignore define _UAPI__LINUX_VIDEODEV2_H
-
-#
-# The cross reference valitator for videodev2.h DocBook never cared
-# about enum symbols or defines. Yet, they're all (or almost all?)
-# handled inside V4L API sections. So, for now, it is safe to just
-# ignore. This should be revisited, as validating it helps to avoid
-# having something not documented at the uAPI.
-#
-
-# Those symbols should not be used by uAPI - don't document them
-ignore symbol V4L2_BUF_TYPE_PRIVATE
-ignore symbol V4L2_TUNER_DIGITAL_TV
-ignore symbol V4L2_COLORSPACE_BT878
-
-# Documented enum v4l2_field
-replace symbol V4L2_FIELD_ALTERNATE v4l2-field
-replace symbol V4L2_FIELD_ANY v4l2-field
-replace symbol V4L2_FIELD_BOTTOM v4l2-field
-replace symbol V4L2_FIELD_INTERLACED v4l2-field
-replace symbol V4L2_FIELD_INTERLACED_BT v4l2-field
-replace symbol V4L2_FIELD_INTERLACED_TB v4l2-field
-replace symbol V4L2_FIELD_NONE v4l2-field
-replace symbol V4L2_FIELD_SEQ_BT v4l2-field
-replace symbol V4L2_FIELD_SEQ_TB v4l2-field
-replace symbol V4L2_FIELD_TOP v4l2-field
-
-# Documented enum v4l2_buf_type
-replace symbol V4L2_BUF_TYPE_SDR_CAPTURE v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_SDR_OUTPUT v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_SLICED_VBI_CAPTURE v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_SLICED_VBI_OUTPUT v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_VBI_CAPTURE v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_VBI_OUTPUT v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_VIDEO_CAPTURE v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_VIDEO_OUTPUT v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY v4l2-buf-type
-replace symbol V4L2_BUF_TYPE_VIDEO_OVERLAY v4l2-buf-type
-
-# Documented enum v4l2_tuner_type
-replace symbol V4L2_TUNER_ANALOG_TV v4l2-tuner-type
-replace symbol V4L2_TUNER_RADIO v4l2-tuner-type
-replace symbol V4L2_TUNER_RF v4l2-tuner-type
-replace symbol V4L2_TUNER_SDR v4l2-tuner-type
-
-# Documented enum v4l2_memory
-replace symbol V4L2_MEMORY_DMABUF v4l2-memory
-replace symbol V4L2_MEMORY_MMAP v4l2-memory
-replace symbol V4L2_MEMORY_OVERLAY v4l2-memory
-replace symbol V4L2_MEMORY_USERPTR v4l2-memory
-
-# Documented enum v4l2_colorspace
-replace symbol V4L2_COLORSPACE_470_SYSTEM_BG v4l2-colorspace
-replace symbol V4L2_COLORSPACE_470_SYSTEM_M v4l2-colorspace
-replace symbol V4L2_COLORSPACE_ADOBERGB v4l2-colorspace
-replace symbol V4L2_COLORSPACE_BT2020 v4l2-colorspace
-replace symbol V4L2_COLORSPACE_DCI_P3 v4l2-colorspace
-replace symbol V4L2_COLORSPACE_DEFAULT v4l2-colorspace
-replace symbol V4L2_COLORSPACE_JPEG v4l2-colorspace
-replace symbol V4L2_COLORSPACE_RAW v4l2-colorspace
-replace symbol V4L2_COLORSPACE_REC709 v4l2-colorspace
-replace symbol V4L2_COLORSPACE_SMPTE170M v4l2-colorspace
-replace symbol V4L2_COLORSPACE_SMPTE240M v4l2-colorspace
-replace symbol V4L2_COLORSPACE_SRGB v4l2-colorspace
-
-# Documented enum v4l2_xfer_func
-replace symbol V4L2_XFER_FUNC_709 v4l2-xfer-func
-replace symbol V4L2_XFER_FUNC_ADOBERGB v4l2-xfer-func
-replace symbol V4L2_XFER_FUNC_DCI_P3 v4l2-xfer-func
-replace symbol V4L2_XFER_FUNC_DEFAULT v4l2-xfer-func
-replace symbol V4L2_XFER_FUNC_NONE v4l2-xfer-func
-replace symbol V4L2_XFER_FUNC_SMPTE2084 v4l2-xfer-func
-replace symbol V4L2_XFER_FUNC_SMPTE240M v4l2-xfer-func
-replace symbol V4L2_XFER_FUNC_SRGB v4l2-xfer-func
-
-# Documented enum v4l2_ycbcr_encoding
-replace symbol V4L2_YCBCR_ENC_601 v4l2-ycbcr-encoding
-replace symbol V4L2_YCBCR_ENC_709 v4l2-ycbcr-encoding
-replace symbol V4L2_YCBCR_ENC_BT2020 v4l2-ycbcr-encoding
-replace symbol V4L2_YCBCR_ENC_BT2020_CONST_LUM v4l2-ycbcr-encoding
-replace symbol V4L2_YCBCR_ENC_DEFAULT v4l2-ycbcr-encoding
-replace symbol V4L2_YCBCR_ENC_SYCC v4l2-ycbcr-encoding
-replace symbol V4L2_YCBCR_ENC_XV601 v4l2-ycbcr-encoding
-replace symbol V4L2_YCBCR_ENC_XV709 v4l2-ycbcr-encoding
-replace symbol V4L2_YCBCR_ENC_SMPTE240M v4l2-ycbcr-encoding
-
-# Documented enum v4l2_quantization
-replace symbol V4L2_QUANTIZATION_DEFAULT v4l2-quantization
-replace symbol V4L2_QUANTIZATION_FULL_RANGE v4l2-quantization
-replace symbol V4L2_QUANTIZATION_LIM_RANGE v4l2-quantization
-
-# Documented enum v4l2_priority
-replace symbol V4L2_PRIORITY_BACKGROUND v4l2-priority
-replace symbol V4L2_PRIORITY_DEFAULT v4l2-priority
-replace symbol V4L2_PRIORITY_INTERACTIVE v4l2-priority
-replace symbol V4L2_PRIORITY_RECORD v4l2-priority
-replace symbol V4L2_PRIORITY_UNSET v4l2-priority
-
-# Documented enum v4l2_frmsizetypes
-replace symbol V4L2_FRMSIZE_TYPE_CONTINUOUS v4l2-frmsizetypes
-replace symbol V4L2_FRMSIZE_TYPE_DISCRETE v4l2-frmsizetypes
-replace symbol V4L2_FRMSIZE_TYPE_STEPWISE v4l2-frmsizetypes
-
-# Documented enum frmivaltypes
-replace symbol V4L2_FRMIVAL_TYPE_CONTINUOUS v4l2-frmivaltypes
-replace symbol V4L2_FRMIVAL_TYPE_DISCRETE v4l2-frmivaltypes
-replace symbol V4L2_FRMIVAL_TYPE_STEPWISE v4l2-frmivaltypes
-
-# Documented enum v4l2-ctrl-type
-replace symbol V4L2_CTRL_COMPOUND_TYPES vidioc_queryctrl
-
-replace symbol V4L2_CTRL_TYPE_BITMASK v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_BOOLEAN v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_BUTTON v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_CTRL_CLASS v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_INTEGER v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_INTEGER64 v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_INTEGER_MENU v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_MENU v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_STRING v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_U16 v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_U32 v4l2-ctrl-type
-replace symbol V4L2_CTRL_TYPE_U8 v4l2-ctrl-type
-
-# V4L2 capability defines
-replace define V4L2_CAP_VIDEO_CAPTURE device-capabilities
-replace define V4L2_CAP_VIDEO_CAPTURE_MPLANE device-capabilities
-replace define V4L2_CAP_VIDEO_OUTPUT device-capabilities
-replace define V4L2_CAP_VIDEO_OUTPUT_MPLANE device-capabilities
-replace define V4L2_CAP_VIDEO_M2M device-capabilities
-replace define V4L2_CAP_VIDEO_M2M_MPLANE device-capabilities
-replace define V4L2_CAP_VIDEO_OVERLAY device-capabilities
-replace define V4L2_CAP_VBI_CAPTURE device-capabilities
-replace define V4L2_CAP_VBI_OUTPUT device-capabilities
-replace define V4L2_CAP_SLICED_VBI_CAPTURE device-capabilities
-replace define V4L2_CAP_SLICED_VBI_OUTPUT device-capabilities
-replace define V4L2_CAP_RDS_CAPTURE device-capabilities
-replace define V4L2_CAP_VIDEO_OUTPUT_OVERLAY device-capabilities
-replace define V4L2_CAP_HW_FREQ_SEEK device-capabilities
-replace define V4L2_CAP_RDS_OUTPUT device-capabilities
-replace define V4L2_CAP_TUNER device-capabilities
-replace define V4L2_CAP_AUDIO device-capabilities
-replace define V4L2_CAP_RADIO device-capabilities
-replace define V4L2_CAP_MODULATOR device-capabilities
-replace define V4L2_CAP_SDR_CAPTURE device-capabilities
-replace define V4L2_CAP_EXT_PIX_FORMAT device-capabilities
-replace define V4L2_CAP_SDR_OUTPUT device-capabilities
-replace define V4L2_CAP_READWRITE device-capabilities
-replace define V4L2_CAP_ASYNCIO device-capabilities
-replace define V4L2_CAP_STREAMING device-capabilities
-replace define V4L2_CAP_DEVICE_CAPS device-capabilities
-
-# V4L2 pix flags
-replace define V4L2_PIX_FMT_PRIV_MAGIC v4l2-pix-format
-replace define V4L2_PIX_FMT_FLAG_PREMUL_ALPHA reserved-formats
-
-# V4L2 format flags
-replace define V4L2_FMT_FLAG_COMPRESSED fmtdesc-flags
-replace define V4L2_FMT_FLAG_EMULATED fmtdesc-flags
-
-# V4L2 tymecode types
-replace define V4L2_TC_TYPE_24FPS timecode-type
-replace define V4L2_TC_TYPE_25FPS timecode-type
-replace define V4L2_TC_TYPE_30FPS timecode-type
-replace define V4L2_TC_TYPE_50FPS timecode-type
-replace define V4L2_TC_TYPE_60FPS timecode-type
-
-# V4L2 tymecode flags
-replace define V4L2_TC_FLAG_DROPFRAME timecode-flags
-replace define V4L2_TC_FLAG_COLORFRAME timecode-flags
-replace define V4L2_TC_USERBITS_field timecode-flags
-replace define V4L2_TC_USERBITS_USERDEFINED timecode-flags
-replace define V4L2_TC_USERBITS_8BITCHARS timecode-flags
-
-# V4L2 JPEG markers
-replace define V4L2_JPEG_MARKER_DHT jpeg-markers
-replace define V4L2_JPEG_MARKER_DQT jpeg-markers
-replace define V4L2_JPEG_MARKER_DRI jpeg-markers
-replace define V4L2_JPEG_MARKER_COM jpeg-markers
-replace define V4L2_JPEG_MARKER_APP jpeg-markers
-
-# V4L2 framebuffer caps and flags
-
-replace define V4L2_FBUF_CAP_EXTERNOVERLAY framebuffer-cap
-replace define V4L2_FBUF_CAP_CHROMAKEY framebuffer-cap
-replace define V4L2_FBUF_CAP_LIST_CLIPPING framebuffer-cap
-replace define V4L2_FBUF_CAP_BITMAP_CLIPPING framebuffer-cap
-replace define V4L2_FBUF_CAP_LOCAL_ALPHA framebuffer-cap
-replace define V4L2_FBUF_CAP_GLOBAL_ALPHA framebuffer-cap
-replace define V4L2_FBUF_CAP_LOCAL_INV_ALPHA framebuffer-cap
-replace define V4L2_FBUF_CAP_SRC_CHROMAKEY framebuffer-cap
-
-replace define V4L2_FBUF_FLAG_PRIMARY framebuffer-flags
-replace define V4L2_FBUF_FLAG_OVERLAY framebuffer-flags
-replace define V4L2_FBUF_FLAG_CHROMAKEY framebuffer-flags
-replace define V4L2_FBUF_FLAG_LOCAL_ALPHA framebuffer-flags
-replace define V4L2_FBUF_FLAG_GLOBAL_ALPHA framebuffer-flags
-replace define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA framebuffer-flags
-replace define V4L2_FBUF_FLAG_SRC_CHROMAKEY framebuffer-flags
-
-# Used on VIDIOC_G_PARM
-
-replace define V4L2_MODE_HIGHQUALITY parm-flags
-replace define V4L2_CAP_TIMEPERFRAME v4l2-captureparm
-
-# The V4L2_STD_foo are all defined at v4l2_std_id table
-
-replace define V4L2_STD_PAL_B v4l2-std-id
-replace define V4L2_STD_PAL_B1 v4l2-std-id
-replace define V4L2_STD_PAL_G v4l2-std-id
-replace define V4L2_STD_PAL_H v4l2-std-id
-replace define V4L2_STD_PAL_I v4l2-std-id
-replace define V4L2_STD_PAL_D v4l2-std-id
-replace define V4L2_STD_PAL_D1 v4l2-std-id
-replace define V4L2_STD_PAL_K v4l2-std-id
-replace define V4L2_STD_PAL_M v4l2-std-id
-replace define V4L2_STD_PAL_N v4l2-std-id
-replace define V4L2_STD_PAL_Nc v4l2-std-id
-replace define V4L2_STD_PAL_60 v4l2-std-id
-replace define V4L2_STD_NTSC_M v4l2-std-id
-replace define V4L2_STD_NTSC_M_JP v4l2-std-id
-replace define V4L2_STD_NTSC_443 v4l2-std-id
-replace define V4L2_STD_NTSC_M_KR v4l2-std-id
-replace define V4L2_STD_SECAM_B v4l2-std-id
-replace define V4L2_STD_SECAM_D v4l2-std-id
-replace define V4L2_STD_SECAM_G v4l2-std-id
-replace define V4L2_STD_SECAM_H v4l2-std-id
-replace define V4L2_STD_SECAM_K v4l2-std-id
-replace define V4L2_STD_SECAM_K1 v4l2-std-id
-replace define V4L2_STD_SECAM_L v4l2-std-id
-replace define V4L2_STD_SECAM_LC v4l2-std-id
-replace define V4L2_STD_ATSC_8_VSB v4l2-std-id
-replace define V4L2_STD_ATSC_16_VSB v4l2-std-id
-replace define V4L2_STD_NTSC v4l2-std-id
-replace define V4L2_STD_SECAM_DK v4l2-std-id
-replace define V4L2_STD_SECAM v4l2-std-id
-replace define V4L2_STD_PAL_BG v4l2-std-id
-replace define V4L2_STD_PAL_DK v4l2-std-id
-replace define V4L2_STD_PAL v4l2-std-id
-replace define V4L2_STD_B v4l2-std-id
-replace define V4L2_STD_G v4l2-std-id
-replace define V4L2_STD_H v4l2-std-id
-replace define V4L2_STD_L v4l2-std-id
-replace define V4L2_STD_GH v4l2-std-id
-replace define V4L2_STD_DK v4l2-std-id
-replace define V4L2_STD_BG v4l2-std-id
-replace define V4L2_STD_MN v4l2-std-id
-replace define V4L2_STD_MTS v4l2-std-id
-replace define V4L2_STD_525_60 v4l2-std-id
-replace define V4L2_STD_625_50 v4l2-std-id
-replace define V4L2_STD_ATSC v4l2-std-id
-replace define V4L2_STD_UNKNOWN v4l2-std-id
-replace define V4L2_STD_ALL v4l2-std-id
-
-# V4L2 DT BT timings definitions
-
-replace define V4L2_DV_PROGRESSIVE v4l2-bt-timings
-replace define V4L2_DV_INTERLACED v4l2-bt-timings
-
-replace define V4L2_DV_VSYNC_POS_POL v4l2-bt-timings
-replace define V4L2_DV_HSYNC_POS_POL v4l2-bt-timings
-
-replace define V4L2_DV_BT_STD_CEA861 dv-bt-standards
-replace define V4L2_DV_BT_STD_DMT dv-bt-standards
-replace define V4L2_DV_BT_STD_CVT dv-bt-standards
-replace define V4L2_DV_BT_STD_GTF dv-bt-standards
-
-replace define V4L2_DV_FL_REDUCED_BLANKING dv-bt-standards
-replace define V4L2_DV_FL_CAN_REDUCE_FPS dv-bt-standards
-replace define V4L2_DV_FL_REDUCED_FPS dv-bt-standards
-replace define V4L2_DV_FL_HALF_LINE dv-bt-standards
-replace define V4L2_DV_FL_IS_CE_VIDEO dv-bt-standards
-
-replace define V4L2_DV_BT_656_1120 dv-timing-types
-
-replace define V4L2_DV_BT_CAP_INTERLACED framebuffer-cap
-replace define V4L2_DV_BT_CAP_PROGRESSIVE framebuffer-cap
-replace define V4L2_DV_BT_CAP_REDUCED_BLANKING framebuffer-cap
-replace define V4L2_DV_BT_CAP_CUSTOM framebuffer-cap
-
-# V4L2 input
-
-replace define V4L2_INPUT_TYPE_TUNER input-type
-replace define V4L2_INPUT_TYPE_CAMERA input-type
-
-replace define V4L2_IN_ST_NO_POWER input-status
-replace define V4L2_IN_ST_NO_SIGNAL input-status
-replace define V4L2_IN_ST_NO_COLOR input-status
-replace define V4L2_IN_ST_HFLIP input-status
-replace define V4L2_IN_ST_VFLIP input-status
-replace define V4L2_IN_ST_NO_H_LOCK input-status
-replace define V4L2_IN_ST_COLOR_KILL input-status
-replace define V4L2_IN_ST_NO_SYNC input-status
-replace define V4L2_IN_ST_NO_EQU input-status
-replace define V4L2_IN_ST_NO_CARRIER input-status
-replace define V4L2_IN_ST_MACROVISION input-status
-replace define V4L2_IN_ST_NO_ACCESS input-status
-replace define V4L2_IN_ST_VTR input-status
-
-replace define V4L2_IN_CAP_DV_TIMINGS input-capabilities
-replace define V4L2_IN_CAP_STD input-capabilities
-replace define V4L2_IN_CAP_NATIVE_SIZE input-capabilities
-
-# V4L2 output
-
-replace define V4L2_OUTPUT_TYPE_MODULATOR output-type
-replace define V4L2_OUTPUT_TYPE_ANALOG output-type
-replace define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY output-type
-
-replace define V4L2_OUT_CAP_DV_TIMINGS output-capabilities
-replace define V4L2_OUT_CAP_STD output-capabilities
-replace define V4L2_OUT_CAP_NATIVE_SIZE output-capabilities
-
-# V4L2 control flags
-
-replace define V4L2_CTRL_FLAG_DISABLED control-flags
-replace define V4L2_CTRL_FLAG_GRABBED control-flags
-replace define V4L2_CTRL_FLAG_READ_ONLY control-flags
-replace define V4L2_CTRL_FLAG_UPDATE control-flags
-replace define V4L2_CTRL_FLAG_INACTIVE control-flags
-replace define V4L2_CTRL_FLAG_SLIDER control-flags
-replace define V4L2_CTRL_FLAG_WRITE_ONLY control-flags
-replace define V4L2_CTRL_FLAG_VOLATILE control-flags
-replace define V4L2_CTRL_FLAG_HAS_PAYLOAD control-flags
-replace define V4L2_CTRL_FLAG_EXECUTE_ON_WRITE control-flags
-
-replace define V4L2_CTRL_FLAG_NEXT_CTRL control
-replace define V4L2_CTRL_FLAG_NEXT_COMPOUND control
-replace define V4L2_CID_PRIVATE_BASE control
-
-# V4L2 tuner
-
-replace define V4L2_TUNER_CAP_LOW tuner-capability
-replace define V4L2_TUNER_CAP_NORM tuner-capability
-replace define V4L2_TUNER_CAP_HWSEEK_BOUNDED tuner-capability
-replace define V4L2_TUNER_CAP_HWSEEK_WRAP tuner-capability
-replace define V4L2_TUNER_CAP_STEREO tuner-capability
-replace define V4L2_TUNER_CAP_LANG2 tuner-capability
-replace define V4L2_TUNER_CAP_SAP tuner-capability
-replace define V4L2_TUNER_CAP_LANG1 tuner-capability
-replace define V4L2_TUNER_CAP_RDS tuner-capability
-replace define V4L2_TUNER_CAP_RDS_BLOCK_IO tuner-capability
-replace define V4L2_TUNER_CAP_RDS_CONTROLS tuner-capability
-replace define V4L2_TUNER_CAP_FREQ_BANDS tuner-capability
-replace define V4L2_TUNER_CAP_HWSEEK_PROG_LIM tuner-capability
-replace define V4L2_TUNER_CAP_1HZ tuner-capability
-
-replace define V4L2_TUNER_SUB_MONO tuner-rxsubchans
-replace define V4L2_TUNER_SUB_STEREO tuner-rxsubchans
-replace define V4L2_TUNER_SUB_LANG2 tuner-rxsubchans
-replace define V4L2_TUNER_SUB_SAP tuner-rxsubchans
-replace define V4L2_TUNER_SUB_LANG1 tuner-rxsubchans
-replace define V4L2_TUNER_SUB_RDS tuner-rxsubchans
-
-replace define V4L2_TUNER_MODE_MONO tuner-audmode
-replace define V4L2_TUNER_MODE_STEREO tuner-audmode
-replace define V4L2_TUNER_MODE_LANG2 tuner-audmode
-replace define V4L2_TUNER_MODE_SAP tuner-audmode
-replace define V4L2_TUNER_MODE_LANG1 tuner-audmode
-replace define V4L2_TUNER_MODE_LANG1_LANG2 tuner-audmode
-
-replace define V4L2_BAND_MODULATION_VSB band-modulation
-replace define V4L2_BAND_MODULATION_FM band-modulation
-replace define V4L2_BAND_MODULATION_AM band-modulation
-
-replace define V4L2_RDS_BLOCK_MSK v4l2-rds-block
-replace define V4L2_RDS_BLOCK_A v4l2-rds-block
-replace define V4L2_RDS_BLOCK_B v4l2-rds-block
-replace define V4L2_RDS_BLOCK_C v4l2-rds-block
-replace define V4L2_RDS_BLOCK_D v4l2-rds-block
-replace define V4L2_RDS_BLOCK_C_ALT v4l2-rds-block
-replace define V4L2_RDS_BLOCK_INVALID v4l2-rds-block
-replace define V4L2_RDS_BLOCK_CORRECTED v4l2-rds-block
-replace define V4L2_RDS_BLOCK_ERROR v4l2-rds-block
-
-# V4L2 audio
-
-replace define V4L2_AUDCAP_STEREO audio-capability
-replace define V4L2_AUDCAP_AVL audio-capability
-
-replace define V4L2_AUDMODE_AVL audio-mode
-
-# MPEG
-
-replace define V4L2_ENC_IDX_FRAME_I v4l2-enc-idx
-replace define V4L2_ENC_IDX_FRAME_P v4l2-enc-idx
-replace define V4L2_ENC_IDX_FRAME_B v4l2-enc-idx
-replace define V4L2_ENC_IDX_FRAME_MASK v4l2-enc-idx
-replace define V4L2_ENC_IDX_ENTRIES v4l2-enc-idx
-
-replace define V4L2_ENC_CMD_START encoder-cmds
-replace define V4L2_ENC_CMD_STOP encoder-cmds
-replace define V4L2_ENC_CMD_PAUSE encoder-cmds
-replace define V4L2_ENC_CMD_RESUME encoder-cmds
-
-replace define V4L2_ENC_CMD_STOP_AT_GOP_END encoder-flags
-
-replace define V4L2_DEC_CMD_START decoder-cmds
-replace define V4L2_DEC_CMD_STOP decoder-cmds
-replace define V4L2_DEC_CMD_PAUSE decoder-cmds
-replace define V4L2_DEC_CMD_RESUME decoder-cmds
-
-replace define V4L2_DEC_CMD_START_MUTE_AUDIO decoder-cmds
-replace define V4L2_DEC_CMD_PAUSE_TO_BLACK decoder-cmds
-replace define V4L2_DEC_CMD_STOP_TO_BLACK decoder-cmds
-replace define V4L2_DEC_CMD_STOP_IMMEDIATELY decoder-cmds
-
-replace define V4L2_DEC_START_FMT_NONE decoder-cmds
-replace define V4L2_DEC_START_FMT_GOP decoder-cmds
-
-# V4L2 VBI
-
-replace define V4L2_VBI_UNSYNC vbifmt-flags
-replace define V4L2_VBI_INTERLACED vbifmt-flags
-
-replace define V4L2_VBI_ITU_525_F1_START v4l2-vbi-format
-replace define V4L2_VBI_ITU_525_F2_START v4l2-vbi-format
-replace define V4L2_VBI_ITU_625_F1_START v4l2-vbi-format
-replace define V4L2_VBI_ITU_625_F2_START v4l2-vbi-format
-
-
-replace define V4L2_SLICED_TELETEXT_B vbi-services
-replace define V4L2_SLICED_VPS vbi-services
-replace define V4L2_SLICED_CAPTION_525 vbi-services
-replace define V4L2_SLICED_WSS_625 vbi-services
-replace define V4L2_SLICED_VBI_525 vbi-services
-replace define V4L2_SLICED_VBI_625 vbi-services
-
-replace define V4L2_MPEG_VBI_IVTV_TELETEXT_B ITV0-Line-Identifier-Constants
-replace define V4L2_MPEG_VBI_IVTV_CAPTION_525 ITV0-Line-Identifier-Constants
-replace define V4L2_MPEG_VBI_IVTV_WSS_625 ITV0-Line-Identifier-Constants
-replace define V4L2_MPEG_VBI_IVTV_VPS ITV0-Line-Identifier-Constants
-
-replace define V4L2_MPEG_VBI_IVTV_MAGIC0 v4l2-mpeg-vbi-fmt-ivtv-magic
-replace define V4L2_MPEG_VBI_IVTV_MAGIC1 v4l2-mpeg-vbi-fmt-ivtv-magic
-
-# V4L2 events
-
-replace define V4L2_EVENT_ALL event-type
-replace define V4L2_EVENT_VSYNC event-type
-replace define V4L2_EVENT_EOS event-type
-replace define V4L2_EVENT_CTRL event-type
-replace define V4L2_EVENT_FRAME_SYNC event-type
-replace define V4L2_EVENT_SOURCE_CHANGE event-type
-replace define V4L2_EVENT_MOTION_DET event-type
-replace define V4L2_EVENT_PRIVATE_START event-type
-
-replace define V4L2_EVENT_CTRL_CH_VALUE ctrl-changes-flags
-replace define V4L2_EVENT_CTRL_CH_FLAGS ctrl-changes-flags
-replace define V4L2_EVENT_CTRL_CH_RANGE ctrl-changes-flags
-
-replace define V4L2_EVENT_SRC_CH_RESOLUTION src-changes-flags
-
-replace define V4L2_EVENT_MD_FL_HAVE_FRAME_SEQ v4l2-event-motion-det
-
-replace define V4L2_EVENT_SUB_FL_SEND_INITIAL event-flags
-replace define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK event-flags
-
-# V4L2 debugging
-replace define V4L2_CHIP_MATCH_BRIDGE vidioc_dbg_g_register
-replace define V4L2_CHIP_MATCH_SUBDEV vidioc_dbg_g_register
-replace define V4L2_CHIP_MATCH_HOST vidioc_dbg_g_register
-replace define V4L2_CHIP_MATCH_I2C_DRIVER vidioc_dbg_g_register
-replace define V4L2_CHIP_MATCH_I2C_ADDR vidioc_dbg_g_register
-replace define V4L2_CHIP_MATCH_AC97 vidioc_dbg_g_register
-
-replace define V4L2_CHIP_FL_READABLE vidioc_dbg_g_register
-replace define V4L2_CHIP_FL_WRITABLE vidioc_dbg_g_register
-
-# Ignore reserved ioctl and ancillary macros
-
-ignore define VIDEO_MAX_FRAME
-ignore define VIDEO_MAX_PLANES
-ignore define v4l2_fourcc
-ignore define v4l2_fourcc_be
-ignore define V4L2_FIELD_HAS_TOP
-ignore define V4L2_FIELD_HAS_BOTTOM
-ignore define V4L2_FIELD_HAS_BOTH
-ignore define V4L2_FIELD_HAS_T_OR_B
-ignore define V4L2_TYPE_IS_MULTIPLANAR
-ignore define V4L2_TYPE_IS_OUTPUT
-ignore define V4L2_TUNER_ADC
-ignore define V4L2_MAP_COLORSPACE_DEFAULT
-ignore define V4L2_MAP_XFER_FUNC_DEFAULT
-ignore define V4L2_MAP_YCBCR_ENC_DEFAULT
-ignore define V4L2_DV_BT_BLANKING_WIDTH
-ignore define V4L2_DV_BT_FRAME_WIDTH
-ignore define V4L2_DV_BT_BLANKING_HEIGHT
-ignore define V4L2_DV_BT_FRAME_HEIGHT
-ignore define V4L2_IN_CAP_CUSTOM_TIMINGS
-ignore define V4L2_CTRL_ID_MASK
-ignore define V4L2_CTRL_ID2CLASS
-ignore define V4L2_CTRL_ID2WHICH
-ignore define V4L2_CTRL_DRIVER_PRIV
-ignore define V4L2_CTRL_MAX_DIMS
-ignore define V4L2_CTRL_WHICH_CUR_VAL
-ignore define V4L2_CTRL_WHICH_DEF_VAL
-ignore define V4L2_OUT_CAP_CUSTOM_TIMINGS
-ignore define V4L2_CID_MAX_CTRLS
-
-ignore ioctl VIDIOC_RESERVED
-ignore define BASE_VIDIOC_PRIVATE
-
-# Associate ioctls with their counterparts
-replace ioctl VIDIOC_DBG_S_REGISTER vidioc_dbg_g_register
-replace ioctl VIDIOC_DQBUF vidioc_qbuf
-replace ioctl VIDIOC_S_AUDOUT vidioc_g_audout
-replace ioctl VIDIOC_S_CROP vidioc_g_crop
-replace ioctl VIDIOC_S_CTRL vidioc_g_ctrl
-replace ioctl VIDIOC_S_DV_TIMINGS vidioc_g_dv_timings
-replace ioctl VIDIOC_S_EDID vidioc_g_edid
-replace ioctl VIDIOC_S_EXT_CTRLS vidioc_g_ext_ctrls
-replace ioctl VIDIOC_S_FBUF vidioc_g_fbuf
-replace ioctl VIDIOC_S_FMT vidioc_g_fmt
-replace ioctl VIDIOC_S_FREQUENCY vidioc_g_frequency
-replace ioctl VIDIOC_S_INPUT vidioc_g_input
-replace ioctl VIDIOC_S_JPEGCOMP vidioc_g_jpegcomp
-replace ioctl VIDIOC_S_MODULATOR vidioc_g_modulator
-replace ioctl VIDIOC_S_OUTPUT vidioc_g_output
-replace ioctl VIDIOC_S_PARM vidioc_g_parm
-replace ioctl VIDIOC_S_PRIORITY vidioc_g_priority
-replace ioctl VIDIOC_S_SELECTION vidioc_g_selection
-replace ioctl VIDIOC_S_STD vidioc_g_std
-replace ioctl VIDIOC_S_AUDIO vidioc_g_audio
-replace ioctl VIDIOC_S_TUNER vidioc_g_tuner
-replace ioctl VIDIOC_TRY_DECODER_CMD vidioc_decoder_cmd
-replace ioctl VIDIOC_TRY_ENCODER_CMD vidioc_encoder_cmd
-replace ioctl VIDIOC_TRY_EXT_CTRLS vidioc_g_ext_ctrls
-replace ioctl VIDIOC_TRY_FMT vidioc_g_fmt
-replace ioctl VIDIOC_STREAMOFF vidioc_streamon
-replace ioctl VIDIOC_QUERY_EXT_CTRL vidioc_queryctrl
-replace ioctl VIDIOC_QUERYMENU vidioc_queryctrl
diff --git a/Documentation/sphinx/parse-headers.pl b/Documentation/sphinx/parse-headers.pl
index 74089b0..92324a5 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -9,10 +9,10 @@ use Text::Tabs;
 my $debug = 0;
 
 if (scalar @ARGV < 2 || scalar @ARGV > 3) {
-	die "Usage:\n\t$0 <file in> <file out> [<exceptions file>]\n";
+	die "Usage:\n\t$0 <file in> [<exceptions file>]\n";
 }
 
-my ($file_in, $file_out, $file_exceptions) = @ARGV;
+my ($file_in, $file_exceptions) = @ARGV;
 
 my $data;
 my %ioctls;
@@ -306,16 +306,13 @@ foreach my $r (keys %typedefs) {
 $data =~ s/\\ \n/\n/g;
 
 #
-# Generate output file
+# print generated content to stdout
 #
 
 my $title = $file_in;
 $title =~ s,.*/,,;
 
-open OUT, "> $file_out" or die "Can't open $file_out";
-print OUT ".. -*- coding: utf-8; mode: rst -*-\n\n";
-print OUT "$title\n";
-print OUT "=" x length($title);
-print OUT "\n\n.. parsed-literal::\n\n";
-print OUT $data;
-close OUT;
+print "$title\n";
+print "=" x length($title);
+print "\n\n.. parsed-literal::\n\n";
+print $data;
-- 
2.7.4


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

* [PATCH 4/4] doc-rst: remove the kernel-include directive
  2016-10-06  7:20 [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Markus Heiser
                   ` (2 preceding siblings ...)
  2016-10-06  7:20 ` [PATCH 3/4] doc-rst: migrated media build kernel-cmd directive Markus Heiser
@ 2016-10-06  7:20 ` Markus Heiser
  2016-10-06  8:42 ` [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Jani Nikula
  4 siblings, 0 replies; 32+ messages in thread
From: Markus Heiser @ 2016-10-06  7:20 UTC (permalink / raw)
  To: Jonathan Corbet, Mauro Carvalho Chehab, Jani Nikula
  Cc: Markus Heiser, Linux Media Mailing List, linux-doc

From: Markus Heiser <markus.heiser@darmarIT.de>

From: Markus Heiser <markus.heiser@darmarIT.de>

The kernel-include directive is no longer needed, so lets remove this
out-of-favor solution.

BTW: fixed a C&P typo in the Documentation/Makefile

Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de>
---
 Documentation/Makefile.sphinx          |   2 +-
 Documentation/conf.py                  |   2 +-
 Documentation/sphinx/kernel_include.py | 190 ---------------------------------
 3 files changed, 2 insertions(+), 192 deletions(-)
 delete mode 100755 Documentation/sphinx/kernel_include.py

diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 2e033e4..36b8c41 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -51,7 +51,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1))
 # $5 reST source folder relative to $(srctree)/$(src),
 #    e.g. "media" for the linux-tv book-set at ./Documentation/media
 
-quiet_cmd_sphinx = SPHINX  $@ --> file://$(abspath $(BUILDDIR)/$3/$4);
+quiet_cmd_sphinx = SPHINX  $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
       cmd_sphinx = \
 	BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
 	$(SPHINXBUILD) \
diff --git a/Documentation/conf.py b/Documentation/conf.py
index 64231e1..a165b53 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -34,7 +34,7 @@ from load_config import loadConfig
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
-extensions = ['kernel-doc', 'rstFlatTable', 'kernel_include', 'cdomain', 'kernel_cmd']
+extensions = ['kernel-doc', 'rstFlatTable', 'cdomain', 'kernel_cmd']
 
 # The name of the math extension changed on Sphinx 1.4
 if minor > 3:
diff --git a/Documentation/sphinx/kernel_include.py b/Documentation/sphinx/kernel_include.py
deleted file mode 100755
index f523aa6..0000000
--- a/Documentation/sphinx/kernel_include.py
+++ /dev/null
@@ -1,190 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8; mode: python -*-
-# pylint: disable=R0903, C0330, R0914, R0912, E0401
-
-u"""
-    kernel-include
-    ~~~~~~~~~~~~~~
-
-    Implementation of the ``kernel-include`` reST-directive.
-
-    :copyright:  Copyright (C) 2016  Markus Heiser
-    :license:    GPL Version 2, June 1991 see linux/COPYING for details.
-
-    The ``kernel-include`` reST-directive is a replacement for the ``include``
-    directive. The ``kernel-include`` directive expand environment variables in
-    the path name and allows to include files from arbitrary locations.
-
-    .. hint::
-
-      Including files from arbitrary locations (e.g. from ``/etc``) is a
-      security risk for builders. This is why the ``include`` directive from
-      docutils *prohibit* pathnames pointing to locations *above* the filesystem
-      tree where the reST document with the include directive is placed.
-
-    Substrings of the form $name or ${name} are replaced by the value of
-    environment variable name. Malformed variable names and references to
-    non-existing variables are left unchanged.
-"""
-
-# ==============================================================================
-# imports
-# ==============================================================================
-
-import os.path
-
-from docutils import io, nodes, statemachine
-from docutils.utils.error_reporting import SafeString, ErrorString
-from docutils.parsers.rst import directives
-from docutils.parsers.rst.directives.body import CodeBlock, NumberLines
-from docutils.parsers.rst.directives.misc import Include
-
-__version__  = '1.0'
-
-# ==============================================================================
-def setup(app):
-# ==============================================================================
-
-    app.add_directive("kernel-include", KernelInclude)
-    return dict(
-        version = __version__,
-        parallel_read_safe = True,
-        parallel_write_safe = True
-    )
-
-# ==============================================================================
-class KernelInclude(Include):
-# ==============================================================================
-
-    u"""KernelInclude (``kernel-include``) directive"""
-
-    def run(self):
-        path = os.path.realpath(
-            os.path.expandvars(self.arguments[0]))
-
-        # to get a bit security back, prohibit /etc:
-        if path.startswith(os.sep + "etc"):
-            raise self.severe(
-                'Problems with "%s" directive, prohibited path: %s'
-                % (self.name, path))
-
-        self.arguments[0] = path
-
-        #return super(KernelInclude, self).run() # won't work, see HINTs in _run()
-        return self._run()
-
-    def _run(self):
-        """Include a file as part of the content of this reST file."""
-
-        # HINT: I had to copy&paste the whole Include.run method. I'am not happy
-        # with this, but due to security reasons, the Include.run method does
-        # not allow absolute or relative pathnames pointing to locations *above*
-        # the filesystem tree where the reST document is placed.
-
-        if not self.state.document.settings.file_insertion_enabled:
-            raise self.warning('"%s" directive disabled.' % self.name)
-        source = self.state_machine.input_lines.source(
-            self.lineno - self.state_machine.input_offset - 1)
-        source_dir = os.path.dirname(os.path.abspath(source))
-        path = directives.path(self.arguments[0])
-        if path.startswith('<') and path.endswith('>'):
-            path = os.path.join(self.standard_include_path, path[1:-1])
-        path = os.path.normpath(os.path.join(source_dir, path))
-
-        # HINT: this is the only line I had to change / commented out:
-        #path = utils.relative_path(None, path)
-
-        path = nodes.reprunicode(path)
-        encoding = self.options.get(
-            'encoding', self.state.document.settings.input_encoding)
-        e_handler=self.state.document.settings.input_encoding_error_handler
-        tab_width = self.options.get(
-            'tab-width', self.state.document.settings.tab_width)
-        try:
-            self.state.document.settings.record_dependencies.add(path)
-            include_file = io.FileInput(source_path=path,
-                                        encoding=encoding,
-                                        error_handler=e_handler)
-        except UnicodeEncodeError as error:
-            raise self.severe('Problems with "%s" directive path:\n'
-                              'Cannot encode input file path "%s" '
-                              '(wrong locale?).' %
-                              (self.name, SafeString(path)))
-        except IOError as error:
-            raise self.severe('Problems with "%s" directive path:\n%s.' %
-                      (self.name, ErrorString(error)))
-        startline = self.options.get('start-line', None)
-        endline = self.options.get('end-line', None)
-        try:
-            if startline or (endline is not None):
-                lines = include_file.readlines()
-                rawtext = ''.join(lines[startline:endline])
-            else:
-                rawtext = include_file.read()
-        except UnicodeError as error:
-            raise self.severe('Problem with "%s" directive:\n%s' %
-                              (self.name, ErrorString(error)))
-        # start-after/end-before: no restrictions on newlines in match-text,
-        # and no restrictions on matching inside lines vs. line boundaries
-        after_text = self.options.get('start-after', None)
-        if after_text:
-            # skip content in rawtext before *and incl.* a matching text
-            after_index = rawtext.find(after_text)
-            if after_index < 0:
-                raise self.severe('Problem with "start-after" option of "%s" '
-                                  'directive:\nText not found.' % self.name)
-            rawtext = rawtext[after_index + len(after_text):]
-        before_text = self.options.get('end-before', None)
-        if before_text:
-            # skip content in rawtext after *and incl.* a matching text
-            before_index = rawtext.find(before_text)
-            if before_index < 0:
-                raise self.severe('Problem with "end-before" option of "%s" '
-                                  'directive:\nText not found.' % self.name)
-            rawtext = rawtext[:before_index]
-
-        include_lines = statemachine.string2lines(rawtext, tab_width,
-                                                  convert_whitespace=True)
-        if 'literal' in self.options:
-            # Convert tabs to spaces, if `tab_width` is positive.
-            if tab_width >= 0:
-                text = rawtext.expandtabs(tab_width)
-            else:
-                text = rawtext
-            literal_block = nodes.literal_block(rawtext, source=path,
-                                    classes=self.options.get('class', []))
-            literal_block.line = 1
-            self.add_name(literal_block)
-            if 'number-lines' in self.options:
-                try:
-                    startline = int(self.options['number-lines'] or 1)
-                except ValueError:
-                    raise self.error(':number-lines: with non-integer '
-                                     'start value')
-                endline = startline + len(include_lines)
-                if text.endswith('\n'):
-                    text = text[:-1]
-                tokens = NumberLines([([], text)], startline, endline)
-                for classes, value in tokens:
-                    if classes:
-                        literal_block += nodes.inline(value, value,
-                                                      classes=classes)
-                    else:
-                        literal_block += nodes.Text(value, value)
-            else:
-                literal_block += nodes.Text(text, text)
-            return [literal_block]
-        if 'code' in self.options:
-            self.options['source'] = path
-            codeblock = CodeBlock(self.name,
-                                  [self.options.pop('code')], # arguments
-                                  self.options,
-                                  include_lines, # content
-                                  self.lineno,
-                                  self.content_offset,
-                                  self.block_text,
-                                  self.state,
-                                  self.state_machine)
-            return codeblock.run()
-        self.state_machine.insert_input(include_lines, path)
-        return []
-- 
2.7.4


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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-06  7:20 [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Markus Heiser
                   ` (3 preceding siblings ...)
  2016-10-06  7:20 ` [PATCH 4/4] doc-rst: remove the kernel-include directive Markus Heiser
@ 2016-10-06  8:42 ` Jani Nikula
  2016-10-06 13:31   ` Mauro Carvalho Chehab
  4 siblings, 1 reply; 32+ messages in thread
From: Jani Nikula @ 2016-10-06  8:42 UTC (permalink / raw)
  To: Markus Heiser, Jonathan Corbet, Mauro Carvalho Chehab
  Cc: Markus Heiser, Linux Media Mailing List, linux-doc

On Thu, 06 Oct 2016, Markus Heiser <markus.heiser@darmarit.de> wrote:
> with this series a reST-directive kernel-cmd is introduced. The kernel-cmd
> directive includes contend from the stdout of a command-line (@mchehab asked
> for).

I like the fact that this removes Documentation/media/Makefile, and
cleans up the Sphinx build rule in Documentation/Makefile.sphinx. Does
this also make the documentation buildable with sphinx-build directly,
without the kernel build system? If so, great.

However, I would have much preferred the approach I proposed months ago,
having the extension itself do specifically what parse-headers.pl does
now. While it may seem generic on the surface, I don't think it's a
clean or a secure approach to allow running of arbitrary scripts from
PATH while building documentation. It's certainly not an approach that
should be encouraged.

In part, the reason the DocBook build became so unwieldy was the
proliferation of arbitrary scripts and tools required to make it
happen. I think it would be really sad to let this happen to the Sphinx
build. I am *already* sad about how parse-headers.pl was bolted on to
the build.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center

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

* Re: [PATCH 3/4] doc-rst: migrated media build kernel-cmd directive
  2016-10-06  7:20 ` [PATCH 3/4] doc-rst: migrated media build kernel-cmd directive Markus Heiser
@ 2016-10-06 11:46   ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-06 11:46 UTC (permalink / raw)
  To: Markus Heiser
  Cc: Jonathan Corbet, Jani Nikula, Linux Media Mailing List, linux-doc

Em Thu,  6 Oct 2016 09:20:19 +0200
Markus Heiser <markus.heiser@darmarit.de> escreveu:

> From: Markus Heiser <markus.heiser@darmarIT.de>
> 
> From: Markus Heiser <markus.heiser@darmarIT.de>
> 
> Remove the media-Makefile and migrate the ``.. kernel-include::``
> directive to the new ``.. kernel-cmd::`` directive.
> 
> To avoid breaking bisect, this patch includes the required changes to
> the implementation (script ``parse-headers.pl``) and the content (*.rst
> files).

It is a way easier to review this patch if you do a diff with the
-M option, as below.

---

doc-rst: migrated media build kernel-cmd directive

From: Markus Heiser <markus.heiser@darmarIT.de>

Remove the media-Makefile and migrate the ``.. kernel-include::``
directive to the new ``.. kernel-cmd::`` directive.

To avoid breaking bisect, this patch includes the required changes to
the implementation (script ``parse-headers.pl``) and the content (*.rst
files).

Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de>

 Documentation/Makefile.sphinx                      |  2 +-
 Documentation/media/Makefile                       | 61 ----------------------
 Documentation/media/uapi/cec/cec-header.rst        |  3 +-
 .../cec/cec.h.exceptions}                          |  0
 .../dvb/audio.h.exceptions}                        |  0
 Documentation/media/uapi/dvb/audio_h.rst           |  2 +-
 .../dvb/ca.h.exceptions}                           |  0
 Documentation/media/uapi/dvb/ca_h.rst              |  2 +-
 .../dvb/dmx.h.exceptions}                          |  0
 Documentation/media/uapi/dvb/dmx_h.rst             |  2 +-
 .../dvb/frontend.h.exceptions}                     |  0
 Documentation/media/uapi/dvb/frontend_h.rst        |  2 +-
 .../dvb/net.h.exceptions}                          |  0
 Documentation/media/uapi/dvb/net_h.rst             |  2 +-
 .../dvb/video.h.exceptions}                        |  0
 Documentation/media/uapi/dvb/video_h.rst           |  2 +-
 Documentation/media/uapi/mediactl/media-header.rst |  3 +-
 .../mediactl/media.h.exceptions}                   |  0
 Documentation/media/uapi/rc/lirc-header.rst        |  2 +-
 .../rc/lirc.h.exceptions}                          |  0
 Documentation/media/uapi/v4l/videodev.rst          |  2 +-
 .../v4l/videodev2.h.exceptions}                    |  0
 Documentation/sphinx/parse-headers.pl              | 17 +++---
 23 files changed, 18 insertions(+), 84 deletions(-)


diff --git a/Documentation/Makefile.sphinx b/Documentation/Makefile.sphinx
index 92deea30b183..2e033e4e0e60 100644
--- a/Documentation/Makefile.sphinx
+++ b/Documentation/Makefile.sphinx
@@ -52,7 +52,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1))
 #    e.g. "media" for the linux-tv book-set at ./Documentation/media
 
 quiet_cmd_sphinx = SPHINX  $@ --> file://$(abspath $(BUILDDIR)/$3/$4);
-      cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media all;\
+      cmd_sphinx = \
 	BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
 	$(SPHINXBUILD) \
 	-b $2 \
diff --git a/Documentation/media/Makefile b/Documentation/media/Makefile
deleted file mode 100644
index a7fb35291f6c..000000000000
--- a/Documentation/media/Makefile
+++ /dev/null
@@ -1,61 +0,0 @@
-# Generate the *.h.rst files from uAPI headers
-
-PARSER = $(srctree)/Documentation/sphinx/parse-headers.pl
-UAPI = $(srctree)/include/uapi/linux
-KAPI = $(srctree)/include/linux
-SRC_DIR=$(srctree)/Documentation/media
-
-FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
-	  videodev2.h.rst media.h.rst cec.h.rst lirc.h.rst
-
-TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
-
-.PHONY: all
-all: $(BUILDDIR) ${TARGETS}
-
-$(BUILDDIR):
-	$(Q)mkdir -p $@
-
-# Rule to convert a .h file to inline RST documentation
-
-gen_rst = \
-	echo ${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions; \
-	${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
-
-quiet_gen_rst = echo '  PARSE   $(patsubst $(srctree)/%,%,$<)'; \
-	${PARSER} $< $@ $(SRC_DIR)/$(notdir $@).exceptions
-
-silent_gen_rst = ${gen_rst}
-
-$(BUILDDIR)/audio.h.rst: ${UAPI}/dvb/audio.h ${PARSER} $(SRC_DIR)/audio.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/ca.h.rst: ${UAPI}/dvb/ca.h ${PARSER} $(SRC_DIR)/ca.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/dmx.h.rst: ${UAPI}/dvb/dmx.h ${PARSER} $(SRC_DIR)/dmx.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/frontend.h.rst: ${UAPI}/dvb/frontend.h ${PARSER} $(SRC_DIR)/frontend.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/net.h.rst: ${UAPI}/dvb/net.h ${PARSER} $(SRC_DIR)/net.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/video.h.rst: ${UAPI}/dvb/video.h ${PARSER} $(SRC_DIR)/video.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/videodev2.h.rst: ${UAPI}/videodev2.h ${PARSER} $(SRC_DIR)/videodev2.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/media.h.rst: ${UAPI}/media.h ${PARSER} $(SRC_DIR)/media.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/cec.h.rst: ${KAPI}/cec.h ${PARSER} $(SRC_DIR)/cec.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-$(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exceptions
-	@$($(quiet)gen_rst)
-
-cleandocs:
-	-rm ${TARGETS}
diff --git a/Documentation/media/uapi/cec/cec-header.rst b/Documentation/media/uapi/cec/cec-header.rst
index d5a9a2828274..c50cf7ff7892 100644
--- a/Documentation/media/uapi/cec/cec-header.rst
+++ b/Documentation/media/uapi/cec/cec-header.rst
@@ -6,5 +6,4 @@
 CEC Header File
 ***************
 
-.. kernel-include:: $BUILDDIR/cec.h.rst
-
+.. kernel-cmd:: parse-headers.pl $srctree/include/linux/cec.h  cec.h.exceptions
diff --git a/Documentation/media/cec.h.rst.exceptions b/Documentation/media/uapi/cec/cec.h.exceptions
similarity index 100%
rename from Documentation/media/cec.h.rst.exceptions
rename to Documentation/media/uapi/cec/cec.h.exceptions
diff --git a/Documentation/media/audio.h.rst.exceptions b/Documentation/media/uapi/dvb/audio.h.exceptions
similarity index 100%
rename from Documentation/media/audio.h.rst.exceptions
rename to Documentation/media/uapi/dvb/audio.h.exceptions
diff --git a/Documentation/media/uapi/dvb/audio_h.rst b/Documentation/media/uapi/dvb/audio_h.rst
index e00c3010fdf9..8d9eff2ac236 100644
--- a/Documentation/media/uapi/dvb/audio_h.rst
+++ b/Documentation/media/uapi/dvb/audio_h.rst
@@ -6,4 +6,4 @@
 DVB Audio Header File
 *********************
 
-.. kernel-include:: $BUILDDIR/audio.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/audio.h audio.h.exceptions
diff --git a/Documentation/media/ca.h.rst.exceptions b/Documentation/media/uapi/dvb/ca.h.exceptions
similarity index 100%
rename from Documentation/media/ca.h.rst.exceptions
rename to Documentation/media/uapi/dvb/ca.h.exceptions
diff --git a/Documentation/media/uapi/dvb/ca_h.rst b/Documentation/media/uapi/dvb/ca_h.rst
index f513592ef529..57d47de8518a 100644
--- a/Documentation/media/uapi/dvb/ca_h.rst
+++ b/Documentation/media/uapi/dvb/ca_h.rst
@@ -6,4 +6,4 @@
 DVB Conditional Access Header File
 **********************************
 
-.. kernel-include:: $BUILDDIR/ca.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/ca.h ca.h.exceptions
diff --git a/Documentation/media/dmx.h.rst.exceptions b/Documentation/media/uapi/dvb/dmx.h.exceptions
similarity index 100%
rename from Documentation/media/dmx.h.rst.exceptions
rename to Documentation/media/uapi/dvb/dmx.h.exceptions
diff --git a/Documentation/media/uapi/dvb/dmx_h.rst b/Documentation/media/uapi/dvb/dmx_h.rst
index 4fd1704a0833..90f965be979c 100644
--- a/Documentation/media/uapi/dvb/dmx_h.rst
+++ b/Documentation/media/uapi/dvb/dmx_h.rst
@@ -6,4 +6,4 @@
 DVB Demux Header File
 *********************
 
-.. kernel-include:: $BUILDDIR/dmx.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/dmx.h dmx.h.exceptions
diff --git a/Documentation/media/frontend.h.rst.exceptions b/Documentation/media/uapi/dvb/frontend.h.exceptions
similarity index 100%
rename from Documentation/media/frontend.h.rst.exceptions
rename to Documentation/media/uapi/dvb/frontend.h.exceptions
diff --git a/Documentation/media/uapi/dvb/frontend_h.rst b/Documentation/media/uapi/dvb/frontend_h.rst
index 15fca04d1c32..84a064f12fc8 100644
--- a/Documentation/media/uapi/dvb/frontend_h.rst
+++ b/Documentation/media/uapi/dvb/frontend_h.rst
@@ -6,4 +6,4 @@
 DVB Frontend Header File
 ************************
 
-.. kernel-include:: $BUILDDIR/frontend.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/frontend.h frontend.h.exceptions
diff --git a/Documentation/media/net.h.rst.exceptions b/Documentation/media/uapi/dvb/net.h.exceptions
similarity index 100%
rename from Documentation/media/net.h.rst.exceptions
rename to Documentation/media/uapi/dvb/net.h.exceptions
diff --git a/Documentation/media/uapi/dvb/net_h.rst b/Documentation/media/uapi/dvb/net_h.rst
index 7bcf5ba9d1eb..34ed22b09677 100644
--- a/Documentation/media/uapi/dvb/net_h.rst
+++ b/Documentation/media/uapi/dvb/net_h.rst
@@ -6,4 +6,4 @@
 DVB Network Header File
 ***********************
 
-.. kernel-include:: $BUILDDIR/net.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/net.h net.h.exceptions
diff --git a/Documentation/media/video.h.rst.exceptions b/Documentation/media/uapi/dvb/video.h.exceptions
similarity index 100%
rename from Documentation/media/video.h.rst.exceptions
rename to Documentation/media/uapi/dvb/video.h.exceptions
diff --git a/Documentation/media/uapi/dvb/video_h.rst b/Documentation/media/uapi/dvb/video_h.rst
index 3f39b0c4879c..c17b23e348a1 100644
--- a/Documentation/media/uapi/dvb/video_h.rst
+++ b/Documentation/media/uapi/dvb/video_h.rst
@@ -6,4 +6,4 @@
 DVB Video Header File
 *********************
 
-.. kernel-include:: $BUILDDIR/video.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/dvb/video.h video.h.exceptions
diff --git a/Documentation/media/uapi/mediactl/media-header.rst b/Documentation/media/uapi/mediactl/media-header.rst
index 96f7b0155e5a..27fe91dd7606 100644
--- a/Documentation/media/uapi/mediactl/media-header.rst
+++ b/Documentation/media/uapi/mediactl/media-header.rst
@@ -6,5 +6,4 @@
 Media Controller Header File
 ****************************
 
-.. kernel-include:: $BUILDDIR/media.h.rst
-
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/media.h media.h.exceptions
diff --git a/Documentation/media/media.h.rst.exceptions b/Documentation/media/uapi/mediactl/media.h.exceptions
similarity index 100%
rename from Documentation/media/media.h.rst.exceptions
rename to Documentation/media/uapi/mediactl/media.h.exceptions
diff --git a/Documentation/media/uapi/rc/lirc-header.rst b/Documentation/media/uapi/rc/lirc-header.rst
index 487fe00e5517..923f10f7f156 100644
--- a/Documentation/media/uapi/rc/lirc-header.rst
+++ b/Documentation/media/uapi/rc/lirc-header.rst
@@ -6,5 +6,5 @@
 LIRC Header File
 ****************
 
-.. kernel-include:: $BUILDDIR/lirc.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/lirc.h lirc.h.exceptions
 
diff --git a/Documentation/media/lirc.h.rst.exceptions b/Documentation/media/uapi/rc/lirc.h.exceptions
similarity index 100%
rename from Documentation/media/lirc.h.rst.exceptions
rename to Documentation/media/uapi/rc/lirc.h.exceptions
diff --git a/Documentation/media/uapi/v4l/videodev.rst b/Documentation/media/uapi/v4l/videodev.rst
index b9ee4672d639..6b36447e5f05 100644
--- a/Documentation/media/uapi/v4l/videodev.rst
+++ b/Documentation/media/uapi/v4l/videodev.rst
@@ -6,4 +6,4 @@
 Video For Linux Two Header File
 *******************************
 
-.. kernel-include:: $BUILDDIR/videodev2.h.rst
+.. kernel-cmd:: parse-headers.pl $srctree/include/uapi/linux/videodev2.h videodev2.h.exceptions
diff --git a/Documentation/media/videodev2.h.rst.exceptions b/Documentation/media/uapi/v4l/videodev2.h.exceptions
similarity index 100%
rename from Documentation/media/videodev2.h.rst.exceptions
rename to Documentation/media/uapi/v4l/videodev2.h.exceptions
diff --git a/Documentation/sphinx/parse-headers.pl b/Documentation/sphinx/parse-headers.pl
index 74089b0da798..92324a588879 100755
--- a/Documentation/sphinx/parse-headers.pl
+++ b/Documentation/sphinx/parse-headers.pl
@@ -9,10 +9,10 @@ use Text::Tabs;
 my $debug = 0;
 
 if (scalar @ARGV < 2 || scalar @ARGV > 3) {
-	die "Usage:\n\t$0 <file in> <file out> [<exceptions file>]\n";
+	die "Usage:\n\t$0 <file in> [<exceptions file>]\n";
 }
 
-my ($file_in, $file_out, $file_exceptions) = @ARGV;
+my ($file_in, $file_exceptions) = @ARGV;
 
 my $data;
 my %ioctls;
@@ -306,16 +306,13 @@ foreach my $r (keys %typedefs) {
 $data =~ s/\\ \n/\n/g;
 
 #
-# Generate output file
+# print generated content to stdout
 #
 
 my $title = $file_in;
 $title =~ s,.*/,,;
 
-open OUT, "> $file_out" or die "Can't open $file_out";
-print OUT ".. -*- coding: utf-8; mode: rst -*-\n\n";
-print OUT "$title\n";
-print OUT "=" x length($title);
-print OUT "\n\n.. parsed-literal::\n\n";
-print OUT $data;
-close OUT;
+print "$title\n";
+print "=" x length($title);
+print "\n\n.. parsed-literal::\n\n";
+print $data;

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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-06  8:42 ` [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Jani Nikula
@ 2016-10-06 13:31   ` Mauro Carvalho Chehab
  2016-10-06 14:21     ` Jani Nikula
  0 siblings, 1 reply; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-06 13:31 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Markus Heiser, Jonathan Corbet, Linux Media Mailing List, linux-doc

Em Thu, 06 Oct 2016 11:42:14 +0300
Jani Nikula <jani.nikula@intel.com> escreveu:

> On Thu, 06 Oct 2016, Markus Heiser <markus.heiser@darmarit.de> wrote:
> > with this series a reST-directive kernel-cmd is introduced. The kernel-cmd
> > directive includes contend from the stdout of a command-line (@mchehab asked
> > for).  

Ok, I ran some tests here and it works as expected.

> I like the fact that this removes Documentation/media/Makefile, and
> cleans up the Sphinx build rule in Documentation/Makefile.sphinx.

Yeah, that sounds great.

> Does
> this also make the documentation buildable with sphinx-build directly,
> without the kernel build system? If so, great.

I guess it probably allows that, if you include the extension on
some other tree.

Just curious here: what use case do you see by building the Kernel
documentation without the Kernel tree?

> However, I would have much preferred the approach I proposed months ago,
> having the extension itself do specifically what parse-headers.pl does
> now. While it may seem generic on the surface, I don't think it's a
> clean or a secure approach to allow running of arbitrary scripts from
> PATH while building documentation. It's certainly not an approach that
> should be encouraged.

Sorry, but I disagree. The security threat of having a random command
doing something wrong is the same as we already have with the Kernel
Makefiles, as they can also run a random command. All it is needed
is to add this to a Makefile:

subdir-y                     += run_some_evil_cmd

If we accept the fact that we do need to run commands when running "make",
it doesn't really matter if such command is at a makefile, inside a 
perl/python script or called via some Sphinx directive. In all cases,
patches need to be reviewed by the community, to be sure that they won't
introduce any vulnerabilities.

Btw, with regards to security, a way bigger threat is if someone
introduces a vulnerable code inside the Kernel code, as this will
affect a lot more systems than a vulnerability at the documentation
build process.

Yet, if you think security is still a high risk, my suggestion
would be to restrict the kernel-cmd script to only run scripts
inside trusted places, like Documentation/sphinx.


-

The real issue here is that Sphinx itself doesn't provide what
it is needed to build the Kernel documentation. Some extra
scripts are required. Right now, we converted maybe 5% of the
documentation to ReST, and we're using running two perl scripts:
	- kernel-doc
	- parse-headers.pl

We also identified that, if we want to add the MAINTAINERS file to
some documentation (or a parsed version of it), we would need an extra
script to filter it[1].

I can think on other use cases to run such scripts[2].

What I'm saying is that, we can keep adding a Sphinx-specific
extension for every such needs, with will result in code duplication
and will make harder to maintain it, or we can use a generic
solution like this kernel-cmd extension.

IMO, a generic solution is a way better, as it sounds easier to
maintain.

Regards,
Mauro

[1] https://git.linuxtv.org/mchehab/experimental.git/commit/?h=lkml-books&id=c8b07684c0278d7f9d0e30f575eb4be3a2da4c3b

[2] There's another possible usecase, with I'm not convinced yet
whether should be addressed or not.

At the media subsystem, we use 8 out-of-tree scripts that update
the list of supported USB and PCI media boards, e. g. the files under:
	Documentation/media/v4l-drivers/*cardlist.rst

Such scripts used to be part of the mercurial tree, before we moved the 
media development to git, like this one:
	https://linuxtv.org/hg/v4l-dvb/file/3724e93f7af5/v4l/scripts/bttv.pl

Currently, I'm using a local fork of the old scripts, and, when I
notice a patch for a driver with a cardlist, if I remember, I run the
scripts to add to update the cardlists. While it could be kept
OOT forever, if moved it to the Kernel tree,  the documentation will 
always reflect the Kernel status, with is, IMHO, a good thing.

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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-06 13:31   ` Mauro Carvalho Chehab
@ 2016-10-06 14:21     ` Jani Nikula
  2016-10-06 16:50       ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 32+ messages in thread
From: Jani Nikula @ 2016-10-06 14:21 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Markus Heiser, Jonathan Corbet, Linux Media Mailing List, linux-doc

On Thu, 06 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
> Em Thu, 06 Oct 2016 11:42:14 +0300
> Jani Nikula <jani.nikula@intel.com> escreveu:
> Just curious here: what use case do you see by building the Kernel
> documentation without the Kernel tree?

Not without the kernel tree, but without the kernel build system. If
sphinx-build works directly, https://readthedocs.org/ just works when
you point it at a kernel git repo and the conf.py inside it.

It would be important to get Sphinx working over at
https://www.kernel.org/doc/htmldocs/ (which still looks kind of sad) but
in the mean time we could have had that at https://readthedocs.org/. If
it weren't for parse-headers.pl and the build hacks around it.

At least there's one at https://01.org/linuxgraphics/gfx-docs/drm/ now.

>> However, I would have much preferred the approach I proposed months ago,
>> having the extension itself do specifically what parse-headers.pl does
>> now. While it may seem generic on the surface, I don't think it's a
>> clean or a secure approach to allow running of arbitrary scripts from
>> PATH while building documentation. It's certainly not an approach that
>> should be encouraged.
>
> Sorry, but I disagree. The security threat of having a random command
> doing something wrong is the same as we already have with the Kernel
> Makefiles, as they can also run a random command. All it is needed
> is to add this to a Makefile:

My intention was to emphasize the importance of the clarity of the
documentation build, and not get hung up on the security aspect.

This is connected to the above: keeping documentation buildable with
sphinx-build directly will force you to avoid the Makefile hacks.

> IMO, a generic solution is a way better, as it sounds easier to
> maintain.

We've seen what happens when we make it easy to add random scripts to
build documentation. We've worked hard to get rid of that. In my books,
one of the bigger points in favor of Sphinx over AsciiDoc(tor) was
getting rid of all the hacks required in the build. Things that broke in
subtle ways.

I think having people write Sphinx extensions for the special needs have
a better chance of solving the problems in more generic ways than
writing scripts for each specific need. Ideally, we can push those
extensions to upstream Sphinx, but at least make them easily usable
across the kernel documentation.

Case in point, parse-headers.pl was added for a specific need of media
documentation, and for the life of me I can't figure out by reading the
script what good, if any, it would be for gpu documentation. I call
*that* unmaintainable.


BR,
Jani.

-- 
Jani Nikula, Intel Open Source Technology Center

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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-06 14:21     ` Jani Nikula
@ 2016-10-06 16:50       ` Mauro Carvalho Chehab
  2016-10-07  5:56         ` Jani Nikula
  0 siblings, 1 reply; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-06 16:50 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Markus Heiser, Jonathan Corbet, Linux Media Mailing List, linux-doc

Em Thu, 06 Oct 2016 17:21:36 +0300
Jani Nikula <jani.nikula@intel.com> escreveu:

> On Thu, 06 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
> > Em Thu, 06 Oct 2016 11:42:14 +0300
> > Jani Nikula <jani.nikula@intel.com> escreveu:
> > Just curious here: what use case do you see by building the Kernel
> > documentation without the Kernel tree?  
> 
> Not without the kernel tree, but without the kernel build system. If
> sphinx-build works directly, https://readthedocs.org/ just works when
> you point it at a kernel git repo and the conf.py inside it.
> 
> It would be important to get Sphinx working over at
> https://www.kernel.org/doc/htmldocs/ (which still looks kind of sad) but
> in the mean time we could have had that at https://readthedocs.org/. If
> it weren't for parse-headers.pl and the build hacks around it.

I'm not sure how readthedocs.org work, but if it doesn't use the
extensions inside the git tree, it won't work anyway, and if it uses,
it will run the right scripts, including kernel-doc and parse-headers.pl,
if our tree would contain kernel-cmd or a parse-headers extension.

In the specific case of kernel.org, fixing it to produce all docs
is likely just a matter of installing Sphinx there and be sure that
the documentation will be generated at the right place, like at an
output dir inside https://www.kernel.org/doc/Documentation/. 

I guess we could talk to kernel.org maintainers asking them to do that
for us.

It probably makes sense to create a global index.html file that will
point to both html DocBook and Sphinx output dirs, while we there are
still some DocBook files somewhere - or to finish their conversion for
Kernel 4.10.

> At least there's one at https://01.org/linuxgraphics/gfx-docs/drm/ now.

Good! We can also host a complete Sphinx output at linuxtv.org if 
worth. I'll likely do it anyway, in order to point to the user and
development-process books once we merge those patches, in order to do
some cleanup at the linux media wiki pages there.

> >> However, I would have much preferred the approach I proposed months ago,
> >> having the extension itself do specifically what parse-headers.pl does
> >> now. While it may seem generic on the surface, I don't think it's a
> >> clean or a secure approach to allow running of arbitrary scripts from
> >> PATH while building documentation. It's certainly not an approach that
> >> should be encouraged.  
> >
> > Sorry, but I disagree. The security threat of having a random command
> > doing something wrong is the same as we already have with the Kernel
> > Makefiles, as they can also run a random command. All it is needed
> > is to add this to a Makefile:  
> 
> My intention was to emphasize the importance of the clarity of the
> documentation build, and not get hung up on the security aspect.
> 
> This is connected to the above: keeping documentation buildable with
> sphinx-build directly will force you to avoid the Makefile hacks.

A generic kernel-cmd extension will avoid Makefile hacks. It will
also prevent the addition of a new extension for every new script
we may need to run, in order to cover the Sphinx deficiencies.

> > IMO, a generic solution is a way better, as it sounds easier to
> > maintain.  
> 
> We've seen what happens when we make it easy to add random scripts to
> build documentation. We've worked hard to get rid of that. In my books,
> one of the bigger points in favor of Sphinx over AsciiDoc(tor) was
> getting rid of all the hacks required in the build. Things that broke in
> subtle ways.

I really can't see what scripts it get rids. with both Sphinx and
AsciiDoc(tor), the kernel-doc perl/python script is still needed.

On media books, as Sphinx is incapable of generate cross-references
from C code to the documentation, we needed to add the parse_headers.pl.

So, at the end of the day, we still need the same scripts as before.

If the choice was for Doxygen, then we would get rid of both scripts,
at the price of needing to write tables in HTML, and the need to convert
all kernel-doc markups to Doxygen syntax, with would be worse, IMHO.

> I think having people write Sphinx extensions for the special needs have
> a better chance of solving the problems in more generic ways than
> writing scripts for each specific need. Ideally, we can push those
> extensions to upstream Sphinx, but at least make them easily usable
> across the kernel documentation.

Well, writing a Sphinx extension would require a deep knowledge about
Sphinx internals and a python programmer. As I don't have any, nor
intend to invest some time to be expert on writing Sphinx extensions
any time soon, it means that for me a Sphinx extension is unmaintainable.

> Case in point, parse-headers.pl was added for a specific need of media
> documentation, and for the life of me I can't figure out by reading the
> script what good, if any, it would be for gpu documentation. I call
> *that* unmaintainable.

Actually, parse-headers.pl was added to do something that Doxygen does for
a long time: if you include a file example inside a documentation, all API
calls become cross-references for the code. See, for example, the
documentation I wrote for the libdvbv5:
	https://linuxtv.org/docs/libdvbv5/dvbv5-zap_8c-example.html

All it requires on Doxygen to produce such markup is to add a block like:

/**

@example dvbv5-scan.c
@example dvbv5-zap.c
@example dvb-fe-tool.c
@example dvb-format-convert.c

*/

inside a file parsed by Doxygen (in this case, it is at
https://git.linuxtv.org/v4l-utils.git/tree/doc/libdvbv5-index.doc#n233).

Doxygen will parse the file, seek for all function, define, enum, struct,
typedef, ... that was marked via a Doxygen markup block (/** ... */)
and create the corresponding cross-references.

Btw, this specific script can indeed be converted into a Sphinx
extension generic enough to be pushed upstream that could fix 
.. literalinclude:: tag (or some other include tag) for it to not 
blindly call pygments, but instead do be smart and do the code
cross-references. Yet, for it to work in a generic way, we'll need
to fix the kernel-doc script for it to generate C-domain references
for each enum/struct field, and fix its parser for function callback
arguments and struct elements.

Thanks,
Mauro

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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-06 16:50       ` Mauro Carvalho Chehab
@ 2016-10-07  5:56         ` Jani Nikula
  2016-10-11  7:26           ` Markus Heiser
  0 siblings, 1 reply; 32+ messages in thread
From: Jani Nikula @ 2016-10-07  5:56 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Markus Heiser, Jonathan Corbet, Linux Media Mailing List, linux-doc

On Thu, 06 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
> Em Thu, 06 Oct 2016 17:21:36 +0300
> Jani Nikula <jani.nikula@intel.com> escreveu:
>> We've seen what happens when we make it easy to add random scripts to
>> build documentation. We've worked hard to get rid of that. In my books,
>> one of the bigger points in favor of Sphinx over AsciiDoc(tor) was
>> getting rid of all the hacks required in the build. Things that broke in
>> subtle ways.
>
> I really can't see what scripts it get rids.

Really? You don't see why the DocBook build was so fragile and difficult
to maintain? That scares me a bit, because then you will not have
learned why we should at all costs avoid adding random scripts to
produce documentation.

The DocBook build was designed by Rube Goldberg, and this video
accurately illustrates how it works:
https://www.youtube.com/watch?v=qybUFnY7Y8w

I don't want the Sphinx build to end up like that.


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Technology Center

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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-07  5:56         ` Jani Nikula
@ 2016-10-11  7:26           ` Markus Heiser
  2016-10-11 14:28             ` Mauro Carvalho Chehab
  2016-10-21 22:05             ` Jonathan Corbet
  0 siblings, 2 replies; 32+ messages in thread
From: Markus Heiser @ 2016-10-11  7:26 UTC (permalink / raw)
  To: Jani Nikula, Jonathan Corbet, Mauro Carvalho Chehab
  Cc: Linux Media Mailing List, linux-doc@vger.kernel.org Mailing List


Am 07.10.2016 um 07:56 schrieb Jani Nikula <jani.nikula@intel.com>:

> On Thu, 06 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
>> Em Thu, 06 Oct 2016 17:21:36 +0300
>> Jani Nikula <jani.nikula@intel.com> escreveu:
>>> We've seen what happens when we make it easy to add random scripts to
>>> build documentation. We've worked hard to get rid of that. In my books,
>>> one of the bigger points in favor of Sphinx over AsciiDoc(tor) was
>>> getting rid of all the hacks required in the build. Things that broke in
>>> subtle ways.
>> 
>> I really can't see what scripts it get rids.
> 
> Really? You don't see why the DocBook build was so fragile and difficult
> to maintain? That scares me a bit, because then you will not have
> learned why we should at all costs avoid adding random scripts to
> produce documentation.

For me, disassembling the DocBok build was hard and bothersome, I don't
want this back.

IMO: old hats are productive with perl and they won't adapt another
interpreter language (like python) for scripting. 

This series -- the kernel-cmd -- directive avoid that they build
fragile and difficult to maintain Makefile constructs, calling their
perl scripts.

Am 06.10.2016 um 16:21 schrieb Jani Nikula <jani.nikula@intel.com>:

> This is connected to the above: keeping documentation buildable with
> sphinx-build directly will force you to avoid the Makefile hacks.


Thats why I think, that the kernel-cmd directive is a more *straight-
forward* solution, helps to **avoid** complexity while not everyone
has to script in python ... 

> Case in point, parse-headers.pl was added for a specific need of media
> documentation, and for the life of me I can't figure out by reading the
> script what good, if any, it would be for gpu documentation. I call
> *that* unmaintainable.


If one adds a script like parse-headers.pl to the Documentation/sphinx 
folder, he/she also has to add a documentation to the kernel-documentation.rst

If the kernel-cmd directive gets acked, I will add a description to
kernel-documentation.rst and I request Mauro to document the parse-headers.pl
also.

But, let's hear what Jon says.

-- Markus --




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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-11  7:26           ` Markus Heiser
@ 2016-10-11 14:28             ` Mauro Carvalho Chehab
  2016-10-11 15:34               ` Jani Nikula
  2016-10-21 22:05             ` Jonathan Corbet
  1 sibling, 1 reply; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-11 14:28 UTC (permalink / raw)
  To: Markus Heiser
  Cc: Jani Nikula, Jonathan Corbet, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List

Em Tue, 11 Oct 2016 09:26:48 +0200
Markus Heiser <markus.heiser@darmarit.de> escreveu:

> Am 07.10.2016 um 07:56 schrieb Jani Nikula <jani.nikula@intel.com>:
> 
> > On Thu, 06 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:  
> >> Em Thu, 06 Oct 2016 17:21:36 +0300
> >> Jani Nikula <jani.nikula@intel.com> escreveu:  
> >>> We've seen what happens when we make it easy to add random scripts to
> >>> build documentation. We've worked hard to get rid of that. In my books,
> >>> one of the bigger points in favor of Sphinx over AsciiDoc(tor) was
> >>> getting rid of all the hacks required in the build. Things that broke in
> >>> subtle ways.  
> >> 
> >> I really can't see what scripts it get rids.  
> > 
> > Really? You don't see why the DocBook build was so fragile and difficult
> > to maintain? That scares me a bit, because then you will not have
> > learned why we should at all costs avoid adding random scripts to
> > produce documentation.  
> 
> For me, disassembling the DocBok build was hard and bothersome, I don't
> want this back.
> 
> IMO: old hats are productive with perl and they won't adapt another
> interpreter language (like python) for scripting. 
> 
> This series -- the kernel-cmd -- directive avoid that they build
> fragile and difficult to maintain Makefile constructs, calling their
> perl scripts.
> 
> Am 06.10.2016 um 16:21 schrieb Jani Nikula <jani.nikula@intel.com>:
> 
> > This is connected to the above: keeping documentation buildable with
> > sphinx-build directly will force you to avoid the Makefile hacks.  
> 
> 
> Thats why I think, that the kernel-cmd directive is a more *straight-
> forward* solution, helps to **avoid** complexity while not everyone
> has to script in python ... 
> 
> > Case in point, parse-headers.pl was added for a specific need of media
> > documentation, and for the life of me I can't figure out by reading the
> > script what good, if any, it would be for gpu documentation. I call
> > *that* unmaintainable.  
> 
> 
> If one adds a script like parse-headers.pl to the Documentation/sphinx 
> folder, he/she also has to add a documentation to the kernel-documentation.rst
> 
> If the kernel-cmd directive gets acked, I will add a description to
> kernel-documentation.rst and I request Mauro to document the parse-headers.pl
> also.

I can write documentation for parse-headers.pl, either as a --help/--man
option or at some ReST file (or both). I'll add this to my mental TODO
list.

-

With regards to Sphinx x DocBook, in terms of functionality, Sphinx
is an improvement, as we can now use the same markup for everything,
and cross-reference all documents. Unfortunately, it has less
functionality than DocBook, and requires more magic to work.

However, there are costs to pay on using a Python script like Sphinx.
I won't mention again the issues with Python itself and its unstable
API, but, instead, focus on Sphinx script itself.

First of all, installing packages for Sphinx script to work is a lot
more complex, specially for the PDF output, as the LaTeX requirements are
very distribution specific, as some distributions package each LaTeX
extension as optional packages, and the required extensions used by
the Sphinx script are not documented.

Also, the Sphinx script and its build logic is a lot more fragile than 
the Makefile/xmlto that we use on DocBook, and this has nothing to do 
with adding extra perl/python scripts.

While it is clean for html output, it is very dirty when producing
a PDF output.

It starts by generating its own Makefile for PDF builds, at the output
directory, with we have little control on it. 

Also, it seems that almost all books will need hacks to produce proper PDF,
as neither ReST or Sphinx extensions currently have proper support to adjust
things provided on DocBook, like setting page properties, enabling 
image/table scaling, auto-numbering images/tables/examples or changing page
orientation in the middle of a document.

The biggest issue I found is related to table outputs in PDF format, as
it does a very poor job adjusting table margins to fit inside the paper
margins. Also, the auto-generated TOC index on PDF doesn't match the
numeration of the HTML output. Currently, I didn't find any solution
for the latter issue.

As Sphinx markup doesn't have any way to tell how the output would be
formatted, a lot of magic is required at Sphinx conf.py for PDF
output to start working. Worse than that, several tables require
extra tags for PDF output, specifying the column sizes, and forcing
them to be handled as longtables[1]. Also, if the table is too big,
the rst files require raw latex macros/code before/after such
tables, in order for them to fit inside a paper page - either by
changing their orientation or enabling auto-scale, if the table is
not a longtable. Currently, no way to tell Sphinx to enable auto-scale
on big tables. 

So, in practice, it means that Sphinx build is a house of cards, 
at least for PDF output, as every new book should be tested if
it will produce a proper PDF output, and add extra hacks inside
the rst files to fix them, when the defaults won't work.

I'm almost sure that we end by needing similar hacks for man
page output.

Thanks,
Mauro


[1] 

Sphinx script outputs table in LaTeX format using either
"tabularx" or "longtable". A "tabularx" table should fit into
one page, but it can be scaled to fit into a page using the
"adjustbox" LaTeX extension. A "longtable" can have multiple pages,
but can't be scaled.

The way the Sphinx script decides either to use tabularx or longtable 
is based *only* on the number of table rows: if bigger than 30, it
uses "longtable" - even if the table is small enough to fit on a single
page; if lower than 30, even if the table is very big, it will use
"tabularx".

There are several cases of tables with less than 30 rows that won't
fit on a single page, because each row has several lines. Every such
table requires an extra tag (".. cssclass:: longtable") for it to
be properly displayed at the PDF output.

However, the reverse is a lot worse: there are have several cases on
media where we have tables bigger than 30 rows that would fit well on
a single page, as there's just one line per how. Unfortunately,
Sphinx doesn't allow forcing a table to be output using "tabularx".
As "longtable" cannot be scaled using "adjustbox", the ones whose
lines won't fit into a page requires a magic raw latex spell in
order to force the LaTeX output to use a smaller font size, as ReST
doesn't have any markup to specify the text output size.

In practice, a typical "tabularx" table found on media require
those markups:

	.. raw:: latex

	   \begin{adjustbox}{width=\columnwidth}

	.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|

	<some table>

	.. raw:: latex

	   \end{adjustbox}

And for some "longtable" (as found at Documentation/media/uapi/v4l/subdev-formats.rst):

	.. tabularcolumns:: <column sizes>

	.. _v4l2-mbus-pixelcode-rgb:

	.. raw:: latex

	    \begingroup
	    \tiny
	    \setlength{\tabcolsep}{2pt}

	<table>

	.. raw:: latex

	    \endgroup

With is very dirty and ugly, IMHO. This is a lot uglier than any extra
scripts added to the Sphinx script, either as via a generic kernel-cmd
script or via some Sphinx script extension.



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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-11 14:28             ` Mauro Carvalho Chehab
@ 2016-10-11 15:34               ` Jani Nikula
  2016-10-11 16:06                 ` Markus Heiser
  0 siblings, 1 reply; 32+ messages in thread
From: Jani Nikula @ 2016-10-11 15:34 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Markus Heiser
  Cc: Jonathan Corbet, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List

On Tue, 11 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
> Em Tue, 11 Oct 2016 09:26:48 +0200
> Markus Heiser <markus.heiser@darmarit.de> escreveu:
>
>> Am 07.10.2016 um 07:56 schrieb Jani Nikula <jani.nikula@intel.com>:
>> 
>> > On Thu, 06 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:  
>> >> Em Thu, 06 Oct 2016 17:21:36 +0300
>> >> Jani Nikula <jani.nikula@intel.com> escreveu:  
>> >>> We've seen what happens when we make it easy to add random scripts to
>> >>> build documentation. We've worked hard to get rid of that. In my books,
>> >>> one of the bigger points in favor of Sphinx over AsciiDoc(tor) was
>> >>> getting rid of all the hacks required in the build. Things that broke in
>> >>> subtle ways.  
>> >> 
>> >> I really can't see what scripts it get rids.  
>> > 
>> > Really? You don't see why the DocBook build was so fragile and difficult
>> > to maintain? That scares me a bit, because then you will not have
>> > learned why we should at all costs avoid adding random scripts to
>> > produce documentation.  
>> 
>> For me, disassembling the DocBok build was hard and bothersome, I don't
>> want this back.
>> 
>> IMO: old hats are productive with perl and they won't adapt another
>> interpreter language (like python) for scripting. 
>> 
>> This series -- the kernel-cmd -- directive avoid that they build
>> fragile and difficult to maintain Makefile constructs, calling their
>> perl scripts.
>> 
>> Am 06.10.2016 um 16:21 schrieb Jani Nikula <jani.nikula@intel.com>:
>> 
>> > This is connected to the above: keeping documentation buildable with
>> > sphinx-build directly will force you to avoid the Makefile hacks.  
>> 
>> 
>> Thats why I think, that the kernel-cmd directive is a more *straight-
>> forward* solution, helps to **avoid** complexity while not everyone
>> has to script in python ... 
>> 
>> > Case in point, parse-headers.pl was added for a specific need of media
>> > documentation, and for the life of me I can't figure out by reading the
>> > script what good, if any, it would be for gpu documentation. I call
>> > *that* unmaintainable.  
>> 
>> 
>> If one adds a script like parse-headers.pl to the Documentation/sphinx 
>> folder, he/she also has to add a documentation to the kernel-documentation.rst
>> 
>> If the kernel-cmd directive gets acked, I will add a description to
>> kernel-documentation.rst and I request Mauro to document the parse-headers.pl
>> also.
>
> I can write documentation for parse-headers.pl, either as a --help/--man
> option or at some ReST file (or both). I'll add this to my mental TODO
> list.

Thanks, documentation will help everyone else evaluate whether
parse-headers.pl is only useful for some corner case in media docs, or
perhaps more generally useful. Currently, it's hard to tell.

Anyway, documentation does not change my view on adding such scripts. As
I've said, I think they will make the documentation build more difficult
to maintain. They are likely to become special purpose hacks for corner
cases across documentation.

The rest of what you say is unrelated to the patches at hand.


BR,
Jani.


>
> -
>
> With regards to Sphinx x DocBook, in terms of functionality, Sphinx
> is an improvement, as we can now use the same markup for everything,
> and cross-reference all documents. Unfortunately, it has less
> functionality than DocBook, and requires more magic to work.
>
> However, there are costs to pay on using a Python script like Sphinx.
> I won't mention again the issues with Python itself and its unstable
> API, but, instead, focus on Sphinx script itself.
>
> First of all, installing packages for Sphinx script to work is a lot
> more complex, specially for the PDF output, as the LaTeX requirements are
> very distribution specific, as some distributions package each LaTeX
> extension as optional packages, and the required extensions used by
> the Sphinx script are not documented.
>
> Also, the Sphinx script and its build logic is a lot more fragile than 
> the Makefile/xmlto that we use on DocBook, and this has nothing to do 
> with adding extra perl/python scripts.
>
> While it is clean for html output, it is very dirty when producing
> a PDF output.
>
> It starts by generating its own Makefile for PDF builds, at the output
> directory, with we have little control on it. 
>
> Also, it seems that almost all books will need hacks to produce proper PDF,
> as neither ReST or Sphinx extensions currently have proper support to adjust
> things provided on DocBook, like setting page properties, enabling 
> image/table scaling, auto-numbering images/tables/examples or changing page
> orientation in the middle of a document.
>
> The biggest issue I found is related to table outputs in PDF format, as
> it does a very poor job adjusting table margins to fit inside the paper
> margins. Also, the auto-generated TOC index on PDF doesn't match the
> numeration of the HTML output. Currently, I didn't find any solution
> for the latter issue.
>
> As Sphinx markup doesn't have any way to tell how the output would be
> formatted, a lot of magic is required at Sphinx conf.py for PDF
> output to start working. Worse than that, several tables require
> extra tags for PDF output, specifying the column sizes, and forcing
> them to be handled as longtables[1]. Also, if the table is too big,
> the rst files require raw latex macros/code before/after such
> tables, in order for them to fit inside a paper page - either by
> changing their orientation or enabling auto-scale, if the table is
> not a longtable. Currently, no way to tell Sphinx to enable auto-scale
> on big tables. 
>
> So, in practice, it means that Sphinx build is a house of cards, 
> at least for PDF output, as every new book should be tested if
> it will produce a proper PDF output, and add extra hacks inside
> the rst files to fix them, when the defaults won't work.
>
> I'm almost sure that we end by needing similar hacks for man
> page output.
>
> Thanks,
> Mauro
>
>
> [1] 
>
> Sphinx script outputs table in LaTeX format using either
> "tabularx" or "longtable". A "tabularx" table should fit into
> one page, but it can be scaled to fit into a page using the
> "adjustbox" LaTeX extension. A "longtable" can have multiple pages,
> but can't be scaled.
>
> The way the Sphinx script decides either to use tabularx or longtable 
> is based *only* on the number of table rows: if bigger than 30, it
> uses "longtable" - even if the table is small enough to fit on a single
> page; if lower than 30, even if the table is very big, it will use
> "tabularx".
>
> There are several cases of tables with less than 30 rows that won't
> fit on a single page, because each row has several lines. Every such
> table requires an extra tag (".. cssclass:: longtable") for it to
> be properly displayed at the PDF output.
>
> However, the reverse is a lot worse: there are have several cases on
> media where we have tables bigger than 30 rows that would fit well on
> a single page, as there's just one line per how. Unfortunately,
> Sphinx doesn't allow forcing a table to be output using "tabularx".
> As "longtable" cannot be scaled using "adjustbox", the ones whose
> lines won't fit into a page requires a magic raw latex spell in
> order to force the LaTeX output to use a smaller font size, as ReST
> doesn't have any markup to specify the text output size.
>
> In practice, a typical "tabularx" table found on media require
> those markups:
>
> 	.. raw:: latex
>
> 	   \begin{adjustbox}{width=\columnwidth}
>
> 	.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
>
> 	<some table>
>
> 	.. raw:: latex
>
> 	   \end{adjustbox}
>
> And for some "longtable" (as found at Documentation/media/uapi/v4l/subdev-formats.rst):
>
> 	.. tabularcolumns:: <column sizes>
>
> 	.. _v4l2-mbus-pixelcode-rgb:
>
> 	.. raw:: latex
>
> 	    \begingroup
> 	    \tiny
> 	    \setlength{\tabcolsep}{2pt}
>
> 	<table>
>
> 	.. raw:: latex
>
> 	    \endgroup
>
> With is very dirty and ugly, IMHO. This is a lot uglier than any extra
> scripts added to the Sphinx script, either as via a generic kernel-cmd
> script or via some Sphinx script extension.
>
>

-- 
Jani Nikula, Intel Open Source Technology Center

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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-11 15:34               ` Jani Nikula
@ 2016-10-11 16:06                 ` Markus Heiser
  2016-10-11 16:45                   ` Mauro Carvalho Chehab
  2016-10-12  8:20                   ` Jani Nikula
  0 siblings, 2 replies; 32+ messages in thread
From: Markus Heiser @ 2016-10-11 16:06 UTC (permalink / raw)
  To: Jani Nikula, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List


Am 11.10.2016 um 17:34 schrieb Jani Nikula <jani.nikula@intel.com>:

> On Tue, 11 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
>> Em Tue, 11 Oct 2016 09:26:48 +0200
>> Markus Heiser <markus.heiser@darmarit.de> escreveu:
>> 
>>> Am 07.10.2016 um 07:56 schrieb Jani Nikula <jani.nikula@intel.com>:
>>> 
>>>> On Thu, 06 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:  
>>>>> Em Thu, 06 Oct 2016 17:21:36 +0300
>>>>> Jani Nikula <jani.nikula@intel.com> escreveu:  
>>>>>> We've seen what happens when we make it easy to add random scripts to
>>>>>> build documentation. We've worked hard to get rid of that. In my books,
>>>>>> one of the bigger points in favor of Sphinx over AsciiDoc(tor) was
>>>>>> getting rid of all the hacks required in the build. Things that broke in
>>>>>> subtle ways.  
>>>>> 
>>>>> I really can't see what scripts it get rids.  
>>>> 
>>>> Really? You don't see why the DocBook build was so fragile and difficult
>>>> to maintain? That scares me a bit, because then you will not have
>>>> learned why we should at all costs avoid adding random scripts to
>>>> produce documentation.  
>>> 
>>> For me, disassembling the DocBok build was hard and bothersome, I don't
>>> want this back.
>>> 
>>> IMO: old hats are productive with perl and they won't adapt another
>>> interpreter language (like python) for scripting. 
>>> 
>>> This series -- the kernel-cmd -- directive avoid that they build
>>> fragile and difficult to maintain Makefile constructs, calling their
>>> perl scripts.
>>> 
>>> Am 06.10.2016 um 16:21 schrieb Jani Nikula <jani.nikula@intel.com>:
>>> 
>>>> This is connected to the above: keeping documentation buildable with
>>>> sphinx-build directly will force you to avoid the Makefile hacks.  
>>> 
>>> 
>>> Thats why I think, that the kernel-cmd directive is a more *straight-
>>> forward* solution, helps to **avoid** complexity while not everyone
>>> has to script in python ... 
>>> 
>>>> Case in point, parse-headers.pl was added for a specific need of media
>>>> documentation, and for the life of me I can't figure out by reading the
>>>> script what good, if any, it would be for gpu documentation. I call
>>>> *that* unmaintainable.  
>>> 
>>> 
>>> If one adds a script like parse-headers.pl to the Documentation/sphinx 
>>> folder, he/she also has to add a documentation to the kernel-documentation.rst
>>> 
>>> If the kernel-cmd directive gets acked, I will add a description to
>>> kernel-documentation.rst and I request Mauro to document the parse-headers.pl
>>> also.
>> 
>> I can write documentation for parse-headers.pl, either as a --help/--man
>> option or at some ReST file (or both). I'll add this to my mental TODO
>> list.
> 
> Thanks, documentation will help everyone else evaluate whether
> parse-headers.pl is only useful for some corner case in media docs, or
> perhaps more generally useful. Currently, it's hard to tell.
> 
> Anyway, documentation does not change my view on adding such scripts. As
> I've said, I think they will make the documentation build more difficult
> to maintain. They are likely to become special purpose hacks for corner
> cases across documentation.

Hmm, why not generating reST content by (Perl) scripts? From my POV,
the scripts/kernel-doc is such a script and parse-headers.pl
is just another. The only difference of both is, that kernel-doc
has its own integration (directive) while kernel-cmd is a simple
solution to call scripts (e.g. parse-headers.pl) within sphinx-build.

Joking: the kernel-doc directive could replaced by
        the kernel-cmd directive ;-)

> The rest of what you say is unrelated to the patches at hand.

I think Mauro want's to address your (justifiable) fear about
complexity and hacks. IMO he says (by examples); "there are a lot of
other hard to maintain hacks required, especially when it comes
to build PDF".

IMO, complexity is not reduced by prohibit scripts, it is
ongoing job of the maintainers to observe. 

Anyway, these are only my 2cent. I'am interested in what Jon says
in general about using (Perl) scripts to generate reST content.

--Markus--


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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-11 16:06                 ` Markus Heiser
@ 2016-10-11 16:45                   ` Mauro Carvalho Chehab
  2016-10-12  6:57                     ` Markus Heiser
  2016-10-12  8:20                   ` Jani Nikula
  1 sibling, 1 reply; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-11 16:45 UTC (permalink / raw)
  To: Markus Heiser
  Cc: Jani Nikula, Jonathan Corbet, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List

Em Tue, 11 Oct 2016 18:06:46 +0200
Markus Heiser <markus.heiser@darmarit.de> escreveu:

> Am 11.10.2016 um 17:34 schrieb Jani Nikula <jani.nikula@intel.com>:
> 
> > On Tue, 11 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:  
> >> Em Tue, 11 Oct 2016 09:26:48 +0200
> >> Markus Heiser <markus.heiser@darmarit.de> escreveu:
> >>   
> >>> Am 07.10.2016 um 07:56 schrieb Jani Nikula <jani.nikula@intel.com>:
> >>>   
> >>>> On Thu, 06 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:    
> >>>>> Em Thu, 06 Oct 2016 17:21:36 +0300
> >>>>> Jani Nikula <jani.nikula@intel.com> escreveu:    
> >>>>>> We've seen what happens when we make it easy to add random scripts to
> >>>>>> build documentation. We've worked hard to get rid of that. In my books,
> >>>>>> one of the bigger points in favor of Sphinx over AsciiDoc(tor) was
> >>>>>> getting rid of all the hacks required in the build. Things that broke in
> >>>>>> subtle ways.    
> >>>>> 
> >>>>> I really can't see what scripts it get rids.    
> >>>> 
> >>>> Really? You don't see why the DocBook build was so fragile and difficult
> >>>> to maintain? That scares me a bit, because then you will not have
> >>>> learned why we should at all costs avoid adding random scripts to
> >>>> produce documentation.    
> >>> 
> >>> For me, disassembling the DocBok build was hard and bothersome, I don't
> >>> want this back.
> >>> 
> >>> IMO: old hats are productive with perl and they won't adapt another
> >>> interpreter language (like python) for scripting. 
> >>> 
> >>> This series -- the kernel-cmd -- directive avoid that they build
> >>> fragile and difficult to maintain Makefile constructs, calling their
> >>> perl scripts.
> >>> 
> >>> Am 06.10.2016 um 16:21 schrieb Jani Nikula <jani.nikula@intel.com>:
> >>>   
> >>>> This is connected to the above: keeping documentation buildable with
> >>>> sphinx-build directly will force you to avoid the Makefile hacks.    
> >>> 
> >>> 
> >>> Thats why I think, that the kernel-cmd directive is a more *straight-
> >>> forward* solution, helps to **avoid** complexity while not everyone
> >>> has to script in python ... 
> >>>   
> >>>> Case in point, parse-headers.pl was added for a specific need of media
> >>>> documentation, and for the life of me I can't figure out by reading the
> >>>> script what good, if any, it would be for gpu documentation. I call
> >>>> *that* unmaintainable.    
> >>> 
> >>> 
> >>> If one adds a script like parse-headers.pl to the Documentation/sphinx 
> >>> folder, he/she also has to add a documentation to the kernel-documentation.rst
> >>> 
> >>> If the kernel-cmd directive gets acked, I will add a description to
> >>> kernel-documentation.rst and I request Mauro to document the parse-headers.pl
> >>> also.  
> >> 
> >> I can write documentation for parse-headers.pl, either as a --help/--man
> >> option or at some ReST file (or both). I'll add this to my mental TODO
> >> list.  
> > 
> > Thanks, documentation will help everyone else evaluate whether
> > parse-headers.pl is only useful for some corner case in media docs, or
> > perhaps more generally useful. Currently, it's hard to tell.
> > 
> > Anyway, documentation does not change my view on adding such scripts. As
> > I've said, I think they will make the documentation build more difficult
> > to maintain. They are likely to become special purpose hacks for corner
> > cases across documentation.  
> 
> Hmm, why not generating reST content by (Perl) scripts? From my POV,
> the scripts/kernel-doc is such a script and parse-headers.pl
> is just another. 

And Sphinx is a third one - or, actually, a set of scripts, as each
extension is also a script ;)

> The only difference of both is, that kernel-doc
> has its own integration (directive) while kernel-cmd is a simple
> solution to call scripts (e.g. parse-headers.pl) within sphinx-build.
> 
> Joking: the kernel-doc directive could replaced by
>         the kernel-cmd directive ;-)

I'm actually OK with either strategy - although it sounds easier
to maintain if we have a single extension to run an external
script - including kernel-doc - specially if the Sphinx extension
API and/or Python changes in the future in a non-backward compatible way.

> > The rest of what you say is unrelated to the patches at hand.  
> 
> I think Mauro want's to address your (justifiable) fear about
> complexity and hacks. IMO he says (by examples); "there are a lot of
> other hard to maintain hacks required, especially when it comes
> to build PDF".
> 
> IMO, complexity is not reduced by prohibit scripts, it is
> ongoing job of the maintainers to observe. 

Yes, that's exactly my point. IMO, not allowing scripts actually
increase complexity, as we'll need Makefile rules to generate
rst files, if we won't allow doing that via perl/python scripts.

If we allow such scripts (and we do since day zero, due to
kernel-doc), then there are 3 options:

1) use a single python script to run the scripts needed in the
   build process (e. g. merging kernel-cmd extension upstream);

2) use a dedicated python script for every non-phyton script;

3) use only python scripts to extend Sphinx functionality.

The (2) scenario seems to be the worse case, as it will end by
having a perl(/shell?) script/python script pair for every 
non-python script we need to run, we're actually making it twice
worse.

For (3) to happen, we'll need to convert both kernel-doc and
parse-headers.pl to Python. This could be a long term goal,
but I prefer to not rewrite those scripts for a while, as
it is a lot easier to maintain them in perl, at least to me, and it
is less disruptive, as rewriting kernel-doc to Python can introduce
regressions.

So, the way I see, (1) is the best approach.

> Anyway, these are only my 2cent. I'am interested in what Jon says
> in general about using (Perl) scripts to generate reST content.
> 
> --Markus--
> 

Regards,
Mauro

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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-11 16:45                   ` Mauro Carvalho Chehab
@ 2016-10-12  6:57                     ` Markus Heiser
  0 siblings, 0 replies; 32+ messages in thread
From: Markus Heiser @ 2016-10-12  6:57 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Jani Nikula, Jonathan Corbet, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List


Am 11.10.2016 um 18:45 schrieb Mauro Carvalho Chehab <mchehab@infradead.org>:

> If we allow such scripts (and we do since day zero, due to
> kernel-doc), then there are 3 options:
> 
> 1) use a single python script to run the scripts needed in the
>   build process (e. g. merging kernel-cmd extension upstream);
> 
> 2) use a dedicated python script for every non-phyton script;
> 
> 3) use only python scripts to extend Sphinx functionality.
> 
> The (2) scenario seems to be the worse case, as it will end by
> having a perl(/shell?) script/python script pair for every 
> non-python script we need to run, we're actually making it twice
> worse.
> 
> For (3) to happen, we'll need to convert both kernel-doc and
> parse-headers.pl to Python. This could be a long term goal,
> but I prefer to not rewrite those scripts for a while, as
> it is a lot easier to maintain them in perl, at least to me, and it
> is less disruptive, as rewriting kernel-doc to Python can introduce
> regressions.
> 

Hi Mauro,

its a bit OT in this thread, but in the linuxdoc project,
the kernel-doc is already converted to python.

  https://return42.github.io/linuxdoc/cmd-line.html#kernel-doc

and you have used it already, when you lint with kernel-lint.
Hence I see more progressions than regression ;-)

> So, the way I see, (1) is the best approach.

agree

--Markus--

> 
>> Anyway, these are only my 2cent. I'am interested in what Jon says
>> in general about using (Perl) scripts to generate reST content.
>> 
>> --Markus--
>> 
> 
> Regards,
> Mauro


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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-11 16:06                 ` Markus Heiser
  2016-10-11 16:45                   ` Mauro Carvalho Chehab
@ 2016-10-12  8:20                   ` Jani Nikula
  1 sibling, 0 replies; 32+ messages in thread
From: Jani Nikula @ 2016-10-12  8:20 UTC (permalink / raw)
  To: Markus Heiser, Jonathan Corbet
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List

On Tue, 11 Oct 2016, Markus Heiser <markus.heiser@darmarit.de> wrote:
> Anyway, these are only my 2cent. I'am interested in what Jon says
> in general about using (Perl) scripts to generate reST content.

I think I've said all that I have to say on the subject. Up to Jon.

BR,
Jani.

-- 
Jani Nikula, Intel Open Source Technology Center

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

* Re: [PATCH 1/4] doc-rst: reST-directive kernel-cmd / include contentent from scripts
  2016-10-06  7:20 ` [PATCH 1/4] doc-rst: " Markus Heiser
@ 2016-10-17 16:46   ` Mauro Carvalho Chehab
  2016-10-18  6:07     ` Jani Nikula
  2016-10-18  7:03     ` Markus Heiser
  0 siblings, 2 replies; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-17 16:46 UTC (permalink / raw)
  To: Markus Heiser
  Cc: Jonathan Corbet, Jani Nikula, Linux Media Mailing List, linux-doc

Hi Markus,

Em Thu,  6 Oct 2016 09:20:17 +0200
Markus Heiser <markus.heiser@darmarit.de> escreveu:

> From: Markus Heiser <markus.heiser@darmarIT.de>
> 
> The ``kernel-cmd`` directive includes contend from the stdout of a
> command-line. With the ``kernel-cmd`` directive we can include the
> output of any (Perl or whatever) script. This is a more general solution
> for other workarounds like the "kernel_include + parseheaders" solution.

Unfortunately, there are some problems with kernel-cmd: it seems
that it only partially parses the ReST file, not accepting several ReST tags.

See the enclosed patch and see the produced html file at:
	Documentation/output/user/MAINTAINERS.html

Then run the script manually with:
	./Documentation/sphinx/format_maintainers.pl MAINTAINERS >Documentation/user/MAINTAINERS.rst

And see the produced html output after re-building the user book.


PS.: You can test it on my git tree, with has the code to produce
it at the lkml-books branch, at
	http:://git.linuxtv.org/mchehab/experimental.git

Regards,
Mauro


[PATCH] docs-rst: user: add MAINTAINERS

including MAINTAINERS using ReST is tricky, because all
maintainer's entries are like:

FOO SUBSYSTEM:
M: My Name <my@name>
L: mailing@list
S: Maintained
F: foo/bar

On ReST, this would be displayed on a single line. Using
alias, like |M|, |L|, ... won't solve, as an alias in
Sphinx doesn't accept breaking lines.

So, instead of changing every line at MAINTAINERS, let's
use kernel-cmd extension in order to parse it via a script.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

diff --git a/Documentation/sphinx/format_maintainers.pl b/Documentation/sphinx/format_maintainers.pl
new file mode 100755
index 000000000000..fb3af2a30c36
--- /dev/null
+++ b/Documentation/sphinx/format_maintainers.pl
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+
+my $is_rst = 1;
+
+# For now, ignore file tags, like F, N, X, K.
+my %tags = (
+	'P' => 'Person',
+	'M' => 'Mail',
+	'R' => 'Designated reviewer',
+	'L' => 'Mailing list',
+	'W' => 'Web page',
+	'Q' => 'Patchwork',
+	'T' => 'Develoment tree',
+	'S' => 'Status',
+);
+
+while (<>) {
+	if ($is_rst) {
+		if (m/^\s+\-+$/) {
+			$is_rst = 0;
+			next;
+		}
+		print $_;
+		next;
+	}
+
+	next if (m/^$/);
+
+	if (m/^([A-Z])\:(.*)/) {
+		my $tag = $1;
+		my $value = $2;
+
+		my $meaning;
+
+		next if (!defined($tags{$tag}));
+
+		printf " - %s:\n   %s\n\n", $tags{$tag}, $value;
+		next;
+	}
+
+	print "\n$_";
+}
+
+print "\n";
diff --git a/Documentation/user/MAINTAINERS.rst b/Documentation/user/MAINTAINERS.rst
new file mode 100644
index 000000000000..9b01b51749bd
--- /dev/null
+++ b/Documentation/user/MAINTAINERS.rst
@@ -0,0 +1 @@
+.. kernel-cmd:: format_maintainers.pl $srctree/MAINTAINERS
diff --git a/Documentation/user/index.rst b/Documentation/user/index.rst
index 6fbb2dc4b3b7..c4bfd45f0649 100644
--- a/Documentation/user/index.rst
+++ b/Documentation/user/index.rst
@@ -32,3 +32,4 @@ Contents:
    java
    bad_memory
    basic_profiling
+   MAINTAINERS
diff --git a/MAINTAINERS b/MAINTAINERS
index 1cd38a7e0064..d46ffec4e682 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1,12 +1,14 @@
-
-
-	List of maintainers and how to submit kernel changes
+List of maintainers and how to submit kernel changes
+====================================================
 
 Please try to follow the guidelines below.  This will make things
 easier on the maintainers.  Not all of these guidelines matter for every
 trivial patch so apply some common sense.
 
-1.	Always _test_ your changes, however small, on at least 4 or
+Tips for patch submitters
+-------------------------
+
+1.	Always **test** your changes, however small, on at least 4 or
 	5 people, preferably many more.
 
 2.	Try to release a few ALPHA test versions to the net. Announce
@@ -15,7 +17,7 @@ trivial patch so apply some common sense.
 	you will find things like the fact version 3 firmware needs
 	a magic fix you didn't know about, or some clown changed the
 	chips on a board and not its name.  (Don't laugh!  Look at the
-	SMC etherpower for that.)
+	SMC ``etherpower`` for that.)
 
 3.	Make sure your changes compile correctly in multiple
 	configurations. In particular check that changes work both as a
@@ -25,7 +27,7 @@ trivial patch so apply some common sense.
 	testing and await feedback.
 
 5.	Make a patch available to the relevant maintainer in the list. Use
-	'diff -u' to make the patch easy to merge. Be prepared to get your
+	``diff -u`` to make the patch easy to merge. Be prepared to get your
 	changes sent back with seemingly silly requests about formatting
 	and variable names.  These aren't as silly as they seem. One
 	job the maintainers (and especially Linus) do is to keep things
@@ -33,28 +35,34 @@ trivial patch so apply some common sense.
 	your driver to get around a problem actually needs to become a
 	generalized kernel feature ready for next time.
 
-	PLEASE check your patch with the automated style checker
-	(scripts/checkpatch.pl) to catch trivial style violations.
-	See Documentation/CodingStyle for guidance here.
+	.. attention::
+
+	  **PLEASE:**
+
+	  - check your patch with the automated style checker
+	    (``scripts/checkpatch.pl``) to catch trivial style violations.
+	    See :ref:`Documentation/CodingStyle <codingstyle>` for guidance
+	    here.
 
-	PLEASE CC: the maintainers and mailing lists that are generated
-	by scripts/get_maintainer.pl.  The results returned by the
-	script will be best if you have git installed and are making
-	your changes in a branch derived from Linus' latest git tree.
-	See Documentation/SubmittingPatches for details.
+	  - CC: the maintainers and mailing lists that are generated
+	    by ``scripts/get_maintainer.pl``.  The results returned by the
+	    script will be best if you have git installed and are making
+	    your changes in a branch derived from Linus' latest git tree.
+	    See :ref:`Documentation/SubmittingPatches <submittingpatches>`
+	    for details.
 
-	PLEASE try to include any credit lines you want added with the
-	patch. It avoids people being missed off by mistake and makes
-	it easier to know who wants adding and who doesn't.
+	  - try to include any credit lines you want added with the
+	    patch. It avoids people being missed off by mistake and makes
+	    it easier to know who wants adding and who doesn't.
 
-	PLEASE document known bugs. If it doesn't work for everything
-	or does something very odd once a month document it.
+	  - document known bugs. If it doesn't work for everything
+	    or does something very odd once a month document it.
 
-	PLEASE remember that submissions must be made under the terms
-	of the Linux Foundation certificate of contribution and should
-	include a Signed-off-by: line.  The current version of this
-	"Developer's Certificate of Origin" (DCO) is listed in the file
-	Documentation/SubmittingPatches.
+	  - remember that submissions must be made under the terms
+	    of the Linux Foundation certificate of contribution and should
+	    include a Signed-off-by: line.  The current version of this
+	    "Developer's Certificate of Origin" (DCO) is listed in the file
+	    :ref:`Documentation/SubmittingPatches <submittingpatches>`.
 
 6.	Make sure you have the right to send any changes you make. If you
 	do changes at work you may find your employer owns the patch
@@ -66,64 +74,103 @@ trivial patch so apply some common sense.
 
 8.	Happy hacking.
 
-Descriptions of section entries:
-
-	P: Person (obsolete)
-	M: Mail patches to: FullName <address@domain>
-	R: Designated reviewer: FullName <address@domain>
-	   These reviewers should be CCed on patches.
-	L: Mailing list that is relevant to this area
-	W: Web-page with status/info
-	Q: Patchwork web based patch tracking system site
-	T: SCM tree type and location.
-	   Type is one of: git, hg, quilt, stgit, topgit
-	S: Status, one of the following:
-	   Supported:	Someone is actually paid to look after this.
-	   Maintained:	Someone actually looks after it.
-	   Odd Fixes:	It has a maintainer but they don't have time to do
+Descriptions of section entries
+-------------------------------
+
+-	``P:`` Person (obsolete)
+-	``M:`` Mail patches to: FullName <address@domain>
+-	``R:`` Designated reviewer: FullName <address@domain>
+
+	- These reviewers should be CCed on patches.
+
+-	``L:`` Mailing list that is relevant to this area
+-	``W:`` Web-page with status/info
+-	``Q:`` Patchwork web based patch tracking system site
+-	``T:`` SCM tree type and location.
+
+	- Type is one of: **git**, **hg**, **quilt**, **stgit**, **topgit**
+
+-	``S:`` Status, one of the following:
+
+	   - Supported:
+			Someone is actually paid to look after this.
+	   - Maintained:
+			Someone actually looks after it.
+	   - Odd Fixes:
+			It has a maintainer but they don't have time to do
 			much other than throw the odd patch in. See below..
-	   Orphan:	No current maintainer [but maybe you could take the
+	   - Orphan:
+			No current maintainer [but maybe you could take the
 			role as you write your new code].
-	   Obsolete:	Old code. Something tagged obsolete generally means
+	   - Obsolete:
+			Old code. Something tagged obsolete generally means
 			it has been replaced by a better system and you
 			should be using that.
-	F: Files and directories with wildcard patterns.
+-	``F:`` Files and directories with wildcard patterns.
+
 	   A trailing slash includes all files and subdirectory files.
-	   F:	drivers/net/	all files in and below drivers/net
-	   F:	drivers/net/*	all files in drivers/net, but not below
-	   F:	*/net/*		all files in "any top level directory"/net
-	   One pattern per line.  Multiple F: lines acceptable.
-	N: Files and directories with regex patterns.
-	   N:	[^a-z]tegra	all files whose path contains the word tegra
-	   One pattern per line.  Multiple N: lines acceptable.
-	   scripts/get_maintainer.pl has different behavior for files that
-	   match F: pattern and matches of N: patterns.  By default,
-	   get_maintainer will not look at git log history when an F: pattern
-	   match occurs.  When an N: match occurs, git log history is used
-	   to also notify the people that have git commit signatures.
-	X: Files and directories that are NOT maintained, same rules as F:
-	   Files exclusions are tested before file matches.
-	   Can be useful for excluding a specific subdirectory, for instance:
-	   F:	net/
-	   X:	net/ipv6/
-	   matches all files in and below net excluding net/ipv6/
-	K: Keyword perl extended regex pattern to match content in a
+
+	   ============================== ======================================
+	   ``F:``	``drivers/net/``	all files in and below
+						``drivers/net``
+	   ``F:``	``drivers/net/*``	all files in ``drivers/net``,
+						but not below
+	   ``F:``	``*/net/*``		all files in "any top level
+						directory" ``/net``
+	   ============================== ======================================
+
+	   One pattern per line.  Multiple ``F:`` lines acceptable.
+-	``N:`` Files and directories with regex patterns.
+
+	   ============================ ========================================
+	   ``N:``	``[^a-z]tegra``		all files whose path contains
+						the word ``tegra``
+	   ============================ ========================================
+
+	   One pattern per line.  Multiple ``N:`` lines acceptable.
+	   ``scripts/get_maintainer.pl`` has different behavior for files that
+	   match ``F:`` pattern and matches of ``N:`` patterns.  By default,
+	   get_maintainer will not look at git log history when an ``F:``
+	   pattern match occurs.  When an ``N:`` match occurs, git log history
+	   is used to also notify the people that have git commit signatures.
+-	``X:`` Files and directories that are NOT maintained, same rules as
+	``F:`` Files exclusions are tested before file matches.
+	Can be useful for excluding a specific subdirectory, for instance:
+
+	   ============================ ========================================
+	   ``F:``	``net/``	matches all files in and below
+					``net`` ...
+	   ``X:``	``net/ipv6/``	... excluding ``net/ipv6/``
+	   ============================ ========================================
+
+-	``K:`` Keyword perl extended regex pattern to match content in a
 	   patch or file.  For instance:
-	   K: of_get_profile
-	      matches patches or files that contain "of_get_profile"
-	   K: \b(printk|pr_(info|err))\b
-	      matches patches or files that contain one or more of the words
-	      printk, pr_info or pr_err
-	   One regex pattern per line.  Multiple K: lines acceptable.
 
-Note: For the hard of thinking, this list is meant to remain in alphabetical
-order. If you could add yourselves to it in alphabetical order that would be
-so much easier [Ed]
+	   =========================================== =========================
+	   ``K:`` ``of_get_profile``			matches patches or files
+							that contain
+							``of_get_profile``
+	   ``K:`` ``\b(printk|pr_(info|err))\b``	matches patches or
+							files that contain one
+							or more of the words
+							``printk``, ``pr_info``
+							or ``pr_err``
+	   =========================================== =========================
+
+	   One regex pattern per line.  Multiple ``K:`` lines acceptable.
+
+.. note::
+
+  For the hard of thinking, this list is meant to remain in alphabetical
+  order. If you could add yourselves to it in alphabetical order that would be
+  so much easier [Ed]
 
 Maintainers List (try to look for most precise areas first)
+-----------------------------------------------------------
 
 		-----------------------------------
 
+
 3C59X NETWORK DRIVER
 M:	Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
 L:	netdev@vger.kernel.org

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

* Re: [PATCH 1/4] doc-rst: reST-directive kernel-cmd / include contentent from scripts
  2016-10-17 16:46   ` Mauro Carvalho Chehab
@ 2016-10-18  6:07     ` Jani Nikula
  2016-10-18  6:52       ` Markus Heiser
  2016-10-18  9:13       ` Mauro Carvalho Chehab
  2016-10-18  7:03     ` Markus Heiser
  1 sibling, 2 replies; 32+ messages in thread
From: Jani Nikula @ 2016-10-18  6:07 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Markus Heiser
  Cc: Jonathan Corbet, Linux Media Mailing List, linux-doc, Joe Perches

On Mon, 17 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
> [PATCH] docs-rst: user: add MAINTAINERS
>
> including MAINTAINERS using ReST is tricky, because all
> maintainer's entries are like:
>
> FOO SUBSYSTEM:
> M: My Name <my@name>
> L: mailing@list
> S: Maintained
> F: foo/bar
>
> On ReST, this would be displayed on a single line. Using
> alias, like |M|, |L|, ... won't solve, as an alias in
> Sphinx doesn't accept breaking lines.
>
> So, instead of changing every line at MAINTAINERS, let's
> use kernel-cmd extension in order to parse it via a script.

Soon I'm going to stop fighting the windmills...

If you're going to insist on getting kernel-cmd upstream (and I haven't
changed my opinion on that) please at least have the sense to have just
*one* perl script to parse MAINTAINERS, not many. The one script should
be scripts/get_maintainer.pl.


BR,
Jani.

>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
>
> diff --git a/Documentation/sphinx/format_maintainers.pl b/Documentation/sphinx/format_maintainers.pl
> new file mode 100755
> index 000000000000..fb3af2a30c36
> --- /dev/null
> +++ b/Documentation/sphinx/format_maintainers.pl
> @@ -0,0 +1,44 @@
> +#!/usr/bin/perl
> +
> +my $is_rst = 1;
> +
> +# For now, ignore file tags, like F, N, X, K.
> +my %tags = (
> +	'P' => 'Person',
> +	'M' => 'Mail',
> +	'R' => 'Designated reviewer',
> +	'L' => 'Mailing list',
> +	'W' => 'Web page',
> +	'Q' => 'Patchwork',
> +	'T' => 'Develoment tree',
> +	'S' => 'Status',
> +);
> +
> +while (<>) {
> +	if ($is_rst) {
> +		if (m/^\s+\-+$/) {
> +			$is_rst = 0;
> +			next;
> +		}
> +		print $_;
> +		next;
> +	}
> +
> +	next if (m/^$/);
> +
> +	if (m/^([A-Z])\:(.*)/) {
> +		my $tag = $1;
> +		my $value = $2;
> +
> +		my $meaning;
> +
> +		next if (!defined($tags{$tag}));
> +
> +		printf " - %s:\n   %s\n\n", $tags{$tag}, $value;
> +		next;
> +	}
> +
> +	print "\n$_";
> +}
> +
> +print "\n";
> diff --git a/Documentation/user/MAINTAINERS.rst b/Documentation/user/MAINTAINERS.rst
> new file mode 100644
> index 000000000000..9b01b51749bd
> --- /dev/null
> +++ b/Documentation/user/MAINTAINERS.rst
> @@ -0,0 +1 @@
> +.. kernel-cmd:: format_maintainers.pl $srctree/MAINTAINERS
> diff --git a/Documentation/user/index.rst b/Documentation/user/index.rst
> index 6fbb2dc4b3b7..c4bfd45f0649 100644
> --- a/Documentation/user/index.rst
> +++ b/Documentation/user/index.rst
> @@ -32,3 +32,4 @@ Contents:
>     java
>     bad_memory
>     basic_profiling
> +   MAINTAINERS
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 1cd38a7e0064..d46ffec4e682 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1,12 +1,14 @@
> -
> -
> -	List of maintainers and how to submit kernel changes
> +List of maintainers and how to submit kernel changes
> +====================================================
>  
>  Please try to follow the guidelines below.  This will make things
>  easier on the maintainers.  Not all of these guidelines matter for every
>  trivial patch so apply some common sense.
>  
> -1.	Always _test_ your changes, however small, on at least 4 or
> +Tips for patch submitters
> +-------------------------
> +
> +1.	Always **test** your changes, however small, on at least 4 or
>  	5 people, preferably many more.
>  
>  2.	Try to release a few ALPHA test versions to the net. Announce
> @@ -15,7 +17,7 @@ trivial patch so apply some common sense.
>  	you will find things like the fact version 3 firmware needs
>  	a magic fix you didn't know about, or some clown changed the
>  	chips on a board and not its name.  (Don't laugh!  Look at the
> -	SMC etherpower for that.)
> +	SMC ``etherpower`` for that.)
>  
>  3.	Make sure your changes compile correctly in multiple
>  	configurations. In particular check that changes work both as a
> @@ -25,7 +27,7 @@ trivial patch so apply some common sense.
>  	testing and await feedback.
>  
>  5.	Make a patch available to the relevant maintainer in the list. Use
> -	'diff -u' to make the patch easy to merge. Be prepared to get your
> +	``diff -u`` to make the patch easy to merge. Be prepared to get your
>  	changes sent back with seemingly silly requests about formatting
>  	and variable names.  These aren't as silly as they seem. One
>  	job the maintainers (and especially Linus) do is to keep things
> @@ -33,28 +35,34 @@ trivial patch so apply some common sense.
>  	your driver to get around a problem actually needs to become a
>  	generalized kernel feature ready for next time.
>  
> -	PLEASE check your patch with the automated style checker
> -	(scripts/checkpatch.pl) to catch trivial style violations.
> -	See Documentation/CodingStyle for guidance here.
> +	.. attention::
> +
> +	  **PLEASE:**
> +
> +	  - check your patch with the automated style checker
> +	    (``scripts/checkpatch.pl``) to catch trivial style violations.
> +	    See :ref:`Documentation/CodingStyle <codingstyle>` for guidance
> +	    here.
>  
> -	PLEASE CC: the maintainers and mailing lists that are generated
> -	by scripts/get_maintainer.pl.  The results returned by the
> -	script will be best if you have git installed and are making
> -	your changes in a branch derived from Linus' latest git tree.
> -	See Documentation/SubmittingPatches for details.
> +	  - CC: the maintainers and mailing lists that are generated
> +	    by ``scripts/get_maintainer.pl``.  The results returned by the
> +	    script will be best if you have git installed and are making
> +	    your changes in a branch derived from Linus' latest git tree.
> +	    See :ref:`Documentation/SubmittingPatches <submittingpatches>`
> +	    for details.
>  
> -	PLEASE try to include any credit lines you want added with the
> -	patch. It avoids people being missed off by mistake and makes
> -	it easier to know who wants adding and who doesn't.
> +	  - try to include any credit lines you want added with the
> +	    patch. It avoids people being missed off by mistake and makes
> +	    it easier to know who wants adding and who doesn't.
>  
> -	PLEASE document known bugs. If it doesn't work for everything
> -	or does something very odd once a month document it.
> +	  - document known bugs. If it doesn't work for everything
> +	    or does something very odd once a month document it.
>  
> -	PLEASE remember that submissions must be made under the terms
> -	of the Linux Foundation certificate of contribution and should
> -	include a Signed-off-by: line.  The current version of this
> -	"Developer's Certificate of Origin" (DCO) is listed in the file
> -	Documentation/SubmittingPatches.
> +	  - remember that submissions must be made under the terms
> +	    of the Linux Foundation certificate of contribution and should
> +	    include a Signed-off-by: line.  The current version of this
> +	    "Developer's Certificate of Origin" (DCO) is listed in the file
> +	    :ref:`Documentation/SubmittingPatches <submittingpatches>`.
>  
>  6.	Make sure you have the right to send any changes you make. If you
>  	do changes at work you may find your employer owns the patch
> @@ -66,64 +74,103 @@ trivial patch so apply some common sense.
>  
>  8.	Happy hacking.
>  
> -Descriptions of section entries:
> -
> -	P: Person (obsolete)
> -	M: Mail patches to: FullName <address@domain>
> -	R: Designated reviewer: FullName <address@domain>
> -	   These reviewers should be CCed on patches.
> -	L: Mailing list that is relevant to this area
> -	W: Web-page with status/info
> -	Q: Patchwork web based patch tracking system site
> -	T: SCM tree type and location.
> -	   Type is one of: git, hg, quilt, stgit, topgit
> -	S: Status, one of the following:
> -	   Supported:	Someone is actually paid to look after this.
> -	   Maintained:	Someone actually looks after it.
> -	   Odd Fixes:	It has a maintainer but they don't have time to do
> +Descriptions of section entries
> +-------------------------------
> +
> +-	``P:`` Person (obsolete)
> +-	``M:`` Mail patches to: FullName <address@domain>
> +-	``R:`` Designated reviewer: FullName <address@domain>
> +
> +	- These reviewers should be CCed on patches.
> +
> +-	``L:`` Mailing list that is relevant to this area
> +-	``W:`` Web-page with status/info
> +-	``Q:`` Patchwork web based patch tracking system site
> +-	``T:`` SCM tree type and location.
> +
> +	- Type is one of: **git**, **hg**, **quilt**, **stgit**, **topgit**
> +
> +-	``S:`` Status, one of the following:
> +
> +	   - Supported:
> +			Someone is actually paid to look after this.
> +	   - Maintained:
> +			Someone actually looks after it.
> +	   - Odd Fixes:
> +			It has a maintainer but they don't have time to do
>  			much other than throw the odd patch in. See below..
> -	   Orphan:	No current maintainer [but maybe you could take the
> +	   - Orphan:
> +			No current maintainer [but maybe you could take the
>  			role as you write your new code].
> -	   Obsolete:	Old code. Something tagged obsolete generally means
> +	   - Obsolete:
> +			Old code. Something tagged obsolete generally means
>  			it has been replaced by a better system and you
>  			should be using that.
> -	F: Files and directories with wildcard patterns.
> +-	``F:`` Files and directories with wildcard patterns.
> +
>  	   A trailing slash includes all files and subdirectory files.
> -	   F:	drivers/net/	all files in and below drivers/net
> -	   F:	drivers/net/*	all files in drivers/net, but not below
> -	   F:	*/net/*		all files in "any top level directory"/net
> -	   One pattern per line.  Multiple F: lines acceptable.
> -	N: Files and directories with regex patterns.
> -	   N:	[^a-z]tegra	all files whose path contains the word tegra
> -	   One pattern per line.  Multiple N: lines acceptable.
> -	   scripts/get_maintainer.pl has different behavior for files that
> -	   match F: pattern and matches of N: patterns.  By default,
> -	   get_maintainer will not look at git log history when an F: pattern
> -	   match occurs.  When an N: match occurs, git log history is used
> -	   to also notify the people that have git commit signatures.
> -	X: Files and directories that are NOT maintained, same rules as F:
> -	   Files exclusions are tested before file matches.
> -	   Can be useful for excluding a specific subdirectory, for instance:
> -	   F:	net/
> -	   X:	net/ipv6/
> -	   matches all files in and below net excluding net/ipv6/
> -	K: Keyword perl extended regex pattern to match content in a
> +
> +	   ============================== ======================================
> +	   ``F:``	``drivers/net/``	all files in and below
> +						``drivers/net``
> +	   ``F:``	``drivers/net/*``	all files in ``drivers/net``,
> +						but not below
> +	   ``F:``	``*/net/*``		all files in "any top level
> +						directory" ``/net``
> +	   ============================== ======================================
> +
> +	   One pattern per line.  Multiple ``F:`` lines acceptable.
> +-	``N:`` Files and directories with regex patterns.
> +
> +	   ============================ ========================================
> +	   ``N:``	``[^a-z]tegra``		all files whose path contains
> +						the word ``tegra``
> +	   ============================ ========================================
> +
> +	   One pattern per line.  Multiple ``N:`` lines acceptable.
> +	   ``scripts/get_maintainer.pl`` has different behavior for files that
> +	   match ``F:`` pattern and matches of ``N:`` patterns.  By default,
> +	   get_maintainer will not look at git log history when an ``F:``
> +	   pattern match occurs.  When an ``N:`` match occurs, git log history
> +	   is used to also notify the people that have git commit signatures.
> +-	``X:`` Files and directories that are NOT maintained, same rules as
> +	``F:`` Files exclusions are tested before file matches.
> +	Can be useful for excluding a specific subdirectory, for instance:
> +
> +	   ============================ ========================================
> +	   ``F:``	``net/``	matches all files in and below
> +					``net`` ...
> +	   ``X:``	``net/ipv6/``	... excluding ``net/ipv6/``
> +	   ============================ ========================================
> +
> +-	``K:`` Keyword perl extended regex pattern to match content in a
>  	   patch or file.  For instance:
> -	   K: of_get_profile
> -	      matches patches or files that contain "of_get_profile"
> -	   K: \b(printk|pr_(info|err))\b
> -	      matches patches or files that contain one or more of the words
> -	      printk, pr_info or pr_err
> -	   One regex pattern per line.  Multiple K: lines acceptable.
>  
> -Note: For the hard of thinking, this list is meant to remain in alphabetical
> -order. If you could add yourselves to it in alphabetical order that would be
> -so much easier [Ed]
> +	   =========================================== =========================
> +	   ``K:`` ``of_get_profile``			matches patches or files
> +							that contain
> +							``of_get_profile``
> +	   ``K:`` ``\b(printk|pr_(info|err))\b``	matches patches or
> +							files that contain one
> +							or more of the words
> +							``printk``, ``pr_info``
> +							or ``pr_err``
> +	   =========================================== =========================
> +
> +	   One regex pattern per line.  Multiple ``K:`` lines acceptable.
> +
> +.. note::
> +
> +  For the hard of thinking, this list is meant to remain in alphabetical
> +  order. If you could add yourselves to it in alphabetical order that would be
> +  so much easier [Ed]
>  
>  Maintainers List (try to look for most precise areas first)
> +-----------------------------------------------------------
>  
>  		-----------------------------------
>  
> +
>  3C59X NETWORK DRIVER
>  M:	Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
>  L:	netdev@vger.kernel.org

-- 
Jani Nikula, Intel Open Source Technology Center

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

* Re: [PATCH 1/4] doc-rst: reST-directive kernel-cmd / include contentent from scripts
  2016-10-18  6:07     ` Jani Nikula
@ 2016-10-18  6:52       ` Markus Heiser
  2016-10-18  9:13       ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 32+ messages in thread
From: Markus Heiser @ 2016-10-18  6:52 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Mauro Carvalho Chehab, Jonathan Corbet, Linux Media Mailing List,
	linux-doc, Joe Perches


Am 18.10.2016 um 08:07 schrieb Jani Nikula <jani.nikula@intel.com>:

> If you're going to insist on getting kernel-cmd upstream (and I haven't
> changed my opinion on that) please at least have the sense to have just
> *one* perl script to parse MAINTAINERS, not many. The one script should
> be scripts/get_maintainer.pl.

Great minds think alike. ;-)

-- Markus --


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

* Re: [PATCH 1/4] doc-rst: reST-directive kernel-cmd / include contentent from scripts
  2016-10-17 16:46   ` Mauro Carvalho Chehab
  2016-10-18  6:07     ` Jani Nikula
@ 2016-10-18  7:03     ` Markus Heiser
  2016-10-18  8:59       ` Mauro Carvalho Chehab
  2016-10-18 10:06       ` Mauro Carvalho Chehab
  1 sibling, 2 replies; 32+ messages in thread
From: Markus Heiser @ 2016-10-18  7:03 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Jonathan Corbet, Jani Nikula, Linux Media Mailing List, linux-doc

Am 17.10.2016 um 18:46 schrieb Mauro Carvalho Chehab <mchehab@infradead.org>:

> Hi Markus,
> 
> Em Thu,  6 Oct 2016 09:20:17 +0200
> Markus Heiser <markus.heiser@darmarit.de> escreveu:
> 
>> From: Markus Heiser <markus.heiser@darmarIT.de>
>> 
>> The ``kernel-cmd`` directive includes contend from the stdout of a
>> command-line. With the ``kernel-cmd`` directive we can include the
>> output of any (Perl or whatever) script. This is a more general solution
>> for other workarounds like the "kernel_include + parseheaders" solution.
> 
> Unfortunately, there are some problems with kernel-cmd: it seems
> that it only partially parses the ReST file, not accepting several ReST tags.
> 
> See the enclosed patch and see the produced html file at:
> 	Documentation/output/user/MAINTAINERS.html
> 
> Then run the script manually with:
> 	./Documentation/sphinx/format_maintainers.pl MAINTAINERS >Documentation/user/MAINTAINERS.rst
> 
> And see the produced html output after re-building the user book.

Hmm, I can't see what you mean ... the MAINTAINERS.html is formated
according to the markup in the MAINTAINERS.html ... could you 
be more precise?  But before ... I added some comments in the patch
below to clarify.

OT but as I'am looking at:

/share/linux-docs-next/Documentation/user/BUG-HUNTING.rst:247: WARNING: undefined label: submittingpatches (if the link has no caption the label must precede a section header)
/share/linux-docs-next/Documentation/user/MAINTAINERS.rst:42: WARNING: undefined label: codingstyle (if the link has no caption the label must precede a section header)
/share/linux-docs-next/Documentation/user/MAINTAINERS.rst:47: WARNING: undefined label: submittingpatches (if the link has no caption the label must precede a section header)
/share/linux-docs-next/Documentation/user/MAINTAINERS.rst:61: WARNING: undefined label: submittingpatches (if the link has no caption the label must precede a section header)
/share/linux-docs-next/Documentation/user/README.rst:92: WARNING: undefined label: applying_patches (if the link has no caption the label must precede a section header)
/share/linux-docs-next/Documentation/user/README.rst:121: WARNING: undefined label: changes (if the link has no caption the label must precede a section header)
/share/linux-docs-next/Documentation/user/README.rst:256: WARNING: undefined label: changes (if the link has no caption the label must precede a section header)
/share/linux-docs-next/Documentation/user/devices.rst:9: WARNING: undefined label: submittingpatches (if the link has no caption the label must precede a section header)

.. this is why I think;  "links are the beginning of babylon" ;-)


> 
> PS.: You can test it on my git tree, with has the code to produce
> it at the lkml-books branch, at
> 	http:://git.linuxtv.org/mchehab/experimental.git
> 
> Regards,
> Mauro
> 
> 
> [PATCH] docs-rst: user: add MAINTAINERS
> 
> including MAINTAINERS using ReST is tricky, because all
> maintainer's entries are like:
> 
> FOO SUBSYSTEM:
> M: My Name <my@name>
> L: mailing@list
> S: Maintained
> F: foo/bar
> 
> On ReST, this would be displayed on a single line. Using
> alias, like |M|, |L|, ... won't solve, as an alias in
> Sphinx doesn't accept breaking lines.
> 
> So, instead of changing every line at MAINTAINERS, let's
> use kernel-cmd extension in order to parse it via a script.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> 
> diff --git a/Documentation/sphinx/format_maintainers.pl b/Documentation/sphinx/format_maintainers.pl
> new file mode 100755
> index 000000000000..fb3af2a30c36
> --- /dev/null
> +++ b/Documentation/sphinx/format_maintainers.pl
> @@ -0,0 +1,44 @@
> +#!/usr/bin/perl
> +
> +my $is_rst = 1;
> +
> +# For now, ignore file tags, like F, N, X, K.
> +my %tags = (
> +	'P' => 'Person',
> +	'M' => 'Mail',
> +	'R' => 'Designated reviewer',
> +	'L' => 'Mailing list',
> +	'W' => 'Web page',
> +	'Q' => 'Patchwork',
> +	'T' => 'Develoment tree',
> +	'S' => 'Status',
> +);
> +
> +while (<>) {
> +	if ($is_rst) {
> +		if (m/^\s+\-+$/) {
> +			$is_rst = 0;
> +			next;
> +		}
> +		print $_;
> +		next;
> +	}
> +
> +	next if (m/^$/);
> +
> +	if (m/^([A-Z])\:(.*)/) {
> +		my $tag = $1;
> +		my $value = $2;
> +
> +		my $meaning;
> +
> +		next if (!defined($tags{$tag}));
> +
> +		printf " - %s:\n   %s\n\n", $tags{$tag}, $value;
> +		next;
> +	}
> +
> +	print "\n$_";
> +}
> +
> +print "\n";

OK, its a starting point, but it is IMO a bit poor.
I missed the 'F' section and the markup arguable

|3C59X NETWORK DRIVER
| - Mail:
|   	Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
|
| - Mailing list:
|   	netdev@vger.kernel.org
|
| - Status:
|   	Maintained

I prefer would prefer an indent of zero/two spaces and no tabs:

|3C59X NETWORK DRIVER
|--------------------
|
|- Mail:
|
|  * Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
|
|- Mailing list:
| 
|  * netdev@vger.kernel.org
|
|- Status:
| 
|  * Maintained

Anyway, the first time I thought MAINTAINERS is a database,
I also thought, the scripts/get_maintainers.pl is "the parser".
But my perl is poor and I have not yet looked closer / did you?


> diff --git a/Documentation/user/MAINTAINERS.rst b/Documentation/user/MAINTAINERS.rst
> new file mode 100644
> index 000000000000..9b01b51749bd
> --- /dev/null
> +++ b/Documentation/user/MAINTAINERS.rst
> @@ -0,0 +1 @@
> +.. kernel-cmd:: format_maintainers.pl $srctree/MAINTAINERS
> diff --git a/Documentation/user/index.rst b/Documentation/user/index.rst
> index 6fbb2dc4b3b7..c4bfd45f0649 100644
> --- a/Documentation/user/index.rst
> +++ b/Documentation/user/index.rst
> @@ -32,3 +32,4 @@ Contents:
>   java
>   bad_memory
>   basic_profiling
> +   MAINTAINERS
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 1cd38a7e0064..d46ffec4e682 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1,12 +1,14 @@
> -
> -
> -	List of maintainers and how to submit kernel changes
> +List of maintainers and how to submit kernel changes
> +====================================================
> 
> Please try to follow the guidelines below.  This will make things
> easier on the maintainers.  Not all of these guidelines matter for every
> trivial patch so apply some common sense.
> 
> -1.	Always _test_ your changes, however small, on at least 4 or
> +Tips for patch submitters
> +-------------------------
> +
> +1.	Always **test** your changes, however small, on at least 4 or
> 	5 people, preferably many more.
> 
> 2.	Try to release a few ALPHA test versions to the net. Announce
> @@ -15,7 +17,7 @@ trivial patch so apply some common sense.
> 	you will find things like the fact version 3 firmware needs
> 	a magic fix you didn't know about, or some clown changed the
> 	chips on a board and not its name.  (Don't laugh!  Look at the
> -	SMC etherpower for that.)
> +	SMC ``etherpower`` for that.)
> 
> 3.	Make sure your changes compile correctly in multiple
> 	configurations. In particular check that changes work both as a
> @@ -25,7 +27,7 @@ trivial patch so apply some common sense.
> 	testing and await feedback.
> 
> 5.	Make a patch available to the relevant maintainer in the list. Use
> -	'diff -u' to make the patch easy to merge. Be prepared to get your
> +	``diff -u`` to make the patch easy to merge. Be prepared to get your
> 	changes sent back with seemingly silly requests about formatting
> 	and variable names.  These aren't as silly as they seem. One
> 	job the maintainers (and especially Linus) do is to keep things
> @@ -33,28 +35,34 @@ trivial patch so apply some common sense.
> 	your driver to get around a problem actually needs to become a
> 	generalized kernel feature ready for next time.
> 
> -	PLEASE check your patch with the automated style checker
> -	(scripts/checkpatch.pl) to catch trivial style violations.
> -	See Documentation/CodingStyle for guidance here.
> +	.. attention::
> +
> +	  **PLEASE:**
> +
> +	  - check your patch with the automated style checker
> +	    (``scripts/checkpatch.pl``) to catch trivial style violations.
> +	    See :ref:`Documentation/CodingStyle <codingstyle>` for guidance
> +	    here.
> 
> -	PLEASE CC: the maintainers and mailing lists that are generated
> -	by scripts/get_maintainer.pl.  The results returned by the
> -	script will be best if you have git installed and are making
> -	your changes in a branch derived from Linus' latest git tree.
> -	See Documentation/SubmittingPatches for details.
> +	  - CC: the maintainers and mailing lists that are generated
> +	    by ``scripts/get_maintainer.pl``.  The results returned by the
> +	    script will be best if you have git installed and are making
> +	    your changes in a branch derived from Linus' latest git tree.
> +	    See :ref:`Documentation/SubmittingPatches <submittingpatches>`
> +	    for details.
> 
> -	PLEASE try to include any credit lines you want added with the
> -	patch. It avoids people being missed off by mistake and makes
> -	it easier to know who wants adding and who doesn't.
> +	  - try to include any credit lines you want added with the
> +	    patch. It avoids people being missed off by mistake and makes
> +	    it easier to know who wants adding and who doesn't.
> 
> -	PLEASE document known bugs. If it doesn't work for everything
> -	or does something very odd once a month document it.
> +	  - document known bugs. If it doesn't work for everything
> +	    or does something very odd once a month document it.
> 
> -	PLEASE remember that submissions must be made under the terms
> -	of the Linux Foundation certificate of contribution and should
> -	include a Signed-off-by: line.  The current version of this
> -	"Developer's Certificate of Origin" (DCO) is listed in the file
> -	Documentation/SubmittingPatches.
> +	  - remember that submissions must be made under the terms
> +	    of the Linux Foundation certificate of contribution and should
> +	    include a Signed-off-by: line.  The current version of this
> +	    "Developer's Certificate of Origin" (DCO) is listed in the file
> +	    :ref:`Documentation/SubmittingPatches <submittingpatches>`.
> 
> 6.	Make sure you have the right to send any changes you make. If you
> 	do changes at work you may find your employer owns the patch
> @@ -66,64 +74,103 @@ trivial patch so apply some common sense.
> 
> 8.	Happy hacking.
> 
> -Descriptions of section entries:
> -
> -	P: Person (obsolete)
> -	M: Mail patches to: FullName <address@domain>
> -	R: Designated reviewer: FullName <address@domain>
> -	   These reviewers should be CCed on patches.
> -	L: Mailing list that is relevant to this area
> -	W: Web-page with status/info
> -	Q: Patchwork web based patch tracking system site
> -	T: SCM tree type and location.
> -	   Type is one of: git, hg, quilt, stgit, topgit
> -	S: Status, one of the following:
> -	   Supported:	Someone is actually paid to look after this.
> -	   Maintained:	Someone actually looks after it.
> -	   Odd Fixes:	It has a maintainer but they don't have time to do
> +Descriptions of section entries
> +-------------------------------
> +
> +-	``P:`` Person (obsolete)
> +-	``M:`` Mail patches to: FullName <address@domain>
> +-	``R:`` Designated reviewer: FullName <address@domain>
> +
> +	- These reviewers should be CCed on patches.
> +
> +-	``L:`` Mailing list that is relevant to this area
> +-	``W:`` Web-page with status/info
> +-	``Q:`` Patchwork web based patch tracking system site
> +-	``T:`` SCM tree type and location.
> +
> +	- Type is one of: **git**, **hg**, **quilt**, **stgit**, **topgit**
> +

Hmm, why is the last line a bullet list, shouldn't it be:

+- ``T:`` SCM tree type and location
+  Type is one of: git, hg, quilt, stgit, topgit


> +-	``S:`` Status, one of the following:
> +
> +	   - Supported:
> +			Someone is actually paid to look after this.

Sorry, but I will never understand why you using mixed tabs and space 
for the same thing ;-) ... what I mean; why is the top-list indented by 
a tab after the bullet and the sub-list by two spaces ... 

We had the tab discussion already ... and IMO calling the CodeStyle is not
helpful when using ASCII markup ... lets take the ASCI documentation compact
and forget the tab ;-)

> +	   - Maintained:
> +			Someone actually looks after it.
> +	   - Odd Fixes:
> +			It has a maintainer but they don't have time to do
> 			much other than throw the odd patch in. See below..
> -	   Orphan:	No current maintainer [but maybe you could take the
> +	   - Orphan:
> +			No current maintainer [but maybe you could take the
> 			role as you write your new code].
> -	   Obsolete:	Old code. Something tagged obsolete generally means
> +	   - Obsolete:
> +			Old code. Something tagged obsolete generally means
> 			it has been replaced by a better system and you
> 			should be using that.

Hmm, here its the same with the indent. List, list-items, paragraphs etc. are all
"body elements". 

* http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#body-elements

A body element is always introduced by a leading empty line. E.g:

- ``S:`` Status, one of the following:

 - Supported:

   Someone is actually paid to look after this.

 - Maintained:

   Someone actually looks after it.

or even more compact (which I do prefer), without paragraphs in the list items:

- ``S:`` Status, one of the following:

 - Supported: Someone is actually paid to look after this.

 - Maintained: Someone actually looks after it.

> -	F: Files and directories with wildcard patterns.
> +-	``F:`` Files and directories with wildcard patterns.
> +
> 	   A trailing slash includes all files and subdirectory files.
> -	   F:	drivers/net/	all files in and below drivers/net
> -	   F:	drivers/net/*	all files in drivers/net, but not below
> -	   F:	*/net/*		all files in "any top level directory"/net
> -	   One pattern per line.  Multiple F: lines acceptable.
> -	N: Files and directories with regex patterns.
> -	   N:	[^a-z]tegra	all files whose path contains the word tegra
> -	   One pattern per line.  Multiple N: lines acceptable.
> -	   scripts/get_maintainer.pl has different behavior for files that
> -	   match F: pattern and matches of N: patterns.  By default,
> -	   get_maintainer will not look at git log history when an F: pattern
> -	   match occurs.  When an N: match occurs, git log history is used
> -	   to also notify the people that have git commit signatures.
> -	X: Files and directories that are NOT maintained, same rules as F:
> -	   Files exclusions are tested before file matches.
> -	   Can be useful for excluding a specific subdirectory, for instance:
> -	   F:	net/
> -	   X:	net/ipv6/
> -	   matches all files in and below net excluding net/ipv6/
> -	K: Keyword perl extended regex pattern to match content in a
> +
> +	   ============================== ======================================
> +	   ``F:``	``drivers/net/``	all files in and below
> +						``drivers/net``
> +	   ``F:``	``drivers/net/*``	all files in ``drivers/net``,
> +						but not below
> +	   ``F:``	``*/net/*``		all files in "any top level
> +						directory" ``/net``
> +	   ============================== ======================================
> +
> +	   One pattern per line.  Multiple ``F:`` lines acceptable.
> +-	``N:`` Files and directories with regex patterns.

Between the last two lines, a empty line is required ... I fond this more times
(will not comment each).

OK, I will stop here, if you are interested in I can prepare a patch for
illustration ....

-- Markus --


> +
> +	   ============================ ========================================
> +	   ``N:``	``[^a-z]tegra``		all files whose path contains
> +						the word ``tegra``
> +	   ============================ ========================================
> +
> +	   One pattern per line.  Multiple ``N:`` lines acceptable.
> +	   ``scripts/get_maintainer.pl`` has different behavior for files that
> +	   match ``F:`` pattern and matches of ``N:`` patterns.  By default,
> +	   get_maintainer will not look at git log history when an ``F:``
> +	   pattern match occurs.  When an ``N:`` match occurs, git log history
> +	   is used to also notify the people that have git commit signatures.
> +-	``X:`` Files and directories that are NOT maintained, same rules as
> +	``F:`` Files exclusions are tested before file matches.
> +	Can be useful for excluding a specific subdirectory, for instance:
> +
> +	   ============================ ========================================
> +	   ``F:``	``net/``	matches all files in and below
> +					``net`` ...
> +	   ``X:``	``net/ipv6/``	... excluding ``net/ipv6/``
> +	   ============================ ========================================
> +
> +-	``K:`` Keyword perl extended regex pattern to match content in a
> 	   patch or file.  For instance:
> -	   K: of_get_profile
> -	      matches patches or files that contain "of_get_profile"
> -	   K: \b(printk|pr_(info|err))\b
> -	      matches patches or files that contain one or more of the words
> -	      printk, pr_info or pr_err
> -	   One regex pattern per line.  Multiple K: lines acceptable.
> 
> -Note: For the hard of thinking, this list is meant to remain in alphabetical
> -order. If you could add yourselves to it in alphabetical order that would be
> -so much easier [Ed]
> +	   =========================================== =========================
> +	   ``K:`` ``of_get_profile``			matches patches or files
> +							that contain
> +							``of_get_profile``
> +	   ``K:`` ``\b(printk|pr_(info|err))\b``	matches patches or
> +							files that contain one
> +							or more of the words
> +							``printk``, ``pr_info``
> +							or ``pr_err``
> +	   =========================================== =========================
> +
> +	   One regex pattern per line.  Multiple ``K:`` lines acceptable.
> +
> +.. note::
> +
> +  For the hard of thinking, this list is meant to remain in alphabetical
> +  order. If you could add yourselves to it in alphabetical order that would be
> +  so much easier [Ed]
> 
> Maintainers List (try to look for most precise areas first)
> +-----------------------------------------------------------
> 
> 		-----------------------------------
> 
> +
> 3C59X NETWORK DRIVER
> M:	Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
> L:	netdev@vger.kernel.org
> --
> To unsubscribe from this list: send the line "unsubscribe linux-doc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [PATCH 1/4] doc-rst: reST-directive kernel-cmd / include contentent from scripts
  2016-10-18  7:03     ` Markus Heiser
@ 2016-10-18  8:59       ` Mauro Carvalho Chehab
  2016-10-18 10:06       ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-18  8:59 UTC (permalink / raw)
  To: Markus Heiser
  Cc: Jonathan Corbet, Jani Nikula, Linux Media Mailing List, linux-doc

Em Tue, 18 Oct 2016 09:03:28 +0200
Markus Heiser <markus.heiser@darmarit.de> escreveu:

> Am 17.10.2016 um 18:46 schrieb Mauro Carvalho Chehab <mchehab@infradead.org>:
> 
> > Hi Markus,
> > 
> > Em Thu,  6 Oct 2016 09:20:17 +0200
> > Markus Heiser <markus.heiser@darmarit.de> escreveu:
> >   
> >> From: Markus Heiser <markus.heiser@darmarIT.de>
> >> 
> >> The ``kernel-cmd`` directive includes contend from the stdout of a
> >> command-line. With the ``kernel-cmd`` directive we can include the
> >> output of any (Perl or whatever) script. This is a more general solution
> >> for other workarounds like the "kernel_include + parseheaders" solution.  
> > 
> > Unfortunately, there are some problems with kernel-cmd: it seems
> > that it only partially parses the ReST file, not accepting several ReST tags.
> > 
> > See the enclosed patch and see the produced html file at:
> > 	Documentation/output/user/MAINTAINERS.html
> > 
> > Then run the script manually with:
> > 	./Documentation/sphinx/format_maintainers.pl MAINTAINERS >Documentation/user/MAINTAINERS.rst
> > 
> > And see the produced html output after re-building the user book.  
> 
> Hmm, I can't see what you mean ... the MAINTAINERS.html is formated
> according to the markup in the MAINTAINERS.html ... could you 
> be more precise?

Look, for example, on how the tables will be formatted using the
kernel-cmd extension, and how they appear if you create the
MAINTAINERS.rst with:
	./Documentation/sphinx/format_maintainers.pl MAINTAINERS >Documentation/user/MAINTAINERS.rst

The .. attention:: is also not parsed by kernel-cmd script, nor
the item lists.


>  But before ... I added some comments in the patch
> below to clarify.
> 
> OT but as I'am looking at:
> 
> /share/linux-docs-next/Documentation/user/BUG-HUNTING.rst:247: WARNING: undefined label: submittingpatches (if the link has no caption the label must precede a section header)
> /share/linux-docs-next/Documentation/user/MAINTAINERS.rst:42: WARNING: undefined label: codingstyle (if the link has no caption the label must precede a section header)
> /share/linux-docs-next/Documentation/user/MAINTAINERS.rst:47: WARNING: undefined label: submittingpatches (if the link has no caption the label must precede a section header)
> /share/linux-docs-next/Documentation/user/MAINTAINERS.rst:61: WARNING: undefined label: submittingpatches (if the link has no caption the label must precede a section header)
> /share/linux-docs-next/Documentation/user/README.rst:92: WARNING: undefined label: applying_patches (if the link has no caption the label must precede a section header)
> /share/linux-docs-next/Documentation/user/README.rst:121: WARNING: undefined label: changes (if the link has no caption the label must precede a section header)
> /share/linux-docs-next/Documentation/user/README.rst:256: WARNING: undefined label: changes (if the link has no caption the label must precede a section header)
> /share/linux-docs-next/Documentation/user/devices.rst:9: WARNING: undefined label: submittingpatches (if the link has no caption the label must precede a section header)
> 
> .. this is why I think;  "links are the beginning of babylon" ;-)

Yes. We need intersphinx to fix those if we build just one book, as those 
links belong to other books.


> 
> 
> > 
> > PS.: You can test it on my git tree, with has the code to produce
> > it at the lkml-books branch, at
> > 	http:://git.linuxtv.org/mchehab/experimental.git
> > 
> > Regards,
> > Mauro
> > 
> > 
> > [PATCH] docs-rst: user: add MAINTAINERS
> > 
> > including MAINTAINERS using ReST is tricky, because all
> > maintainer's entries are like:
> > 
> > FOO SUBSYSTEM:
> > M: My Name <my@name>
> > L: mailing@list
> > S: Maintained
> > F: foo/bar
> > 
> > On ReST, this would be displayed on a single line. Using
> > alias, like |M|, |L|, ... won't solve, as an alias in
> > Sphinx doesn't accept breaking lines.
> > 
> > So, instead of changing every line at MAINTAINERS, let's
> > use kernel-cmd extension in order to parse it via a script.
> > 
> > Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
> > 
> > diff --git a/Documentation/sphinx/format_maintainers.pl b/Documentation/sphinx/format_maintainers.pl
> > new file mode 100755
> > index 000000000000..fb3af2a30c36
> > --- /dev/null
> > +++ b/Documentation/sphinx/format_maintainers.pl
> > @@ -0,0 +1,44 @@
> > +#!/usr/bin/perl
> > +
> > +my $is_rst = 1;
> > +
> > +# For now, ignore file tags, like F, N, X, K.
> > +my %tags = (
> > +	'P' => 'Person',
> > +	'M' => 'Mail',
> > +	'R' => 'Designated reviewer',
> > +	'L' => 'Mailing list',
> > +	'W' => 'Web page',
> > +	'Q' => 'Patchwork',
> > +	'T' => 'Develoment tree',
> > +	'S' => 'Status',
> > +);
> > +
> > +while (<>) {
> > +	if ($is_rst) {
> > +		if (m/^\s+\-+$/) {
> > +			$is_rst = 0;
> > +			next;
> > +		}
> > +		print $_;
> > +		next;
> > +	}
> > +
> > +	next if (m/^$/);
> > +
> > +	if (m/^([A-Z])\:(.*)/) {
> > +		my $tag = $1;
> > +		my $value = $2;
> > +
> > +		my $meaning;
> > +
> > +		next if (!defined($tags{$tag}));
> > +
> > +		printf " - %s:\n   %s\n\n", $tags{$tag}, $value;
> > +		next;
> > +	}
> > +
> > +	print "\n$_";
> > +}
> > +
> > +print "\n";  
> 
> OK, its a starting point, but it is IMO a bit poor.

Yes, I know. This was just proof of concept, that took me no more than 10 
mins to write, meant to test the idea of using kernel-cmd with MAINTAINERS,
instead of using 'sphinxcontrib.programoutput' extension, as proposed
originally on this patch:
	https://git.linuxtv.org/mchehab/experimental.git/commit/?h=lkml-books&id=b731eca3d5ba71605bedb64578cc82e986034139

> I missed the 'F' section and the markup arguable
> 
> |3C59X NETWORK DRIVER
> | - Mail:
> |   	Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
> |
> | - Mailing list:
> |   	netdev@vger.kernel.org
> |
> | - Status:
> |   	Maintained
> 
> I prefer would prefer an indent of zero/two spaces and no tabs:
> 
> |3C59X NETWORK DRIVER
> |--------------------
> |
> |- Mail:
> |
> |  * Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
> |
> |- Mailing list:
> | 
> |  * netdev@vger.kernel.org
> |
> |- Status:
> | 
> |  * Maintained
> 

Maybe, it could do, instead:

3C59X NETWORK DRIVER
--------------------

- **Mail**: Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
- **Mailing list**: netdev@vger.kernel.org
- **Status**:  Maintained

> Anyway, the first time I thought MAINTAINERS is a database,
> I also thought, the scripts/get_maintainers.pl is "the parser".
> But my perl is poor and I have not yet looked closer / did you?

Yes, but I didn't look into its code yet. At least for a PoC,
I prefer to have a separate script. If we decide to go this way,
whatever we do can be migrated to it.

Btw, one of the things that occurred to me is that the html output
could come with javascript version of get_maintainers.pl, letting the
user to provide a file name and such script would find the MAINTAINER's
entry associated with a file.

> > diff --git a/Documentation/user/MAINTAINERS.rst b/Documentation/user/MAINTAINERS.rst
> > new file mode 100644
> > index 000000000000..9b01b51749bd
> > --- /dev/null
> > +++ b/Documentation/user/MAINTAINERS.rst
> > @@ -0,0 +1 @@
> > +.. kernel-cmd:: format_maintainers.pl $srctree/MAINTAINERS
> > diff --git a/Documentation/user/index.rst b/Documentation/user/index.rst
> > index 6fbb2dc4b3b7..c4bfd45f0649 100644
> > --- a/Documentation/user/index.rst
> > +++ b/Documentation/user/index.rst
> > @@ -32,3 +32,4 @@ Contents:
> >   java
> >   bad_memory
> >   basic_profiling
> > +   MAINTAINERS
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index 1cd38a7e0064..d46ffec4e682 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -1,12 +1,14 @@
> > -
> > -
> > -	List of maintainers and how to submit kernel changes
> > +List of maintainers and how to submit kernel changes
> > +====================================================
> > 
> > Please try to follow the guidelines below.  This will make things
> > easier on the maintainers.  Not all of these guidelines matter for every
> > trivial patch so apply some common sense.
> > 
> > -1.	Always _test_ your changes, however small, on at least 4 or
> > +Tips for patch submitters
> > +-------------------------
> > +
> > +1.	Always **test** your changes, however small, on at least 4 or
> > 	5 people, preferably many more.
> > 
> > 2.	Try to release a few ALPHA test versions to the net. Announce
> > @@ -15,7 +17,7 @@ trivial patch so apply some common sense.
> > 	you will find things like the fact version 3 firmware needs
> > 	a magic fix you didn't know about, or some clown changed the
> > 	chips on a board and not its name.  (Don't laugh!  Look at the
> > -	SMC etherpower for that.)
> > +	SMC ``etherpower`` for that.)
> > 
> > 3.	Make sure your changes compile correctly in multiple
> > 	configurations. In particular check that changes work both as a
> > @@ -25,7 +27,7 @@ trivial patch so apply some common sense.
> > 	testing and await feedback.
> > 
> > 5.	Make a patch available to the relevant maintainer in the list. Use
> > -	'diff -u' to make the patch easy to merge. Be prepared to get your
> > +	``diff -u`` to make the patch easy to merge. Be prepared to get your
> > 	changes sent back with seemingly silly requests about formatting
> > 	and variable names.  These aren't as silly as they seem. One
> > 	job the maintainers (and especially Linus) do is to keep things
> > @@ -33,28 +35,34 @@ trivial patch so apply some common sense.
> > 	your driver to get around a problem actually needs to become a
> > 	generalized kernel feature ready for next time.
> > 
> > -	PLEASE check your patch with the automated style checker
> > -	(scripts/checkpatch.pl) to catch trivial style violations.
> > -	See Documentation/CodingStyle for guidance here.
> > +	.. attention::
> > +
> > +	  **PLEASE:**
> > +
> > +	  - check your patch with the automated style checker
> > +	    (``scripts/checkpatch.pl``) to catch trivial style violations.
> > +	    See :ref:`Documentation/CodingStyle <codingstyle>` for guidance
> > +	    here.
> > 
> > -	PLEASE CC: the maintainers and mailing lists that are generated
> > -	by scripts/get_maintainer.pl.  The results returned by the
> > -	script will be best if you have git installed and are making
> > -	your changes in a branch derived from Linus' latest git tree.
> > -	See Documentation/SubmittingPatches for details.
> > +	  - CC: the maintainers and mailing lists that are generated
> > +	    by ``scripts/get_maintainer.pl``.  The results returned by the
> > +	    script will be best if you have git installed and are making
> > +	    your changes in a branch derived from Linus' latest git tree.
> > +	    See :ref:`Documentation/SubmittingPatches <submittingpatches>`
> > +	    for details.
> > 
> > -	PLEASE try to include any credit lines you want added with the
> > -	patch. It avoids people being missed off by mistake and makes
> > -	it easier to know who wants adding and who doesn't.
> > +	  - try to include any credit lines you want added with the
> > +	    patch. It avoids people being missed off by mistake and makes
> > +	    it easier to know who wants adding and who doesn't.
> > 
> > -	PLEASE document known bugs. If it doesn't work for everything
> > -	or does something very odd once a month document it.
> > +	  - document known bugs. If it doesn't work for everything
> > +	    or does something very odd once a month document it.
> > 
> > -	PLEASE remember that submissions must be made under the terms
> > -	of the Linux Foundation certificate of contribution and should
> > -	include a Signed-off-by: line.  The current version of this
> > -	"Developer's Certificate of Origin" (DCO) is listed in the file
> > -	Documentation/SubmittingPatches.
> > +	  - remember that submissions must be made under the terms
> > +	    of the Linux Foundation certificate of contribution and should
> > +	    include a Signed-off-by: line.  The current version of this
> > +	    "Developer's Certificate of Origin" (DCO) is listed in the file
> > +	    :ref:`Documentation/SubmittingPatches <submittingpatches>`.
> > 
> > 6.	Make sure you have the right to send any changes you make. If you
> > 	do changes at work you may find your employer owns the patch
> > @@ -66,64 +74,103 @@ trivial patch so apply some common sense.
> > 
> > 8.	Happy hacking.
> > 
> > -Descriptions of section entries:
> > -
> > -	P: Person (obsolete)
> > -	M: Mail patches to: FullName <address@domain>
> > -	R: Designated reviewer: FullName <address@domain>
> > -	   These reviewers should be CCed on patches.
> > -	L: Mailing list that is relevant to this area
> > -	W: Web-page with status/info
> > -	Q: Patchwork web based patch tracking system site
> > -	T: SCM tree type and location.
> > -	   Type is one of: git, hg, quilt, stgit, topgit
> > -	S: Status, one of the following:
> > -	   Supported:	Someone is actually paid to look after this.
> > -	   Maintained:	Someone actually looks after it.
> > -	   Odd Fixes:	It has a maintainer but they don't have time to do
> > +Descriptions of section entries
> > +-------------------------------
> > +
> > +-	``P:`` Person (obsolete)
> > +-	``M:`` Mail patches to: FullName <address@domain>
> > +-	``R:`` Designated reviewer: FullName <address@domain>
> > +
> > +	- These reviewers should be CCed on patches.
> > +
> > +-	``L:`` Mailing list that is relevant to this area
> > +-	``W:`` Web-page with status/info
> > +-	``Q:`` Patchwork web based patch tracking system site
> > +-	``T:`` SCM tree type and location.
> > +
> > +	- Type is one of: **git**, **hg**, **quilt**, **stgit**, **topgit**
> > +  
> 
> Hmm, why is the last line a bullet list, shouldn't it be:
> 
> +- ``T:`` SCM tree type and location
> +  Type is one of: git, hg, quilt, stgit, topgit
> 
> 
> > +-	``S:`` Status, one of the following:
> > +
> > +	   - Supported:
> > +			Someone is actually paid to look after this.  
> 
> Sorry, but I will never understand why you using mixed tabs and space 
> for the same thing ;-) ... what I mean; why is the top-list indented by 
> a tab after the bullet and the sub-list by two spaces ... 
> 
> We had the tab discussion already ... and IMO calling the CodeStyle is not
> helpful when using ASCII markup ... lets take the ASCI documentation compact
> and forget the tab ;-)
> 
> > +	   - Maintained:
> > +			Someone actually looks after it.
> > +	   - Odd Fixes:
> > +			It has a maintainer but they don't have time to do
> > 			much other than throw the odd patch in. See below..
> > -	   Orphan:	No current maintainer [but maybe you could take the
> > +	   - Orphan:
> > +			No current maintainer [but maybe you could take the
> > 			role as you write your new code].
> > -	   Obsolete:	Old code. Something tagged obsolete generally means
> > +	   - Obsolete:
> > +			Old code. Something tagged obsolete generally means
> > 			it has been replaced by a better system and you
> > 			should be using that.  
> 
> Hmm, here its the same with the indent. List, list-items, paragraphs etc. are all
> "body elements". 
> 
> * http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#body-elements
> 
> A body element is always introduced by a leading empty line. E.g:
> 
> - ``S:`` Status, one of the following:
> 
>  - Supported:
> 
>    Someone is actually paid to look after this.
> 
>  - Maintained:
> 
>    Someone actually looks after it.
> 
> or even more compact (which I do prefer), without paragraphs in the list items:
> 
> - ``S:`` Status, one of the following:
> 
>  - Supported: Someone is actually paid to look after this.
> 
>  - Maintained: Someone actually looks after it.
> 
> > -	F: Files and directories with wildcard patterns.
> > +-	``F:`` Files and directories with wildcard patterns.
> > +
> > 	   A trailing slash includes all files and subdirectory files.
> > -	   F:	drivers/net/	all files in and below drivers/net
> > -	   F:	drivers/net/*	all files in drivers/net, but not below
> > -	   F:	*/net/*		all files in "any top level directory"/net
> > -	   One pattern per line.  Multiple F: lines acceptable.
> > -	N: Files and directories with regex patterns.
> > -	   N:	[^a-z]tegra	all files whose path contains the word tegra
> > -	   One pattern per line.  Multiple N: lines acceptable.
> > -	   scripts/get_maintainer.pl has different behavior for files that
> > -	   match F: pattern and matches of N: patterns.  By default,
> > -	   get_maintainer will not look at git log history when an F: pattern
> > -	   match occurs.  When an N: match occurs, git log history is used
> > -	   to also notify the people that have git commit signatures.
> > -	X: Files and directories that are NOT maintained, same rules as F:
> > -	   Files exclusions are tested before file matches.
> > -	   Can be useful for excluding a specific subdirectory, for instance:
> > -	   F:	net/
> > -	   X:	net/ipv6/
> > -	   matches all files in and below net excluding net/ipv6/
> > -	K: Keyword perl extended regex pattern to match content in a
> > +
> > +	   ============================== ======================================
> > +	   ``F:``	``drivers/net/``	all files in and below
> > +						``drivers/net``
> > +	   ``F:``	``drivers/net/*``	all files in ``drivers/net``,
> > +						but not below
> > +	   ``F:``	``*/net/*``		all files in "any top level
> > +						directory" ``/net``
> > +	   ============================== ======================================
> > +
> > +	   One pattern per line.  Multiple ``F:`` lines acceptable.
> > +-	``N:`` Files and directories with regex patterns.  
> 
> Between the last two lines, a empty line is required ... I fond this more times
> (will not comment each).
> 
> OK, I will stop here, if you are interested in I can prepare a patch for
> illustration ....
> 
> -- Markus --
> 
> 
> > +
> > +	   ============================ ========================================
> > +	   ``N:``	``[^a-z]tegra``		all files whose path contains
> > +						the word ``tegra``
> > +	   ============================ ========================================
> > +
> > +	   One pattern per line.  Multiple ``N:`` lines acceptable.
> > +	   ``scripts/get_maintainer.pl`` has different behavior for files that
> > +	   match ``F:`` pattern and matches of ``N:`` patterns.  By default,
> > +	   get_maintainer will not look at git log history when an ``F:``
> > +	   pattern match occurs.  When an ``N:`` match occurs, git log history
> > +	   is used to also notify the people that have git commit signatures.
> > +-	``X:`` Files and directories that are NOT maintained, same rules as
> > +	``F:`` Files exclusions are tested before file matches.
> > +	Can be useful for excluding a specific subdirectory, for instance:
> > +
> > +	   ============================ ========================================
> > +	   ``F:``	``net/``	matches all files in and below
> > +					``net`` ...
> > +	   ``X:``	``net/ipv6/``	... excluding ``net/ipv6/``
> > +	   ============================ ========================================
> > +
> > +-	``K:`` Keyword perl extended regex pattern to match content in a
> > 	   patch or file.  For instance:
> > -	   K: of_get_profile
> > -	      matches patches or files that contain "of_get_profile"
> > -	   K: \b(printk|pr_(info|err))\b
> > -	      matches patches or files that contain one or more of the words
> > -	      printk, pr_info or pr_err
> > -	   One regex pattern per line.  Multiple K: lines acceptable.
> > 
> > -Note: For the hard of thinking, this list is meant to remain in alphabetical
> > -order. If you could add yourselves to it in alphabetical order that would be
> > -so much easier [Ed]
> > +	   =========================================== =========================
> > +	   ``K:`` ``of_get_profile``			matches patches or files
> > +							that contain
> > +							``of_get_profile``
> > +	   ``K:`` ``\b(printk|pr_(info|err))\b``	matches patches or
> > +							files that contain one
> > +							or more of the words
> > +							``printk``, ``pr_info``
> > +							or ``pr_err``
> > +	   =========================================== =========================
> > +
> > +	   One regex pattern per line.  Multiple ``K:`` lines acceptable.
> > +
> > +.. note::
> > +
> > +  For the hard of thinking, this list is meant to remain in alphabetical
> > +  order. If you could add yourselves to it in alphabetical order that would be
> > +  so much easier [Ed]
> > 
> > Maintainers List (try to look for most precise areas first)
> > +-----------------------------------------------------------
> > 
> > 		-----------------------------------
> > 
> > +
> > 3C59X NETWORK DRIVER
> > M:	Steffen Klassert <klassert@mathematik.tu-chemnitz.de>
> > L:	netdev@vger.kernel.org
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-doc" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html  
> 



Thanks,
Mauro

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

* Re: [PATCH 1/4] doc-rst: reST-directive kernel-cmd / include contentent from scripts
  2016-10-18  6:07     ` Jani Nikula
  2016-10-18  6:52       ` Markus Heiser
@ 2016-10-18  9:13       ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-18  9:13 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Markus Heiser, Jonathan Corbet, Linux Media Mailing List,
	linux-doc, Joe Perches

Em Tue, 18 Oct 2016 09:07:03 +0300
Jani Nikula <jani.nikula@intel.com> escreveu:

> On Mon, 17 Oct 2016, Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
> > [PATCH] docs-rst: user: add MAINTAINERS
> >
> > including MAINTAINERS using ReST is tricky, because all
> > maintainer's entries are like:
> >
> > FOO SUBSYSTEM:
> > M: My Name <my@name>
> > L: mailing@list
> > S: Maintained
> > F: foo/bar
> >
> > On ReST, this would be displayed on a single line. Using
> > alias, like |M|, |L|, ... won't solve, as an alias in
> > Sphinx doesn't accept breaking lines.
> >
> > So, instead of changing every line at MAINTAINERS, let's
> > use kernel-cmd extension in order to parse it via a script.  
> 
> Soon I'm going to stop fighting the windmills...
> 
> If you're going to insist on getting kernel-cmd upstream (and I haven't
> changed my opinion on that) 

I also didn't change my mind that maintaining just one python script is
easier than maintaining a plead of python scripts with almost identical
contents.

In any case, if we're willing to have one Python script per each
different non-Python parser, it helps if the source code of such extensions
would be identical, except for the command line that will run the script,
as, if we find a bug on one such script, the same bug fix could be applied
to the other almost identical ones.

> please at least have the sense to have just
> *one* perl script to parse MAINTAINERS, not many. The one script should
> be scripts/get_maintainer.pl.

Agreed. get_maintainer.pl is indeed the best place to put it. I wrote
it this separate script just for a proof of concept, whose goal is to test
if the kernel-cmd extension would be properly parsing the ReST output,
and to identify what sort of output would fit best for the MAINTAINERS
database.

Thanks,
Mauro

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

* Re: [PATCH 1/4] doc-rst: reST-directive kernel-cmd / include contentent from scripts
  2016-10-18  7:03     ` Markus Heiser
  2016-10-18  8:59       ` Mauro Carvalho Chehab
@ 2016-10-18 10:06       ` Mauro Carvalho Chehab
  2016-10-18 11:36         ` Markus Heiser
  1 sibling, 1 reply; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-18 10:06 UTC (permalink / raw)
  To: Markus Heiser
  Cc: Jonathan Corbet, Jani Nikula, Linux Media Mailing List, linux-doc

Sorry, I missed part of your comments on my last reply...


Em Tue, 18 Oct 2016 09:03:28 +0200
Markus Heiser <markus.heiser@darmarit.de> escreveu:

> +-	``T:`` SCM tree type and location.
> +
> > +	- Type is one of: **git**, **hg**, **quilt**, **stgit**, **topgit**
> > +  
> 
> Hmm, why is the last line a bullet list, shouldn't it be:
> 
> +- ``T:`` SCM tree type and location
> +  Type is one of: git, hg, quilt, stgit, topgit

IMHO, it is better to output it as:

	- T: SCM tree type and location.

	  *  Type is one of: git, hg, quilt, stgit, topgit

Putting the explanation on a separate line, then merging the description
of the tag with the details about the valid values.

> 
> 
> > +-	``S:`` Status, one of the following:
> > +
> > +	   - Supported:
> > +			Someone is actually paid to look after this.  
> 
> Sorry, but I will never understand why you using mixed tabs and space 
> for the same thing ;-) ... what I mean; why is the top-list indented by 
> a tab after the bullet and the sub-list by two spaces ... 
> 
> We had the tab discussion already ... and IMO calling the CodeStyle is not
> helpful when using ASCII markup ... lets take the ASCI documentation compact
> and forget the tab ;-)

Well, my text editor is set to replace 8 spaces by tabs, as this is the
Kernel CodingStyle. I suspect other Kernel hackers do the same.
Using a different style just for documentation is really odd and will
cause problems, and make the maintainers life like hell if they would
need to manually check if a documentation hunk is not using tabs.

> 
> > +	   - Maintained:
> > +			Someone actually looks after it.
> > +	   - Odd Fixes:
> > +			It has a maintainer but they don't have time to do
> > 			much other than throw the odd patch in. See below..
> > -	   Orphan:	No current maintainer [but maybe you could take the
> > +	   - Orphan:
> > +			No current maintainer [but maybe you could take the
> > 			role as you write your new code].
> > -	   Obsolete:	Old code. Something tagged obsolete generally means
> > +	   - Obsolete:
> > +			Old code. Something tagged obsolete generally means
> > 			it has been replaced by a better system and you
> > 			should be using that.  
> 
> Hmm, here its the same with the indent. List, list-items, paragraphs etc. are all
> "body elements". 
> 
> * http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#body-elements
> 
> A body element is always introduced by a leading empty line. E.g:
> 
> - ``S:`` Status, one of the following:
> 
>  - Supported:
> 
>    Someone is actually paid to look after this.
> 
>  - Maintained:
> 
>    Someone actually looks after it.
> 
> or even more compact (which I do prefer), without paragraphs in the list items:
> 
> - ``S:`` Status, one of the following:
> 
>  - Supported: Someone is actually paid to look after this.
> 
>  - Maintained: Someone actually looks after it.

Hmm... we actually use a lot of markups on the media books like:

- foo
  - bar

when we want to put the first line in **bold**, as this seems to be the
only way to make the first line bold if it contains a verbatim.

There's an additional advantage of the above... it requires less typing
than:

- **foo**

  - bar

:-)

> 
> > -	F: Files and directories with wildcard patterns.
> > +-	``F:`` Files and directories with wildcard patterns.
> > +
> > 	   A trailing slash includes all files and subdirectory files.
> > -	   F:	drivers/net/	all files in and below drivers/net
> > -	   F:	drivers/net/*	all files in drivers/net, but not below
> > -	   F:	*/net/*		all files in "any top level directory"/net
> > -	   One pattern per line.  Multiple F: lines acceptable.
> > -	N: Files and directories with regex patterns.
> > -	   N:	[^a-z]tegra	all files whose path contains the word tegra
> > -	   One pattern per line.  Multiple N: lines acceptable.
> > -	   scripts/get_maintainer.pl has different behavior for files that
> > -	   match F: pattern and matches of N: patterns.  By default,
> > -	   get_maintainer will not look at git log history when an F: pattern
> > -	   match occurs.  When an N: match occurs, git log history is used
> > -	   to also notify the people that have git commit signatures.
> > -	X: Files and directories that are NOT maintained, same rules as F:
> > -	   Files exclusions are tested before file matches.
> > -	   Can be useful for excluding a specific subdirectory, for instance:
> > -	   F:	net/
> > -	   X:	net/ipv6/
> > -	   matches all files in and below net excluding net/ipv6/
> > -	K: Keyword perl extended regex pattern to match content in a
> > +
> > +	   ============================== ======================================
> > +	   ``F:``	``drivers/net/``	all files in and below
> > +						``drivers/net``
> > +	   ``F:``	``drivers/net/*``	all files in ``drivers/net``,
> > +						but not below
> > +	   ``F:``	``*/net/*``		all files in "any top level
> > +						directory" ``/net``
> > +	   ============================== ======================================
> > +
> > +	   One pattern per line.  Multiple ``F:`` lines acceptable.
> > +-	``N:`` Files and directories with regex patterns.  
> 
> Between the last two lines, a empty line is required ... I fond this more times
> (will not comment each).

Surely we can improve the markups here. Yet, the point is that the html
produced via kernel-cmd is completely different than he one produced by
calling the perl script directly. When kernel-cmd is used, lots of tags are 
not parsed.

That's said, if I add a logic at the script to expand the tabs before
output (patch enclosed), everything looks OK.

> 
> OK, I will stop here, if you are interested in I can prepare a patch for
> illustration ....
> 

Thanks,
Mauro


diff --git a/Documentation/sphinx/format_maintainers.pl b/Documentation/sphinx/format_maintainers.pl
index fb3af2a30c36..c3174c2b180a 100755
--- a/Documentation/sphinx/format_maintainers.pl
+++ b/Documentation/sphinx/format_maintainers.pl
@@ -1,4 +1,5 @@
 #!/usr/bin/perl
+use Text::Tabs;
 
 my $is_rst = 1;
 
@@ -15,18 +16,20 @@ my %tags = (
 );
 
 while (<>) {
+	my $s = expand($_);
+
 	if ($is_rst) {
-		if (m/^\s+\-+$/) {
+		if ($s =~ m/^\s+\-+$/) {
 			$is_rst = 0;
 			next;
 		}
-		print $_;
+		print $s;
 		next;
 	}
 
-	next if (m/^$/);
+	next if ($s =~ m/^\s*$/);
 
-	if (m/^([A-Z])\:(.*)/) {
+	if ($s =~ m/^([A-Z])\:(.*)/) {
 		my $tag = $1;
 		my $value = $2;
 
@@ -38,7 +41,7 @@ while (<>) {
 		next;
 	}
 
-	print "\n$_";
+	print "\n$s";
 }
 
 print "\n";




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

* Re: [PATCH 1/4] doc-rst: reST-directive kernel-cmd / include contentent from scripts
  2016-10-18 10:06       ` Mauro Carvalho Chehab
@ 2016-10-18 11:36         ` Markus Heiser
  0 siblings, 0 replies; 32+ messages in thread
From: Markus Heiser @ 2016-10-18 11:36 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Jonathan Corbet, Jani Nikula, Linux Media Mailing List, linux-doc


Am 18.10.2016 um 12:06 schrieb Mauro Carvalho Chehab <mchehab@infradead.org>:

> Sorry, I missed part of your comments on my last reply...
> 
> 
> Em Tue, 18 Oct 2016 09:03:28 +0200
> Markus Heiser <markus.heiser@darmarit.de> escreveu:
> 
>> +-	``T:`` SCM tree type and location.
>> +
>>> +	- Type is one of: **git**, **hg**, **quilt**, **stgit**, **topgit**
>>> +  
>> 
>> Hmm, why is the last line a bullet list, shouldn't it be:
>> 
>> +- ``T:`` SCM tree type and location
>> +  Type is one of: git, hg, quilt, stgit, topgit
> 
> IMHO, it is better to output it as:
> 
> 	- T: SCM tree type and location.
> 
> 	  *  Type is one of: git, hg, quilt, stgit, topgit
> 
> Putting the explanation on a separate line, then merging the description
> of the tag with the details about the valid values.

right. (sorry for nitpicking) but IMO there is no need for a
list (-item), just using a simple paragraph should enough

- T: SCM tree type and location.

  Type is one of: git, hg, quilt, stgit, topgit

>> 
>> 
>>> +-	``S:`` Status, one of the following:
>>> +
>>> +	   - Supported:
>>> +			Someone is actually paid to look after this.  
>> 
>> Sorry, but I will never understand why you using mixed tabs and space 
>> for the same thing ;-) ... what I mean; why is the top-list indented by 
>> a tab after the bullet and the sub-list by two spaces ... 
>> 
>> We had the tab discussion already ... and IMO calling the CodeStyle is not
>> helpful when using ASCII markup ... lets take the ASCI documentation compact
>> and forget the tab ;-)
> 
> Well, my text editor is set to replace 8 spaces by tabs, as this is the
> Kernel CodingStyle. I suspect other Kernel hackers do the same.

Since I suppose most Kernel hackers use Emacs I recommend:

(setq-default indent-tabs-mode nil     ; default is not using any TAB
              c-indent-tabs-mode t     ; Pressing TAB should cause indentation
              c-basic-offset 8
              )

* https://www.emacswiki.org/emacs/IndentationBasics

> Using a different style just for documentation is really odd and will
> cause problems,

We already have other sources e.g. python ;-) where spaces
are the preferred indentation method (and mixing is not allowed PY3).

* https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces

> and make the maintainers life like hell if they would
> need to manually check if a documentation hunk is not using tabs.

There is no need to check ... tabs are working, but they
stretch lines unnecessary. 

BTW: There is also a smart-tab

* https://www.emacswiki.org/emacs/SmartTabs

.. have you seen what could happen if you use both ;-)

>> 
>>> +	   - Maintained:
>>> +			Someone actually looks after it.
>>> +	   - Odd Fixes:
>>> +			It has a maintainer but they don't have time to do
>>> 			much other than throw the odd patch in. See below..
>>> -	   Orphan:	No current maintainer [but maybe you could take the
>>> +	   - Orphan:
>>> +			No current maintainer [but maybe you could take the
>>> 			role as you write your new code].
>>> -	   Obsolete:	Old code. Something tagged obsolete generally means
>>> +	   - Obsolete:
>>> +			Old code. Something tagged obsolete generally means
>>> 			it has been replaced by a better system and you
>>> 			should be using that.  
>> 
>> Hmm, here its the same with the indent. List, list-items, paragraphs etc. are all
>> "body elements". 
>> 
>> * http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#body-elements
>> 
>> A body element is always introduced by a leading empty line. E.g:
>> 
>> - ``S:`` Status, one of the following:
>> 
>> - Supported:
>> 
>>   Someone is actually paid to look after this.
>> 
>> - Maintained:
>> 
>>   Someone actually looks after it.
>> 
>> or even more compact (which I do prefer), without paragraphs in the list items:
>> 
>> - ``S:`` Status, one of the following:
>> 
>> - Supported: Someone is actually paid to look after this.
>> 
>> - Maintained: Someone actually looks after it.
> 
> Hmm... we actually use a lot of markups on the media books like:
> 
> - foo
>  - bar
> 
> when we want to put the first line in **bold**, as this seems to be the
> only way to make the first line bold if it contains a verbatim.
> 
> There's an additional advantage of the above... it requires less typing
> than:
> 
> - **foo**
> 
>  - bar
> 
> :-)

What you are looking for is a definition list:

foo
  lorem ipsum ...
 
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#definition-lists



> 
>> 
>>> -	F: Files and directories with wildcard patterns.
>>> +-	``F:`` Files and directories with wildcard patterns.
>>> +
>>> 	   A trailing slash includes all files and subdirectory files.
>>> -	   F:	drivers/net/	all files in and below drivers/net
>>> -	   F:	drivers/net/*	all files in drivers/net, but not below
>>> -	   F:	*/net/*		all files in "any top level directory"/net
>>> -	   One pattern per line.  Multiple F: lines acceptable.
>>> -	N: Files and directories with regex patterns.
>>> -	   N:	[^a-z]tegra	all files whose path contains the word tegra
>>> -	   One pattern per line.  Multiple N: lines acceptable.
>>> -	   scripts/get_maintainer.pl has different behavior for files that
>>> -	   match F: pattern and matches of N: patterns.  By default,
>>> -	   get_maintainer will not look at git log history when an F: pattern
>>> -	   match occurs.  When an N: match occurs, git log history is used
>>> -	   to also notify the people that have git commit signatures.
>>> -	X: Files and directories that are NOT maintained, same rules as F:
>>> -	   Files exclusions are tested before file matches.
>>> -	   Can be useful for excluding a specific subdirectory, for instance:
>>> -	   F:	net/
>>> -	   X:	net/ipv6/
>>> -	   matches all files in and below net excluding net/ipv6/
>>> -	K: Keyword perl extended regex pattern to match content in a
>>> +
>>> +	   ============================== ======================================
>>> +	   ``F:``	``drivers/net/``	all files in and below
>>> +						``drivers/net``
>>> +	   ``F:``	``drivers/net/*``	all files in ``drivers/net``,
>>> +						but not below
>>> +	   ``F:``	``*/net/*``		all files in "any top level
>>> +						directory" ``/net``
>>> +	   ============================== ======================================
>>> +
>>> +	   One pattern per line.  Multiple ``F:`` lines acceptable.
>>> +-	``N:`` Files and directories with regex patterns.  
>> 
>> Between the last two lines, a empty line is required ... I fond this more times
>> (will not comment each).
> 
> Surely we can improve the markups here. Yet, the point is that the html
> produced via kernel-cmd is completely different than he one produced by
> calling the perl script directly. When kernel-cmd is used, lots of tags are 
> not parsed.
> 
> That's said, if I add a logic at the script to expand the tabs before
> output (patch enclosed), everything looks OK.

OK Thanks, I will give it a try ... comment soon .. 

--Markus--

> 
>> 
>> OK, I will stop here, if you are interested in I can prepare a patch for
>> illustration ....
>> 
> 
> Thanks,
> Mauro
> 
> 
> diff --git a/Documentation/sphinx/format_maintainers.pl b/Documentation/sphinx/format_maintainers.pl
> index fb3af2a30c36..c3174c2b180a 100755
> --- a/Documentation/sphinx/format_maintainers.pl
> +++ b/Documentation/sphinx/format_maintainers.pl
> @@ -1,4 +1,5 @@
> #!/usr/bin/perl
> +use Text::Tabs;
> 
> my $is_rst = 1;
> 
> @@ -15,18 +16,20 @@ my %tags = (
> );
> 
> while (<>) {
> +	my $s = expand($_);
> +
> 	if ($is_rst) {
> -		if (m/^\s+\-+$/) {
> +		if ($s =~ m/^\s+\-+$/) {
> 			$is_rst = 0;
> 			next;
> 		}
> -		print $_;
> +		print $s;
> 		next;
> 	}
> 
> -	next if (m/^$/);
> +	next if ($s =~ m/^\s*$/);
> 
> -	if (m/^([A-Z])\:(.*)/) {
> +	if ($s =~ m/^([A-Z])\:(.*)/) {
> 		my $tag = $1;
> 		my $value = $2;
> 
> @@ -38,7 +41,7 @@ while (<>) {
> 		next;
> 	}
> 
> -	print "\n$_";
> +	print "\n$s";
> }
> 
> print "\n";
> 
> 
> 


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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-11  7:26           ` Markus Heiser
  2016-10-11 14:28             ` Mauro Carvalho Chehab
@ 2016-10-21 22:05             ` Jonathan Corbet
  2016-10-22 10:56               ` Mauro Carvalho Chehab
  1 sibling, 1 reply; 32+ messages in thread
From: Jonathan Corbet @ 2016-10-21 22:05 UTC (permalink / raw)
  To: Markus Heiser
  Cc: Jani Nikula, Mauro Carvalho Chehab, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List

On Tue, 11 Oct 2016 09:26:48 +0200
Markus Heiser <markus.heiser@darmarit.de> wrote:

> If the kernel-cmd directive gets acked, I will add a description to
> kernel-documentation.rst and I request Mauro to document the parse-headers.pl
> also.
> 
> But, let's hear what Jon says.

Sigh.

I've been shunting this discussion aside while I dug out from other
things.  Now I've pushed through the whole thing; I'm still not sure what
I think is the best thing to do.

kernel-cmd scares me.  It looks like the ioctl() of documentation
building; people will be able to add all kinds of wild things and it will
take a lot of attention to catch them.  I think we could make things
pretty messy in a real hurry.  And yes, I do think we should consider the
security aspects of it; we're talking about adding another shell
code-execution context in the kernel build, and that can only make things
harder to audit.

OTOH, forcing things into dedicated Sphinx extensions doesn't necessarily
fix the problem.  We're adding system calls rather than ioctl() commands,
let's say, but we're still adding long-term maintenance complications.

How many special-case commands are we going to need to run?  Does it
really need to go beyond what parse-headers is doing now?  Let's really
think about what the other use cases might be and whether we can do
without them. I'm still thoroughly unconvinced about the utility of
incorporating, say, the MAINTAINERS file into the formatted docs, for
example, so I'm not yet convinced that making that easier to do is
something we need.

Not much clarity here, sorry.

jon

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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-21 22:05             ` Jonathan Corbet
@ 2016-10-22 10:56               ` Mauro Carvalho Chehab
  2016-10-22 15:04                 ` Jonathan Corbet
  2016-10-23 11:20                 ` Mauro Carvalho Chehab
  0 siblings, 2 replies; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-22 10:56 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Markus Heiser, Jani Nikula, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List

Em Fri, 21 Oct 2016 16:05:43 -0600
Jonathan Corbet <corbet@lwn.net> escreveu:

> On Tue, 11 Oct 2016 09:26:48 +0200
> Markus Heiser <markus.heiser@darmarit.de> wrote:
> 
> > If the kernel-cmd directive gets acked, I will add a description to
> > kernel-documentation.rst and I request Mauro to document the parse-headers.pl
> > also.
> > 
> > But, let's hear what Jon says.  
> 
> Sigh.
> 
> I've been shunting this discussion aside while I dug out from other
> things.  Now I've pushed through the whole thing; I'm still not sure what
> I think is the best thing to do.
> 
> kernel-cmd scares me.  It looks like the ioctl() of documentation
> building; people will be able to add all kinds of wild things and it will
> take a lot of attention to catch them.  I think we could make things
> pretty messy in a real hurry.  And yes, I do think we should consider the
> security aspects of it; we're talking about adding another shell
> code-execution context in the kernel build, and that can only make things
> harder to audit.
> 
> OTOH, forcing things into dedicated Sphinx extensions doesn't necessarily
> fix the problem.  We're adding system calls rather than ioctl() commands,
> let's say, but we're still adding long-term maintenance complications.

The security implications will be the same if either coded as an
"ioctl()" or as "syscall", the scripts should be audited. Actually,
if we force the need of a "syscall" for every such script, we have
twice the code to audit, as both the Sphinx extension and the perl
script will need to audit, increasing the attack surface.

> How many special-case commands are we going to need to run?  Does it
> really need to go beyond what parse-headers is doing now?

Right now, we have actually 2 such cases: kernel-doc and parse-headers.

I also use a set of perl scripts that I manually run, on each Kernel
version, to update the cards list of several drivers. It is a total of
9 such scripts. See below for one of such example[1]

[1] this is actually new version of the script that produces the
Documentation/media/v4l-drivers/em28xx-cardlist.rst file, using a
flat table. The one used up to 4.9-rc1 were using a code-block tag.

The problem those scripts address is that there are several media boards that
don't have an unique PCI or USB ID, because they don't have eeproms, or
because the vendor sells different models with the very same ID
(for example, using one tuner for US market and another one for EU).

As there are no ways for the Kernel to auto-identify such boards,
the user need to pass two numbers for the driver, in order to set the
card and the tuner type, when modprobing the driver. 

Such drivers have those two parameters:

	parm:           tuner:tuner type (array of int)
	parm:           card:card type (array of int)

The tuner parameter define what TV tuner is present at the device(s).

The card number define things like GPIOs used to turn on the several
components of the board{s}, and describe the boards' capabilities.

Thankfully, we only have a couple of new additions to those drivers
per Kernel release, so, right now, I take myself the burden of manually
run those scripts, but if we could add it to the building system, that would
reduce a a little bit my workload, with is a good thing :) It would also
prevent the risk of releasing a Kernel with outdated information, with
sometimes happen.

I've no idea if we'll either need scripts or not on other non-media docs.

>  Let's really
> think about what the other use cases might be and whether we can do
> without them. I'm still thoroughly unconvinced about the utility of
> incorporating, say, the MAINTAINERS file into the formatted docs, for
> example, so I'm not yet convinced that making that easier to do is
> something we need.

With regards to MAINTAINERS, what's your suggestion? 

Right now, there are cross-references for it in 58 places, being 25 on a
documentation file, including README and REPORTING-BUGS, with has a broader
audience.

IMHO, we should provide a section somehow at the documentation
in order to give directions if someone reads one of such documents.

Also, the section "List of maintainers and how to submit kernel changes"
Has a short list of rules for people to follow when submitting a patch,
with could make sense at the process book.

So, I can see some ways to handle it:

1) convert everything, including the database to ReST and include
   it at documentation;

2) convert it to ReST format, except for the database, and use some
   extension to parse it, like on my PoC patches;

3) move the "how to submit kernel changes" list to process/ and
   create a small guide at the admin-guide/ book to be used as
   cross-reference to MAINTAINERS, explaining how to get the
   maintainer for a file (e. g. running ./scripts/get-maintainer.pl);

4) do nothing and assume that anyone capable of reading the
   README or REPORTING-BUGS file would guess what "MAINTAINERS" mean
   (or that if then won't guess, we don't want bug reports from them).


> 
> Not much clarity here, sorry.
> 
> jon

Thanks,
Mauro

---
	
#!/usr/bin/perl -w
use strict;

my $new_entry = -1;
my $nr = 0;
my ($id,$subvendor,$subdevice);
my %data;

my $debug = 0;

while (<>) {
	# defines in header file
	if (/#define\s+(EM2[\d]+_BOARD_[\w\d_]+)\s+(\d+)/) {
		printf("$1 = $2\n") if ($debug);
		$data{$1}->{nr} = $2;
		next;
	}
	# em2820_boards
	if (/\[(EM2820_BOARD_[\w\d_]+)\]/) {
		$id = $1;
		printf("ID = $id\n") if $debug;
		$data{$id}->{id} = $id;
		$data{$id}->{type} = "em2820 or em2840";
		$data{$id}->{qtd}++;
	} elsif (/\[(EM)(2[\d]+)(_BOARD_[\w\d_]+)\]/) {
		$id = "$1$2$3";
		printf("ID = $id\n") if $debug;
		$data{$id}->{id} = $id;
		$data{$id}->{type} = "em$2";
		$data{$id}->{qtd}++;
	};

	next unless defined($id);

	if (/USB_DEVICE.*0x([0-9a-fA-F]+)\s*\,\s*0x([0-9a-fA-F]+)/ ) {
		$subvendor=$1;
		$subdevice=$2;
	}

	if (/.*driver_info.*(EM2[\d]+_BOARD_[\w\d_]+)/ ) {
		push @{$data{$1}->{subid}}, "$subvendor:$subdevice";
	}

	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
		$data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/);
		if (defined $data{$id}->{name} && $debug) {
			printf("name[$id] = %s\n", $data{$id}->{name});
		}
	}
}

print "EM28xx cards list\n";
print "=================\n\n";

print ".. flat-table::\n";
print "    :header-rows:  1\n";
print "    :stub-columns: 0\n";
print "    :widths:       10 50 15 50\n\n";
print "    * - Card number\n";
print "      - Card name\n";
print "      - Empia Chip\n";
print "      - USB IDs\n\n";

foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
	printf "    * - %s\n", $data{$item}->{nr};
	printf "      - %s\n", $data{$item}->{name};
	printf "      - %s\n", $data{$item}->{type};
	if ($data{$item}->{subid}) {
		printf "      - %s\n", join(", ",@{$data{$item}->{subid}})
	} else {
		printf "      -\n";
	}
	printf "\n";

	printf "(%d entires)", $data{$item}->{qtd} if ($debug);
}


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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-22 10:56               ` Mauro Carvalho Chehab
@ 2016-10-22 15:04                 ` Jonathan Corbet
  2016-10-22 16:46                   ` Markus Heiser
  2016-10-22 19:10                   ` Mauro Carvalho Chehab
  2016-10-23 11:20                 ` Mauro Carvalho Chehab
  1 sibling, 2 replies; 32+ messages in thread
From: Jonathan Corbet @ 2016-10-22 15:04 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Markus Heiser, Jani Nikula, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List

On Sat, 22 Oct 2016 08:56:29 -0200
Mauro Carvalho Chehab <mchehab@infradead.org> wrote:

> The security implications will be the same if either coded as an
> "ioctl()" or as "syscall", the scripts should be audited. Actually,
> if we force the need of a "syscall" for every such script, we have
> twice the code to audit, as both the Sphinx extension and the perl
> script will need to audit, increasing the attack surface.

Just addressing this one part for the moment.  Clearly I've not explained
my concern well.

The kernel-cmd directive makes it possible for *any* RST file to run
arbitrary shell commands.  I'm not concerned about the scripts we add, I
hope we can get those right.  I'm worried about what slips in via a tweak
to some obscure .rst file somewhere.

A quick check says that 932 commits touched Documentation/ since 4.8.  A
lot of those did not come from either my tree or yours; *everybody* messes
around in the docs tree.  People know to look closely at changes to
makefiles and such; nobody thinks to examine documentation changes for
such things. I think there are attackers out there who would like the
opportunity to run commands in the settings where kernels are built; we
need to think pretty hard before we make that easier to do.

See what I'm getting at here?

jon

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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-22 15:04                 ` Jonathan Corbet
@ 2016-10-22 16:46                   ` Markus Heiser
  2016-10-22 19:10                   ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 32+ messages in thread
From: Markus Heiser @ 2016-10-22 16:46 UTC (permalink / raw)
  To: Jonathan Corbet, Mauro Carvalho Chehab, Jani Nikula
  Cc: Linux Media Mailing List, linux-doc@vger.kernel.org Mailing List


Am 22.10.2016 um 17:04 schrieb Jonathan Corbet <corbet@lwn.net>:

> On Sat, 22 Oct 2016 08:56:29 -0200
> Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
> 
>> The security implications will be the same if either coded as an
>> "ioctl()" or as "syscall", the scripts should be audited. Actually,
>> if we force the need of a "syscall" for every such script, we have
>> twice the code to audit, as both the Sphinx extension and the perl
>> script will need to audit, increasing the attack surface.
> 
> Just addressing this one part for the moment.  Clearly I've not explained
> my concern well.
> 
> The kernel-cmd directive makes it possible for *any* RST file to run
> arbitrary shell commands.  I'm not concerned about the scripts we add, I
> hope we can get those right.  I'm worried about what slips in via a tweak
> to some obscure .rst file somewhere.

> 
> A quick check says that 932 commits touched Documentation/ since 4.8.  A
> lot of those did not come from either my tree or yours; *everybody* messes
> around in the docs tree.  People know to look closely at changes to
> makefiles and such; nobody thinks to examine documentation changes for
> such things. I think there are attackers out there who would like the
> opportunity to run commands in the settings where kernels are built; we
> need to think pretty hard before we make that easier to do.

Hmm, I understand, it would not be good, if every .rst (and c-file with
kernel-doc in) becomes the potential to be a *executable* ...

Might it be a compromise, if we reduce kernel-cmd to start only selected
scripts from Documentation/sphinx ?

-- Markus --


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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-22 15:04                 ` Jonathan Corbet
  2016-10-22 16:46                   ` Markus Heiser
@ 2016-10-22 19:10                   ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-22 19:10 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Markus Heiser, Jani Nikula, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List

Em Sat, 22 Oct 2016 09:04:21 -0600
Jonathan Corbet <corbet@lwn.net> escreveu:

> On Sat, 22 Oct 2016 08:56:29 -0200
> Mauro Carvalho Chehab <mchehab@infradead.org> wrote:
> 
> > The security implications will be the same if either coded as an
> > "ioctl()" or as "syscall", the scripts should be audited. Actually,
> > if we force the need of a "syscall" for every such script, we have
> > twice the code to audit, as both the Sphinx extension and the perl
> > script will need to audit, increasing the attack surface.  
> 
> Just addressing this one part for the moment.  Clearly I've not explained
> my concern well.
> 
> The kernel-cmd directive makes it possible for *any* RST file to run
> arbitrary shell commands.  I'm not concerned about the scripts we add, I
> hope we can get those right.  I'm worried about what slips in via a tweak
> to some obscure .rst file somewhere.
> 
> A quick check says that 932 commits touched Documentation/ since 4.8.  A
> lot of those did not come from either my tree or yours; *everybody* messes
> around in the docs tree.  People know to look closely at changes to
> makefiles and such; nobody thinks to examine documentation changes for
> such things. I think there are attackers out there who would like the
> opportunity to run commands in the settings where kernels are built; we
> need to think pretty hard before we make that easier to do.
> 
> See what I'm getting at here?

Yes, I see your point, but IMHO, if we add an extra logic at kernel-cmd to
restrict it to run scripts *only* from an specific directory 
(like Documentation/sphinx), then you'll have a better control.
There were only 37 commits there, from you, me and Jani (and, AFAIKT, all
of them were sent to the linux-doc ML for review):

$ git log --pretty=fuller Documentation/sphinx|grep Commit:|sort|uniq -c
     11 Commit:     Jani Nikula <jani.nikula@intel.com>
     10 Commit:     Jonathan Corbet <corbet@lwn.net>
     16 Commit:     Mauro Carvalho Chehab <mchehab@s-opensource.com>

With is, btw, the same rule we have for a Sphinx extension. 

If you thing this isn't enough, we could also add some logic at
checkpatch.pl to check for the usage of Sphinx extensions.

Thanks,
Mauro

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

* Re: [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts
  2016-10-22 10:56               ` Mauro Carvalho Chehab
  2016-10-22 15:04                 ` Jonathan Corbet
@ 2016-10-23 11:20                 ` Mauro Carvalho Chehab
  1 sibling, 0 replies; 32+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-23 11:20 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Markus Heiser, Jani Nikula, Linux Media Mailing List,
	linux-doc@vger.kernel.org Mailing List

Em Sat, 22 Oct 2016 08:56:29 -0200
Mauro Carvalho Chehab <mchehab@infradead.org> escreveu:

> How many special-case commands are we going to need to run?  Does it
> > really need to go beyond what parse-headers is doing now?  
> 
> Right now, we have actually 2 such cases: kernel-doc and parse-headers.
> 
> I also use a set of perl scripts that I manually run, on each Kernel
> version, to update the cards list of several drivers. It is a total of
> 9 such scripts.

I ended by adding a few more scripts, as ivtv, tm6000 and gspca
cardlists were missing. As result, all three had some documentation
gaps.

As an example of such scripts, I added a PoC patch at my development
tree, at the lkml-books-v2 branch:

	https://git.linuxtv.org/mchehab/experimental.git/log/?h=lkml-books-v2

Patch follows.

As I mentioned before, usually at -rc6 or -rc7, when I remember that a driver
with a cardlist was touched, I run those scripts to make sure that the
driver documentation will reflect the board additions. The scripts
run quick, so, It doesn't hurt much from my side to keep using the same
procedure. There are just a few drawbacks with this:

1) from time to time, third-party patches touch those cardlist tables,
usually not doing exactly the same thing as the script. So, when I run
the script manually, it will replace by the one at the cards definition,
producing an extra patch;

2) sometimes, I just forget running it;

3) as those cardlists are auto-generated, they need to be on a separate
rst file. If we use the kernel-cmd directive, I could write some text
before the cardlist database, and update it independently from the
scripts.

So, I prefer if we could generate it dynamically while building the
documentation.

Thanks,
Mauro

[RFC] [media] cardlists: dynamically generate cardlists from source
    
Instead of manually patch the cardlists by hand, on every Kernel
version, use scripts to auto-generate them when building the
documentation.
    
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

diff --git a/Documentation/media/v4l-drivers/au0828-cardlist.rst b/Documentation/media/v4l-drivers/au0828-cardlist.rst
index 82d2567bc7c1..afaef88969b6 100644
--- a/Documentation/media/v4l-drivers/au0828-cardlist.rst
+++ b/Documentation/media/v4l-drivers/au0828-cardlist.rst
@@ -1,13 +1 @@
-AU0828 cards list
-=================
-
-=========== ========================== =======================================================================================================================
-Card number Card name                  USB IDs
-=========== ========================== =======================================================================================================================
-0           Unknown board
-1           Hauppauge HVR950Q          2040:7200, 2040:7210, 2040:7217, 2040:721b, 2040:721e, 2040:721f, 2040:7280, 0fd9:0008, 2040:7260, 2040:7213, 2040:7270
-2           Hauppauge HVR850           2040:7240
-3           DViCO FusionHDTV USB       0fe9:d620
-4           Hauppauge HVR950Q rev xxF8 2040:7201, 2040:7211, 2040:7281
-5           Hauppauge Woodbury         05e1:0480, 2040:8200
-=========== ========================== =======================================================================================================================
+.. kernel-cmd:: au0828-cardlist.pl $srctree/drivers/media/usb/au0828/au0828-cards.h $srctree/drivers/media/usb/au0828/au0828-cards.c
diff --git a/Documentation/media/v4l-drivers/bttv-cardlist.rst b/Documentation/media/v4l-drivers/bttv-cardlist.rst
index 28a01cd6cf2e..3ae5099ffdd3 100644
--- a/Documentation/media/v4l-drivers/bttv-cardlist.rst
+++ b/Documentation/media/v4l-drivers/bttv-cardlist.rst
@@ -1,174 +1 @@
-BTTV cards list
-===============
-
-=========== ================================================================================= ==============================================================================================================================================================================
-Card number Card name                                                                         PCI IDs
-=========== ================================================================================= ==============================================================================================================================================================================
-0            *** UNKNOWN/GENERIC ***
-1           MIRO PCTV
-2           Hauppauge (bt848)
-3           STB, Gateway P/N 6000699 (bt848)
-4           Intel Create and Share PCI/ Smart Video Recorder III
-5           Diamond DTV2000
-6           AVerMedia TVPhone
-7           MATRIX-Vision MV-Delta
-8           Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26
-9           IMS/IXmicro TurboTV
-10          Hauppauge (bt878)                                                                 0070:13eb, 0070:3900, 2636:10b4
-11          MIRO PCTV pro
-12          ADS Technologies Channel Surfer TV (bt848)
-13          AVerMedia TVCapture 98                                                            1461:0002, 1461:0004, 1461:0300
-14          Aimslab Video Highway Xtreme (VHX)
-15          Zoltrix TV-Max                                                                    a1a0:a0fc
-16          Prolink Pixelview PlayTV (bt878)
-17          Leadtek WinView 601
-18          AVEC Intercapture
-19          Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)
-20          CEI Raffles Card
-21          Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50
-22          Askey CPH050/ Phoebe Tv Master + FM                                               14ff:3002
-23          Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878                      14c7:0101
-24          Askey CPH05X/06X (bt878) [many vendors]                                           144f:3002, 144f:3005, 144f:5000, 14ff:3000
-25          Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar
-26          Hauppauge WinCam newer (bt878)
-27          Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50
-28          Terratec TerraTV+ Version 1.1 (bt878)                                             153b:1127, 1852:1852
-29          Imagenation PXC200                                                                1295:200a
-30          Lifeview FlyVideo 98 LR50                                                         1f7f:1850
-31          Formac iProTV, Formac ProTV I (bt848)
-32          Intel Create and Share PCI/ Smart Video Recorder III
-33          Terratec TerraTValue Version Bt878                                                153b:1117, 153b:1118, 153b:1119, 153b:111a, 153b:1134, 153b:5018
-34          Leadtek WinFast 2000/ WinFast 2000 XP                                             107d:6606, 107d:6609, 6606:217d, f6ff:fff6
-35          Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II                              1851:1850, 1851:a050
-36          Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner                           1852:1852
-37          Prolink PixelView PlayTV pro
-38          Askey CPH06X TView99                                                              144f:3000, 144f:a005, a04f:a0fc
-39          Pinnacle PCTV Studio/Rave                                                         11bd:0012, bd11:1200, bd11:ff00, 11bd:ff12
-40          STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100                     10b4:2636, 10b4:2645, 121a:3060
-41          AVerMedia TVPhone 98                                                              1461:0001, 1461:0003
-42          ProVideo PV951                                                                    aa0c:146c
-43          Little OnAir TV
-44          Sigma TVII-FM
-45          MATRIX-Vision MV-Delta 2
-46          Zoltrix Genie TV/FM                                                               15b0:4000, 15b0:400a, 15b0:400d, 15b0:4010, 15b0:4016
-47          Terratec TV/Radio+                                                                153b:1123
-48          Askey CPH03x/ Dynalink Magic TView
-49          IODATA GV-BCTV3/PCI                                                               10fc:4020
-50          Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP
-51          Eagle Wireless Capricorn2 (bt878A)
-52          Pinnacle PCTV Studio Pro
-53          Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS
-54          Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]
-55          Askey CPH031/ BESTBUY Easy TV
-56          Lifeview FlyVideo 98FM LR50                                                       a051:41a0
-57          GrandTec 'Grand Video Capture' (Bt848)                                            4344:4142
-58          Askey CPH060/ Phoebe TV Master Only (No FM)
-59          Askey CPH03x TV Capturer
-60          Modular Technology MM100PCTV
-61          AG Electronics GMV1                                                               15cb:0101
-62          Askey CPH061/ BESTBUY Easy TV (bt878)
-63          ATI TV-Wonder                                                                     1002:0001
-64          ATI TV-Wonder VE                                                                  1002:0003
-65          Lifeview FlyVideo 2000S LR90
-66          Terratec TValueRadio                                                              153b:1135, 153b:ff3b
-67          IODATA GV-BCTV4/PCI                                                               10fc:4050
-68          3Dfx VoodooTV FM (Euro)                                                           10b4:2637
-69          Active Imaging AIMMS
-70          Prolink Pixelview PV-BT878P+ (Rev.4C,8E)
-71          Lifeview FlyVideo 98EZ (capture only) LR51                                        1851:1851
-72          Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)                       1554:4011
-73          Sensoray 311/611                                                                  6000:0311, 6000:0611
-74          RemoteVision MX (RV605)
-75          Powercolor MTV878/ MTV878R/ MTV878F
-76          Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)                               0e11:0079
-77          GrandTec Multi Capture Card (Bt878)
-78          Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF                                 0a01:17de
-79          DSP Design TCVIDEO
-80          Hauppauge WinTV PVR                                                               0070:4500
-81          IODATA GV-BCTV5/PCI                                                               10fc:4070, 10fc:d018
-82          Osprey 100/150 (878)                                                              0070:ff00
-83          Osprey 100/150 (848)
-84          Osprey 101 (848)
-85          Osprey 101/151
-86          Osprey 101/151 w/ svid
-87          Osprey 200/201/250/251
-88          Osprey 200/250                                                                    0070:ff01
-89          Osprey 210/220/230
-90          Osprey 500                                                                        0070:ff02
-91          Osprey 540                                                                        0070:ff04
-92          Osprey 2000                                                                       0070:ff03
-93          IDS Eagle
-94          Pinnacle PCTV Sat                                                                 11bd:001c
-95          Formac ProTV II (bt878)
-96          MachTV
-97          Euresys Picolo
-98          ProVideo PV150                                                                    aa00:1460, aa01:1461, aa02:1462, aa03:1463, aa04:1464, aa05:1465, aa06:1466, aa07:1467
-99          AD-TVK503
-100         Hercules Smart TV Stereo
-101         Pace TV & Radio Card
-102         IVC-200                                                                           0000:a155, 0001:a155, 0002:a155, 0003:a155, 0100:a155, 0101:a155, 0102:a155, 0103:a155, 0800:a155, 0801:a155, 0802:a155, 0803:a155
-103         Grand X-Guard / Trust 814PCI                                                      0304:0102
-104         Nebula Electronics DigiTV                                                         0071:0101
-105         ProVideo PV143                                                                    aa00:1430, aa00:1431, aa00:1432, aa00:1433, aa03:1433
-106         PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)
-107         PHYTEC VD-009-X1 VD-011 Combi (bt878)
-108         PHYTEC VD-009 MiniDIN (bt878)
-109         PHYTEC VD-009 Combi (bt878)
-110         IVC-100                                                                           ff00:a132
-111         IVC-120G                                                                          ff00:a182, ff01:a182, ff02:a182, ff03:a182, ff04:a182, ff05:a182, ff06:a182, ff07:a182, ff08:a182, ff09:a182, ff0a:a182, ff0b:a182, ff0c:a182, ff0d:a182, ff0e:a182, ff0f:a182
-112         pcHDTV HD-2000 TV                                                                 7063:2000
-113         Twinhan DST + clones                                                              11bd:0026, 1822:0001, 270f:fc00, 1822:0026
-114         Winfast VC100                                                                     107d:6607
-115         Teppro TEV-560/InterVision IV-560
-116         SIMUS GVC1100                                                                     aa6a:82b2
-117         NGS NGSTV+
-118         LMLBT4
-119         Tekram M205 PRO
-120         Conceptronic CONTVFMi
-121         Euresys Picolo Tetra                                                              1805:0105, 1805:0106, 1805:0107, 1805:0108
-122         Spirit TV Tuner
-123         AVerMedia AVerTV DVB-T 771                                                        1461:0771
-124         AverMedia AverTV DVB-T 761                                                        1461:0761
-125         MATRIX Vision Sigma-SQ
-126         MATRIX Vision Sigma-SLC
-127         APAC Viewcomp 878(AMAX)
-128         DViCO FusionHDTV DVB-T Lite                                                       18ac:db10, 18ac:db11
-129         V-Gear MyVCD
-130         Super TV Tuner
-131         Tibet Systems 'Progress DVR' CS16
-132         Kodicom 4400R (master)
-133         Kodicom 4400R (slave)
-134         Adlink RTV24
-135         DViCO FusionHDTV 5 Lite                                                           18ac:d500
-136         Acorp Y878F                                                                       9511:1540
-137         Conceptronic CTVFMi v2                                                            036e:109e
-138         Prolink Pixelview PV-BT878P+ (Rev.2E)
-139         Prolink PixelView PlayTV MPEG2 PV-M4900
-140         Osprey 440                                                                        0070:ff07
-141         Asound Skyeye PCTV
-142         Sabrent TV-FM (bttv version)
-143         Hauppauge ImpactVCB (bt878)                                                       0070:13eb
-144         MagicTV
-145         SSAI Security Video Interface                                                     4149:5353
-146         SSAI Ultrasound Video Interface                                                   414a:5353
-147         VoodooTV 200 (USA)                                                                121a:3000
-148         DViCO FusionHDTV 2                                                                dbc0:d200
-149         Typhoon TV-Tuner PCI (50684)
-150         Geovision GV-600                                                                  008a:763c
-151         Kozumi KTV-01C
-152         Encore ENL TV-FM-2                                                                1000:1801
-153         PHYTEC VD-012 (bt878)
-154         PHYTEC VD-012-X1 (bt878)
-155         PHYTEC VD-012-X2 (bt878)
-156         IVCE-8784                                                                         0000:f050, 0001:f050, 0002:f050, 0003:f050
-157         Geovision GV-800(S) (master)                                                      800a:763d
-158         Geovision GV-800(S) (slave)                                                       800b:763d, 800c:763d, 800d:763d
-159         ProVideo PV183                                                                    1830:1540, 1831:1540, 1832:1540, 1833:1540, 1834:1540, 1835:1540, 1836:1540, 1837:1540
-160         Tongwei Video Technology TD-3116                                                  f200:3116
-161         Aposonic W-DVR                                                                    0279:0228
-162         Adlink MPG24
-163         Bt848 Capture 14MHz
-164         CyberVision CV06 (SV)
-165         Kworld V-Stream Xpert TV PVR878
-166         PCI-8604PW
-=========== ================================================================================= ==============================================================================================================================================================================
+.. kernel-cmd:: bttv-cardlist.pl $srctree/drivers/media/pci/bt8xx/bttv.h $srctree/drivers/media/pci/bt8xx/bttv-cards.c
diff --git a/Documentation/media/v4l-drivers/cx23885-cardlist.rst b/Documentation/media/v4l-drivers/cx23885-cardlist.rst
index fd20b50d2c1d..2a76b5a0c147 100644
--- a/Documentation/media/v4l-drivers/cx23885-cardlist.rst
+++ b/Documentation/media/v4l-drivers/cx23885-cardlist.rst
@@ -1,65 +1 @@
-cx23885 cards list
-==================
-
-=========== ==================================== ======================================================================================
-Card number Card name                            PCI IDs
-=========== ==================================== ======================================================================================
-0           UNKNOWN/GENERIC                      0070:3400
-1           Hauppauge WinTV-HVR1800lp            0070:7600
-2           Hauppauge WinTV-HVR1800              0070:7800, 0070:7801, 0070:7809
-3           Hauppauge WinTV-HVR1250              0070:7911
-4           DViCO FusionHDTV5 Express            18ac:d500
-5           Hauppauge WinTV-HVR1500Q             0070:7790, 0070:7797
-6           Hauppauge WinTV-HVR1500              0070:7710, 0070:7717
-7           Hauppauge WinTV-HVR1200              0070:71d1, 0070:71d3
-8           Hauppauge WinTV-HVR1700              0070:8101
-9           Hauppauge WinTV-HVR1400              0070:8010
-10          DViCO FusionHDTV7 Dual Express       18ac:d618
-11          DViCO FusionHDTV DVB-T Dual Express  18ac:db78
-12          Leadtek Winfast PxDVR3200 H          107d:6681
-13          Compro VideoMate E650F               185b:e800
-14          TurboSight TBS 6920                  6920:8888
-15          TeVii S470                           d470:9022
-16          DVBWorld DVB-S2 2005                 0001:2005
-17          NetUP Dual DVB-S2 CI                 1b55:2a2c
-18          Hauppauge WinTV-HVR1270              0070:2211
-19          Hauppauge WinTV-HVR1275              0070:2215, 0070:221d, 0070:22f2
-20          Hauppauge WinTV-HVR1255              0070:2251, 0070:22f1
-21          Hauppauge WinTV-HVR1210              0070:2291, 0070:2295, 0070:2299, 0070:229d, 0070:22f0, 0070:22f3, 0070:22f4, 0070:22f5
-22          Mygica X8506 DMB-TH                  14f1:8651
-23          Magic-Pro ProHDTV Extreme 2          14f1:8657
-24          Hauppauge WinTV-HVR1850              0070:8541
-25          Compro VideoMate E800                1858:e800
-26          Hauppauge WinTV-HVR1290              0070:8551
-27          Mygica X8558 PRO DMB-TH              14f1:8578
-28          LEADTEK WinFast PxTV1200             107d:6f22
-29          GoTView X5 3D Hybrid                 5654:2390
-30          NetUP Dual DVB-T/C-CI RF             1b55:e2e4
-31          Leadtek Winfast PxDVR3200 H XC4000   107d:6f39
-32          MPX-885
-33          Mygica X8502/X8507 ISDB-T            14f1:8502
-34          TerraTec Cinergy T PCIe Dual         153b:117e
-35          TeVii S471                           d471:9022
-36          Hauppauge WinTV-HVR1255              0070:2259
-37          Prof Revolution DVB-S2 8000          8000:3034
-38          Hauppauge WinTV-HVR4400/HVR5500      0070:c108, 0070:c138, 0070:c1f8
-39          AVerTV Hybrid Express Slim HC81R     1461:d939
-40          TurboSight TBS 6981                  6981:8888
-41          TurboSight TBS 6980                  6980:8888
-42          Leadtek Winfast PxPVR2200            107d:6f21
-43          Hauppauge ImpactVCB-e                0070:7133
-44          DViCO FusionHDTV DVB-T Dual Express2 18ac:db98
-45          DVBSky T9580                         4254:9580
-46          DVBSky T980C                         4254:980c
-47          DVBSky S950C                         4254:950c
-48          Technotrend TT-budget CT2-4500 CI    13c2:3013
-49          DVBSky S950                          4254:0950
-50          DVBSky S952                          4254:0952
-51          DVBSky T982                          4254:0982
-52          Hauppauge WinTV-HVR5525              0070:f038
-53          Hauppauge WinTV Starburst            0070:c12a
-54          ViewCast 260e                        1576:0260
-55          ViewCast 460e                        1576:0460
-56          Hauppauge WinTV-QuadHD-DVB           0070:6a28, 0070:6b28
-57          Hauppauge WinTV-QuadHD-ATSC          0070:6a18, 0070:6b18
-=========== ==================================== ======================================================================================
+.. kernel-cmd:: cx23885-cardlist.pl $srctree/drivers/media/pci/cx23885/cx23885.h $srctree/drivers/media/pci/cx23885/cx23885-cards.c
diff --git a/Documentation/media/v4l-drivers/cx88-cardlist.rst b/Documentation/media/v4l-drivers/cx88-cardlist.rst
index 8cc1cea17035..85a71537b98e 100644
--- a/Documentation/media/v4l-drivers/cx88-cardlist.rst
+++ b/Documentation/media/v4l-drivers/cx88-cardlist.rst
@@ -1,98 +1 @@
-CX88 cards list
-===============
-
-=========== =================================================== ======================================================================================
-Card number Card name                                           PCI IDs
-=========== =================================================== ======================================================================================
-0           UNKNOWN/GENERIC
-1           Hauppauge WinTV 34xxx models                        0070:3400, 0070:3401
-2           GDI Black Gold                                      14c7:0106, 14c7:0107
-3           PixelView                                           1554:4811
-4           ATI TV Wonder Pro                                   1002:00f8, 1002:00f9
-5           Leadtek Winfast 2000XP Expert                       107d:6611, 107d:6613
-6           AverTV Studio 303 (M126)                            1461:000b
-7           MSI TV-@nywhere Master                              1462:8606
-8           Leadtek Winfast DV2000                              107d:6620, 107d:6621
-9           Leadtek PVR 2000                                    107d:663b, 107d:663c, 107d:6632, 107d:6630, 107d:6638, 107d:6631, 107d:6637, 107d:663d
-10          IODATA GV-VCP3/PCI                                  10fc:d003
-11          Prolink PlayTV PVR
-12          ASUS PVR-416                                        1043:4823, 1461:c111
-13          MSI TV-@nywhere
-14          KWorld/VStream XPert DVB-T                          17de:08a6
-15          DViCO FusionHDTV DVB-T1                             18ac:db00
-16          KWorld LTV883RF
-17          DViCO FusionHDTV 3 Gold-Q                           18ac:d810, 18ac:d800
-18          Hauppauge Nova-T DVB-T                              0070:9002, 0070:9001, 0070:9000
-19          Conexant DVB-T reference design                     14f1:0187
-20          Provideo PV259                                      1540:2580
-21          DViCO FusionHDTV DVB-T Plus                         18ac:db10, 18ac:db11
-22          pcHDTV HD3000 HDTV                                  7063:3000
-23          digitalnow DNTV Live! DVB-T                         17de:a8a6
-24          Hauppauge WinTV 28xxx (Roslyn) models               0070:2801
-25          Digital-Logic MICROSPACE Entertainment Center (MEC) 14f1:0342
-26          IODATA GV/BCTV7E                                    10fc:d035
-27          PixelView PlayTV Ultra Pro (Stereo)
-28          DViCO FusionHDTV 3 Gold-T                           18ac:d820
-29          ADS Tech Instant TV DVB-T PCI                       1421:0334
-30          TerraTec Cinergy 1400 DVB-T                         153b:1166
-31          DViCO FusionHDTV 5 Gold                             18ac:d500
-32          AverMedia UltraTV Media Center PCI 550              1461:8011
-33          Kworld V-Stream Xpert DVD
-34          ATI HDTV Wonder                                     1002:a101
-35          WinFast DTV1000-T                                   107d:665f
-36          AVerTV 303 (M126)                                   1461:000a
-37          Hauppauge Nova-S-Plus DVB-S                         0070:9201, 0070:9202
-38          Hauppauge Nova-SE2 DVB-S                            0070:9200
-39          KWorld DVB-S 100                                    17de:08b2, 1421:0341
-40          Hauppauge WinTV-HVR1100 DVB-T/Hybrid                0070:9400, 0070:9402
-41          Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile)  0070:9800, 0070:9802
-42          digitalnow DNTV Live! DVB-T Pro                     1822:0025, 1822:0019
-43          KWorld/VStream XPert DVB-T with cx22702             17de:08a1, 12ab:2300
-44          DViCO FusionHDTV DVB-T Dual Digital                 18ac:db50, 18ac:db54
-45          KWorld HardwareMpegTV XPert                         17de:0840, 1421:0305
-46          DViCO FusionHDTV DVB-T Hybrid                       18ac:db40, 18ac:db44
-47          pcHDTV HD5500 HDTV                                  7063:5500
-48          Kworld MCE 200 Deluxe                               17de:0841
-49          PixelView PlayTV P7000                              1554:4813
-50          NPG Tech Real TV FM Top 10                          14f1:0842
-51          WinFast DTV2000 H                                   107d:665e
-52          Geniatech DVB-S                                     14f1:0084
-53          Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T  0070:1404, 0070:1400, 0070:1401, 0070:1402
-54          Norwood Micro TV Tuner
-55          Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM  c180:c980
-56          Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder   0070:9600, 0070:9601, 0070:9602
-57          ADS Tech Instant Video PCI                          1421:0390
-58          Pinnacle PCTV HD 800i                               11bd:0051
-59          DViCO FusionHDTV 5 PCI nano                         18ac:d530
-60          Pinnacle Hybrid PCTV                                12ab:1788
-61          Leadtek TV2000 XP Global                            107d:6f18, 107d:6618, 107d:6619
-62          PowerColor RA330                                    14f1:ea3d
-63          Geniatech X8000-MT DVBT                             14f1:8852
-64          DViCO FusionHDTV DVB-T PRO                          18ac:db30
-65          DViCO FusionHDTV 7 Gold                             18ac:d610
-66          Prolink Pixelview MPEG 8000GT                       1554:4935
-67          Kworld PlusTV HD PCI 120 (ATSC 120)                 17de:08c1
-68          Hauppauge WinTV-HVR4000 DVB-S/S2/T/Hybrid           0070:6900, 0070:6904, 0070:6902
-69          Hauppauge WinTV-HVR4000(Lite) DVB-S/S2              0070:6905, 0070:6906
-70          TeVii S460 DVB-S/S2                                 d460:9022
-71          Omicom SS4 DVB-S/S2 PCI                             A044:2011
-72          TBS 8920 DVB-S/S2                                   8920:8888
-73          TeVii S420 DVB-S                                    d420:9022
-74          Prolink Pixelview Global Extreme                    1554:4976
-75          PROF 7300 DVB-S/S2                                  B033:3033
-76          SATTRADE ST4200 DVB-S/S2                            b200:4200
-77          TBS 8910 DVB-S                                      8910:8888
-78          Prof 6200 DVB-S                                     b022:3022
-79          Terratec Cinergy HT PCI MKII                        153b:1177
-80          Hauppauge WinTV-IR Only                             0070:9290
-81          Leadtek WinFast DTV1800 Hybrid                      107d:6654
-82          WinFast DTV2000 H rev. J                            107d:6f2b
-83          Prof 7301 DVB-S/S2                                  b034:3034
-84          Samsung SMT 7020 DVB-S                              18ac:dc00, 18ac:dccd
-85          Twinhan VP-1027 DVB-S                               1822:0023
-86          TeVii S464 DVB-S/S2                                 d464:9022
-87          Leadtek WinFast DTV2000 H PLUS                      107d:6f42
-88          Leadtek WinFast DTV1800 H (XC4000)                  107d:6f38
-89          Leadtek TV2000 XP Global (SC4100)                   107d:6f36
-90          Leadtek TV2000 XP Global (XC4100)                   107d:6f43
-=========== =================================================== ======================================================================================
+.. kernel-cmd:: cx88-cardlist.pl $srctree/drivers/media/pci/cx88/cx88.h $srctree/drivers/media/pci/cx88/cx88-cards.c
diff --git a/Documentation/media/v4l-drivers/em28xx-cardlist.rst b/Documentation/media/v4l-drivers/em28xx-cardlist.rst
index 76b1d301754c..b08e6eddbb12 100644
--- a/Documentation/media/v4l-drivers/em28xx-cardlist.rst
+++ b/Documentation/media/v4l-drivers/em28xx-cardlist.rst
@@ -1,107 +1 @@
-EM28xx cards list
-=================
-
-=========== ==================================================================== ================ ==================================================================================================================================
-Card number Card name                                                            Empia Chip       USB IDs
-=========== ==================================================================== ================ ==================================================================================================================================
-0           Unknown EM2800 video grabber                                         em2800           eb1a:2800
-1           Unknown EM2750/28xx video grabber                                    em2820 or em2840 eb1a:2710, eb1a:2820, eb1a:2821, eb1a:2860, eb1a:2861, eb1a:2862, eb1a:2863, eb1a:2870, eb1a:2881, eb1a:2883, eb1a:2868, eb1a:2875
-2           Terratec Cinergy 250 USB                                             em2820 or em2840 0ccd:0036
-3           Pinnacle PCTV USB 2                                                  em2820 or em2840 2304:0208
-4           Hauppauge WinTV USB 2                                                em2820 or em2840 2040:4200, 2040:4201
-5           MSI VOX USB 2.0                                                      em2820 or em2840
-6           Terratec Cinergy 200 USB                                             em2800
-7           Leadtek Winfast USB II                                               em2800           0413:6023
-8           Kworld USB2800                                                       em2800
-9           Pinnacle Dazzle DVC 90/100/101/107 / Kaiser Baas Video to DVD maker  em2820 or em2840 1b80:e302, 1b80:e304, 2304:0207, 2304:021a, 093b:a003
-10          Hauppauge WinTV HVR 900                                              em2880           2040:6500
-11          Terratec Hybrid XS                                                   em2880
-12          Kworld PVR TV 2800 RF                                                em2820 or em2840
-13          Terratec Prodigy XS                                                  em2880
-14          SIIG AVTuner-PVR / Pixelview Prolink PlayTV USB 2.0                  em2820 or em2840
-15          V-Gear PocketTV                                                      em2800
-16          Hauppauge WinTV HVR 950                                              em2883           2040:6513, 2040:6517, 2040:651b
-17          Pinnacle PCTV HD Pro Stick                                           em2880           2304:0227
-18          Hauppauge WinTV HVR 900 (R2)                                         em2880           2040:6502
-19          EM2860/SAA711X Reference Design                                      em2860
-20          AMD ATI TV Wonder HD 600                                             em2880           0438:b002
-21          eMPIA Technology, Inc. GrabBeeX+ Video Encoder                       em2800           eb1a:2801
-22          EM2710/EM2750/EM2751 webcam grabber                                  em2750           eb1a:2750, eb1a:2751
-23          Huaqi DLCW-130                                                       em2750
-24          D-Link DUB-T210 TV Tuner                                             em2820 or em2840 2001:f112
-25          Gadmei UTV310                                                        em2820 or em2840
-26          Hercules Smart TV USB 2.0                                            em2820 or em2840
-27          Pinnacle PCTV USB 2 (Philips FM1216ME)                               em2820 or em2840
-28          Leadtek Winfast USB II Deluxe                                        em2820 or em2840
-29          EM2860/TVP5150 Reference Design                                      em2860
-30          Videology 20K14XUSB USB2.0                                           em2820 or em2840
-31          Usbgear VD204v9                                                      em2821
-32          Supercomp USB 2.0 TV                                                 em2821
-33          Elgato Video Capture                                                 em2860           0fd9:0033
-34          Terratec Cinergy A Hybrid XS                                         em2860           0ccd:004f
-35          Typhoon DVD Maker                                                    em2860
-36          NetGMBH Cam                                                          em2860
-37          Gadmei UTV330                                                        em2860           eb1a:50a6
-38          Yakumo MovieMixer                                                    em2861
-39          KWorld PVRTV 300U                                                    em2861           eb1a:e300
-40          Plextor ConvertX PX-TV100U                                           em2861           093b:a005
-41          Kworld 350 U DVB-T                                                   em2870           eb1a:e350
-42          Kworld 355 U DVB-T                                                   em2870           eb1a:e355, eb1a:e357, eb1a:e359
-43          Terratec Cinergy T XS                                                em2870
-44          Terratec Cinergy T XS (MT2060)                                       em2870           0ccd:0043
-45          Pinnacle PCTV DVB-T                                                  em2870
-46          Compro, VideoMate U3                                                 em2870           185b:2870
-47          KWorld DVB-T 305U                                                    em2880           eb1a:e305
-48          KWorld DVB-T 310U                                                    em2880
-49          MSI DigiVox A/D                                                      em2880           eb1a:e310
-50          MSI DigiVox A/D II                                                   em2880           eb1a:e320
-51          Terratec Hybrid XS Secam                                             em2880           0ccd:004c
-52          DNT DA2 Hybrid                                                       em2881
-53          Pinnacle Hybrid Pro                                                  em2881
-54          Kworld VS-DVB-T 323UR                                                em2882           eb1a:e323
-55          Terratec Cinnergy Hybrid T USB XS (em2882)                           em2882           0ccd:005e, 0ccd:0042
-56          Pinnacle Hybrid Pro (330e)                                           em2882           2304:0226
-57          Kworld PlusTV HD Hybrid 330                                          em2883           eb1a:a316
-58          Compro VideoMate ForYou/Stereo                                       em2820 or em2840 185b:2041
-59          Pinnacle PCTV HD Mini                                                em2874           2304:023f
-60          Hauppauge WinTV HVR 850                                              em2883           2040:651f
-61          Pixelview PlayTV Box 4 USB 2.0                                       em2820 or em2840
-62          Gadmei TVR200                                                        em2820 or em2840
-63          Kaiomy TVnPC U2                                                      em2860           eb1a:e303
-64          Easy Cap Capture DC-60                                               em2860           1b80:e309
-65          IO-DATA GV-MVP/SZ                                                    em2820 or em2840 04bb:0515
-66          Empire dual TV                                                       em2880
-67          Terratec Grabby                                                      em2860           0ccd:0096, 0ccd:10AF
-68          Terratec AV350                                                       em2860           0ccd:0084
-69          KWorld ATSC 315U HDTV TV Box                                         em2882           eb1a:a313
-70          Evga inDtube                                                         em2882
-71          Silvercrest Webcam 1.3mpix                                           em2820 or em2840
-72          Gadmei UTV330+                                                       em2861
-73          Reddo DVB-C USB TV Box                                               em2870
-74          Actionmaster/LinXcel/Digitus VC211A                                  em2800
-75          Dikom DK300                                                          em2882
-76          KWorld PlusTV 340U or UB435-Q (ATSC)                                 em2870           1b80:a340
-77          EM2874 Leadership ISDBT                                              em2874
-78          PCTV nanoStick T2 290e                                               em28174          2013:024f
-79          Terratec Cinergy H5                                                  em2884           eb1a:2885, 0ccd:10a2, 0ccd:10ad, 0ccd:10b6
-80          PCTV DVB-S2 Stick (460e)                                             em28174          2013:024c
-81          Hauppauge WinTV HVR 930C                                             em2884           2040:1605
-82          Terratec Cinergy HTC Stick                                           em2884           0ccd:00b2
-83          Honestech Vidbox NW03                                                em2860           eb1a:5006
-84          MaxMedia UB425-TC                                                    em2874           1b80:e425
-85          PCTV QuatroStick (510e)                                              em2884           2304:0242
-86          PCTV QuatroStick nano (520e)                                         em2884           2013:0251
-87          Terratec Cinergy HTC USB XS                                          em2884           0ccd:008e, 0ccd:00ac
-88          C3 Tech Digital Duo HDTV/SDTV USB                                    em2884           1b80:e755
-89          Delock 61959                                                         em2874           1b80:e1cc
-90          KWorld USB ATSC TV Stick UB435-Q V2                                  em2874           1b80:e346
-91          SpeedLink Vicious And Devine Laplace webcam                          em2765           1ae7:9003, 1ae7:9004
-92          PCTV DVB-S2 Stick (461e)                                             em28178          2013:0258
-93          KWorld USB ATSC TV Stick UB435-Q V3                                  em2874           1b80:e34c
-94          PCTV tripleStick (292e)                                              em28178          2013:025f, 2040:0264
-95          Leadtek VC100                                                        em2861           0413:6f07
-96          Terratec Cinergy T2 Stick HD                                         em28178          eb1a:8179
-97          Elgato EyeTV Hybrid 2008 INT                                         em2884           0fd9:0018
-98          PLEX PX-BCUD                                                         em28178          3275:0085
-99          Hauppauge WinTV-dualHD DVB                                           em28174          2040:0265
-=========== ==================================================================== ================ ==================================================================================================================================
+.. kernel-cmd:: em28xx-cardlist.pl $srctree/drivers/media/usb/em28xx/em28xx-cards.c   $srctree/drivers/media/usb/em28xx/em28xx.h
diff --git a/Documentation/media/v4l-drivers/ivtv-cardlist.rst b/Documentation/media/v4l-drivers/ivtv-cardlist.rst
index 754ffa820b4c..e9ab6849335f 100644
--- a/Documentation/media/v4l-drivers/ivtv-cardlist.rst
+++ b/Documentation/media/v4l-drivers/ivtv-cardlist.rst
@@ -1,38 +1 @@
-IVTV cards list
-===============
-
-=========== ============================================================= ====================================================
-Card number Card name                                                     PCI IDs
-=========== ============================================================= ====================================================
-0           Hauppauge WinTV PVR-250                                       IVTV16 104d:813d
-1           Hauppauge WinTV PVR-350                                       IVTV16 104d:813d
-2           Hauppauge WinTV PVR-150                                       IVTV16 104d:813d
-3           AVerMedia M179                                                IVTV15 1461:a3cf, IVTV15 1461:a3ce
-4           Yuan MPG600, Kuroutoshikou ITVC16-STVLP                       IVTV16 12ab:fff3, IVTV16 12ab:ffff
-5           YUAN MPG160, Kuroutoshikou ITVC15-STVLP, I/O Data GV-M2TV/PCI IVTV15 10fc:40a0
-6           Yuan PG600, Diamond PVR-550                                   IVTV16 ff92:0070, IVTV16 ffab:0600
-7           Adaptec VideOh! AVC-2410                                      IVTV16 9005:0093
-8           Adaptec VideOh! AVC-2010                                      IVTV16 9005:0092
-9           Nagase Transgear 5000TV                                       IVTV16 1461:bfff
-10          AOpen VA2000MAX-SNT6                                          IVTV16 0000:ff5f
-11          Yuan MPG600GR, Kuroutoshikou CX23416GYC-STVLP                 IVTV16 12ab:0600, IVTV16 fbab:0600, IVTV16 1154:0523
-12          I/O Data GV-MVP/RX, GV-MVP/RX2W (dual tuner)                  IVTV16 10fc:d01e, IVTV16 10fc:d038, IVTV16 10fc:d039
-13          I/O Data GV-MVP/RX2E                                          IVTV16 10fc:d025
-14          GotView PCI DVD                                               IVTV16 12ab:0600
-15          GotView PCI DVD2 Deluxe                                       IVTV16 ffac:0600
-16          Yuan MPC622                                                   IVTV16 ff01:d998
-17          Digital Cowboy DCT-MTVP1                                      IVTV16 1461:bfff
-18          Yuan PG600-2, GotView PCI DVD Lite                            IVTV16 ffab:0600, IVTV16 ffad:0600
-19          Club3D ZAP-TV1x01                                             IVTV16 ffab:0600
-20          AVerTV MCE 116 Plus                                           IVTV16 1461:c439
-21          ASUS Falcon2                                                  IVTV16 1043:4b66, IVTV16 1043:462e, IVTV16 1043:4b2e
-22          AVerMedia PVR-150 Plus / AVerTV M113 Partsnic (Daewoo) Tuner  IVTV16 1461:c034, IVTV16 1461:c035
-23          AVerMedia EZMaker PCI Deluxe                                  IVTV16 1461:c03f
-24          AVerMedia M104                                                IVTV16 1461:c136
-25          Buffalo PC-MV5L/PCI                                           IVTV16 1154:052b
-26          AVerMedia UltraTV 1500 MCE / AVerTV M113 Philips Tuner        IVTV16 1461:c019, IVTV16 1461:c01b
-27          Sony VAIO Giga Pocket (ENX Kikyou)                            IVTV16 104d:813d
-28          Hauppauge WinTV PVR-350 (V1)                                  IVTV16 104d:813d
-29          Yuan MPG600GR, Kuroutoshikou CX23416GYC-STVLP (no GR)         IVTV16 104d:813d
-30          Yuan MPG600GR, Kuroutoshikou CX23416GYC-STVLP (no GR/YCS)     IVTV16 104d:813d
-=========== ============================================================= ====================================================
+.. kernel-cmd:: ivtv-cardlist.pl $srctree/drivers/media/pci/ivtv/ivtv-cards.h $srctree/drivers/media/pci/ivtv/ivtv-cards.c
diff --git a/Documentation/media/v4l-drivers/saa7134-cardlist.rst b/Documentation/media/v4l-drivers/saa7134-cardlist.rst
index a5efa8f4b8e4..6164ba154abe 100644
--- a/Documentation/media/v4l-drivers/saa7134-cardlist.rst
+++ b/Documentation/media/v4l-drivers/saa7134-cardlist.rst
@@ -1,204 +1 @@
-SAA7134 cards list
-==================
-
-=========== ======================================================= ================================================================
-Card number Card name                                               PCI IDs
-=========== ======================================================= ================================================================
-0           UNKNOWN/GENERIC
-1           Proteus Pro [philips reference design]                  1131:2001, 1131:2001
-2           LifeView FlyVIDEO3000                                   5168:0138, 4e42:0138
-3           LifeView/Typhoon FlyVIDEO2000                           5168:0138, 4e42:0138
-4           EMPRESS                                                 1131:6752
-5           SKNet Monster TV                                        1131:4e85
-6           Tevion MD 9717
-7           KNC One TV-Station RDS / Typhoon TV Tuner RDS           1131:fe01, 1894:fe01
-8           Terratec Cinergy 400 TV                                 153b:1142
-9           Medion 5044
-10          Kworld/KuroutoShikou SAA7130-TVPCI
-11          Terratec Cinergy 600 TV                                 153b:1143
-12          Medion 7134                                             16be:0003, 16be:5000
-13          Typhoon TV+Radio 90031
-14          ELSA EX-VISION 300TV                                    1048:226b
-15          ELSA EX-VISION 500TV                                    1048:226a
-16          ASUS TV-FM 7134                                         1043:4842, 1043:4830, 1043:4840
-17          AOPEN VA1000 POWER                                      1131:7133
-18          BMK MPEX No Tuner
-19          Compro VideoMate TV                                     185b:c100
-20          Matrox CronosPlus                                       102B:48d0
-21          10MOONS PCI TV CAPTURE CARD                             1131:2001
-22          AverMedia M156 / Medion 2819                            1461:a70b
-23          BMK MPEX Tuner
-24          KNC One TV-Station DVR                                  1894:a006
-25          ASUS TV-FM 7133                                         1043:4843
-26          Pinnacle PCTV Stereo (saa7134)                          11bd:002b
-27          Manli MuchTV M-TV002
-28          Manli MuchTV M-TV001
-29          Nagase Sangyo TransGear 3000TV                          1461:050c
-30          Elitegroup ECS TVP3XP FM1216 Tuner Card(PAL-BG,FM)      1019:4cb4
-31          Elitegroup ECS TVP3XP FM1236 Tuner Card (NTSC,FM)       1019:4cb5
-32          AVACS SmartTV
-33          AVerMedia DVD EZMaker                                   1461:10ff
-34          Noval Prime TV 7133
-35          AverMedia AverTV Studio 305                             1461:2115
-36          UPMOST PURPLE TV                                        12ab:0800
-37          Items MuchTV Plus / IT-005
-38          Terratec Cinergy 200 TV                                 153b:1152
-39          LifeView FlyTV Platinum Mini                            5168:0212, 4e42:0212, 5169:1502
-40          Compro VideoMate TV PVR/FM                              185b:c100
-41          Compro VideoMate TV Gold+                               185b:c100
-42          Sabrent SBT-TVFM (saa7130)
-43          :Zolid Xpert TV7134
-44          Empire PCI TV-Radio LE
-45          Avermedia AVerTV Studio 307                             1461:9715
-46          AVerMedia Cardbus TV/Radio (E500)                       1461:d6ee
-47          Terratec Cinergy 400 mobile                             153b:1162
-48          Terratec Cinergy 600 TV MK3                             153b:1158
-49          Compro VideoMate Gold+ Pal                              185b:c200
-50          Pinnacle PCTV 300i DVB-T + PAL                          11bd:002d
-51          ProVideo PV952                                          1540:9524
-52          AverMedia AverTV/305                                    1461:2108
-53          ASUS TV-FM 7135                                         1043:4845
-54          LifeView FlyTV Platinum FM / Gold                       5168:0214, 5168:5214, 1489:0214, 5168:0304
-55          LifeView FlyDVB-T DUO / MSI TV@nywhere Duo              5168:0306, 4E42:0306
-56          Avermedia AVerTV 307                                    1461:a70a
-57          Avermedia AVerTV GO 007 FM                              1461:f31f
-58          ADS Tech Instant TV (saa7135)                           1421:0350, 1421:0351, 1421:0370, 1421:1370
-59          Kworld/Tevion V-Stream Xpert TV PVR7134
-60          LifeView/Typhoon/Genius FlyDVB-T Duo Cardbus            5168:0502, 4e42:0502, 1489:0502
-61          Philips TOUGH DVB-T reference design                    1131:2004
-62          Compro VideoMate TV Gold+II
-63          Kworld Xpert TV PVR7134
-64          FlyTV mini Asus Digimatrix                              1043:0210
-65          V-Stream Studio TV Terminator
-66          Yuan TUN-900 (saa7135)
-67          Beholder BeholdTV 409 FM                                0000:4091
-68          GoTView 7135 PCI                                        5456:7135
-69          Philips EUROPA V3 reference design                      1131:2004
-70          Compro Videomate DVB-T300                               185b:c900
-71          Compro Videomate DVB-T200                               185b:c901
-72          RTD Embedded Technologies VFG7350                       1435:7350
-73          RTD Embedded Technologies VFG7330                       1435:7330
-74          LifeView FlyTV Platinum Mini2                           14c0:1212
-75          AVerMedia AVerTVHD MCE A180                             1461:1044
-76          SKNet MonsterTV Mobile                                  1131:4ee9
-77          Pinnacle PCTV 40i/50i/110i (saa7133)                    11bd:002e
-78          ASUSTeK P7131 Dual                                      1043:4862
-79          Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B)
-80          ASUS Digimatrix TV                                      1043:0210
-81          Philips Tiger reference design                          1131:2018
-82          MSI TV@Anywhere plus                                    1462:6231, 1462:8624
-83          Terratec Cinergy 250 PCI TV                             153b:1160
-84          LifeView FlyDVB Trio                                    5168:0319
-85          AverTV DVB-T 777                                        1461:2c05, 1461:2c05
-86          LifeView FlyDVB-T / Genius VideoWonder DVB-T            5168:0301, 1489:0301
-87          ADS Instant TV Duo Cardbus PTV331                       0331:1421
-88          Tevion/KWorld DVB-T 220RF                               17de:7201
-89          ELSA EX-VISION 700TV                                    1048:226c
-90          Kworld ATSC110/115                                      17de:7350, 17de:7352
-91          AVerMedia A169 B                                        1461:7360
-92          AVerMedia A169 B1                                       1461:6360
-93          Medion 7134 Bridge #2                                   16be:0005
-94          LifeView FlyDVB-T Hybrid Cardbus/MSI TV @nywhere A/D NB 5168:3306, 5168:3502, 5168:3307, 4e42:3502
-95          LifeView FlyVIDEO3000 (NTSC)                            5169:0138
-96          Medion Md8800 Quadro                                    16be:0007, 16be:0008, 16be:000d
-97          LifeView FlyDVB-S /Acorp TV134DS                        5168:0300, 4e42:0300
-98          Proteus Pro 2309                                        0919:2003
-99          AVerMedia TV Hybrid A16AR                               1461:2c00
-100         Asus Europa2 OEM                                        1043:4860
-101         Pinnacle PCTV 310i                                      11bd:002f
-102         Avermedia AVerTV Studio 507                             1461:9715
-103         Compro Videomate DVB-T200A
-104         Hauppauge WinTV-HVR1110 DVB-T/Hybrid                    0070:6700, 0070:6701, 0070:6702, 0070:6703, 0070:6704, 0070:6705
-105         Terratec Cinergy HT PCMCIA                              153b:1172
-106         Encore ENLTV                                            1131:2342, 1131:2341, 3016:2344
-107         Encore ENLTV-FM                                         1131:230f
-108         Terratec Cinergy HT PCI                                 153b:1175
-109         Philips Tiger - S Reference design
-110         Avermedia M102                                          1461:f31e
-111         ASUS P7131 4871                                         1043:4871
-112         ASUSTeK P7131 Hybrid                                    1043:4876
-113         Elitegroup ECS TVP3XP FM1246 Tuner Card (PAL,FM)        1019:4cb6
-114         KWorld DVB-T 210                                        17de:7250
-115         Sabrent PCMCIA TV-PCB05                                 0919:2003
-116         10MOONS TM300 TV Card                                   1131:2304
-117         Avermedia Super 007                                     1461:f01d
-118         Beholder BeholdTV 401                                   0000:4016
-119         Beholder BeholdTV 403                                   0000:4036
-120         Beholder BeholdTV 403 FM                                0000:4037
-121         Beholder BeholdTV 405                                   0000:4050
-122         Beholder BeholdTV 405 FM                                0000:4051
-123         Beholder BeholdTV 407                                   0000:4070
-124         Beholder BeholdTV 407 FM                                0000:4071
-125         Beholder BeholdTV 409                                   0000:4090
-126         Beholder BeholdTV 505 FM                                5ace:5050
-127         Beholder BeholdTV 507 FM / BeholdTV 509 FM              5ace:5070, 5ace:5090
-128         Beholder BeholdTV Columbus TV/FM                        0000:5201
-129         Beholder BeholdTV 607 FM                                5ace:6070
-130         Beholder BeholdTV M6                                    5ace:6190
-131         Twinhan Hybrid DTV-DVB 3056 PCI                         1822:0022
-132         Genius TVGO AM11MCE
-133         NXP Snake DVB-S reference design
-134         Medion/Creatix CTX953 Hybrid                            16be:0010
-135         MSI TV@nywhere A/D v1.1                                 1462:8625
-136         AVerMedia Cardbus TV/Radio (E506R)                      1461:f436
-137         AVerMedia Hybrid TV/Radio (A16D)                        1461:f936
-138         Avermedia M115                                          1461:a836
-139         Compro VideoMate T750                                   185b:c900
-140         Avermedia DVB-S Pro A700                                1461:a7a1
-141         Avermedia DVB-S Hybrid+FM A700                          1461:a7a2
-142         Beholder BeholdTV H6                                    5ace:6290
-143         Beholder BeholdTV M63                                   5ace:6191
-144         Beholder BeholdTV M6 Extra                              5ace:6193
-145         AVerMedia MiniPCI DVB-T Hybrid M103                     1461:f636, 1461:f736
-146         ASUSTeK P7131 Analog
-147         Asus Tiger 3in1                                         1043:4878
-148         Encore ENLTV-FM v5.3                                    1a7f:2008
-149         Avermedia PCI pure analog (M135A)                       1461:f11d
-150         Zogis Real Angel 220
-151         ADS Tech Instant HDTV                                   1421:0380
-152         Asus Tiger Rev:1.00                                     1043:4857
-153         Kworld Plus TV Analog Lite PCI                          17de:7128
-154         Avermedia AVerTV GO 007 FM Plus                         1461:f31d
-155         Hauppauge WinTV-HVR1150 ATSC/QAM-Hybrid                 0070:6706, 0070:6708
-156         Hauppauge WinTV-HVR1120 DVB-T/Hybrid                    0070:6707, 0070:6709, 0070:670a
-157         Avermedia AVerTV Studio 507UA                           1461:a11b
-158         AVerMedia Cardbus TV/Radio (E501R)                      1461:b7e9
-159         Beholder BeholdTV 505 RDS                               0000:505B
-160         Beholder BeholdTV 507 RDS                               0000:5071
-161         Beholder BeholdTV 507 RDS                               0000:507B
-162         Beholder BeholdTV 607 FM                                5ace:6071
-163         Beholder BeholdTV 609 FM                                5ace:6090
-164         Beholder BeholdTV 609 FM                                5ace:6091
-165         Beholder BeholdTV 607 RDS                               5ace:6072
-166         Beholder BeholdTV 607 RDS                               5ace:6073
-167         Beholder BeholdTV 609 RDS                               5ace:6092
-168         Beholder BeholdTV 609 RDS                               5ace:6093
-169         Compro VideoMate S350/S300                              185b:c900
-170         AverMedia AverTV Studio 505                             1461:a115
-171         Beholder BeholdTV X7                                    5ace:7595
-172         RoverMedia TV Link Pro FM                               19d1:0138
-173         Zolid Hybrid TV Tuner PCI                               1131:2004
-174         Asus Europa Hybrid OEM                                  1043:4847
-175         Leadtek Winfast DTV1000S                                107d:6655
-176         Beholder BeholdTV 505 RDS                               0000:5051
-177         Hawell HW-404M7
-178         Beholder BeholdTV H7                                    5ace:7190
-179         Beholder BeholdTV A7                                    5ace:7090
-180         Avermedia PCI M733A                                     1461:4155, 1461:4255
-181         TechoTrend TT-budget T-3000                             13c2:2804
-182         Kworld PCI SBTVD/ISDB-T Full-Seg Hybrid                 17de:b136
-183         Compro VideoMate Vista M1F                              185b:c900
-184         Encore ENLTV-FM 3                                       1a7f:2108
-185         MagicPro ProHDTV Pro2 DMB-TH/Hybrid                     17de:d136
-186         Beholder BeholdTV 501                                   5ace:5010
-187         Beholder BeholdTV 503 FM                                5ace:5030
-188         Sensoray 811/911                                        6000:0811, 6000:0911
-189         Kworld PC150-U                                          17de:a134
-190         Asus My Cinema PS3-100                                  1043:48cd
-191         Hawell HW-9004V1
-192         AverMedia AverTV Satellite Hybrid+FM A706               1461:2055
-193         WIS Voyager or compatible                               1905:7007
-194         AverMedia AverTV/505                                    1461:a10a
-195         Leadtek Winfast TV2100 FM                               107d:6f3a
-196         SnaZio* TVPVR PRO                                       1779:13cf
-=========== ======================================================= ================================================================
+.. kernel-cmd:: saa7134-cardlist.pl $srctree/drivers/media/pci/saa7134/saa7134.h $srctree/drivers/media/pci/saa7134/saa7134-cards.c
diff --git a/Documentation/media/v4l-drivers/saa7164-cardlist.rst b/Documentation/media/v4l-drivers/saa7164-cardlist.rst
index 7d17d38df3bc..012c60358e91 100644
--- a/Documentation/media/v4l-drivers/saa7164-cardlist.rst
+++ b/Documentation/media/v4l-drivers/saa7164-cardlist.rst
@@ -1,21 +1 @@
-SAA7164 cards list
-==================
-
-=========== ==================================== ====================
-Card number Card name                            PCI IDs
-=========== ==================================== ====================
-0           Unknown
-1           Generic Rev2
-2           Generic Rev3
-3           Hauppauge WinTV-HVR2250              0070:8880, 0070:8810
-4           Hauppauge WinTV-HVR2200              0070:8980
-5           Hauppauge WinTV-HVR2200              0070:8900
-6           Hauppauge WinTV-HVR2200              0070:8901
-7           Hauppauge WinTV-HVR2250              0070:8891, 0070:8851
-8           Hauppauge WinTV-HVR2250              0070:88A1
-9           Hauppauge WinTV-HVR2200              0070:8940
-10          Hauppauge WinTV-HVR2200              0070:8953
-11          Hauppauge WinTV-HVR2255(proto)       0070:f111
-12          Hauppauge WinTV-HVR2255              0070:f111
-13          Hauppauge WinTV-HVR2205              0070:f123, 0070:f120
-=========== ==================================== ====================
+.. kernel-cmd:: saa7164-cardlist.pl $srctree/drivers/media/pci/saa7164/saa7164.h    $srctree/drivers/media/pci/saa7164/saa7164-cards.c
diff --git a/Documentation/media/v4l-drivers/tm6000-cardlist.rst b/Documentation/media/v4l-drivers/tm6000-cardlist.rst
index ae2952683ccf..58af44eecc0d 100644
--- a/Documentation/media/v4l-drivers/tm6000-cardlist.rst
+++ b/Documentation/media/v4l-drivers/tm6000-cardlist.rst
@@ -1,24 +1 @@
-TM6000 cards list
-=================
-
-=========== ================================================= ==========================================
-Card number Card name                                         USB IDs
-=========== ================================================= ==========================================
-0           Unknown tm6000 video grabber
-1           Generic tm5600 board                              6000:0001
-2           Generic tm6000 board
-3           Generic tm6010 board                              6000:0002
-4           10Moons UT 821
-5           10Moons UT 330
-6           ADSTECH Dual TV USB                               06e1:f332
-7           Freecom Hybrid Stick / Moka DVB-T Receiver Dual   14aa:0620
-8           ADSTECH Mini Dual TV USB                          06e1:b339
-9           Hauppauge WinTV HVR-900H / WinTV USB2-Stick       2040:6600, 2040:6601, 2040:6610, 2040:6611
-10          Beholder Wander DVB-T/TV/FM USB2.0                6000:dec0
-11          Beholder Voyager TV/FM USB2.0                     6000:dec1
-12          Terratec Cinergy Hybrid XE / Cinergy Hybrid-Stick 0ccd:0086, 0ccd:00A5
-13          Twinhan TU501(704D1)                              13d3:3240, 13d3:3241, 13d3:3243, 13d3:3264
-14          Beholder Wander Lite DVB-T/TV/FM USB2.0           6000:dec2
-15          Beholder Voyager Lite TV/FM USB2.0                6000:dec3
-16          Terratec Grabster AV 150/250 MX                   0ccd:0079
-=========== ================================================= ==========================================
+.. kernel-cmd:: tm6000-cardlist.pl $srctree/drivers/media/usb/tm6000/tm6000-cards.c
diff --git a/Documentation/media/v4l-drivers/tuner-cardlist.rst b/Documentation/media/v4l-drivers/tuner-cardlist.rst
index 276dd90e0c59..b2a04dc396d5 100644
--- a/Documentation/media/v4l-drivers/tuner-cardlist.rst
+++ b/Documentation/media/v4l-drivers/tuner-cardlist.rst
@@ -1,98 +1 @@
-Tuner cards list
-================
-
-============ =====================================================
-Tuner number Card name
-============ =====================================================
-0            Temic PAL (4002 FH5)
-1            Philips PAL_I (FI1246 and compatibles)
-2            Philips NTSC (FI1236,FM1236 and compatibles)
-3            Philips (SECAM+PAL_BG) (FI1216MF, FM1216MF, FR1216MF)
-4            NoTuner
-5            Philips PAL_BG (FI1216 and compatibles)
-6            Temic NTSC (4032 FY5)
-7            Temic PAL_I (4062 FY5)
-8            Temic NTSC (4036 FY5)
-9            Alps HSBH1
-10           Alps TSBE1
-11           Alps TSBB5
-12           Alps TSBE5
-13           Alps TSBC5
-14           Temic PAL_BG (4006FH5)
-15           Alps TSCH6
-16           Temic PAL_DK (4016 FY5)
-17           Philips NTSC_M (MK2)
-18           Temic PAL_I (4066 FY5)
-19           Temic PAL* auto (4006 FN5)
-20           Temic PAL_BG (4009 FR5) or PAL_I (4069 FR5)
-21           Temic NTSC (4039 FR5)
-22           Temic PAL/SECAM multi (4046 FM5)
-23           Philips PAL_DK (FI1256 and compatibles)
-24           Philips PAL/SECAM multi (FQ1216ME)
-25           LG PAL_I+FM (TAPC-I001D)
-26           LG PAL_I (TAPC-I701D)
-27           LG NTSC+FM (TPI8NSR01F)
-28           LG PAL_BG+FM (TPI8PSB01D)
-29           LG PAL_BG (TPI8PSB11D)
-30           Temic PAL* auto + FM (4009 FN5)
-31           SHARP NTSC_JP (2U5JF5540)
-32           Samsung PAL TCPM9091PD27
-33           MT20xx universal
-34           Temic PAL_BG (4106 FH5)
-35           Temic PAL_DK/SECAM_L (4012 FY5)
-36           Temic NTSC (4136 FY5)
-37           LG PAL (newer TAPC series)
-38           Philips PAL/SECAM multi (FM1216ME MK3)
-39           LG NTSC (newer TAPC series)
-40           HITACHI V7-J180AT
-41           Philips PAL_MK (FI1216 MK)
-42           Philips FCV1236D ATSC/NTSC dual in
-43           Philips NTSC MK3 (FM1236MK3 or FM1236/F)
-44           Philips 4 in 1 (ATI TV Wonder Pro/Conexant)
-45           Microtune 4049 FM5
-46           Panasonic VP27s/ENGE4324D
-47           LG NTSC (TAPE series)
-48           Tenna TNF 8831 BGFF)
-49           Microtune 4042 FI5 ATSC/NTSC dual in
-50           TCL 2002N
-51           Philips PAL/SECAM_D (FM 1256 I-H3)
-52           Thomson DTT 7610 (ATSC/NTSC)
-53           Philips FQ1286
-54           Philips/NXP TDA 8290/8295 + 8275/8275A/18271
-55           TCL 2002MB
-56           Philips PAL/SECAM multi (FQ1216AME MK4)
-57           Philips FQ1236A MK4
-58           Ymec TVision TVF-8531MF/8831MF/8731MF
-59           Ymec TVision TVF-5533MF
-60           Thomson DTT 761X (ATSC/NTSC)
-61           Tena TNF9533-D/IF/TNF9533-B/DF
-62           Philips TEA5767HN FM Radio
-63           Philips FMD1216ME MK3 Hybrid Tuner
-64           LG TDVS-H06xF
-65           Ymec TVF66T5-B/DFF
-66           LG TALN series
-67           Philips TD1316 Hybrid Tuner
-68           Philips TUV1236D ATSC/NTSC dual in
-69           Tena TNF 5335 and similar models
-70           Samsung TCPN 2121P30A
-71           Xceive xc2028/xc3028 tuner
-72           Thomson FE6600
-73           Samsung TCPG 6121P30A
-75           Philips TEA5761 FM Radio
-76           Xceive 5000 tuner
-77           TCL tuner MF02GIP-5N-E
-78           Philips FMD1216MEX MK3 Hybrid Tuner
-79           Philips PAL/SECAM multi (FM1216 MK5)
-80           Philips FQ1216LME MK3 PAL/SECAM w/active loopthrough
-81           Partsnic (Daewoo) PTI-5NF05
-82           Philips CU1216L
-83           NXP TDA18271
-84           Sony BTF-Pxn01Z
-85           Philips FQ1236 MK5
-86           Tena TNF5337 MFD
-87           Xceive 4000 tuner
-88           Xceive 5000C tuner
-89           Sony BTF-PG472Z PAL/SECAM
-90           Sony BTF-PK467Z NTSC-M-JP
-91           Sony BTF-PB463Z NTSC-M
-============ =====================================================
+.. kernel-cmd:: tuner-cardlist.pl $srctree/include/media/tuner.h $srctree/drivers/media/tuners/tuner-types.c
diff --git a/Documentation/media/v4l-drivers/usbvision-cardlist.rst b/Documentation/media/v4l-drivers/usbvision-cardlist.rst
index 44d53dff0984..014496c6b435 100644
--- a/Documentation/media/v4l-drivers/usbvision-cardlist.rst
+++ b/Documentation/media/v4l-drivers/usbvision-cardlist.rst
@@ -1,74 +1 @@
-USBvision cards list
-====================
-
-=========== ======================================================== =========
-Card number Card name                                                USB IDs
-=========== ======================================================== =========
-0           Xanboo                                                   0a6f:0400
-1           Belkin USB VideoBus II Adapter                           050d:0106
-2           Belkin Components USB VideoBus                           050d:0207
-3           Belkin USB VideoBus II                                   050d:0208
-4           echoFX InterView Lite                                    0571:0002
-5           USBGear USBG-V1 resp. HAMA USB                           0573:0003
-6           D-Link V100                                              0573:0400
-7           X10 USB Camera                                           0573:2000
-8           Hauppauge WinTV USB Live (PAL B/G)                       0573:2d00
-9           Hauppauge WinTV USB Live Pro (NTSC M/N)                  0573:2d01
-10          Zoran Co. PMD (Nogatech) AV-grabber Manhattan            0573:2101
-11          Nogatech USB-TV (NTSC) FM                                0573:4100
-12          PNY USB-TV (NTSC) FM                                     0573:4110
-13          PixelView PlayTv-USB PRO (PAL) FM                        0573:4450
-14          ZTV ZT-721 2.4GHz USB A/V Receiver                       0573:4550
-15          Hauppauge WinTV USB (NTSC M/N)                           0573:4d00
-16          Hauppauge WinTV USB (PAL B/G)                            0573:4d01
-17          Hauppauge WinTV USB (PAL I)                              0573:4d02
-18          Hauppauge WinTV USB (PAL/SECAM L)                        0573:4d03
-19          Hauppauge WinTV USB (PAL D/K)                            0573:4d04
-20          Hauppauge WinTV USB (NTSC FM)                            0573:4d10
-21          Hauppauge WinTV USB (PAL B/G FM)                         0573:4d11
-22          Hauppauge WinTV USB (PAL I FM)                           0573:4d12
-23          Hauppauge WinTV USB (PAL D/K FM)                         0573:4d14
-24          Hauppauge WinTV USB Pro (NTSC M/N)                       0573:4d2a
-25          Hauppauge WinTV USB Pro (NTSC M/N) V2                    0573:4d2b
-26          Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L)          0573:4d2c
-27          Hauppauge WinTV USB Pro (NTSC M/N) V3                    0573:4d20
-28          Hauppauge WinTV USB Pro (PAL B/G)                        0573:4d21
-29          Hauppauge WinTV USB Pro (PAL I)                          0573:4d22
-30          Hauppauge WinTV USB Pro (PAL/SECAM L)                    0573:4d23
-31          Hauppauge WinTV USB Pro (PAL D/K)                        0573:4d24
-32          Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L)             0573:4d25
-33          Hauppauge WinTV USB Pro (PAL/SECAM BGDK/I/L) V2          0573:4d26
-34          Hauppauge WinTV USB Pro (PAL B/G) V2                     0573:4d27
-35          Hauppauge WinTV USB Pro (PAL B/G,D/K)                    0573:4d28
-36          Hauppauge WinTV USB Pro (PAL I,D/K)                      0573:4d29
-37          Hauppauge WinTV USB Pro (NTSC M/N FM)                    0573:4d30
-38          Hauppauge WinTV USB Pro (PAL B/G FM)                     0573:4d31
-39          Hauppauge WinTV USB Pro (PAL I FM)                       0573:4d32
-40          Hauppauge WinTV USB Pro (PAL D/K FM)                     0573:4d34
-41          Hauppauge WinTV USB Pro (Temic PAL/SECAM B/G/I/D/K/L FM) 0573:4d35
-42          Hauppauge WinTV USB Pro (Temic PAL B/G FM)               0573:4d36
-43          Hauppauge WinTV USB Pro (PAL/SECAM B/G/I/D/K/L FM)       0573:4d37
-44          Hauppauge WinTV USB Pro (NTSC M/N FM) V2                 0573:4d38
-45          Camtel Technology USB TV Genie Pro FM Model TVB330       0768:0006
-46          Digital Video Creator I                                  07d0:0001
-47          Global Village GV-007 (NTSC)                             07d0:0002
-48          Dazzle Fusion Model DVC-50 Rev 1 (NTSC)                  07d0:0003
-49          Dazzle Fusion Model DVC-80 Rev 1 (PAL)                   07d0:0004
-50          Dazzle Fusion Model DVC-90 Rev 1 (SECAM)                 07d0:0005
-51          Eskape Labs MyTV2Go                                      07f8:9104
-52          Pinnacle Studio PCTV USB (PAL)                           2304:010d
-53          Pinnacle Studio PCTV USB (SECAM)                         2304:0109
-54          Pinnacle Studio PCTV USB (PAL) FM                        2304:0110
-55          Miro PCTV USB                                            2304:0111
-56          Pinnacle Studio PCTV USB (NTSC) FM                       2304:0112
-57          Pinnacle Studio PCTV USB (PAL) FM V2                     2304:0210
-58          Pinnacle Studio PCTV USB (NTSC) FM V2                    2304:0212
-59          Pinnacle Studio PCTV USB (PAL) FM V3                     2304:0214
-60          Pinnacle Studio Linx Video input cable (NTSC)            2304:0300
-61          Pinnacle Studio Linx Video input cable (PAL)             2304:0301
-62          Pinnacle PCTV Bungee USB (PAL) FM                        2304:0419
-63          Hauppauge WinTv-USB                                      2400:4200
-64          Pinnacle Studio PCTV USB (NTSC) FM V3                    2304:0113
-65          Nogatech USB MicroCam NTSC (NV3000N)                     0573:3000
-66          Nogatech USB MicroCam PAL (NV3001P)                      0573:3001
-=========== ======================================================== =========
+.. kernel-cmd:: usbvision-cardlist.pl $srctree/drivers/media/usb/usbvision/usbvision-cards.h $srctree/drivers/media/usb/usbvision/usbvision-cards.c
diff --git a/Documentation/sphinx/au0828-cardlist.pl b/Documentation/sphinx/au0828-cardlist.pl
new file mode 100755
index 000000000000..5425a7af3f5b
--- /dev/null
+++ b/Documentation/sphinx/au0828-cardlist.pl
@@ -0,0 +1,66 @@
+#!/usr/bin/perl -w
+use strict;
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+my $len = 0;
+my $idlen = 0;
+
+while (<>) {
+	# defines in header file
+	if (/#define\s+(AU08[\d]._BOARD_\w+)\s+(\d+)/) {
+		$data{$1}->{nr} = $2;
+		next;
+	}
+	# au0828_boards
+	if (/\[(AU0828_BOARD_\w+)\]/) {
+		$id = $1;
+		$data{$id}->{id} = $id;
+		$data{$id}->{type} = "(au0828)";
+	};
+
+	next unless defined($id);
+
+	if (/USB_DEVICE.*0x([0-9a-fA-F]*).*0x([0-9a-fA-F]*)/ ) {
+		$subvendor=$1;
+		$subdevice=$2;
+	}
+
+	if (/.*driver_info.*(AU08[\d]._BOARD_\w+)/ ) {
+		my $name = "$subvendor:$subdevice";
+		if ($data{$1}->{subid}) {
+			$data{$1}->{subid} .= ", " . $name;
+		} else {
+			$data{$1}->{subid} = $name;
+		}
+		$idlen = length($data{$1}->{subid}) if (length($data{$1}->{subid}) > $idlen);
+	}
+
+	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+		if (/\.name\s*=\s*\"([^\"]+)\"/) {
+			$data{$id}->{name} = $1;
+			$len = length($1) if (length($1) > $len);
+		}
+	}
+}
+
+print "AU0828 cards list\n";
+print "=================\n\n";
+
+
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+my $s = sprintf "%-11s %-${len}s %s\n", "Card number", "Card name", "USB IDs";
+$s =~ s/[ \t]+$//;
+print $s;
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	$data{$item}->{subid} = "" if (!defined $data{$item}->{subid});
+
+	my $s = sprintf "%-11s %-${len}s %s\n", $data{$item}->{nr}, $data{$item}->{name}, $data{$item}->{subid};
+	$s =~ s/[ \t]+$//;
+	printf $s;
+}
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
diff --git a/Documentation/sphinx/bttv-cardlist.pl b/Documentation/sphinx/bttv-cardlist.pl
new file mode 100755
index 000000000000..fc6056042fe7
--- /dev/null
+++ b/Documentation/sphinx/bttv-cardlist.pl
@@ -0,0 +1,75 @@
+#!/usr/bin/perl -w
+use strict;
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+my $len = 0;
+my $idlen = 0;
+
+my $pciid = 0;
+
+while (<>) {
+	# defines in header file
+        if (/#define\s+(BTTV_BOARD_\w+)\s+0x([0-9a-fA-F]*).*/) {
+		$data{$1}->{nr} = hex $2;
+
+		next;
+	}
+	# cx88_boards
+	if (/\[(BTTV_BOARD_\w+)\]/) {
+		$id = $1;
+		$data{$id}->{id} = $id;
+#		$data{$id}->{nr} = $nr++;
+	};
+	if (/0x([0-9a-fA-F]...)([0-9a-fA-F]...)/) {
+		$subvendor = $2;
+		$subdevice = $1;
+		if (/(BTTV_BOARD_\w+)/) {
+			my $name = "$subvendor:$subdevice";
+			if ($data{$1}->{subid}) {
+				$data{$1}->{subid} .= ", " . $name;
+			} else {
+				$data{$1}->{subid} = $name;
+			}
+			$idlen = length($data{$1}->{subid}) if (length($data{$1}->{subid}) > $idlen);
+
+			undef $subvendor;
+			undef $subdevice;
+		}
+	}
+
+	next unless defined($id);
+
+	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+		if (/\.name\s*=\s*\"([^\"]+)\"/) {
+			$data{$id}->{name} = $1;
+			$len = length($1) if (length($1) > $len);
+		}
+	}
+
+	if (/0x([0-9]...)([0-9]...)/) {
+		$subvendor = $1;
+		$subdevice = $2;
+	}
+
+}
+
+print "BTTV cards list\n";
+print "===============\n\n";
+
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+my $s = sprintf "%-11s %-${len}s %s\n", "Card number", "Card name", "PCI IDs";
+$s =~ s/[ \t]+$//;
+print $s;
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	$data{$item}->{subid} = "" if (!defined $data{$item}->{subid});
+
+	my $s = sprintf "%-11s %-${len}s %s\n", $data{$item}->{nr}, $data{$item}->{name}, $data{$item}->{subid};
+	$s =~ s/[ \t]+$//;
+	printf $s;
+}
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
diff --git a/Documentation/sphinx/cx23885-cardlist.pl b/Documentation/sphinx/cx23885-cardlist.pl
new file mode 100755
index 000000000000..7de92cdb4643
--- /dev/null
+++ b/Documentation/sphinx/cx23885-cardlist.pl
@@ -0,0 +1,79 @@
+#!/usr/bin/perl -w
+use strict;
+
+my %map = (
+	   "PCI_ANY_ID"            => "0",
+);
+
+sub fix_id($) {
+	my $id = shift;
+	$id = $map{$id} if defined($map{$id});
+	$id =~ s/^0x//;
+	return $id;
+}
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+my $len = 0;
+my $idlen = 0;
+
+while (<>) {
+	# defines in header file
+	if (/#define\s+(CX23885_BOARD_\w+)\s+(\d+)/) {
+		$data{$1}->{nr} = $2;
+		next;
+	}
+	# cx88_boards
+	if (/\[(CX23885_BOARD_\w+)\]/) {
+		$id = $1;
+		$data{$id}->{id} = $id;
+#		$data{$id}->{nr} = $nr++;
+	};
+	next unless defined($id);
+
+	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+		if (/\.name\s*=\s*\"([^\"]+)\"/) {
+			$data{$id}->{name} = $1;
+			$len = length($1) if (length($1) > $len);
+		}
+	}
+
+	# cx88_pci_tbl
+	$subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/);
+	$subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/);
+	if (/.card\s*=\s*(\w+),/) {
+		if (defined($data{$1})  &&
+		    defined($subvendor) && $subvendor ne "0" &&
+		    defined($subdevice) && $subdevice ne "0") {
+			my $name = "$subvendor:$subdevice";
+			if ($data{$1}->{subid}) {
+				$data{$1}->{subid} .= ", " . $name;
+			} else {
+				$data{$1}->{subid} = $name;
+			}
+			$idlen = length($data{$1}->{subid}) if (length($data{$1}->{subid}) > $idlen);
+			undef $subvendor;
+			undef $subdevice;
+		}
+	}
+}
+
+print "cx23885 cards list\n";
+print "==================\n\n";
+
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+my $s = sprintf "%-11s %-${len}s %s\n", "Card number", "Card name", "PCI IDs";
+$s =~ s/[ \t]+$//;
+print $s;
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	$data{$item}->{subid} = "" if (!defined $data{$item}->{subid});
+
+	my $s = sprintf "%-11s %-${len}s %s\n", $data{$item}->{nr}, $data{$item}->{name}, $data{$item}->{subid};
+	$s =~ s/[ \t]+$//;
+	printf $s;
+}
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
diff --git a/Documentation/sphinx/cx88-cardlist.pl b/Documentation/sphinx/cx88-cardlist.pl
new file mode 100755
index 000000000000..e66a71840777
--- /dev/null
+++ b/Documentation/sphinx/cx88-cardlist.pl
@@ -0,0 +1,78 @@
+#!/usr/bin/perl -w
+use strict;
+
+my %map = (
+	   "PCI_ANY_ID"            => "0",
+	   "PCI_VENDOR_ID_PHILIPS" => "1131",
+	   "PCI_VENDOR_ID_ASUSTEK" => "1043",
+	   "PCI_VENDOR_ID_MATROX"  => "102B",
+	   "PCI_VENDOR_ID_ATI"     => "1002",
+);
+
+sub fix_id($) {
+	my $id = shift;
+	$id = $map{$id} if defined($map{$id});
+	$id =~ s/^0x//;
+	return $id;
+}
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+my $len = 0;
+my $idlen = 0;
+
+while (<>) {
+	# defines in header file
+	if (/#define\s+(CX88_BOARD_\w+)\s+(\d+)/) {
+		$data{$1}->{nr} = $2;
+		next;
+	}
+	# cx88_boards
+	if (/\[(CX88_BOARD_\w+)\]/) {
+		$id = $1;
+		$data{$id}->{id} = $id;
+	};
+	next unless defined($id);
+
+	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+		$data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/);
+		$len = length($1) if (length($1) > $len);
+	}
+
+	# cx88_pci_tbl
+	$subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/);
+	$subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/);
+	if (/.card\s*=\s*(\w+),/) {
+		if (defined($data{$1})  &&
+		    defined($subvendor) && $subvendor ne "0" &&
+		    defined($subdevice) && $subdevice ne "0") {
+			my $name = "$subvendor:$subdevice";
+			if ($data{$1}->{subid}) {
+				$data{$1}->{subid} .= ", " . $name;
+			} else {
+				$data{$1}->{subid} = $name;
+			}
+			$idlen = length($data{$1}->{subid}) if (length($data{$1}->{subid}) > $idlen);
+		}
+	}
+}
+
+print "CX88 cards list\n";
+print "===============\n\n";
+
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+my $s = sprintf "%-11s %-${len}s %s\n", "Card number", "Card name", "PCI IDs";
+$s =~ s/[ \t]+$//;
+print $s;
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	$data{$item}->{subid} = "" if (!defined $data{$item}->{subid});
+
+	my $s = sprintf "%-11s %-${len}s %s\n", $data{$item}->{nr}, $data{$item}->{name}, $data{$item}->{subid};
+	$s =~ s/[ \t]+$//;
+	printf $s;
+}
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
diff --git a/Documentation/sphinx/em28xx-cardlist.pl b/Documentation/sphinx/em28xx-cardlist.pl
new file mode 100755
index 000000000000..d8ebacc443ab
--- /dev/null
+++ b/Documentation/sphinx/em28xx-cardlist.pl
@@ -0,0 +1,84 @@
+#!/usr/bin/perl -w
+use strict;
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+my $len = 0;
+my $idlen = 0;
+
+my $debug = 0;
+
+while (<>) {
+	# defines in header file
+	if (/#define\s+(EM2[\d]+_BOARD_[\w\d_]+)\s+(\d+)/) {
+		printf("$1 = $2\n") if ($debug);
+		$data{$1}->{nr} = $2;
+		next;
+	}
+	# em2820_boards
+	if (/\[(EM2820_BOARD_[\w\d_]+)\]/) {
+		$id = $1;
+		printf("ID = $id\n") if $debug;
+		$data{$id}->{id} = $id;
+		$data{$id}->{type} = "em2820 or em2840";
+		$data{$id}->{qtd}++;
+	} elsif (/\[(EM)(2[\d]+)(_BOARD_[\w\d_]+)\]/) {
+		$id = "$1$2$3";
+		printf("ID = $id\n") if $debug;
+		$data{$id}->{id} = $id;
+		$data{$id}->{type} = "em$2";
+		$data{$id}->{qtd}++;
+	};
+
+	next unless defined($id);
+
+	if (/USB_DEVICE.*0x([0-9a-fA-F]+)\s*\,\s*0x([0-9a-fA-F]+)/ ) {
+		$subvendor=$1;
+		$subdevice=$2;
+	}
+
+	if (/.*driver_info.*(EM2[\d]+_BOARD_[\w\d_]+)/ ) {
+		my $name = "$subvendor:$subdevice";
+		if ($data{$1}->{subid}) {
+			$data{$1}->{subid} .= ", " . $name;
+		} else {
+			$data{$1}->{subid} = $name;
+		}
+		$idlen = length($data{$1}->{subid}) if (length($data{$1}->{subid}) > $idlen);
+	}
+
+	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+		if (/\.name\s*=\s*\"([^\"]+)\"/) {
+			$data{$id}->{name} = $1;
+			printf("name[$id] = %s\n", $data{$id}->{name}) if ($debug);
+			$len = length($1) if (length($1) > $len);
+		}
+	}
+}
+
+print "EM28xx cards list\n";
+print "=================\n\n";
+
+print "=========== " . "=" x $len . " " . "=" x 16 . " " . "=" x $idlen . "\n";
+my $s = sprintf "%-11s %-${len}s %-16s %s\n",
+		"Card number", "Card name", "Empia Chip", "USB IDs";
+$s =~ s/[ \t]+$//;
+print $s;
+print "=========== " . "=" x $len . " " . "=" x 16 . " " . "=" x $idlen . "\n";
+
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	$data{$item}->{subid} = "" if (!defined $data{$item}->{subid});
+
+	my $s = sprintf "%-11s %-${len}s %-16s %s\n",
+			$data{$item}->{nr}, $data{$item}->{name},
+			$data{$item}->{type}, $data{$item}->{subid};
+	$s =~ s/[ \t]+$//;
+	print $s;
+
+	printf "(%d entries)", $data{$item}->{qtd} if ($debug);
+}
+
+print "=========== " . "=" x $len . " " . "=" x 16 . " " . "=" x $idlen . "\n";
diff --git a/Documentation/sphinx/ivtv-cardlist.pl b/Documentation/sphinx/ivtv-cardlist.pl
new file mode 100755
index 000000000000..a26284683466
--- /dev/null
+++ b/Documentation/sphinx/ivtv-cardlist.pl
@@ -0,0 +1,133 @@
+#!/usr/bin/perl -w
+use strict;
+
+my $debug = 0;
+
+my %map = (
+	"PCI_DEVICE_ID_IVTV15"	=> "0803",
+	"PCI_DEVICE_ID_IVTV16"	=> "0016",
+	"PCI_ANY_ID"            => "0",
+);
+
+sub fix_id($) {
+	my $id = shift;
+	if (defined($map{$id})) {
+		$id = $map{$id};
+	} else {
+		$id = sprintf "%04x", hex($id);
+	}
+	return $id;
+}
+
+my $new_entry = -1;
+my $nr = -1;
+my ($id,$pci);
+my %data;
+my %number;
+my %pci_map;
+my $len = 0;
+my $idlen = 0;
+
+my $last;
+
+while (<>) {
+	# defines in header file
+	if (/#define\s+(IVTV_CARD_[\w\d\_]+)\s+(\d+)/) {
+		my $c = $1;
+		my $n = $2;
+		if (/IVTV_CARD_LAST/) {
+			printf("$c = $n\n") if ($debug);
+			$last = $n;
+			next;
+		};
+		next if (/IVTV_CARD_INPUT_/);
+		next if (/IVTV_CARD_MAX_/);
+		$number{$c} = $n;
+		printf("$c = $n\n") if ($debug);
+		next;
+	}
+
+	if (/#define\s+(IVTV_CARD_[\w\d\_]+)\s+.*IVTV_CARD_LAST\s*\+\s*(\d+)/) {
+		$number{$1} = $2 + $last;
+		printf("$1 = %d\n", $number{$1}) if ($debug);
+		next;
+	}
+	if (/#define\s+(IVTV_PCI_ID_\w+)\s+0x([\w\d]+)/) {
+		$map{$1} = $2;
+		printf("$1 = $2\n") if ($debug);
+		next;
+	}
+	#  ivtv-cards
+	if (m/static const struct ivtv_card\s+([\w\d_]+)/) {
+		$id = $1;
+	}
+
+	if (m/static const struct ivtv_card_pci_info\s+([\w\d_]+)/) {
+		$pci = $1;
+	}
+
+	if (defined($id)) {
+		if (m/^\};$/) {
+			undef $id;
+			next;
+		}
+
+		if (/.type\s*=\s*(IVTV_CARD_\w+)/) {
+			$nr = $number{$1};
+			printf("ID#$nr: $id\n") if ($debug);
+			$data{$id}->{nr} = $nr;
+		};
+
+		if (/\.name\s*=\s*\"([^\"]+)\"/) {
+			printf("ID#$nr: $id, name $1\n") if ($debug);
+			$data{$id}->{id} = $id;
+			$data{$id}->{name} = $1;
+			$len = length($1) if (length($1) > $len);
+		}
+
+		if (/\.pci_list\s*=\s*([\w\d_]+)/) {
+			$data{$id}->{pci} = $1;
+			printf("pci map for $id: $1\n") if ($debug);
+		}
+	}
+
+	if (defined ($pci)) {
+		if (m/PCI_DEVICE_ID_(\S+)\s*\,\s*(\S+)\s*\,\s*0x(\S+)/) {
+			my $ivtv = $1;
+			my $vend = fix_id($2);
+			my $sub = fix_id($3);
+			my $name = "$ivtv $vend:$sub";
+			printf "pci map: $pci, PCI ID %name\n", if ($debug);
+			if (defined($pci_map{$pci})) {
+				$pci_map{$pci} .= ", " . $name;
+			} else {
+				$pci_map{$pci} = $name;
+			}
+			$idlen = length($pci_map{$pci}) if (length($pci_map{$pci}) > $idlen);
+		}
+	}
+}
+
+print "IVTV cards list\n";
+print "===============\n\n";
+
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+my $s = sprintf "%-11s %-${len}s %s\n", "Card number", "Card name", "PCI IDs";
+$s =~ s/[ \t]+$//;
+print $s;
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	printf "ITEM: $item\n" if ($debug);
+	printf "PCI map: $pci\n" if ($debug && $pci);
+
+	$pci = $data{$item}->{pci} if defined $data{$item}->{pci};
+
+	$pci_map{$pci} = "" if (!$pci_map{$pci});
+
+	my $s = sprintf "%-11s %-${len}s %s\n",
+		$data{$item}->{nr}, $data{$item}->{name}, $pci_map{$pci};
+	$s =~ s/[ \t]+$//;
+	printf $s;
+}
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
diff --git a/Documentation/sphinx/saa7134-cardlist.pl b/Documentation/sphinx/saa7134-cardlist.pl
new file mode 100755
index 000000000000..73d3f18dd856
--- /dev/null
+++ b/Documentation/sphinx/saa7134-cardlist.pl
@@ -0,0 +1,80 @@
+#!/usr/bin/perl -w
+use strict;
+
+my %map = (
+	   "PCI_ANY_ID"            => "0",
+	   "PCI_VENDOR_ID_PHILIPS" => "1131",
+	   "PCI_VENDOR_ID_ASUSTEK" => "1043",
+	   "PCI_VENDOR_ID_MATROX"  => "102B",
+);
+
+sub fix_id($) {
+	my $id = shift;
+	$id = $map{$id} if defined($map{$id});
+	$id =~ s/^0x//;
+	return $id;
+}
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+my $len = 0;
+my $idlen = 0;
+
+while (<>) {
+	# defines in header file
+	if (/#define\s+(SAA7134_BOARD_\w+)\s+(\d+)/) {
+		$data{$1}->{nr} = $2;
+		next;
+	}
+	# saa7134_boards
+	if (/\[(SAA7134_BOARD_\w+)\]/) {
+		$id = $1;
+		$data{$id}->{id} = $id;
+#		$data{$id}->{nr} = $nr++;
+	};
+	next unless defined($id);
+
+	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+		if (/\.name\s*=\s*\"([^\"]+)\"/) {
+			$data{$id}->{name} = $1;
+			$len = length($1) if (length($1) > $len);
+		}
+	}
+
+	# saa7134_pci_tbl
+	$subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+)\s*,*/);
+	$subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+)\s*,*/);
+	if (/.driver_data\s*=\s*(\w+)\s*,*/) {
+		if (defined($data{$1})  &&
+		    defined($subvendor) && $subvendor ne "0" &&
+		    defined($subdevice) && $subdevice ne "0") {
+			my $name = "$subvendor:$subdevice";
+			if ($data{$1}->{subid}) {
+				$data{$1}->{subid} .= ", " . $name;
+			} else {
+				$data{$1}->{subid} = $name;
+			}
+			$idlen = length($data{$1}->{subid}) if (length($data{$1}->{subid}) > $idlen);
+		}
+	}
+}
+
+print "SAA7134 cards list\n";
+print "==================\n\n";
+
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+my $s = sprintf "%-11s %-${len}s %s\n", "Card number", "Card name", "PCI IDs";
+$s =~ s/[ \t]+$//;
+print $s;
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	$data{$item}->{subid} = "" if (!defined $data{$item}->{subid});
+
+	my $s = sprintf "%-11s %-${len}s %s\n", $data{$item}->{nr}, $data{$item}->{name}, $data{$item}->{subid};
+	$s =~ s/[ \t]+$//;
+	printf $s;
+}
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
diff --git a/Documentation/sphinx/saa7164-cardlist.pl b/Documentation/sphinx/saa7164-cardlist.pl
new file mode 100755
index 000000000000..b7c1ea080540
--- /dev/null
+++ b/Documentation/sphinx/saa7164-cardlist.pl
@@ -0,0 +1,74 @@
+#!/usr/bin/perl -w
+use strict;
+
+my %map = (
+	   "PCI_ANY_ID"            => "0",
+);
+
+sub fix_id($) {
+	my $id = shift;
+	$id = $map{$id} if defined($map{$id});
+	$id =~ s/^0x//;
+	return $id;
+}
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+my $len = 0;
+my $idlen = 0;
+
+while (<>) {
+	# defines in header file
+	if (/#define\s+(SAA7164_BOARD_\w+)\s+(\d+)/) {
+		$data{$1}->{nr} = $2;
+		next;
+	}
+	# saa7164_boards
+	if (/\[(SAA7164_BOARD_\w+)\]/) {
+		$id = $1;
+		$data{$id}->{id} = $id;
+	};
+	next unless defined($id);
+
+	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+		$data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/);
+		$len = length($1) if (length($1) > $len);
+	}
+
+	# saa7164_pci_tbl
+	$subvendor = fix_id($1) if (/\.subvendor\s*=\s*(\w+),/);
+	$subdevice = fix_id($1) if (/\.subdevice\s*=\s*(\w+),/);
+	if (/.card\s*=\s*(\w+),/) {
+		if (defined($data{$1})  &&
+		    defined($subvendor) && $subvendor ne "0" &&
+		    defined($subdevice) && $subdevice ne "0") {
+			my $name = "$subvendor:$subdevice";
+			if ($data{$1}->{subid}) {
+				$data{$1}->{subid} .= ", " . $name;
+			} else {
+				$data{$1}->{subid} = $name;
+			}
+			$idlen = length($data{$1}->{subid}) if (length($data{$1}->{subid}) > $idlen);
+		}
+	}
+}
+
+print "SAA7164 cards list\n";
+print "==================\n\n";
+
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+my $s = sprintf "%-11s %-${len}s %s\n", "Card number", "Card name", "PCI IDs";
+$s =~ s/[ \t]+$//;
+print $s;
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	$data{$item}->{subid} = "" if (!defined $data{$item}->{subid});
+
+	my $s = sprintf "%-11s %-${len}s %s\n", $data{$item}->{nr}, $data{$item}->{name}, $data{$item}->{subid};
+	$s =~ s/[ \t]+$//;
+	printf $s;
+}
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
diff --git a/Documentation/sphinx/tm6000-cardlist.pl b/Documentation/sphinx/tm6000-cardlist.pl
new file mode 100755
index 000000000000..07fc5e7557e5
--- /dev/null
+++ b/Documentation/sphinx/tm6000-cardlist.pl
@@ -0,0 +1,73 @@
+#!/usr/bin/perl -w
+use strict;
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+my $len = 0;
+my $idlen = 0;
+
+my $debug = 0;
+
+while (<>) {
+	# defines in header file
+	if (/#define\s+(TM[\d]+_BOARD_[\w\d_]+)\s+(\d+)/) {
+		printf("$1 = $2\n") if ($debug);
+		$data{$1}->{nr} = $2;
+		next;
+	}
+	# em2820_boards
+	if (/\[(TM)([\d]+)(_BOARD_[\w\d_]+)\]/) {
+		$id = "$1$2$3";
+		printf("ID = $id\n") if $debug;
+		$data{$id}->{id} = $id;
+		$data{$id}->{type} = "tm$2";
+		$data{$id}->{qtd}++;
+	};
+
+	next unless defined($id);
+
+	if (/USB_DEVICE.*0x([0-9a-fA-F]+)\s*\,\s*0x([0-9a-fA-F]+)/ ) {
+		$subvendor=$1;
+		$subdevice=$2;
+	}
+
+	if (/.*driver_info.*(TM[\d]+_BOARD_[\w\d_]+)/ ) {
+		my $name = "$subvendor:$subdevice";
+		if ($data{$1}->{subid}) {
+			$data{$1}->{subid} .= ", " . $name;
+		} else {
+			$data{$1}->{subid} = $name;
+		}
+		$idlen = length($data{$1}->{subid}) if (length($data{$1}->{subid}) > $idlen);
+	}
+
+	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+		if (/\.name\s*=\s*\"([^\"]+)\"/) {
+			$data{$id}->{name} = $1;
+			$len = length($1) if (length($1) > $len);
+			printf("name[$id] = %s\n", $data{$id}->{name}) if ($debug);
+		}
+	}
+}
+
+print "TM6000 cards list\n";
+print "=================\n\n";
+
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+my $s = sprintf "%-11s %-${len}s %s\n", "Card number", "Card name", "USB IDs";
+$s =~ s/[ \t]+$//;
+print $s;
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	$data{$item}->{subid} = "" if (!defined $data{$item}->{subid});
+
+	my $s = sprintf "%-11s %-${len}s %s\n", $data{$item}->{nr}, $data{$item}->{name}, $data{$item}->{subid};
+	$s =~ s/[ \t]+$//;
+	printf $s;
+
+	printf "(%d entires)", $data{$item}->{qtd} if ($debug);
+}
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
diff --git a/Documentation/sphinx/tuner-cardlist.pl b/Documentation/sphinx/tuner-cardlist.pl
new file mode 100755
index 000000000000..ff9163643dcb
--- /dev/null
+++ b/Documentation/sphinx/tuner-cardlist.pl
@@ -0,0 +1,63 @@
+#!/usr/bin/perl -w
+use strict;
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+my $len = 0;
+
+my $H = shift;
+my $C = shift;
+my %blacklist;
+
+open IN, "<$H";
+while (<IN>) {
+	# defines in header file
+	if (/#define\s+(TUNER_\w+)\s+(\d+)/) {
+		my $num=$2;
+		$data{$1}->{nr} = $num;
+		if (/#define\s+TUNER_TDA9887/) {
+			$blacklist{$num}=1;
+		}
+		next;
+	}
+}
+close IN;
+
+open IN, "<$C";
+while (<IN>) {
+	# tuners
+	if (/\[(TUNER_\w+)\]/) {
+		$id = $1;
+		if ($id =~ m/TUNER_MAX/) {
+			next;
+		}
+		$data{$id}->{id} = $id;
+	};
+	next unless defined($id);
+
+	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+		$data{$id}->{name} = $1 if (/\.name\s*=\s*\"([^\"]+)\"/);
+		$len = length($1) if (length($1) > $len);
+	}
+}
+
+print "Tuner cards list\n";
+print "================\n\n";
+
+print "============ " . "=" x $len . "\n";
+my $s = sprintf "%-12s %-${len}s\n", "Tuner number", "Card name";
+$s =~ s/[ \t]+$//;
+print $s;
+print "============ " . "=" x $len . "\n";
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	if ($blacklist{$data{$item}->{nr}}) {
+		next;
+	}
+	my $s = sprintf "%-12s %-${len}s\n", $data{$item}->{nr}, $data{$item}->{name};
+	$s =~ s/[ \t]+$//;
+	printf $s;
+}
+print "============ " . "=" x $len . "\n";
diff --git a/Documentation/sphinx/usbvision-cardlist.pl b/Documentation/sphinx/usbvision-cardlist.pl
new file mode 100755
index 000000000000..c0191dc5606c
--- /dev/null
+++ b/Documentation/sphinx/usbvision-cardlist.pl
@@ -0,0 +1,65 @@
+#!/usr/bin/perl -w
+use strict;
+
+my $new_entry = -1;
+my $nr = 0;
+my ($id,$subvendor,$subdevice);
+my %data;
+my $len = 0;
+my $idlen = 0;
+
+while (<>) {
+	# defines in header file
+	if (/#define\s*(\w+)\s*(\d+)/) {
+		$data{$1}->{nr} = $2;
+		next;
+	}
+	# boards
+	if (/^\s*\[([\w\d_]+)\]\s*=\s*{/) {
+		$id = $1;
+		$data{$id}->{id} = $id;
+	};
+
+	next unless defined($id);
+
+	if (/USB_DEVICE.*0x([0-9a-fA-F]*).*0x([0-9a-fA-F]*).*/)
+	{
+		$subvendor=$1;
+		$subdevice=$2;
+	}
+	if(/driver_info\s*=\s*([\w\d_]+)/)
+	{
+		my $name = "$subvendor:$subdevice";
+		if ($data{$1}->{subid}) {
+			$data{$1}->{subid} .= ", " . $name;
+		} else {
+			$data{$1}->{subid} = $name;
+		}
+		$idlen = length($data{$1}->{subid}) if (length($data{$1}->{subid}) > $idlen);
+	}
+	if (!defined($data{$id}) || !defined($data{$id}->{name})) {
+		if (/\.model_string\s*=\s*\"([^\"]+)\"/) {
+			$data{$id}->{name} = $1;
+
+			$len = length($1) if (length($1) > $len);
+		}
+	}
+}
+
+print "USBvision cards list\n";
+print "====================\n\n";
+
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+my $s = sprintf "%-11s %-${len}s %s\n", "Card number", "Card name", "USB IDs";
+$s =~ s/[ \t]+$//;
+print $s;
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";
+
+foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+	$data{$item}->{subid} = "" if (!defined $data{$item}->{subid});
+
+	my $s = sprintf "%-11s %-${len}s %s\n", $data{$item}->{nr}, $data{$item}->{name}, $data{$item}->{subid};
+	$s =~ s/[ \t]+$//;
+	printf $s;
+}
+print "=========== " . "=" x $len . " " . "=" x $idlen . "\n";


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

end of thread, other threads:[~2016-10-23 11:20 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-06  7:20 [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Markus Heiser
2016-10-06  7:20 ` [PATCH 1/4] doc-rst: " Markus Heiser
2016-10-17 16:46   ` Mauro Carvalho Chehab
2016-10-18  6:07     ` Jani Nikula
2016-10-18  6:52       ` Markus Heiser
2016-10-18  9:13       ` Mauro Carvalho Chehab
2016-10-18  7:03     ` Markus Heiser
2016-10-18  8:59       ` Mauro Carvalho Chehab
2016-10-18 10:06       ` Mauro Carvalho Chehab
2016-10-18 11:36         ` Markus Heiser
2016-10-06  7:20 ` [PATCH 2/4] doc-rst: customize RTD theme; literal-block Markus Heiser
2016-10-06  7:20 ` [PATCH 3/4] doc-rst: migrated media build kernel-cmd directive Markus Heiser
2016-10-06 11:46   ` Mauro Carvalho Chehab
2016-10-06  7:20 ` [PATCH 4/4] doc-rst: remove the kernel-include directive Markus Heiser
2016-10-06  8:42 ` [PATCH 0/4] reST-directive kernel-cmd / include contentent from scripts Jani Nikula
2016-10-06 13:31   ` Mauro Carvalho Chehab
2016-10-06 14:21     ` Jani Nikula
2016-10-06 16:50       ` Mauro Carvalho Chehab
2016-10-07  5:56         ` Jani Nikula
2016-10-11  7:26           ` Markus Heiser
2016-10-11 14:28             ` Mauro Carvalho Chehab
2016-10-11 15:34               ` Jani Nikula
2016-10-11 16:06                 ` Markus Heiser
2016-10-11 16:45                   ` Mauro Carvalho Chehab
2016-10-12  6:57                     ` Markus Heiser
2016-10-12  8:20                   ` Jani Nikula
2016-10-21 22:05             ` Jonathan Corbet
2016-10-22 10:56               ` Mauro Carvalho Chehab
2016-10-22 15:04                 ` Jonathan Corbet
2016-10-22 16:46                   ` Markus Heiser
2016-10-22 19:10                   ` Mauro Carvalho Chehab
2016-10-23 11:20                 ` Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.