Skip to contentSkip to conversation

Fix most of Sphinx warnings in nitpick mode

PATCH In review Mauro Carvalho Chehab 4 participants 51 messages Sep 8, 2016

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

cover Fix most of Sphinx warnings in nitpick mode

Before this patch series, there is ~400 warnings when building docs in nitpick mode. That means ~400 broken links.

This patch series move the C references to use Sphinx C domain, instead of using :ref:, add more documentation to some V4L2 headers and fix several broken links. After this series, only 21 errors remain, and they all seem to be due to the lack of documentation that should be there:

make cleandocs; make DOCBOOKS="" SPHINXOPTS="-j5" SPHINXDIRS=media SPHINX_CONF="conf_nitpick.py" htmldocs

./include/media/media-entity.h:1053: warning: No description found for parameter '...' /devel/v4l/patchwork/Documentation/media/kapi/mc-core.rst:97: WARNING: c:func reference target not found: media_devnode_release /devel/v4l/patchwork/Documentation/media/kapi/v4l2-dev.rst:166: WARNING: c:func reference target not found: vb2_ops_wait_prepare /devel/v4l/patchwork/Documentation/media/kapi/v4l2-dev.rst:166: WARNING: c:func reference target not found: vb2_ops_wait_finish /devel/v4l/patchwork/Documentation/media/kapi/v4l2-fh.rst:56: WARNING: c:type reference target not found: v4l2_m2m_ctx ./include/media/v4l2-flash-led-class.h:103: WARNING: c:type reference target not found: v4l2_flash_ops ./include/media/v4l2-mem2mem.h:25: WARNING: c:func reference target not found: v4l2_m2m_job_finish ./include/media/v4l2-mem2mem.h:36: WARNING: c:func reference target not found: v4l2_m2m_job_finish ./include/media/v4l2-mem2mem.h:168: WARNING: c:type reference target not found: v4l2_m2m_ctx ./include/media/v4l2-mem2mem.h:180: WARNING: c:type reference target not found: v4l2_m2m_ctx ./include/media/v4l2-mem2mem.h:194: WARNING: c:type reference target not found: v4l2_m2m_ctx ./include/media/v4l2-mem2mem.h:205: WARNING: c:type reference target not found: v4l2_m2m_ctx ./include/media/v4l2-mem2mem.h:216: WARNING: c:type reference target not found: v4l2_m2m_ctx ./include/media/v4l2-mem2mem.h:227: WARNING: c:type reference target not found: v4l2_m2m_ctx ./include/media/v4l2-mem2mem.h:240: WARNING: c:type reference target not found: v4l2_m2m_ctx ./include/media/v4l2-mem2mem.h:251: WARNING: c:type reference target not found: v4l2_m2m_ctx ./include/media/v4l2-subdev.h:424: WARNING: c:type reference target not found: v4l2_sliced_vbi_line ./include/media/v4l2-subdev.h:768: WARNING: c:type reference target not found: v4l2_dev ./include/media/videobuf2-core.h:349: WARNING: c:func reference target not found: vb2_wait_for_all_buffers ./include/media/videobuf2-core.h:355: WARNING: c:func reference target not found: vb2_buffer_done ./include/media/videobuf2-core.h:442: WARNING: c:func reference target not found: start_streaming ./include/media/videobuf2-core.h:592: WARNING: c:type reference target not found: vb2_thread_fnc

So, it seems to fix the issue of identifying the documentation gaps via nitpick mode.

Please notice that the first patch were already submitted, and Markus proposed to fix it via the C domain override extension.

Yet, as it reduces 20 bogus warnings, I'm keeping in this series for the ones that may want to test this patchset.

As usual, I'm placing those patches on my development tree:

https://git.linuxtv.org//mchehab/experimental.git/log/?h=docs-next

git//linuxtv.org/mchehab/experimental.git docs-next

Jon,

Please notice that patches 2 and 3 touches at Documentation/sphinx/parse-headers.pl.

If it is ok for you, I intend to merge those patches (except for patch 1) on my tree, including the two patches that touch at the parse-headers.pl script, as, currently, the only user for it is media. I'm also OK if you prefer to merge patches 2 and 3 on your tree instead.

Regards,
Mauro

Mauro Carvalho Chehab (47):
kernel-doc: ignore arguments on macro definitions
docs-rst: parse-headers.pl: make debug a command line option
docs-rst: parse-headers.pl: use the C domain for cross-references [media] conf_nitpick.py: add external vars to ignore list [media] dvb_ringbuffer.h: Document all functions
[media] dtv-core.rst: move DTV ringbuffer notes to kAPI doc [media] dvb_ringbuffer.h: document the define macros [media] demux.h: Fix a few documentation issues
[media] mc-core.rst: Fix cross-references to the source [media] demux.h: fix a documentation warning
[media] docs-rst: improve the kAPI documentation for the mediactl [media] conf_nitpick.py: ignore external functions used on mediactl [media] rc-map.h: document structs/enums on it
[media] v4l2-ctrls: document some extra data structures [media] docs-rst: convert uAPI structs to C domain [media] diff-v4l.rst: Fix V4L version 1 references [media] v4l2-ctrls.h: fix doc reference for prepare_ext_ctrls() [media] docs-rst: use C domain for enum references on uapi [media] v4l2-ctrls.h: Fix some c:type references
[media] cec-ioc-dqevent.rst: fix some undefined references [media] v4l2-ioctl.h: document the remaining functions [media] v4l2-dev.rst: fix a broken c domain reference [media] v4l2-device.h: fix some doc tags
[media] v4l2-dv-timings.h: let kernel-doc parte the typedef argument [media] v4l2-subdev.rst: get rid of legacy functions [media] v4l2-subdev.h: fix a doc nitpick warning
[media] docs-rst exceptions: use C domain references for DVB headers [media] ca-get-cap.rst: add a table for struct ca_caps [media] ca-get-descr-info.rst: add doc for for struct ca_descr_info [media] ca-get-msg.rst: add a boilerplate for struct ca_msg [media] ca-get-slot-info.rst: document struct ca_slot_info [media] ca-set-pid.rst: document struct ca_pid
[media] docs-rst: fix the remaining broken links for DVB CA API [media] fix broken references on dvb/video*rst
[media] docs-rst: fix dmx bad cross-references
[media] docs-rst: fix cec bad cross-references
[media] docs-rst: simplify c:type: cross references [media] docs-rst: fix some broken struct references [media] fix clock_gettime cross-references
[media] libv4l-introdution.rst: fix function definitions [media] libv4l-introduction.rst: improve crossr-references [media] hist-v4l2.rst: don't do refs to old structures [media] docs-rst: fix cross-references for videodev2.h [media] dev-sliced-vbi.rst: fix reference for v4l2_mpeg_vbi_ITV0 [media] media-ioc-g-topology.rst: fix a c domain reference [media] docs-rst: fix two wrong :name: tags
[media] rc-map.h: fix a Sphinx warning

 Documentation/media/audio.h.rst.exceptions         |   6 +-
 Documentation/media/ca.h.rst.exceptions            |  32 +-
 Documentation/media/cec.h.rst.exceptions           |   6 -
 Documentation/media/conf_nitpick.py                |  17 +-
 Documentation/media/dmx.h.rst.exceptions           |  85 ++--
 Documentation/media/frontend.h.rst.exceptions      |   8 +-
 Documentation/media/intro.rst                      |   2 +-
 Documentation/media/kapi/dtv-core.rst              |  38 +-
 Documentation/media/kapi/mc-core.rst               |  25 +-
 Documentation/media/kapi/v4l2-dev.rst              |   2 +-
 Documentation/media/kapi/v4l2-event.rst            |   6 +-
 Documentation/media/kapi/v4l2-subdev.rst           |  21 +-
 Documentation/media/net.h.rst.exceptions           |   4 +-
 Documentation/media/uapi/cec/cec-func-poll.rst     |   2 +-
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst         |   4 +-
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst    |  10 +-
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst   |   8 +-
 Documentation/media/uapi/cec/cec-ioc-receive.rst   |  15 +-
 .../uapi/dvb/audio-bilingual-channel-select.rst    |   2 +-
 .../media/uapi/dvb/audio-channel-select.rst        |   2 +-
 .../media/uapi/dvb/audio-select-source.rst         |   2 +-
 .../media/uapi/dvb/audio-set-attributes.rst        |   2 +-
 Documentation/media/uapi/dvb/audio-set-karaoke.rst |   2 +-
 Documentation/media/uapi/dvb/audio-set-mixer.rst   |   2 +-
 Documentation/media/uapi/dvb/audio_data_types.rst  |  37 +-
 Documentation/media/uapi/dvb/ca-get-cap.rst        |  31 +-
 Documentation/media/uapi/dvb/ca-get-descr-info.rst |  25 +-
 Documentation/media/uapi/dvb/ca-get-msg.rst        |  35 +-
 Documentation/media/uapi/dvb/ca-get-slot-info.rst  |  86 +++-
 Documentation/media/uapi/dvb/ca-send-msg.rst       |   4 +-
 Documentation/media/uapi/dvb/ca-set-descr.rst      |   6 +-
 Documentation/media/uapi/dvb/ca-set-pid.rst        |  21 +-
 Documentation/media/uapi/dvb/ca_data_types.rst     |  12 +-
 Documentation/media/uapi/dvb/dmx-get-caps.rst      |   5 +-
 Documentation/media/uapi/dvb/dmx-set-source.rst    |   2 +-
 Documentation/media/uapi/dvb/dmx_types.rst         |  41 +-
 Documentation/media/uapi/dvb/dtv-fe-stats.rst      |   2 +-
 Documentation/media/uapi/dvb/dtv-properties.rst    |   2 +-
 Documentation/media/uapi/dvb/dtv-property.rst      |   2 +-
 Documentation/media/uapi/dvb/dtv-stats.rst         |   2 +-
 .../media/uapi/dvb/dvb-frontend-event.rst          |   2 +-
 .../media/uapi/dvb/dvb-frontend-parameters.rst     |  10 +-
 Documentation/media/uapi/dvb/dvbproperty.rst       |   2 +-
 Documentation/media/uapi/dvb/fe-bandwidth-t.rst    |   5 +-
 .../media/uapi/dvb/fe-diseqc-recv-slave-reply.rst  |   7 +-
 .../media/uapi/dvb/fe-diseqc-send-burst.rst        |   9 +-
 .../media/uapi/dvb/fe-diseqc-send-master-cmd.rst   |   6 +-
 Documentation/media/uapi/dvb/fe-get-info.rst       |  15 +-
 Documentation/media/uapi/dvb/fe-get-property.rst   |   2 +-
 Documentation/media/uapi/dvb/fe-read-status.rst    |   8 +-
 Documentation/media/uapi/dvb/fe-set-tone.rst       |   9 +-
 Documentation/media/uapi/dvb/fe-set-voltage.rst    |   4 +-
 Documentation/media/uapi/dvb/fe-type-t.rst         |   8 +-
 .../media/uapi/dvb/fe_property_parameters.rst      |  69 +--
 .../media/uapi/dvb/frontend-stat-properties.rst    |   2 +-
 Documentation/media/uapi/dvb/net-add-if.rst        |  12 +-
 Documentation/media/uapi/dvb/net-get-if.rst        |   6 +-
 Documentation/media/uapi/dvb/video-command.rst     |  30 ++
 Documentation/media/uapi/dvb/video-get-event.rst   |  17 +
 Documentation/media/uapi/dvb/video-get-navi.rst    |  10 +-
 Documentation/media/uapi/dvb/video-get-size.rst    |  10 +
 Documentation/media/uapi/dvb/video-get-status.rst  |  11 +
 .../media/uapi/dvb/video-select-source.rst         |  10 +
 .../media/uapi/dvb/video-set-attributes.rst        |  16 +
 .../media/uapi/dvb/video-set-display-format.rst    |   2 +-
 Documentation/media/uapi/dvb/video-set-format.rst  |   9 +
 .../media/uapi/dvb/video-set-highlight.rst         |  26 +-
 .../media/uapi/dvb/video-set-spu-palette.rst       |  10 +-
 Documentation/media/uapi/dvb/video-set-spu.rst     |  11 +-
 Documentation/media/uapi/dvb/video_types.rst       |  16 +-
 .../media/uapi/mediactl/media-ioc-device-info.rst  |   4 +-
 .../uapi/mediactl/media-ioc-enum-entities.rst      |   6 +-
 .../media/uapi/mediactl/media-ioc-enum-links.rst   |  22 +-
 .../media/uapi/mediactl/media-ioc-g-topology.rst   |  16 +-
 .../media/uapi/mediactl/media-ioc-setup-link.rst   |   4 +-
 Documentation/media/uapi/rc/lirc-read.rst          |   2 +-
 Documentation/media/uapi/v4l/audio.rst             |  12 +-
 Documentation/media/uapi/v4l/buffer.rst            |  60 +--
 Documentation/media/uapi/v4l/crop.rst              |  14 +-
 Documentation/media/uapi/v4l/dev-capture.rst       |  16 +-
 Documentation/media/uapi/v4l/dev-osd.rst           |  22 +-
 Documentation/media/uapi/v4l/dev-output.rst        |  16 +-
 Documentation/media/uapi/v4l/dev-overlay.rst       |  22 +-
 Documentation/media/uapi/v4l/dev-radio.rst         |   2 +-
 Documentation/media/uapi/v4l/dev-raw-vbi.rst       |  14 +-
 Documentation/media/uapi/v4l/dev-rds.rst           |  14 +-
 Documentation/media/uapi/v4l/dev-sdr.rst           |  12 +-
 Documentation/media/uapi/v4l/dev-sliced-vbi.rst    |  42 +-
 Documentation/media/uapi/v4l/dev-subdev.rst        |   4 +-
 Documentation/media/uapi/v4l/dev-touch.rst         |   2 +-
 Documentation/media/uapi/v4l/diff-v4l.rst          | 104 ++---
 Documentation/media/uapi/v4l/dmabuf.rst            |   8 +-
 Documentation/media/uapi/v4l/extended-controls.rst |  10 +-
 Documentation/media/uapi/v4l/field-order.rst       |  12 +-
 Documentation/media/uapi/v4l/format.rst            |   2 +-
 Documentation/media/uapi/v4l/func-mmap.rst         |   8 +-
 Documentation/media/uapi/v4l/func-munmap.rst       |   4 +-
 Documentation/media/uapi/v4l/func-poll.rst         |   2 +-
 Documentation/media/uapi/v4l/hist-v4l2.rst         | 178 ++++----
 .../media/uapi/v4l/libv4l-introduction.rst         |  77 ++--
 Documentation/media/uapi/v4l/mmap.rst              |  12 +-
 Documentation/media/uapi/v4l/pixfmt-002.rst        |  16 +-
 Documentation/media/uapi/v4l/pixfmt-003.rst        |  32 +-
 Documentation/media/uapi/v4l/pixfmt-006.rst        |  20 +-
 Documentation/media/uapi/v4l/pixfmt.rst            |   4 +-
 Documentation/media/uapi/v4l/planar-apis.rst       |  10 +-
 Documentation/media/uapi/v4l/rw.rst                |   2 +-
 Documentation/media/uapi/v4l/selection-api-005.rst |  10 +-
 Documentation/media/uapi/v4l/standard.rst          |   8 +-
 Documentation/media/uapi/v4l/streaming-par.rst     |   2 +-
 Documentation/media/uapi/v4l/subdev-formats.rst    |  12 +-
 Documentation/media/uapi/v4l/tuner.rst             |  14 +-
 Documentation/media/uapi/v4l/userp.rst             |   8 +-
 Documentation/media/uapi/v4l/v4l2.rst              |  12 +-
 Documentation/media/uapi/v4l/video.rst             |   2 +-
 .../media/uapi/v4l/vidioc-create-bufs.rst          |  10 +-
 Documentation/media/uapi/v4l/vidioc-cropcap.rst    |   8 +-
 .../media/uapi/v4l/vidioc-dbg-g-chip-info.rst      |   4 +-
 .../media/uapi/v4l/vidioc-dbg-g-register.rst       |   8 +-
 .../media/uapi/v4l/vidioc-decoder-cmd.rst          |   6 +-
 Documentation/media/uapi/v4l/vidioc-dqevent.rst    |  46 +-
 .../media/uapi/v4l/vidioc-dv-timings-cap.rst       |  10 +-
 .../media/uapi/v4l/vidioc-encoder-cmd.rst          |   4 +-
 .../media/uapi/v4l/vidioc-enum-dv-timings.rst      |  10 +-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |   8 +-
 .../media/uapi/v4l/vidioc-enum-frameintervals.rst  |  18 +-
 .../media/uapi/v4l/vidioc-enum-framesizes.rst      |  14 +-
 .../media/uapi/v4l/vidioc-enum-freq-bands.rst      |  16 +-
 Documentation/media/uapi/v4l/vidioc-enumaudio.rst  |   4 +-
 .../media/uapi/v4l/vidioc-enumaudioout.rst         |   4 +-
 Documentation/media/uapi/v4l/vidioc-enuminput.rst  |   8 +-
 Documentation/media/uapi/v4l/vidioc-enumoutput.rst |   8 +-
 Documentation/media/uapi/v4l/vidioc-enumstd.rst    |  12 +-
 Documentation/media/uapi/v4l/vidioc-expbuf.rst     |  14 +-
 Documentation/media/uapi/v4l/vidioc-g-audio.rst    |   6 +-
 Documentation/media/uapi/v4l/vidioc-g-audioout.rst |   6 +-
 Documentation/media/uapi/v4l/vidioc-g-crop.rst     |  12 +-
 Documentation/media/uapi/v4l/vidioc-g-ctrl.rst     |  10 +-
 .../media/uapi/v4l/vidioc-g-dv-timings.rst         |  10 +-
 Documentation/media/uapi/v4l/vidioc-g-edid.rst     |   2 +-
 .../media/uapi/v4l/vidioc-g-enc-index.rst          |   8 +-
 .../media/uapi/v4l/vidioc-g-ext-ctrls.rst          |  26 +-
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst     |  22 +-
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst      |  26 +-
 .../media/uapi/v4l/vidioc-g-frequency.rst          |  22 +-
 Documentation/media/uapi/v4l/vidioc-g-input.rst    |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst |   2 +-
 .../media/uapi/v4l/vidioc-g-modulator.rst          |  10 +-
 Documentation/media/uapi/v4l/vidioc-g-output.rst   |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-parm.rst     |  24 +-
 Documentation/media/uapi/v4l/vidioc-g-priority.rst |   2 +-
 .../media/uapi/v4l/vidioc-g-selection.rst          |  30 +-
 .../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst     |   6 +-
 Documentation/media/uapi/v4l/vidioc-g-std.rst      |   4 +-
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst    |  16 +-
 .../media/uapi/v4l/vidioc-prepare-buf.rst          |   2 +-
 Documentation/media/uapi/v4l/vidioc-qbuf.rst       |  20 +-
 .../media/uapi/v4l/vidioc-query-dv-timings.rst     |   2 +-
 Documentation/media/uapi/v4l/vidioc-querybuf.rst   |  14 +-
 Documentation/media/uapi/v4l/vidioc-querycap.rst   |  10 +-
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst  |  22 +-
 Documentation/media/uapi/v4l/vidioc-reqbufs.rst    |  10 +-
 .../media/uapi/v4l/vidioc-s-hw-freq-seek.rst       |  24 +-
 Documentation/media/uapi/v4l/vidioc-streamon.rst   |   2 +-
 .../uapi/v4l/vidioc-subdev-enum-frame-interval.rst |   9 +-
 .../uapi/v4l/vidioc-subdev-enum-frame-size.rst     |   6 +-
 .../uapi/v4l/vidioc-subdev-enum-mbus-code.rst      |   6 +-
 .../media/uapi/v4l/vidioc-subdev-g-crop.rst        |  10 +-
 .../media/uapi/v4l/vidioc-subdev-g-fmt.rst         |  12 +-
 .../uapi/v4l/vidioc-subdev-g-frame-interval.rst    |  10 +-
 .../media/uapi/v4l/vidioc-subdev-g-selection.rst   |   6 +-
 .../media/uapi/v4l/vidioc-subscribe-event.rst      |   2 +-
 Documentation/media/video.h.rst.exceptions         |  20 +-
 Documentation/media/videodev2.h.rst.exceptions     | 204 ++++-----
 Documentation/sphinx/parse-headers.pl              | 127 +++---
 drivers/media/dvb-core/demux.h                     |  44 +-
 drivers/media/dvb-core/dvb_ringbuffer.h            | 222 ++++++---
 include/media/media-device.h                       | 115 +++--
 include/media/media-devnode.h                      |   2 +-
 include/media/media-entity.h                       | 237 ++++++----
 include/media/rc-map.h                             |  94 +++-
 include/media/v4l2-ctrls.h                         |  61 ++-
 include/media/v4l2-dev.h                           |  12 +-
 include/media/v4l2-device.h                        |  54 +--
 include/media/v4l2-dv-timings.h                    |   4 +-
 include/media/v4l2-ioctl.h                         | 502 ++++++++++++---------
 include/media/v4l2-subdev.h                        |   2 +-
 include/uapi/linux/dvb/video.h                     |   3 +-
 scripts/kernel-doc                                 |   5 +-
 189 files changed, 2422 insertions(+), 1758 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/47 kernel-doc: ignore arguments on macro definitions

A macro definition is mapped via .. c:function:: at the ReST markup when using the following kernel-doc tag:

/**
* DMX_FE_ENTRY - Casts elements in the list of registered
* front-ends from the generic type struct list_head
* to the type * struct dmx_frontend
*
* @list: list of struct dmx_frontend
*/
#define DMX_FE_ENTRY(list) \
list_entry(list, struct dmx_frontend, connectivity_list)

However, unlike a function description, the arguments of a macro doesn't contain the data type.

This causes warnings when enabling Sphinx on nitkpick mode,
like this one:
./drivers/media/dvb-core/demux.h:358: WARNING: c:type reference target not found: list

That happens because kernel-doc output for the above is:

.. c:function:: DMX_FE_ENTRY ( list)

Casts elements in the list of registered front-ends from the generic type struct list_head to the type * struct dmx_frontend

**Parameters**

``list``
list of struct dmx_frontend

As the type is blank, Sphinx would think that ``list`` is a type, and will try to add a cross reference for it, using their internal representation for c:type:list.

However, ``list`` is not a type. So, that would cause either the above warning, or if a ``list`` type exists, it would create a reference to the wrong place at the doc.

To avoid that, let's ommit macro arguments from c:function::
declaration. As each argument will appear below the Parameters, the type of the argument can be described there, if needed.

---
 scripts/kernel-doc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/kernel-doc +3 -2
index 93721f3c91bf..3db6e6ac83f1 100755
@@ -1857,14 +1857,15 @@ sub output_function_rst(%) {
 	if ($count ne 0) {
 	    print ", ";
 	}
-	$count++;
 	$type = $args{'parametertypes'}{$parameter};
 
 	if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
 	    # pointer-to-function
 	    print $1 . $parameter . ") (" . $2;
-	} else {
+	    $count++;
+	} elsif ($type ne "") {
 	    print $type . " " . $parameter;
+	    $count++;
 	}
     }
     if ($args{'typedef'}) {
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/47 docs-rst: parse-headers.pl: make debug a command line option

In reply to Mauro Carvalho Chehab

Add a parser for the --debug option, in order to allow seeing what the parser is doing.

---
 Documentation/sphinx/parse-headers.pl | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
Documentation/sphinx/parse-headers.pl +10 -4
index 74089b0da798..531c710fc73f 100755
@@ -2,12 +2,18 @@
 use strict;
 use Text::Tabs;
 
-# Uncomment if debug is needed
-#use Data::Dumper;
-
-# change to 1 to generate some debug prints
 my $debug = 0;
 
+while ($ARGV[0] =~ m/^-(.*)/) {
+	my $cmd = shift @ARGV;
+	if ($cmd eq "--debug") {
+		require Data::Dumper;
+		$debug = 1;
+		next;
+	}
+	die "argument $cmd unknown";
+}
+
 if (scalar @ARGV < 2 || scalar @ARGV > 3) {
 	die "Usage:\n\t$0 <file in> <file out> [<exceptions file>]\n";
 }
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/47 docs-rst: parse-headers.pl: use the C domain for cross-references

In reply to Mauro Carvalho Chehab

Instead of keep using the normal reference, move to the C domain ones. Using C domains everywhere will allow cross-references between kAPI and uAPI docs.

---
 Documentation/sphinx/parse-headers.pl | 113 ++++++++++++++++++----------------
 1 file changed, 59 insertions(+), 54 deletions(-)
Documentation/sphinx/parse-headers.pl +59 -54
index 531c710fc73f..db0186a7618f 100755
@@ -57,7 +57,7 @@ while (<IN>) {
 		$n =~ tr/A-Z/a-z/;
 		$n =~ tr/_/-/;
 
-		$enum_symbols{$s} = $n;
+		$enum_symbols{$s} =  "\\ :ref:`$s <$n>`\\ ";
 
 		$is_enum = 0 if ($is_enum && m/\}/);
 		next;
@@ -69,7 +69,7 @@ while (<IN>) {
 		my $n = $1;
 		$n =~ tr/A-Z/a-z/;
 
-		$ioctls{$s} = $n;
+		$ioctls{$s} = "\\ :ref:`$s <$n>`\\ ";
 		next;
 	}
 
@@ -79,17 +79,15 @@ while (<IN>) {
 		$n =~ tr/A-Z/a-z/;
 		$n =~ tr/_/-/;
 
-		$defines{$s} = $n;
+		$defines{$s} = "\\ :ref:`$s <$n>`\\ ";
 		next;
 	}
 
-	if ($ln =~ m/^\s*typedef\s+.*\s+([_\w][\w\d_]+);/) {
-		my $s = $1;
-		my $n = $1;
-		$n =~ tr/A-Z/a-z/;
-		$n =~ tr/_/-/;
+	if ($ln =~ m/^\s*typedef\s+([_\w][\w\d_]+)\s+(.*)\s+([_\w][\w\d_]+);/) {
+		my $s = $2;
+		my $n = $3;
 
-		$typedefs{$s} = $n;
+		$typedefs{$n} = "\\ :c:type:`$n <$s>`\\ ";
 		next;
 	}
 	if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
@@ -97,11 +95,8 @@ while (<IN>) {
 	    || $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)\s+\{/
 	    || $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)$/) {
 		my $s = $1;
-		my $n = $1;
-		$n =~ tr/A-Z/a-z/;
-		$n =~ tr/_/-/;
 
-		$enums{$s} = $n;
+		$enums{$s} =  "enum :c:type:`$s`\\ ";
 
 		$is_enum = $1;
 		next;
@@ -112,11 +107,8 @@ while (<IN>) {
 	    || $ln =~ m/^\s*typedef\s*struct\s+([[_\w][\w\d_]+)$/
 	    ) {
 		my $s = $1;
-		my $n = $1;
-		$n =~ tr/A-Z/a-z/;
-		$n =~ tr/_/-/;
 
-		$structs{$s} = $n;
+		$structs{$s} = "struct :c:type:`$s`\\ ";
 		next;
 	}
 }
@@ -129,12 +121,9 @@ close IN;
 my @matches = ($data =~ m/typedef\s+struct\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,
 	       $data =~ m/typedef\s+enum\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,);
 foreach my $m (@matches) {
-		my $s = $m;
-		my $n = $m;
-		$n =~ tr/A-Z/a-z/;
-		$n =~ tr/_/-/;
+	my $s = $m;
 
-		$typedefs{$s} = $n;
+	$typedefs{$s} = "\\ :c:type:`$s`\\ ";
 	next;
 }
 
@@ -142,6 +131,15 @@ foreach my $m (@matches) {
 # Handle exceptions, if any
 #
 
+my %def_reftype = (
+	"ioctl"   => ":ref",
+	"define"  => ":ref",
+	"symbol"  => ":ref",
+	"typedef" => ":c:type",
+	"enum"    => ":c:type",
+	"struct"  => ":c:type",
+);
+
 if ($file_exceptions) {
 	open IN, $file_exceptions or die "Can't read $file_exceptions";
 	while (<IN>) {
@@ -175,29 +173,49 @@ if ($file_exceptions) {
 		}
 
 		# Parsers to replace a symbol
+		my ($type, $old, $new, $reftype);
 
-		if (m/^replace\s+ioctl\s+(\S+)\s+(\S+)/) {
-			$ioctls{$1} = $2 if (exists($ioctls{$1}));
+		if (m/^replace\s+(\S+)\s+(\S+)\s+(\S+)/) {
+			$type = $1;
+			$old = $2;
+			$new = $3;
+		} else {
+			die "Can't parse $file_exceptions: $_";
+		}
+
+		if ($new =~ m/^\:c\:(data|func|macro|type)\:\`(.+)\`/) {
+			$reftype = ":c:$1";
+			$new = $2;
+		} elsif ($new =~ m/\:ref\:\`(.+)\`/) {
+			$reftype = ":ref";
+			$new = $1;
+		} else {
+			$reftype = $def_reftype{$type};
+		}
+		$new = "$reftype:`$old <$new>`";
+
+		if ($type eq "ioctl") {
+			$ioctls{$old} = $new if (exists($ioctls{$old}));
 			next;
 		}
-		if (m/^replace\s+define\s+(\S+)\s+(\S+)/) {
-			$defines{$1} = $2 if (exists($defines{$1}));
+		if ($type eq "define") {
+			$defines{$old} = $new if (exists($defines{$old}));
 			next;
 		}
-		if (m/^replace\s+typedef\s+(\S+)\s+(\S+)/) {
-			$typedefs{$1} = $2 if (exists($typedefs{$1}));
+		if ($type eq "symbol") {
+			$enum_symbols{$old} = $new if (exists($enum_symbols{$old}));
 			next;
 		}
-		if (m/^replace\s+enum\s+(\S+)\s+(\S+)/) {
-			$enums{$1} = $2 if (exists($enums{$1}));
+		if ($type eq "typedef") {
+			$typedefs{$old} = $new if (exists($typedefs{$old}));
 			next;
 		}
-		if (m/^replace\s+symbol\s+(\S+)\s+(\S+)/) {
-			$enum_symbols{$1} = $2 if (exists($enum_symbols{$1}));
+		if ($type eq "enum") {
+			$enums{$old} = $new if (exists($enums{$old}));
 			next;
 		}
-		if (m/^replace\s+struct\s+(\S+)\s+(\S+)/) {
-			$structs{$1} = $2 if (exists($structs{$1}));
+		if ($type eq "struct") {
+			$structs{$old} = $new if (exists($structs{$old}));
 			next;
 		}
 
@@ -238,9 +256,7 @@ my $start_delim = "[ \n\t\(\=\*\@]";
 my $end_delim = "(\\s|,|\\\\=|\\\\:|\\;|\\\)|\\}|\\{)";
 
 foreach my $r (keys %ioctls) {
-	my $n = $ioctls{$r};
-
-	my $s = "\\ :ref:`$r <$n>`\\ ";
+	my $s = $ioctls{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
@@ -250,9 +266,7 @@ foreach my $r (keys %ioctls) {
 }
 
 foreach my $r (keys %defines) {
-	my $n = $defines{$r};
-
-	my $s = "\\ :ref:`$r <$n>`\\ ";
+	my $s = $defines{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
@@ -262,9 +276,7 @@ foreach my $r (keys %defines) {
 }
 
 foreach my $r (keys %enum_symbols) {
-	my $n = $enum_symbols{$r};
-
-	my $s = "\\ :ref:`$r <$n>`\\ ";
+	my $s = $enum_symbols{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
@@ -274,9 +286,7 @@ foreach my $r (keys %enum_symbols) {
 }
 
 foreach my $r (keys %enums) {
-	my $n = $enums{$r};
-
-	my $s = "\\ :ref:`enum $r <$n>`\\ ";
+	my $s = $enums{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
@@ -286,9 +296,7 @@ foreach my $r (keys %enums) {
 }
 
 foreach my $r (keys %structs) {
-	my $n = $structs{$r};
-
-	my $s = "\\ :ref:`struct $r <$n>`\\ ";
+	my $s = $structs{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
@@ -298,18 +306,15 @@ foreach my $r (keys %structs) {
 }
 
 foreach my $r (keys %typedefs) {
-	my $n = $typedefs{$r};
-
-	my $s = "\\ :ref:`$r <$n>`\\ ";
+	my $s = $typedefs{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
 	print "$r -> $s\n" if ($debug);
-
 	$data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
 }
 
-$data =~ s/\\ \n/\n/g;
+$data =~ s/\\ ([\n\s])/\1/g;
 
 #
 # Generate output file
Signature · 1 line
2.7.4
#4 lore raw

Re: [PATCH 03/47] docs-rst: parse-headers.pl: use the C domain for cross-references

Hi

BTW: porting parse-headers to python / get rid of media/Makefile

* https://www.mail-archive.com/[email protected]/msg101261.html

I think last relevant comment was from you Mauro:

* https://www.mail-archive.com/[email protected]/msg101426.html

should we continue this task? If yes what are the next steps, where can I help?

-- Markus --

Am 08.09.2016 um 14:03 schrieb Mauro Carvalho Chehab <[email protected]>:

Quoted 257 lines

Instead of keep using the normal reference, move to the C domain ones. Using C domains everywhere will allow cross-references between kAPI and uAPI docs.

---
Documentation/sphinx/parse-headers.pl | 113 ++++++++++++++++++----------------

1 file changed, 59 insertions(+), 54 deletions(-)
Documentation/sphinx/parse-headers.pl +59 -54
index 531c710fc73f..db0186a7618f 100755
@@ -57,7 +57,7 @@ while (<IN>) {
 		$n =~ tr/A-Z/a-z/;
 		$n =~ tr/_/-/;
 
-		$enum_symbols{$s} = $n;
+		$enum_symbols{$s} =  "\\ :ref:`$s <$n>`\\ ";
 
 		$is_enum = 0 if ($is_enum && m/\}/);
 		next;
@@ -69,7 +69,7 @@ while (<IN>) {
 		my $n = $1;
 		$n =~ tr/A-Z/a-z/;
 
-		$ioctls{$s} = $n;
+		$ioctls{$s} = "\\ :ref:`$s <$n>`\\ ";
 		next;
 	}
 
@@ -79,17 +79,15 @@ while (<IN>) {
 		$n =~ tr/A-Z/a-z/;
 		$n =~ tr/_/-/;
 
-		$defines{$s} = $n;
+		$defines{$s} = "\\ :ref:`$s <$n>`\\ ";
 		next;
 	}
 
-	if ($ln =~ m/^\s*typedef\s+.*\s+([_\w][\w\d_]+);/) {
-		my $s = $1;
-		my $n = $1;
-		$n =~ tr/A-Z/a-z/;
-		$n =~ tr/_/-/;
+	if ($ln =~ m/^\s*typedef\s+([_\w][\w\d_]+)\s+(.*)\s+([_\w][\w\d_]+);/) {
+		my $s = $2;
+		my $n = $3;
 
-		$typedefs{$s} = $n;
+		$typedefs{$n} = "\\ :c:type:`$n <$s>`\\ ";
 		next;
 	}
 	if ($ln =~ m/^\s*enum\s+([_\w][\w\d_]+)\s+\{/
@@ -97,11 +95,8 @@ while (<IN>) {
 	    || $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)\s+\{/
 	    || $ln =~ m/^\s*typedef\s*enum\s+([_\w][\w\d_]+)$/) {
 		my $s = $1;
-		my $n = $1;
-		$n =~ tr/A-Z/a-z/;
-		$n =~ tr/_/-/;
 
-		$enums{$s} = $n;
+		$enums{$s} =  "enum :c:type:`$s`\\ ";
 
 		$is_enum = $1;
 		next;
@@ -112,11 +107,8 @@ while (<IN>) {
 	    || $ln =~ m/^\s*typedef\s*struct\s+([[_\w][\w\d_]+)$/
 	    ) {
 		my $s = $1;
-		my $n = $1;
-		$n =~ tr/A-Z/a-z/;
-		$n =~ tr/_/-/;
 
-		$structs{$s} = $n;
+		$structs{$s} = "struct :c:type:`$s`\\ ";
 		next;
 	}
 }
@@ -129,12 +121,9 @@ close IN;
 my @matches = ($data =~ m/typedef\s+struct\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,
 	       $data =~ m/typedef\s+enum\s+\S+?\s*\{[^\}]+\}\s*(\S+)\s*\;/g,);
 foreach my $m (@matches) {
-		my $s = $m;
-		my $n = $m;
-		$n =~ tr/A-Z/a-z/;
-		$n =~ tr/_/-/;
+	my $s = $m;
 
-		$typedefs{$s} = $n;
+	$typedefs{$s} = "\\ :c:type:`$s`\\ ";
 	next;
 }
 
@@ -142,6 +131,15 @@ foreach my $m (@matches) {
 # Handle exceptions, if any
 #
 
+my %def_reftype = (
+	"ioctl"   => ":ref",
+	"define"  => ":ref",
+	"symbol"  => ":ref",
+	"typedef" => ":c:type",
+	"enum"    => ":c:type",
+	"struct"  => ":c:type",
+);
+
 if ($file_exceptions) {
 	open IN, $file_exceptions or die "Can't read $file_exceptions";
 	while (<IN>) {
@@ -175,29 +173,49 @@ if ($file_exceptions) {
 		}
 
 		# Parsers to replace a symbol
+		my ($type, $old, $new, $reftype);
 
-		if (m/^replace\s+ioctl\s+(\S+)\s+(\S+)/) {
-			$ioctls{$1} = $2 if (exists($ioctls{$1}));
+		if (m/^replace\s+(\S+)\s+(\S+)\s+(\S+)/) {
+			$type = $1;
+			$old = $2;
+			$new = $3;
+		} else {
+			die "Can't parse $file_exceptions: $_";
+		}
+
+		if ($new =~ m/^\:c\:(data|func|macro|type)\:\`(.+)\`/) {
+			$reftype = ":c:$1";
+			$new = $2;
+		} elsif ($new =~ m/\:ref\:\`(.+)\`/) {
+			$reftype = ":ref";
+			$new = $1;
+		} else {
+			$reftype = $def_reftype{$type};
+		}
+		$new = "$reftype:`$old <$new>`";
+
+		if ($type eq "ioctl") {
+			$ioctls{$old} = $new if (exists($ioctls{$old}));
 			next;
 		}
-		if (m/^replace\s+define\s+(\S+)\s+(\S+)/) {
-			$defines{$1} = $2 if (exists($defines{$1}));
+		if ($type eq "define") {
+			$defines{$old} = $new if (exists($defines{$old}));
 			next;
 		}
-		if (m/^replace\s+typedef\s+(\S+)\s+(\S+)/) {
-			$typedefs{$1} = $2 if (exists($typedefs{$1}));
+		if ($type eq "symbol") {
+			$enum_symbols{$old} = $new if (exists($enum_symbols{$old}));
 			next;
 		}
-		if (m/^replace\s+enum\s+(\S+)\s+(\S+)/) {
-			$enums{$1} = $2 if (exists($enums{$1}));
+		if ($type eq "typedef") {
+			$typedefs{$old} = $new if (exists($typedefs{$old}));
 			next;
 		}
-		if (m/^replace\s+symbol\s+(\S+)\s+(\S+)/) {
-			$enum_symbols{$1} = $2 if (exists($enum_symbols{$1}));
+		if ($type eq "enum") {
+			$enums{$old} = $new if (exists($enums{$old}));
 			next;
 		}
-		if (m/^replace\s+struct\s+(\S+)\s+(\S+)/) {
-			$structs{$1} = $2 if (exists($structs{$1}));
+		if ($type eq "struct") {
+			$structs{$old} = $new if (exists($structs{$old}));
 			next;
 		}
 
@@ -238,9 +256,7 @@ my $start_delim = "[ \n\t\(\=\*\@]";
 my $end_delim = "(\\s|,|\\\\=|\\\\:|\\;|\\\)|\\}|\\{)";
 
 foreach my $r (keys %ioctls) {
-	my $n = $ioctls{$r};
-
-	my $s = "\\ :ref:`$r <$n>`\\ ";
+	my $s = $ioctls{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
@@ -250,9 +266,7 @@ foreach my $r (keys %ioctls) {
 }
 
 foreach my $r (keys %defines) {
-	my $n = $defines{$r};
-
-	my $s = "\\ :ref:`$r <$n>`\\ ";
+	my $s = $defines{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
@@ -262,9 +276,7 @@ foreach my $r (keys %defines) {
 }
 
 foreach my $r (keys %enum_symbols) {
-	my $n = $enum_symbols{$r};
-
-	my $s = "\\ :ref:`$r <$n>`\\ ";
+	my $s = $enum_symbols{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
@@ -274,9 +286,7 @@ foreach my $r (keys %enum_symbols) {
 }
 
 foreach my $r (keys %enums) {
-	my $n = $enums{$r};
-
-	my $s = "\\ :ref:`enum $r <$n>`\\ ";
+	my $s = $enums{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
@@ -286,9 +296,7 @@ foreach my $r (keys %enums) {
 }
 
 foreach my $r (keys %structs) {
-	my $n = $structs{$r};
-
-	my $s = "\\ :ref:`struct $r <$n>`\\ ";
+	my $s = $structs{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
@@ -298,18 +306,15 @@ foreach my $r (keys %structs) {
 }
 
 foreach my $r (keys %typedefs) {
-	my $n = $typedefs{$r};
-
-	my $s = "\\ :ref:`$r <$n>`\\ ";
+	my $s = $typedefs{$r};
 
 	$r =~ s,([\_\`\*\<\>\&\\\\:\/]),\\\\$1,g;
 
 	print "$r -> $s\n" if ($debug);
-
 	$data =~ s/($start_delim)($r)$end_delim/$1$s$3/g;
 }
 
-$data =~ s/\\ \n/\n/g;
+$data =~ s/\\ ([\n\s])/\1/g;
 
 #
 # Generate output file
Signature · 7 lines
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

PATCH 4/47 conf_nitpick.py: add external vars to ignore list

In reply to Mauro Carvalho Chehab

There a some other types and functions that aren't declared inside the media document but are elsewhere. Add them to the ignore list.

---
 Documentation/media/conf_nitpick.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
Documentation/media/conf_nitpick.py +9 -4
index 227deee68c88..4de9533ce361 100644
@@ -21,8 +21,11 @@ nitpick_ignore = [
     ("c:func", "clock_gettime"),
     ("c:func", "close"),
     ("c:func", "container_of"),
+    ("c:func", "copy_from_user"),
+    ("c:func", "copy_to_user"),
     ("c:func", "determine_valid_ioctls"),
     ("c:func", "ERR_PTR"),
+    ("c:func", "i2c_new_device"),
     ("c:func", "ioctl"),
     ("c:func", "IS_ERR"),
     ("c:func", "mmap"),
@@ -37,6 +40,7 @@ nitpick_ignore = [
     ("c:func", "struct pollfd"),
     ("c:func", "usb_make_path"),
     ("c:func", "write"),
+
     ("c:type", "atomic_t"),
     ("c:type", "bool"),
     ("c:type", "boolean"),
@@ -72,10 +76,10 @@ nitpick_ignore = [
     ("c:type", "spi_device"),
     ("c:type", "spi_master"),
     ("c:type", "ssize_t"),
-    ("c:type", "struct fb_fix_screeninfo"),
-    ("c:type", "struct pollfd"),
-    ("c:type", "struct timeval"),
-    ("c:type", "struct video_capability"),
+    ("c:type", "fb_fix_screeninfo"),
+    ("c:type", "pollfd"),
+    ("c:type", "timeval"),
+    ("c:type", "video_capability"),
     ("c:type", "timeval"),
     ("c:type", "__u16"),
     ("c:type", "u16"),
@@ -87,6 +91,7 @@ nitpick_ignore = [
     ("c:type", "uint16_t"),
     ("c:type", "uint32_t"),
     ("c:type", "union"),
+    ("c:type", "__user"),
     ("c:type", "usb_device"),
     ("c:type", "video_system_t"),
 ]
Signature · 1 line
2.7.4
#6 lore raw

PATCH 5/47 dvb_ringbuffer.h: Document all functions

In reply to Mauro Carvalho Chehab

There are several functions there there weren't properly documented. Add documentation for them.

While here, make checkpatch.pl happier.

---
 drivers/media/dvb-core/dvb_ringbuffer.h | 179 ++++++++++++++++++++++++--------
 1 file changed, 134 insertions(+), 45 deletions(-)
drivers/media/dvb-core/dvb_ringbuffer.h +134 -45
index 8af642399f1e..8209eb4db2aa 100644
@@ -18,10 +18,6 @@
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
 #ifndef _DVB_RINGBUFFER_H_
@@ -30,6 +26,18 @@
 #include <linux/spinlock.h>
 #include <linux/wait.h>
 
+/**
+ * struct dvb_ringbuffer - Describes a ring buffer used at DVB framework
+ *
+ * @data: Area were the ringbuffer data is written
+ * @size: size of the ringbuffer
+ * @pread: next position to read
+ * @pwrite: next position to write
+ * @error: used by ringbuffer clients to indicate that an error happened.
+ * @queue: Wait queue used by ringbuffer clients to indicate when buffer
+ *         was filled
+ * @lock: Spinlock used to protect the ringbuffer
+ */
 struct dvb_ringbuffer {
 	u8               *data;
 	ssize_t           size;
@@ -43,7 +51,21 @@ struct dvb_ringbuffer {
 
 #define DVB_RINGBUFFER_PKTHDRSIZE 3
 
+/**
+ * dvb_ringbuffer_init - initialize ring buffer, lock and queue
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @data: pointer to the buffer where the data will be stored
+ * @len: bytes from ring buffer into @buf
+ */
+extern void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data,
+				size_t len);
 
+/**
+ * dvb_ringbuffer_empty - test whether buffer is empty
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ */
 /*
  * Notes:
  * ------
@@ -72,69 +94,133 @@ struct dvb_ringbuffer {
  *     Resetting the buffer counts as a read and write operation.
  *     Two or more writers must be locked against each other.
  */
-
-/* initialize ring buffer, lock and queue */
-extern void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len);
-
-/* test whether buffer is empty */
 extern int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf);
 
-/* return the number of free bytes in the buffer */
+/**
+ * dvb_ringbuffer_free - returns the number of free bytes in the buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ *
+ * Return: number of free bytes in the buffer
+ */
 extern ssize_t dvb_ringbuffer_free(struct dvb_ringbuffer *rbuf);
 
-/* return the number of bytes waiting in the buffer */
+/**
+ * dvb_ringbuffer_avail - returns the number of bytes waiting in the buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ *
+ * Return: number of bytes waiting in the buffer
+ */
 extern ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf);
 
-
-/*
- * Reset the read and write pointers to zero and flush the buffer
+/**
+ * dvb_ringbuffer_reset - resets the ringbuffer to initial state
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ *
+ * Resets the read and write pointers to zero and flush the buffer.
+ *
  * This counts as a read and write operation
  */
 extern void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf);
 
 
-/* read routines & macros */
-/* ---------------------- */
-/* flush buffer */
+/*
+ * read routines & macros
+ */
+
+/**
+ * dvb_ringbuffer_flush - flush buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ */
 extern void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf);
 
-/* flush buffer protected by spinlock and wake-up waiting task(s) */
+/**
+ * dvb_ringbuffer_flush_spinlock_wakeup- flush buffer protected by spinlock
+ *      and wake-up waiting task(s)
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ */
 extern void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf);
 
-/* peek at byte @offs: in the buffer */
-#define DVB_RINGBUFFER_PEEK(rbuf,offs)	\
-			(rbuf)->data[((rbuf)->pread+(offs))%(rbuf)->size]
+/* DVB_RINGBUFFER_PEEK - peek at byte @offs: in the buffer */
+#define DVB_RINGBUFFER_PEEK(rbuf, offs)	\
+			(rbuf)->data[((rbuf)->pread + (offs)) % (rbuf)->size]
 
 /* advance read ptr by @num: bytes */
-#define DVB_RINGBUFFER_SKIP(rbuf,num)	\
-			(rbuf)->pread=((rbuf)->pread+(num))%(rbuf)->size
+#define DVB_RINGBUFFER_SKIP(rbuf, num)	{\
+			(rbuf)->pread = ((rbuf)->pread + (num)) % (rbuf)->size;\
+}
 
-/*
- * read @len: bytes from ring buffer into @buf:
- * @usermem: specifies whether @buf: resides in user space
- * returns number of bytes transferred or -EFAULT
+/**
+ * dvb_ringbuffer_read_user - Reads a buffer into an user pointer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @buf: pointer to the buffer where the data will be stored
+ * @len: bytes from ring buffer into @buf
+ *
+ * This variant assumes that the buffer is a memory at the userspace. So,
+ * it will internally call copy_to_user().
+ *
+ * Return: number of bytes transferred or -EFAULT
  */
 extern ssize_t dvb_ringbuffer_read_user(struct dvb_ringbuffer *rbuf,
 				   u8 __user *buf, size_t len);
+
+/**
+ * dvb_ringbuffer_read - Reads a buffer into a pointer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @buf: pointer to the buffer where the data will be stored
+ * @len: bytes from ring buffer into @buf
+ *
+ * This variant assumes that the buffer is a memory at the Kernel space
+ *
+ * Return: number of bytes transferred or -EFAULT
+ */
 extern void dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf,
 				   u8 *buf, size_t len);
 
 
-/* write routines & macros */
-/* ----------------------- */
+/*
+ * write routines & macros
+ */
+
 /* write single byte to ring buffer */
-#define DVB_RINGBUFFER_WRITE_BYTE(rbuf,byte)	\
-			{ (rbuf)->data[(rbuf)->pwrite]=(byte); \
-			(rbuf)->pwrite=((rbuf)->pwrite+1)%(rbuf)->size; }
-/*
- * write @len: bytes to ring buffer
- * @usermem: specifies whether @buf: resides in user space
- * returns number of bytes transferred or -EFAULT
-*/
+#define DVB_RINGBUFFER_WRITE_BYTE(rbuf, byte)	\
+			{ (rbuf)->data[(rbuf)->pwrite] = (byte); \
+			(rbuf)->pwrite = ((rbuf)->pwrite + 1) % (rbuf)->size; }
+
+/**
+ * dvb_ringbuffer_write - Writes a buffer into the ringbuffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @buf: pointer to the buffer where the data will be read
+ * @len: bytes from ring buffer into @buf
+ *
+ * This variant assumes that the buffer is a memory at the Kernel space
+ *
+ * return: number of bytes transferred or -EFAULT
+ */
 extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
 				    size_t len);
+
+/**
+ * dvb_ringbuffer_writeuser - Writes a buffer received via an user pointer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @buf: pointer to the buffer where the data will be read
+ * @len: bytes from ring buffer into @buf
+ *
+ * This variant assumes that the buffer is a memory at the userspace. So,
+ * it will internally call copy_from_user().
+ *
+ * Return: number of bytes transferred or -EFAULT
+ */
 extern ssize_t dvb_ringbuffer_write_user(struct dvb_ringbuffer *rbuf,
-				         const u8 __user *buf, size_t len);
+					 const u8 __user *buf, size_t len);
 
 
 /**
@@ -143,9 +229,10 @@ extern ssize_t dvb_ringbuffer_write_user(struct dvb_ringbuffer *rbuf,
  * @rbuf: Ringbuffer to write to.
  * @buf: Buffer to write.
  * @len: Length of buffer (currently limited to 65535 bytes max).
- * returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.
+ *
+ * Return: Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.
  */
-extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
+extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8 *buf,
 					size_t len);
 
 /**
@@ -157,7 +244,7 @@ extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
  * @buf: Destination buffer for data.
  * @len: Size of destination buffer.
  *
- * returns Number of bytes read, or -EFAULT.
+ * Return: Number of bytes read, or -EFAULT.
  *
  * .. note::
  *
@@ -167,7 +254,7 @@ extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
  */
 extern ssize_t dvb_ringbuffer_pkt_read_user(struct dvb_ringbuffer *rbuf,
 					    size_t idx,
-				            int offset, u8 __user *buf,
+					    int offset, u8 __user *buf,
 					    size_t len);
 
 /**
@@ -181,7 +268,7 @@ extern ssize_t dvb_ringbuffer_pkt_read_user(struct dvb_ringbuffer *rbuf,
  * @buf: Destination buffer for data.
  * @len: Size of destination buffer.
  *
- * returns Number of bytes read, or -EFAULT.
+ * Return: Number of bytes read, or -EFAULT.
  */
 extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
 				       int offset, u8 *buf, size_t len);
@@ -199,10 +286,12 @@ extern void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx);
  *
  * @rbuf: Ringbuffer concerned.
  * @idx: Previous packet index, or -1 to return the first packet index.
- * @pktlen: On success, will be updated to contain the length of the packet in bytes.
+ * @pktlen: On success, will be updated to contain the length of the packet
+ *          in bytes.
  * returns Packet index (if >=0), or -1 if no packets available.
  */
-extern ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* pktlen);
+extern ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf,
+				       size_t idx, size_t *pktlen);
 
 
 #endif /* _DVB_RINGBUFFER_H_ */
Signature · 1 line
2.7.4
#7 lore raw

PATCH 6/47 dtv-core.rst: move DTV ringbuffer notes to kAPI doc

In reply to Mauro Carvalho Chehab

Instead of keeping those notes at the file on a non-structured way, move them to dtv-core.rst, using the proper ReST tags.

---
 Documentation/media/kapi/dtv-core.rst   | 38 +++++++++++++++++++++++++++++++--
 drivers/media/dvb-core/dvb_ringbuffer.h | 28 ------------------------
 2 files changed, 36 insertions(+), 30 deletions(-)
Documentation/media/kapi/dtv-core.rst +36 -2
index 41df9f144fcb..a3c4642eabfc 100644
@@ -6,8 +6,6 @@ Digital TV Common functions
 
 .. kernel-doc:: drivers/media/dvb-core/dvb_math.h
 
-.. kernel-doc:: drivers/media/dvb-core/dvb_ringbuffer.h
-
 .. kernel-doc:: drivers/media/dvb-core/dvbdev.h
 
 
@@ -18,6 +16,42 @@ Digital TV Common functions
 .. kernel-doc:: drivers/media/dvb-core/dvbdev.h
    :export: drivers/media/dvb-core/dvbdev.c
 
+Digital TV Ring buffer
+----------------------
+
+Those routines implement ring buffers used to handle digital TV data and
+copy it from/to userspace.
+
+.. note::
+
+  1) For performance reasons read and write routines don't check buffer sizes
+     and/or number of bytes free/available. This has to be done before these
+     routines are called. For example:
+
+   .. code-block:: c
+
+        /* write @buflen: bytes */
+        free = dvb_ringbuffer_free(rbuf);
+        if (free >= buflen)
+                count = dvb_ringbuffer_write(rbuf, buffer, buflen);
+        else
+                /* do something */
+
+        /* read min. 1000, max. @bufsize: bytes */
+        avail = dvb_ringbuffer_avail(rbuf);
+        if (avail >= 1000)
+                count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize));
+        else
+                /* do something */
+
+  2) If there is exactly one reader and one writer, there is no need
+     to lock read or write operations.
+     Two or more readers must be locked against each other.
+     Flushing the buffer counts as a read operation.
+     Resetting the buffer counts as a read and write operation.
+     Two or more writers must be locked against each other.
+
+.. kernel-doc:: drivers/media/dvb-core/dvb_ringbuffer.h
 
 
 Digital TV Frontend kABI
drivers/media/dvb-core/dvb_ringbuffer.h +0 -28
index 8209eb4db2aa..f64bd86fe5fd 100644
@@ -66,34 +66,6 @@ extern void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data,
  *
  * @rbuf: pointer to struct dvb_ringbuffer
  */
-/*
- * Notes:
- * ------
- * (1) For performance reasons read and write routines don't check buffer sizes
- *     and/or number of bytes free/available. This has to be done before these
- *     routines are called. For example:
- *
- *     *** write @buflen: bytes ***
- *     free = dvb_ringbuffer_free(rbuf);
- *     if (free >= buflen)
- *         count = dvb_ringbuffer_write(rbuf, buffer, buflen);
- *     else
- *         ...
- *
- *     *** read min. 1000, max. @bufsize: bytes ***
- *     avail = dvb_ringbuffer_avail(rbuf);
- *     if (avail >= 1000)
- *         count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize));
- *     else
- *         ...
- *
- * (2) If there is exactly one reader and one writer, there is no need
- *     to lock read or write operations.
- *     Two or more readers must be locked against each other.
- *     Flushing the buffer counts as a read operation.
- *     Resetting the buffer counts as a read and write operation.
- *     Two or more writers must be locked against each other.
- */
 extern int dvb_ringbuffer_empty(struct dvb_ringbuffer *rbuf);
 
 /**
Signature · 1 line
2.7.4
#8 lore raw

PATCH 7/47 dvb_ringbuffer.h: document the define macros

In reply to Mauro Carvalho Chehab

There are a few define macros not documented, because the ReST output was causing more warnings.

Now that this got fixed, document them. While here, fix the remaining coding style issues.

---
 drivers/media/dvb-core/dvb_ringbuffer.h | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)
drivers/media/dvb-core/dvb_ringbuffer.h +19 -8
index f64bd86fe5fd..eae3f091b6a0 100644
@@ -97,7 +97,6 @@ extern ssize_t dvb_ringbuffer_avail(struct dvb_ringbuffer *rbuf);
  */
 extern void dvb_ringbuffer_reset(struct dvb_ringbuffer *rbuf);
 
-
 /*
  * read routines & macros
  */
@@ -117,11 +116,21 @@ extern void dvb_ringbuffer_flush(struct dvb_ringbuffer *rbuf);
  */
 extern void dvb_ringbuffer_flush_spinlock_wakeup(struct dvb_ringbuffer *rbuf);
 
-/* DVB_RINGBUFFER_PEEK - peek at byte @offs: in the buffer */
+/**
+ * DVB_RINGBUFFER_PEEK - peek at byte @offs in the buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @offs: offset inside the ringbuffer
+ */
 #define DVB_RINGBUFFER_PEEK(rbuf, offs)	\
-			(rbuf)->data[((rbuf)->pread + (offs)) % (rbuf)->size]
+			((rbuf)->data[((rbuf)->pread + (offs)) % (rbuf)->size])
 
-/* advance read ptr by @num: bytes */
+/**
+ * DVB_RINGBUFFER_SKIP - advance read ptr by @num bytes
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @num: number of bytes to advance
+ */
 #define DVB_RINGBUFFER_SKIP(rbuf, num)	{\
 			(rbuf)->pread = ((rbuf)->pread + (num)) % (rbuf)->size;\
 }
@@ -155,12 +164,16 @@ extern ssize_t dvb_ringbuffer_read_user(struct dvb_ringbuffer *rbuf,
 extern void dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf,
 				   u8 *buf, size_t len);
 
-
 /*
  * write routines & macros
  */
 
-/* write single byte to ring buffer */
+/**
+ * DVB_RINGBUFFER_WRITE_BYTE - write single byte to ring buffer
+ *
+ * @rbuf: pointer to struct dvb_ringbuffer
+ * @byte: byte to write
+ */
 #define DVB_RINGBUFFER_WRITE_BYTE(rbuf, byte)	\
 			{ (rbuf)->data[(rbuf)->pwrite] = (byte); \
 			(rbuf)->pwrite = ((rbuf)->pwrite + 1) % (rbuf)->size; }
@@ -194,7 +207,6 @@ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
 extern ssize_t dvb_ringbuffer_write_user(struct dvb_ringbuffer *rbuf,
 					 const u8 __user *buf, size_t len);
 
-
 /**
  * dvb_ringbuffer_pkt_write - Write a packet into the ringbuffer.
  *
@@ -265,5 +277,4 @@ extern void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx);
 extern ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf,
 				       size_t idx, size_t *pktlen);
 
-
 #endif /* _DVB_RINGBUFFER_H_ */
Signature · 1 line
2.7.4
#9 lore raw

PATCH 8/47 demux.h: Fix a few documentation issues

In reply to Mauro Carvalho Chehab

demux.h was lacking documentation for the DMX_FE_ENTRY macro:
./drivers/media/dvb-core/demux.h:511: WARNING: c:func reference target not found: DMX_FE_ENTRY

While here, get rid of unused parameters and fix a few minor issues at the header file.

---
 drivers/media/dvb-core/demux.h | 36 ++++++++++++++++--------------------
 1 file changed, 16 insertions(+), 20 deletions(-)
drivers/media/dvb-core/demux.h +16 -20
index 4b4c1da20f4b..0d9c53518be2 100644
@@ -202,7 +202,7 @@ struct dmx_section_feed {
  *
  * This function callback prototype, provided by the client of the demux API,
  * is called from the demux code. The function is only called when filtering
- * on ae TS feed has been enabled using the start_filtering() function at
+ * on a TS feed has been enabled using the start_filtering\(\) function at
  * the &dmx_demux.
  * Any TS packets that match the filter settings are copied to a circular
  * buffer. The filtered TS packets are delivered to the client using this
@@ -243,8 +243,10 @@ struct dmx_section_feed {
  * will also be sent to the hardware MPEG decoder.
  *
  * Return:
- * 	0, on success;
- * 	-EOVERFLOW, on buffer overflow.
+ *
+ * - 0, on success;
+ *
+ * - -EOVERFLOW, on buffer overflow.
  */
 typedef int (*dmx_ts_cb)(const u8 *buffer1,
 			 size_t buffer1_length,
@@ -293,9 +295,9 @@ typedef int (*dmx_section_cb)(const u8 *buffer1,
 			      size_t buffer2_len,
 			      struct dmx_section_filter *source);
 
-/*--------------------------------------------------------------------------*/
-/* DVB Front-End */
-/*--------------------------------------------------------------------------*/
+/*
+ * DVB Front-End
+ */
 
 /**
  * enum dmx_frontend_source - Used to identify the type of frontend
@@ -349,15 +351,15 @@ enum dmx_demux_caps {
 
 /*
  * Demux resource type identifier.
-*/
-
-/*
- * DMX_FE_ENTRY(): Casts elements in the list of registered
- * front-ends from the generic type struct list_head
- * to the type * struct dmx_frontend
- *.
-*/
+ */
 
+/**
+ * DMX_FE_ENTRY - Casts elements in the list of registered
+ *		  front-ends from the generic type struct list_head
+ *		  to the type * struct dmx_frontend
+ *
+ * @list: list of struct dmx_frontend
+ */
 #define DMX_FE_ENTRY(list) \
 	list_entry(list, struct dmx_frontend, connectivity_list)
 
@@ -551,7 +553,6 @@ enum dmx_demux_caps {
  *	0 on success;
  *	-EINVAL on bad parameter.
  */
-
 struct dmx_demux {
 	enum dmx_demux_caps capabilities;
 	struct dmx_frontend *frontend;
@@ -581,11 +582,6 @@ struct dmx_demux {
 
 	int (*get_pes_pids)(struct dmx_demux *demux, u16 *pids);
 
-	/* private: Not used upstream and never documented */
-#if 0
-	int (*get_caps)(struct dmx_demux *demux, struct dmx_caps *caps);
-	int (*set_source)(struct dmx_demux *demux, const dmx_source_t *src);
-#endif
 	/*
 	 * private: Only used at av7110, to read some data from firmware.
 	 *	As this was never documented, we have no clue about what's
Signature · 1 line
2.7.4
#10 lore raw

PATCH 9/47 mc-core.rst: Fix cross-references to the source

In reply to Mauro Carvalho Chehab

The cross-reference to "struct media_pad" was pointing to a place that doesn't exist. Fix it, and adjust the second reference on the same paragraph to use the same text.

---
 Documentation/media/kapi/mc-core.rst | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/media/kapi/mc-core.rst +3 -2
index 569cfc4f01cd..fb839a6c1f46 100644
@@ -85,8 +85,9 @@ a driver-specific structure.
 Pads are identified by their entity and their 0-based index in the pads
 array.
 
-Both information are stored in the :c:type:`struct media_pad`, making the
-:c:type:`media_pad` pointer the canonical way to store and pass link references.
+Both information are stored in the :c:type:`struct media_pad <media_pad>`,
+making the :c:type:`struct media_pad <media_pad>` pointer the canonical way
+to store and pass link references.
 
 Pads have flags that describe the pad capabilities and state.
 
Signature · 1 line
2.7.4
#11 lore raw

PATCH 10/47 demux.h: fix a documentation warning

In reply to Mauro Carvalho Chehab

The kernel-doc parser didn't handle well the private:
tag. Rewrite it.

---
 drivers/media/dvb-core/demux.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/media/dvb-core/demux.h +5 -3
index 0d9c53518be2..aeda2b64931c 100644
@@ -582,10 +582,12 @@ struct dmx_demux {
 
 	int (*get_pes_pids)(struct dmx_demux *demux, u16 *pids);
 
+	/* private: */
+
 	/*
-	 * private: Only used at av7110, to read some data from firmware.
-	 *	As this was never documented, we have no clue about what's
-	 *	there, and its usage on other drivers aren't encouraged.
+	 * Only used at av7110, to read some data from firmware.
+	 * As this was never documented, we have no clue about what's
+	 * there, and its usage on other drivers aren't encouraged.
 	 */
 	int (*get_stc)(struct dmx_demux *demux, unsigned int num,
 		       u64 *stc, unsigned int *base);
Signature · 1 line
2.7.4
#12 lore raw

PATCH 11/47 docs-rst: improve the kAPI documentation for the mediactl

In reply to Mauro Carvalho Chehab

There are several issues on the documentation:
- the media.h header were not properly referenced;
- verbatim expressions were not properly marked as such;
- struct member references were wrong;
- some notes were not using the right markup;
- a comment that were moved to the kernel-doc markup were

    duplicated as a comment inside the struct media_entity;

- some args were not pointing to the struct they're using;
- macros weren't documented.

---
 include/media/media-device.h  | 115 ++++++++++++--------
 include/media/media-devnode.h |   2 +-
 include/media/media-entity.h  | 237 ++++++++++++++++++++++++++++--------------
 3 files changed, 231 insertions(+), 123 deletions(-)
include/media/media-device.h +73 -42
index 28195242386c..481dd6c672cb 100644
@@ -53,7 +53,7 @@ struct media_entity_notify {
  * @dev:	Parent device
  * @devnode:	Media device node
  * @driver_name: Optional device driver name. If not set, calls to
- *		%MEDIA_IOC_DEVICE_INFO will return dev->driver->name.
+ *		%MEDIA_IOC_DEVICE_INFO will return ``dev->driver->name``.
  *		This is needed for USB drivers for example, as otherwise
  *		they'll all appear as if the driver name was "usb".
  * @model:	Device model name
@@ -102,16 +102,18 @@ struct media_entity_notify {
  * sink entity  and deactivate the link between them. Drivers
  * should call this handler to release the source.
  *
- * Note: Bridge driver is expected to implement and set the
- * handler when media_device is registered or when
- * bridge driver finds the media_device during probe.
- * Bridge driver sets source_priv with information
- * necessary to run enable/disable source handlers.
- *
  * Use-case: find tuner entity connected to the decoder
  * entity and check if it is available, and activate the
- * the link between them from enable_source and deactivate
- * from disable_source.
+ * the link between them from @enable_source and deactivate
+ * from @disable_source.
+ *
+ * .. note::
+ *
+ *    Bridge driver is expected to implement and set the
+ *    handler when &media_device is registered or when
+ *    bridge driver finds the media_device during probe.
+ *    Bridge driver sets source_priv with information
+ *    necessary to run @enable_source and @disable_source handlers.
  */
 struct media_device {
 	/* dev->driver_data points to this struct. */
@@ -168,7 +170,7 @@ struct usb_device;
  * @ent_enum: Entity enumeration to be initialised
  * @mdev: The related media device
  *
- * Returns zero on success or a negative error code.
+ * Return: zero on success or a negative error code.
  */
 static inline __must_check int media_entity_enum_init(
 	struct media_entity_enum *ent_enum, struct media_device *mdev)
@@ -211,36 +213,38 @@ void media_device_cleanup(struct media_device *mdev);
  *
  * Users, should, instead, call the media_device_register() macro.
  *
- * The caller is responsible for initializing the media_device structure before
- * registration. The following fields must be set:
+ * The caller is responsible for initializing the &media_device structure
+ * before registration. The following fields of &media_device must be set:
  *
- *  - dev must point to the parent device (usually a &pci_dev, &usb_interface or
- *    &platform_device instance).
+ *  - &media_entity.dev must point to the parent device (usually a &pci_dev,
+ *    &usb_interface or &platform_device instance).
  *
- *  - model must be filled with the device model name as a NUL-terminated UTF-8
- *    string. The device/model revision must not be stored in this field.
+ *  - &media_entity.model must be filled with the device model name as a
+ *    NUL-terminated UTF-8 string. The device/model revision must not be
+ *    stored in this field.
  *
  * The following fields are optional:
  *
- *  - serial is a unique serial number stored as a NUL-terminated ASCII string.
- *    The field is big enough to store a GUID in text form. If the hardware
- *    doesn't provide a unique serial number this field must be left empty.
+ *  - &media_entity.serial is a unique serial number stored as a
+ *    NUL-terminated ASCII string. The field is big enough to store a GUID
+ *    in text form. If the hardware doesn't provide a unique serial number
+ *    this field must be left empty.
  *
- *  - bus_info represents the location of the device in the system as a
- *    NUL-terminated ASCII string. For PCI/PCIe devices bus_info must be set to
- *    "PCI:" (or "PCIe:") followed by the value of pci_name(). For USB devices,
- *    the usb_make_path() function must be used. This field is used by
- *    applications to distinguish between otherwise identical devices that don't
- *    provide a serial number.
+ *  - &media_entity.bus_info represents the location of the device in the
+ *    system as a NUL-terminated ASCII string. For PCI/PCIe devices
+ *    &media_entity.bus_info must be set to "PCI:" (or "PCIe:") followed by
+ *    the value of pci_name(). For USB devices,the usb_make_path() function
+ *    must be used. This field is used by applications to distinguish between
+ *    otherwise identical devices that don't provide a serial number.
  *
- *  - hw_revision is the hardware device revision in a driver-specific format.
- *    When possible the revision should be formatted with the KERNEL_VERSION
- *    macro.
+ *  - &media_entity.hw_revision is the hardware device revision in a
+ *    driver-specific format. When possible the revision should be formatted
+ *    with the KERNEL_VERSION() macro.
  *
- *  - driver_version is formatted with the KERNEL_VERSION macro. The version
- *    minor must be incremented when new features are added to the userspace API
- *    without breaking binary compatibility. The version major must be
- *    incremented when binary compatibility is broken.
+ *  - &media_entity.driver_version is formatted with the KERNEL_VERSION()
+ *    macro. The version minor must be incremented when new features are added
+ *    to the userspace API without breaking binary compatibility. The version
+ *    major must be incremented when binary compatibility is broken.
  *
  * .. note::
  *
@@ -252,6 +256,16 @@ void media_device_cleanup(struct media_device *mdev);
  */
 int __must_check __media_device_register(struct media_device *mdev,
 					 struct module *owner);
+
+
+/**
+ * media_device_register() - Registers a media device element
+ *
+ * @mdev:	pointer to struct &media_device
+ *
+ * This macro calls __media_device_register() passing %THIS_MODULE as
+ * the __media_device_register() second argument (**owner**).
+ */
 #define media_device_register(mdev) __media_device_register(mdev, THIS_MODULE)
 
 /**
@@ -259,7 +273,6 @@ int __must_check __media_device_register(struct media_device *mdev,
  *
  * @mdev:	pointer to struct &media_device
  *
- *
  * It is safe to call this function on an unregistered (but initialised)
  * media device.
  */
@@ -285,14 +298,15 @@ void media_device_unregister(struct media_device *mdev);
  * framework.
  *
  * If the device has pads, media_entity_pads_init() should be called before
- * this function. Otherwise, the &media_entity.@pad and &media_entity.@num_pads
+ * this function. Otherwise, the &media_entity.pad and &media_entity.num_pads
  * should be zeroed before calling this function.
  *
  * Entities have flags that describe the entity capabilities and state:
  *
- * %MEDIA_ENT_FL_DEFAULT indicates the default entity for a given type.
- *	This can be used to report the default audio and video devices or the
- *	default camera sensor.
+ * %MEDIA_ENT_FL_DEFAULT
+ *    indicates the default entity for a given type.
+ *    This can be used to report the default audio and video devices or the
+ *    default camera sensor.
  *
  * .. note::
  *
@@ -331,8 +345,10 @@ void media_device_unregister_entity(struct media_entity *entity);
  * @mdev:      The media device
  * @nptr:      The media_entity_notify
  *
- * Note: When a new entity is registered, all the registered
- * media_entity_notify callbacks are invoked.
+ * .. note::
+ *
+ *    When a new entity is registered, all the registered
+ *    media_entity_notify callbacks are invoked.
  */
 
 int __must_check media_device_register_entity_notify(struct media_device *mdev,
@@ -410,11 +426,13 @@ void media_device_pci_init(struct media_device *mdev,
  * @board_name:	media device name. If %NULL, the routine will use the usb
  *		product name, if available.
  * @driver_name: name of the driver. if %NULL, the routine will use the name
- *		given by udev->dev->driver->name, with is usually the wrong
+ *		given by ``udev->dev->driver->name``, with is usually the wrong
  *		thing to do.
  *
- * NOTE: It is better to call media_device_usb_init() instead, as
- * such macro fills driver_name with %KBUILD_MODNAME.
+ * .. note::
+ *
+ *    It is better to call media_device_usb_init() instead, as
+ *    such macro fills driver_name with %KBUILD_MODNAME.
  */
 void __media_device_usb_init(struct media_device *mdev,
 			     struct usb_device *udev,
@@ -472,6 +490,19 @@ static inline void __media_device_usb_init(struct media_device *mdev,
 
 #endif /* CONFIG_MEDIA_CONTROLLER */
 
+/**
+ * media_device_usb_init() - create and initialize a
+ *	struct &media_device from a PCI device.
+ *
+ * @mdev:	pointer to struct &media_device
+ * @udev:	pointer to struct usb_device
+ * @name:	media device name. If %NULL, the routine will use the usb
+ *		product name, if available.
+ *
+ * This macro calls media_device_usb_init() passing the
+ * media_device_usb_init() **driver_name** parameter filled with
+ * %KBUILD_MODNAME.
+ */
 #define media_device_usb_init(mdev, udev, name) \
 	__media_device_usb_init(mdev, udev, name, KBUILD_MODNAME)
 
include/media/media-devnode.h +1 -1
index 37d494805944..972168e90413 100644
@@ -75,7 +75,7 @@ struct media_file_operations {
  * @cdev:	struct cdev pointer character device
  * @parent:	parent device
  * @minor:	device node minor number
- * @flags:	flags, combination of the MEDIA_FLAG_* constants
+ * @flags:	flags, combination of the ``MEDIA_FLAG_*`` constants
  * @release:	release callback called at the end of media_devnode_release()
  *
  * This structure represents a media-related device node.
include/media/media-entity.h +157 -80

510 lines not on this page · raw message

Signature · 1 line
2.7.4
#13 lore raw

PATCH 12/47 conf_nitpick.py: ignore external functions used on mediactl

In reply to Mauro Carvalho Chehab

There are some functions/macros used by the mediactl documentation that are alien to the media subsystem. Ignore them.

After this patch, the media core will only complain about this
static function:
Documentation/media/kapi/mc-core.rst:97: WARNING: c:func reference target not found: media_devnode_release

---
 Documentation/media/conf_nitpick.py | 3 +++
 1 file changed, 3 insertions(+)
Documentation/media/conf_nitpick.py +3 -0
index 4de9533ce361..1c7928abace5 100644
@@ -28,6 +28,7 @@ nitpick_ignore = [
     ("c:func", "i2c_new_device"),
     ("c:func", "ioctl"),
     ("c:func", "IS_ERR"),
+    ("c:func", "KERNEL_VERSION"),
     ("c:func", "mmap"),
     ("c:func", "open"),
     ("c:func", "pci_name"),
@@ -66,6 +67,7 @@ nitpick_ignore = [
     ("c:type", "off_t"),
     ("c:type", "pci_dev"),
     ("c:type", "pdvbdev"),
+    ("c:type", "platform_device"),
     ("c:type", "pollfd"),
     ("c:type", "poll_table_struct"),
     ("c:type", "s32"),
@@ -93,5 +95,6 @@ nitpick_ignore = [
     ("c:type", "union"),
     ("c:type", "__user"),
     ("c:type", "usb_device"),
+    ("c:type", "usb_interface"),
     ("c:type", "video_system_t"),
 ]
Signature · 1 line
2.7.4
#14 lore raw

PATCH 13/47 rc-map.h: document structs/enums on it

In reply to Mauro Carvalho Chehab

There are some structs/enums that aren't documented via kernel-doc markup. Add documentation for them.

Fix those warnings:
./include/media/rc-map.h:103: WARNING: c:type reference target not found: rc_map_list ./include/media/rc-map.h:110: WARNING: c:type reference target not found: rc_map_list ./include/media/rc-map.h:117: WARNING: c:type reference target not found: rc_map

---
 include/media/rc-map.h | 94 ++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 71 insertions(+), 23 deletions(-)
include/media/rc-map.h +71 -23
index daa75fcc1ff1..173ad58fb61b 100644
@@ -11,27 +11,51 @@
 
 #include <linux/input.h>
 
+/**
+ * enum rc_type - type of the Remote Controller protocol
+ *
+ * @RC_TYPE_UNKNOWN: Protocol not known
+ * @RC_TYPE_OTHER: Protocol known but proprietary
+ * @RC_TYPE_RC5: Philips RC5 protocol
+ * @RC_TYPE_RC5X: Philips RC5x protocol
+ * @RC_TYPE_RC5_SZ: StreamZap variant of RC5
+ * @RC_TYPE_JVC: JVC protocol
+ * @RC_TYPE_SONY12: Sony 12 bit protocol
+ * @RC_TYPE_SONY15: Sony 15 bit protocol
+ * @RC_TYPE_SONY20: Sony 20 bit protocol
+ * @RC_TYPE_NEC: NEC protocol
+ * @RC_TYPE_SANYO: Sanyo protocol
+ * @RC_TYPE_MCE_KBD: RC6-ish MCE keyboard/mouse
+ * @RC_TYPE_RC6_0: Philips RC6-0-16 protocol
+ * @RC_TYPE_RC6_6A_20: Philips RC6-6A-20 protocol
+ * @RC_TYPE_RC6_6A_24: Philips RC6-6A-24 protocol
+ * @RC_TYPE_RC6_6A_32: Philips RC6-6A-32 protocol
+ * @RC_TYPE_RC6_MCE: MCE (Philips RC6-6A-32 subtype) protocol
+ * @RC_TYPE_SHARP: Sharp protocol
+ * @RC_TYPE_XMP: XMP protocol
+ * @RC_TYPE_CEC: CEC protocol
+ */
 enum rc_type {
-	RC_TYPE_UNKNOWN		= 0,	/* Protocol not known */
-	RC_TYPE_OTHER		= 1,	/* Protocol known but proprietary */
-	RC_TYPE_RC5		= 2,	/* Philips RC5 protocol */
-	RC_TYPE_RC5X		= 3,	/* Philips RC5x protocol */
-	RC_TYPE_RC5_SZ		= 4,	/* StreamZap variant of RC5 */
-	RC_TYPE_JVC		= 5,	/* JVC protocol */
-	RC_TYPE_SONY12		= 6,	/* Sony 12 bit protocol */
-	RC_TYPE_SONY15		= 7,	/* Sony 15 bit protocol */
-	RC_TYPE_SONY20		= 8,	/* Sony 20 bit protocol */
-	RC_TYPE_NEC		= 9,	/* NEC protocol */
-	RC_TYPE_SANYO		= 10,	/* Sanyo protocol */
-	RC_TYPE_MCE_KBD		= 11,	/* RC6-ish MCE keyboard/mouse */
-	RC_TYPE_RC6_0		= 12,	/* Philips RC6-0-16 protocol */
-	RC_TYPE_RC6_6A_20	= 13,	/* Philips RC6-6A-20 protocol */
-	RC_TYPE_RC6_6A_24	= 14,	/* Philips RC6-6A-24 protocol */
-	RC_TYPE_RC6_6A_32	= 15,	/* Philips RC6-6A-32 protocol */
-	RC_TYPE_RC6_MCE		= 16,	/* MCE (Philips RC6-6A-32 subtype) protocol */
-	RC_TYPE_SHARP		= 17,	/* Sharp protocol */
-	RC_TYPE_XMP		= 18,	/* XMP protocol */
-	RC_TYPE_CEC		= 19,	/* CEC protocol */
+	RC_TYPE_UNKNOWN		= 0,
+	RC_TYPE_OTHER		= 1,
+	RC_TYPE_RC5		= 2,
+	RC_TYPE_RC5X		= 3,
+	RC_TYPE_RC5_SZ		= 4,
+	RC_TYPE_JVC		= 5,
+	RC_TYPE_SONY12		= 6,
+	RC_TYPE_SONY15		= 7,
+	RC_TYPE_SONY20		= 8,
+	RC_TYPE_NEC		= 9,
+	RC_TYPE_SANYO		= 10,
+	RC_TYPE_MCE_KBD		= 11,
+	RC_TYPE_RC6_0		= 12,
+	RC_TYPE_RC6_6A_20	= 13,
+	RC_TYPE_RC6_6A_24	= 14,
+	RC_TYPE_RC6_6A_32	= 15,
+	RC_TYPE_RC6_MCE		= 16,
+	RC_TYPE_SHARP		= 17,
+	RC_TYPE_XMP		= 18,
+	RC_TYPE_CEC		= 19,
 };
 
 #define RC_BIT_NONE		0ULL
@@ -76,21 +100,45 @@ enum rc_type {
 #define RC_SCANCODE_RC6_0(sys, cmd)		(((sys) << 8) | (cmd))
 #define RC_SCANCODE_RC6_6A(vendor, sys, cmd)	(((vendor) << 16) | ((sys) << 8) | (cmd))
 
+/**
+ * struct rc_map_table - represents a scancode/keycode pair
+ *
+ * @scancode: scan code (u32)
+ * @keycode: Linux input keycode
+ */
 struct rc_map_table {
 	u32	scancode;
 	u32	keycode;
 };
 
+/**
+ * struct rc_map - represents a keycode map table
+ *
+ * @scan: pointer to struct &rc_map_table
+ * @size: Max number of entries
+ * @len: Number of entries that are in use
+ * @alloc: size of *scan, in bytes
+ * @rc_type: type of the remote controller protocol, as defined at
+ *	     enum &rc_type
+ * @name: name of the key map table
+ * @lock: lock to protect access to this structure
+ */
 struct rc_map {
 	struct rc_map_table	*scan;
-	unsigned int		size;	/* Max number of entries */
-	unsigned int		len;	/* Used number of entries */
-	unsigned int		alloc;	/* Size of *scan in bytes */
+	unsigned int		size;
+	unsigned int		len;
+	unsigned int		alloc;
 	enum rc_type		rc_type;
 	const char		*name;
 	spinlock_t		lock;
 };
 
+/**
+ * struct rc_map_list - list of the registered &rc_map maps
+ *
+ * @list: pointer to struct &list_head
+ * @map: pointer to struct &rc_map
+ */
 struct rc_map_list {
 	struct list_head	 list;
 	struct rc_map map;
Signature · 1 line
2.7.4
#15 lore raw

PATCH 14/47 v4l2-ctrls: document some extra data structures

In reply to Mauro Carvalho Chehab

The typedefs and a macro are not defined. While here, improve a few bits on the documentation.

---
 include/media/v4l2-ctrls.h | 51 +++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 44 insertions(+), 7 deletions(-)
include/media/v4l2-ctrls.h +44 -7
index 178a88d45aea..a63f37044f1c 100644
@@ -93,6 +93,16 @@ struct v4l2_ctrl_type_ops {
 			union v4l2_ctrl_ptr ptr);
 };
 
+/**
+ * typedef v4l2_ctrl_notify_fnc - typedef for a notify argument with a function
+ * 	that should be called when a control value has changed.
+ *
+ * @ctrl: pointer to struct &v4l2_ctrl
+ * @priv: control private data
+ *
+ * This typedef definition is used as an argument to v4l2_ctrl_notify()
+ * and as an argument at struct &v4l2_ctrl_handler.
+ */
 typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
 
 /**
@@ -369,17 +379,38 @@ void v4l2_ctrl_fill(u32 id, const char **name, enum v4l2_ctrl_type *type,
  * @key:	Used by the lock validator if CONFIG_LOCKDEP is set.
  * @name:	Used by the lock validator if CONFIG_LOCKDEP is set.
  *
- * Returns an error if the buckets could not be allocated. This error will
- * also be stored in @hdl->error.
+ * .. attention::
  *
- * Never use this call directly, always use the v4l2_ctrl_handler_init
- * macro that hides the @key and @name arguments.
+ *    Never use this call directly, always use the v4l2_ctrl_handler_init()
+ *    macro that hides the @key and @name arguments.
+ *
+ * Return: returns an error if the buckets could not be allocated. This
+ * error will also be stored in @hdl->error.
  */
 int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl,
 				 unsigned int nr_of_controls_hint,
 				 struct lock_class_key *key, const char *name);
 
 #ifdef CONFIG_LOCKDEP
+
+/**
+ * v4l2_ctrl_handler_init -
+ *
+ * @hdl:	The control handler.
+ * @nr_of_controls_hint: A hint of how many controls this handler is
+ *		expected to refer to. This is the total number, so including
+ *		any inherited controls. It doesn't have to be precise, but if
+ *		it is way off, then you either waste memory (too many buckets
+ *		are allocated) or the control lookup becomes slower (not enough
+ *		buckets are allocated, so there are more slow list lookups).
+ *		It will always work, though.
+ *
+ * This helper function creates a static struct &lock_class_key and
+ * calls v4l2_ctrl_handler_init_class(), providing a proper name for the lock
+ * validador.
+ *
+ * Use this helper function to initialize a control handler.
+ */
 #define v4l2_ctrl_handler_init(hdl, nr_of_controls_hint)		\
 (									\
 	({								\
@@ -564,6 +595,13 @@ struct v4l2_ctrl *v4l2_ctrl_new_int_menu(struct v4l2_ctrl_handler *hdl,
 					 u32 id, u8 max, u8 def,
 					 const s64 *qmenu_int);
 
+/**
+ * typedef v4l2_ctrl_filter - Typedef to define the filter function to be
+ *	used when adding a control handler.
+ *
+ * @ctrl: pointer to struct &v4l2_ctrl.
+ */
+
 typedef bool (*v4l2_ctrl_filter)(const struct v4l2_ctrl *ctrl);
 
 /**
@@ -635,8 +673,8 @@ void v4l2_ctrl_cluster(unsigned int ncontrols, struct v4l2_ctrl **controls);
  * be marked active, and any reads will just return the current value without
  * going through g_volatile_ctrl.
  *
- * In addition, this function will set the V4L2_CTRL_FLAG_UPDATE flag
- * on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
+ * In addition, this function will set the %V4L2_CTRL_FLAG_UPDATE flag
+ * on the autofoo control and %V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
  * if autofoo is in auto mode.
  */
 void v4l2_ctrl_auto_cluster(unsigned int ncontrols,
@@ -686,7 +724,6 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active);
  */
 void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed);
 
-
 /**
  *__v4l2_ctrl_modify_range() - Unlocked variant of v4l2_ctrl_modify_range()
  *
Signature · 1 line
2.7.4
#16 lore raw

PATCH 15/47 docs-rst: convert uAPI structs to C domain

In reply to Mauro Carvalho Chehab

instead of declaring the uAPI structs using usual refs, e. g.:

	.. _foo-struct:

Use the C domain way:

	.. c:type:: foo_struct

This way, the kAPI documentation can use cross-references to point to the uAPI symbols.

That solves about ~100 undefined warnings like:
WARNING: c:type reference target not found: foo_struct

---
 Documentation/media/kapi/v4l2-event.rst            |   6 +-
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst         |   4 +-
 .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst    |   2 +-
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst   |   2 +-
 Documentation/media/uapi/cec/cec-ioc-receive.rst   |   2 +-
 Documentation/media/uapi/dvb/audio_data_types.rst  |   6 +-
 Documentation/media/uapi/dvb/ca_data_types.rst     |  12 +--
 Documentation/media/uapi/dvb/dmx_types.rst         |  10 +-
 Documentation/media/uapi/dvb/dtv-fe-stats.rst      |   2 +-
 Documentation/media/uapi/dvb/dtv-properties.rst    |   2 +-
 Documentation/media/uapi/dvb/dtv-property.rst      |   2 +-
 Documentation/media/uapi/dvb/dtv-stats.rst         |   2 +-
 .../media/uapi/dvb/dvb-frontend-event.rst          |   2 +-
 .../media/uapi/dvb/dvb-frontend-parameters.rst     |  10 +-
 Documentation/media/uapi/dvb/dvbproperty.rst       |   2 +-
 .../media/uapi/dvb/fe-diseqc-recv-slave-reply.rst  |   4 +-
 .../media/uapi/dvb/fe-diseqc-send-master-cmd.rst   |   4 +-
 Documentation/media/uapi/dvb/fe-get-info.rst       |   4 +-
 Documentation/media/uapi/dvb/fe-get-property.rst   |   2 +-
 Documentation/media/uapi/dvb/fe-type-t.rst         |   4 +-
 .../media/uapi/dvb/frontend-stat-properties.rst    |   2 +-
 Documentation/media/uapi/dvb/net-add-if.rst        |   6 +-
 Documentation/media/uapi/dvb/net-get-if.rst        |   6 +-
 Documentation/media/uapi/dvb/video_types.rst       |  16 +--
 .../media/uapi/mediactl/media-ioc-device-info.rst  |   4 +-
 .../uapi/mediactl/media-ioc-enum-entities.rst      |   6 +-
 .../media/uapi/mediactl/media-ioc-enum-links.rst   |  22 ++---
 .../media/uapi/mediactl/media-ioc-g-topology.rst   |  14 +--
 .../media/uapi/mediactl/media-ioc-setup-link.rst   |   4 +-
 Documentation/media/uapi/v4l/audio.rst             |  12 +--
 Documentation/media/uapi/v4l/buffer.rst            |  40 ++++----
 Documentation/media/uapi/v4l/crop.rst              |  14 +--
 Documentation/media/uapi/v4l/dev-capture.rst       |  16 +--
 Documentation/media/uapi/v4l/dev-osd.rst           |  18 ++--
 Documentation/media/uapi/v4l/dev-output.rst        |  16 +--
 Documentation/media/uapi/v4l/dev-overlay.rst       |  22 ++---
 Documentation/media/uapi/v4l/dev-radio.rst         |   2 +-
 Documentation/media/uapi/v4l/dev-raw-vbi.rst       |  14 +--
 Documentation/media/uapi/v4l/dev-rds.rst           |  14 +--
 Documentation/media/uapi/v4l/dev-sdr.rst           |  12 +--
 Documentation/media/uapi/v4l/dev-sliced-vbi.rst    |  36 +++----
 Documentation/media/uapi/v4l/dev-subdev.rst        |   4 +-
 Documentation/media/uapi/v4l/dev-touch.rst         |   2 +-
 Documentation/media/uapi/v4l/diff-v4l.rst          |  66 ++++++-------
 Documentation/media/uapi/v4l/dmabuf.rst            |   8 +-
 Documentation/media/uapi/v4l/extended-controls.rst |  10 +-
 Documentation/media/uapi/v4l/field-order.rst       |   8 +-
 Documentation/media/uapi/v4l/format.rst            |   2 +-
 Documentation/media/uapi/v4l/func-mmap.rst         |   8 +-
 Documentation/media/uapi/v4l/func-munmap.rst       |   4 +-
 Documentation/media/uapi/v4l/hist-v4l2.rst         | 108 ++++++++++-----------
 Documentation/media/uapi/v4l/mmap.rst              |  12 +--
 Documentation/media/uapi/v4l/pixfmt-002.rst        |   6 +-
 Documentation/media/uapi/v4l/pixfmt-003.rst        |  22 ++---
 Documentation/media/uapi/v4l/pixfmt-006.rst        |   4 +-
 Documentation/media/uapi/v4l/pixfmt.rst            |   4 +-
 Documentation/media/uapi/v4l/planar-apis.rst       |   8 +-
 Documentation/media/uapi/v4l/rw.rst                |   2 +-
 Documentation/media/uapi/v4l/selection-api-005.rst |  10 +-
 Documentation/media/uapi/v4l/standard.rst          |   8 +-
 Documentation/media/uapi/v4l/streaming-par.rst     |   2 +-
 Documentation/media/uapi/v4l/tuner.rst             |  10 +-
 Documentation/media/uapi/v4l/userp.rst             |   8 +-
 Documentation/media/uapi/v4l/v4l2.rst              |   6 +-
 Documentation/media/uapi/v4l/video.rst             |   2 +-
 .../media/uapi/v4l/vidioc-create-bufs.rst          |   8 +-
 Documentation/media/uapi/v4l/vidioc-cropcap.rst    |   6 +-
 .../media/uapi/v4l/vidioc-dbg-g-chip-info.rst      |   4 +-
 .../media/uapi/v4l/vidioc-dbg-g-register.rst       |   6 +-
 .../media/uapi/v4l/vidioc-decoder-cmd.rst          |   6 +-
 Documentation/media/uapi/v4l/vidioc-dqevent.rst    |  40 ++++----
 .../media/uapi/v4l/vidioc-dv-timings-cap.rst       |  10 +-
 .../media/uapi/v4l/vidioc-encoder-cmd.rst          |   4 +-
 .../media/uapi/v4l/vidioc-enum-dv-timings.rst      |  10 +-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |   6 +-
 .../media/uapi/v4l/vidioc-enum-frameintervals.rst  |  16 +--
 .../media/uapi/v4l/vidioc-enum-framesizes.rst      |  12 +--
 .../media/uapi/v4l/vidioc-enum-freq-bands.rst      |  14 +--
 Documentation/media/uapi/v4l/vidioc-enumaudio.rst  |   4 +-
 .../media/uapi/v4l/vidioc-enumaudioout.rst         |   4 +-
 Documentation/media/uapi/v4l/vidioc-enuminput.rst  |   8 +-
 Documentation/media/uapi/v4l/vidioc-enumoutput.rst |   8 +-
 Documentation/media/uapi/v4l/vidioc-enumstd.rst    |  12 +--
 Documentation/media/uapi/v4l/vidioc-expbuf.rst     |  12 +--
 Documentation/media/uapi/v4l/vidioc-g-audio.rst    |   6 +-
 Documentation/media/uapi/v4l/vidioc-g-audioout.rst |   6 +-
 Documentation/media/uapi/v4l/vidioc-g-crop.rst     |  10 +-
 Documentation/media/uapi/v4l/vidioc-g-ctrl.rst     |  10 +-
 .../media/uapi/v4l/vidioc-g-dv-timings.rst         |  10 +-
 .../media/uapi/v4l/vidioc-g-enc-index.rst          |   8 +-
 .../media/uapi/v4l/vidioc-g-ext-ctrls.rst          |  26 ++---
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst     |  18 ++--
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst      |  24 ++---
 .../media/uapi/v4l/vidioc-g-frequency.rst          |  20 ++--
 Documentation/media/uapi/v4l/vidioc-g-input.rst    |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst |   2 +-
 .../media/uapi/v4l/vidioc-g-modulator.rst          |   8 +-
 Documentation/media/uapi/v4l/vidioc-g-output.rst   |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-parm.rst     |  22 ++---
 .../media/uapi/v4l/vidioc-g-selection.rst          |  28 +++---
 .../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst     |   4 +-
 Documentation/media/uapi/v4l/vidioc-g-std.rst      |   4 +-
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst    |  12 +--
 .../media/uapi/v4l/vidioc-prepare-buf.rst          |   2 +-
 Documentation/media/uapi/v4l/vidioc-qbuf.rst       |  20 ++--
 .../media/uapi/v4l/vidioc-query-dv-timings.rst     |   2 +-
 Documentation/media/uapi/v4l/vidioc-querybuf.rst   |  14 +--
 Documentation/media/uapi/v4l/vidioc-querycap.rst   |   8 +-
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst  |   4 +-
 Documentation/media/uapi/v4l/vidioc-reqbufs.rst    |   6 +-
 .../media/uapi/v4l/vidioc-s-hw-freq-seek.rst       |  22 ++---
 Documentation/media/uapi/v4l/vidioc-streamon.rst   |   2 +-
 .../uapi/v4l/vidioc-subdev-enum-frame-interval.rst |   2 +-
 .../media/uapi/v4l/vidioc-subdev-g-crop.rst        |   2 +-
 .../uapi/v4l/vidioc-subdev-g-frame-interval.rst    |   2 +-
 .../media/uapi/v4l/vidioc-subdev-g-selection.rst   |   2 +-
 .../media/uapi/v4l/vidioc-subscribe-event.rst      |   2 +-
 117 files changed, 603 insertions(+), 603 deletions(-)
Documentation/media/kapi/v4l2-event.rst +3 -3
index f962686a7b63..9a5e31546ae3 100644
@@ -40,7 +40,7 @@ A good example of these ``replace``/``merge`` callbacks is in v4l2-event.c:
 In order to queue events to video device, drivers should call:
 
 	:c:func:`v4l2_event_queue <v4l2_event_queue>`
-	(:c:type:`vdev <video_device>`, :ref:`ev <v4l2-event>`)
+	(:c:type:`vdev <video_device>`, :c:type:`ev <v4l2_event>`)
 
 The driver's only responsibility is to fill in the type and the data fields.
 The other fields will be filled in by V4L2.
@@ -51,7 +51,7 @@ Event subscription
 Subscribing to an event is via:
 
 	:c:func:`v4l2_event_subscribe <v4l2_event_subscribe>`
-	(:c:type:`fh <v4l2_fh>`, :ref:`sub <v4l2-event-subscription>` ,
+	(:c:type:`fh <v4l2_fh>`, :c:type:`sub <v4l2_event_subscription>` ,
 	elems, :c:type:`ops <v4l2_subscribed_event_ops>`)
 
 
@@ -86,7 +86,7 @@ Unsubscribing an event
 Unsubscribing to an event is via:
 
 	:c:func:`v4l2_event_unsubscribe <v4l2_event_unsubscribe>`
-	(:c:type:`fh <v4l2_fh>`, :ref:`sub <v4l2-event-subscription>`)
+	(:c:type:`fh <v4l2_fh>`, :c:type:`sub <v4l2_event_subscription>`)
 
 This function is used to implement :c:type:`video_device`->
 :c:type:`ioctl_ops <v4l2_ioctl_ops>`-> ``vidioc_unsubscribe_event``.
Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst +2 -2
index 14d7f6a19455..a35dca281178 100644
@@ -36,12 +36,12 @@ Description
 
 All cec devices must support :ref:`ioctl CEC_ADAP_G_CAPS <CEC_ADAP_G_CAPS>`. To query
 device information, applications call the ioctl with a pointer to a
-struct :ref:`cec_caps <cec-caps>`. The driver fills the structure and
+struct :c:type:`cec_caps`. The driver fills the structure and
 returns the information to the application. The ioctl never fails.
 
 .. tabularcolumns:: |p{1.2cm}|p{2.5cm}|p{13.8cm}|
 
-.. _cec-caps:
+.. c:type:: cec_caps
 
 .. flat-table:: struct cec_caps
     :header-rows:  0
Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst +1 -1
index 1a920109072c..bd0756ff022e 100644
@@ -68,7 +68,7 @@ logical address types are already defined will return with error ``EBUSY``.
 
 .. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}|
 
-.. _cec-log-addrs:
+.. c:type:: cec_log_addrs
 
 .. cssclass:: longtable
 
Documentation/media/uapi/cec/cec-ioc-dqevent.rst +1 -1
index b7f104802045..10228eb0fd4a 100644
@@ -105,7 +105,7 @@ it is guaranteed that the state did change in between the two events.
 
 .. tabularcolumns:: |p{1.0cm}|p{4.2cm}|p{2.5cm}|p{8.8cm}|
 
-.. _cec-event:
+.. c:type:: cec_event
 
 .. flat-table:: struct cec_event
     :header-rows:  0
Documentation/media/uapi/cec/cec-ioc-receive.rst +1 -1
index 025a3851ab76..f015f1259b27 100644
@@ -76,7 +76,7 @@ result.
 
 .. tabularcolumns:: |p{1.0cm}|p{3.5cm}|p{13.0cm}|
 
-.. _cec-msg:
+.. c:type:: cec_msg
 
 .. cssclass:: longtable
 
Documentation/media/uapi/dvb/audio_data_types.rst +3 -3
index 4a53127eb13a..0b14c2dfc98c 100644
@@ -71,7 +71,7 @@ the following values.
     } audio_channel_select_t;
 
 
-.. _audio-status:
+.. c:type:: audio_status
 
 struct audio_status
 ===================
@@ -93,7 +93,7 @@ about various states of the playback operation.
     } audio_status_t;
 
 
-.. _audio-mixer:
+.. c:type:: audio_mixer
 
 struct audio_mixer
 ==================
@@ -132,7 +132,7 @@ following bits set according to the hardwares capabilities.
      #define AUDIO_CAP_AC3  256
 
 
-.. _audio-karaoke:
+.. c:type:: audio_karaoke
 
 struct audio_karaoke
 ====================
Documentation/media/uapi/dvb/ca_data_types.rst +6 -6
index 025f910ae945..d9e27c77426c 100644
@@ -7,7 +7,7 @@ CA Data Types
 *************
 
 
-.. _ca-slot-info:
+.. c:type:: ca_slot_info
 
 ca_slot_info_t
 ==============
@@ -31,7 +31,7 @@ ca_slot_info_t
     } ca_slot_info_t;
 
 
-.. _ca-descr-info:
+.. c:type:: ca_descr_info
 
 ca_descr_info_t
 ===============
@@ -48,7 +48,7 @@ ca_descr_info_t
     } ca_descr_info_t;
 
 
-.. _ca-caps:
+.. c:type:: ca_caps
 
 ca_caps_t
 =========
@@ -64,7 +64,7 @@ ca_caps_t
      } ca_cap_t;
 
 
-.. _ca-msg:
+.. c:type:: ca_msg
 
 ca_msg_t
 ========
@@ -81,7 +81,7 @@ ca_msg_t
     } ca_msg_t;
 
 
-.. _ca-descr:
+.. c:type:: ca_descr
 
 ca_descr_t
 ==========
@@ -96,7 +96,7 @@ ca_descr_t
     } ca_descr_t;
 
 
-.. _ca-pid:
+.. c:type:: ca_pid
 
 ca-pid
 ======
Documentation/media/uapi/dvb/dmx_types.rst +5 -5
index efd564035958..65de705fa1ef 100644
@@ -120,7 +120,7 @@ dmx_pes_type_t
     } dmx_pes_type_t;
 
 
-.. _dmx-filter:
+.. c:type:: dmx_filter
 
 struct dmx_filter
 =================
@@ -136,7 +136,7 @@ struct dmx_filter
     } dmx_filter_t;
 
 
-.. _dmx-sct-filter-params:
+.. c:type:: dmx_sct_filter_params
 
 struct dmx_sct_filter_params
 ============================
@@ -157,7 +157,7 @@ struct dmx_sct_filter_params
     };
 
 
-.. _dmx-pes-filter-params:
+.. c:type:: dmx_pes_filter_params
 
 struct dmx_pes_filter_params
 ============================
@@ -194,7 +194,7 @@ struct dmx_event
      };
 
 
-.. _dmx-stc:
+.. c:type:: dmx_stc
 
 struct dmx_stc
 ==============
@@ -209,7 +209,7 @@ struct dmx_stc
     };
 
 
-.. _dmx-caps:
+.. c:type:: dmx_caps
 
 struct dmx_caps
 ===============
Documentation/media/uapi/dvb/dtv-fe-stats.rst +1 -1
index 7c105e2ab27e..e8a02a1f138d 100644
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _dtv-fe-stats:
+.. c:type:: dtv_fe_stats
 
 *******************
 struct dtv_fe_stats
Documentation/media/uapi/dvb/dtv-properties.rst +1 -1
index c13be5de4302..48c4e834ad11 100644
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _dtv-properties:
+.. c:type:: dtv_properties
 
 *********************
 struct dtv_properties
Documentation/media/uapi/dvb/dtv-property.rst +1 -1
index 5073a49def2a..3ddc3474b00e 100644
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _dtv-property:
+.. c:type:: dtv_property
 
 *******************
 struct dtv_property
Documentation/media/uapi/dvb/dtv-stats.rst +1 -1
index 2cfdca00f164..35239e72bf74 100644
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _dtv-stats:
+.. c:type:: dtv_stats
 
 ****************
 struct dtv_stats
Documentation/media/uapi/dvb/dvb-frontend-event.rst +1 -1
index 78e72feaa178..2088bc6cacd8 100644
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _dvb-frontend-event:
+.. c:type:: dvb_frontend_event
 
 ***************
 frontend events
Documentation/media/uapi/dvb/dvb-frontend-parameters.rst +5 -5
index 16cb581d5cff..bf31411fc9df 100644
@@ -1,6 +1,6 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _dvb-frontend-parameters:
+.. c:type:: dvb_frontend_parameters
 
 *******************
 frontend parameters
@@ -49,7 +49,7 @@ frontends the ``frequency`` specifies the absolute frequency and is
 given in Hz.
 
 
-.. _dvb-qpsk-parameters:
+.. c:type:: dvb_qpsk_parameters
 
 QPSK parameters
 ===============
@@ -66,7 +66,7 @@ structure:
      };
 
 
-.. _dvb-qam-parameters:
+.. c:type:: dvb_qam_parameters
 
 QAM parameters
 ==============
@@ -83,7 +83,7 @@ for cable QAM frontend you use the ``dvb_qam_parameters`` structure:
      };
 
 
-.. _dvb-vsb-parameters:
+.. c:type:: dvb_vsb_parameters
 
 VSB parameters
 ==============
@@ -98,7 +98,7 @@ ATSC frontends are supported by the ``dvb_vsb_parameters`` structure:
     };
 
 
-.. _dvb-ofdm-parameters:
+.. c:type:: dvb_ofdm_parameters
 
 OFDM parameters
 ===============
Documentation/media/uapi/dvb/dvbproperty.rst +1 -1
index a5a859a45381..906f3e651e10 100644
@@ -23,7 +23,7 @@ union/struct based approach, in favor of a properties set approach.
 .. note::
 
    On Linux DVB API version 3, setting a frontend were done via
-   :ref:`struct dvb_frontend_parameters <dvb-frontend-parameters>`.
+   :c:type:`struct dvb_frontend_parameters <dvb_frontend_parameters>`.
    This got replaced on version 5 (also called "S2API", as this API were
    added originally_enabled to provide support for DVB-S2), because the
    old API has a very limited support to new standards and new hardware.
Documentation/media/uapi/dvb/fe-diseqc-recv-slave-reply.rst +2 -2
index e1b6da08b3a1..9fda5546d8c1 100644
@@ -27,7 +27,7 @@ Arguments
 
 ``argp``
     pointer to struct
-    :ref:`dvb_diseqc_slave_reply <dvb-diseqc-slave-reply>`
+    :c:type:`dvb_diseqc_slave_reply`
 
 
 Description
@@ -35,7 +35,7 @@ Description
 
 Receives reply from a DiSEqC 2.0 command.
 
-.. _dvb-diseqc-slave-reply:
+.. c:type:: dvb_diseqc_slave_reply
 
 struct dvb_diseqc_slave_reply
 -----------------------------
Documentation/media/uapi/dvb/fe-diseqc-send-master-cmd.rst +2 -2
index ea090cbeaae0..72cb4ebd95c0 100644
@@ -27,7 +27,7 @@ Arguments
 
 ``argp``
     pointer to struct
-    :ref:`dvb_diseqc_master_cmd <dvb-diseqc-master-cmd>`
+    :c:type:`dvb_diseqc_master_cmd`
 
 
 Description
@@ -35,7 +35,7 @@ Description
 
 Sends a DiSEqC command to the antenna subsystem.
 
-.. _dvb-diseqc-master-cmd:
+.. c:type:: dvb_diseqc_master_cmd
 
 struct dvb_diseqc_master_cmd
 ============================
Documentation/media/uapi/dvb/fe-get-info.rst +2 -2
index c367b5ab023c..3557b756ef27 100644
@@ -27,7 +27,7 @@ Arguments
 
 ``argp``
     pointer to struct struct
-    :ref:`dvb_frontend_info <dvb-frontend-info>`
+    :c:type:`dvb_frontend_info`
 
 
 Description
@@ -40,7 +40,7 @@ takes a pointer to dvb_frontend_info which is filled by the driver.
 When the driver is not compatible with this specification the ioctl
 returns an error.
 
-.. _dvb-frontend-info:
+.. c:type:: dvb_frontend_info
 
 struct dvb_frontend_info
 ========================
Documentation/media/uapi/dvb/fe-get-property.rst +1 -1
index 51daf016a8eb..015d4db597b5 100644
@@ -29,7 +29,7 @@ Arguments
     File descriptor returned by :ref:`open() <frontend_f_open>`.
 
 ``argp``
-    pointer to struct :ref:`dtv_properties <dtv-properties>`
+    pointer to struct :c:type:`dtv_properties`
 
 
 Description
Documentation/media/uapi/dvb/fe-type-t.rst +2 -2
index fa377fe9e104..03a6c75bf5de 100644
@@ -78,7 +78,7 @@ at the above, as they're supported via the new
 ioctl's, using the :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>`
 parameter.
 
-In the old days, struct :ref:`dvb_frontend_info <dvb-frontend-info>`
+In the old days, struct :c:type:`dvb_frontend_info`
 used to contain ``fe_type_t`` field to indicate the delivery systems,
 filled with either FE_QPSK, FE_QAM, FE_OFDM or FE_ATSC. While this
 is still filled to keep backward compatibility, the usage of this field
@@ -87,7 +87,7 @@ devices support multiple delivery systems. Please use
 :ref:`DTV_ENUM_DELSYS <DTV-ENUM-DELSYS>` instead.
 
 On devices that support multiple delivery systems, struct
-:ref:`dvb_frontend_info <dvb-frontend-info>`::``fe_type_t`` is
+:c:type:`dvb_frontend_info`::``fe_type_t`` is
 filled with the currently standard, as selected by the last call to
 :ref:`FE_SET_PROPERTY <FE_GET_PROPERTY>` using the
 :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>` property.
Documentation/media/uapi/dvb/frontend-stat-properties.rst +1 -1
index 0fc4aaa304ff..e73754fd0631 100644
@@ -20,7 +20,7 @@ standards, up to 3 groups of statistics can be provided, and
 plus one metric per each carrier group (called "layer" on ISDB).
 
 So, in order to be consistent with other delivery systems, the first
-value at :ref:`dtv_property.stat.dtv_stats <dtv-stats>` array refers
+value at :c:type:`dtv_property.stat.dtv_stats <dtv_stats>` array refers
 to the global metric. The other elements of the array represent each
 layer, starting from layer A(index 1), layer B (index 2) and so on.
 
Documentation/media/uapi/dvb/net-add-if.rst +3 -3
index dfb4509f816c..dbe80c91bdb0 100644
@@ -26,7 +26,7 @@ Arguments
     File descriptor returned by :ref:`open() <frontend_f_open>`.
 
 ``net_if``
-    pointer to struct :ref:`dvb_net_if <dvb-net-if>`
+    pointer to struct :c:type:`dvb_net_if`
 
 
 Description
@@ -38,7 +38,7 @@ ULE) and the interface number for the new interface to be created. When
 the system call successfully returns, a new virtual network interface is
 created.
 
-The struct :ref:`dvb_net_if <dvb-net-if>`::ifnum field will be
+The struct :c:type:`dvb_net_if`::ifnum field will be
 filled with the number of the created interface.
 
 
@@ -47,7 +47,7 @@ filled with the number of the created interface.
 struct dvb_net_if description
 =============================
 
-.. _dvb-net-if:
+.. c:type:: dvb_net_if
 
 .. flat-table:: struct dvb_net_if
     :header-rows:  1
Documentation/media/uapi/dvb/net-get-if.rst +3 -3
index dd9d6a3c4a2b..1bb8ee0cbced 100644
@@ -26,15 +26,15 @@ Arguments
     File descriptor returned by :ref:`open() <frontend_f_open>`.
 
 ``net_if``
-    pointer to struct :ref:`dvb_net_if <dvb-net-if>`
+    pointer to struct :c:type:`dvb_net_if`
 
 
 Description
 ===========
 
 The NET_GET_IF ioctl uses the interface number given by the struct
-:ref:`dvb_net_if <dvb-net-if>`::ifnum field and fills the content of
-struct :ref:`dvb_net_if <dvb-net-if>` with the packet ID and
+:c:type:`dvb_net_if`::ifnum field and fills the content of
+struct :c:type:`dvb_net_if` with the packet ID and
 encapsulation type used on such interface. If the interface was not
 created yet with :ref:`NET_ADD_IF <net>`, it will return -1 and fill
 the ``errno`` with ``EINVAL`` error code.
Documentation/media/uapi/dvb/video_types.rst +8 -8
index 671f365ceeb4..640a21de6b8a 100644
@@ -95,7 +95,7 @@ representing the state of video playback.
     } video_play_state_t;
 
 
-.. _video-command:
+.. c:type:: video_command
 
 struct video_command
 ====================
@@ -146,7 +146,7 @@ video_size_t
     } video_size_t;
 
 
-.. _video-event:
+.. c:type:: video_event
 
 struct video_event
 ==================
@@ -172,7 +172,7 @@ VIDEO_GET_EVENT call.
     };
 
 
-.. _video-status:
+.. c:type:: video_status
 
 struct video_status
 ===================
@@ -203,7 +203,7 @@ case the source video format is not the same as the format of the output
 device.
 
 
-.. _video-still-picture:
+.. c:type:: video_still_picture
 
 struct video_still_picture
 ==========================
@@ -271,7 +271,7 @@ output. The following system types can be set:
     } video_system_t;
 
 
-.. _video-highlight:
+.. c:type:: video_highlight
 
 struct video_highlight
 ======================
@@ -302,7 +302,7 @@ information. The call expects the following format for that information:
      } video_highlight_t;
 
 
-.. _video-spu:
+.. c:type:: video_spu
 
 struct video_spu
 ================
@@ -320,7 +320,7 @@ to the following format:
      } video_spu_t;
 
 
-.. _video-spu-palette:
+.. c:type:: video_spu_palette
 
 struct video_spu_palette
 ========================
@@ -338,7 +338,7 @@ VIDEO_SPU_PALETTE:
      } video_spu_palette_t;
 
 
-.. _video-navi-pack:
+.. c:type:: video_navi_pack
 
 struct video_navi_pack
 ======================
Documentation/media/uapi/mediactl/media-ioc-device-info.rst +2 -2
index 412014110570..f690f9afc470 100644
@@ -33,12 +33,12 @@ Description
 
 All media devices must support the ``MEDIA_IOC_DEVICE_INFO`` ioctl. To
 query device information, applications call the ioctl with a pointer to
-a struct :ref:`media_device_info <media-device-info>`. The driver
+a struct :c:type:`media_device_info`. The driver
 fills the structure and returns the information to the application. The
 ioctl never fails.
 
 
-.. _media-device-info:
+.. c:type:: media_device_info
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
Documentation/media/uapi/mediactl/media-ioc-enum-entities.rst +3 -3
index 628e91aeda97..0fd329279bef 100644
@@ -32,7 +32,7 @@ Description
 ===========
 
 To query the attributes of an entity, applications set the id field of a
-struct :ref:`media_entity_desc <media-entity-desc>` structure and
+struct :c:type:`media_entity_desc` structure and
 call the MEDIA_IOC_ENUM_ENTITIES ioctl with a pointer to this
 structure. The driver fills the rest of the structure or returns an
 EINVAL error code when the id is invalid.
@@ -49,7 +49,7 @@ enumerate entities by calling MEDIA_IOC_ENUM_ENTITIES with increasing
 id's until they get an error.
 
 
-.. _media-entity-desc:
+.. c:type:: media_entity_desc
 
 .. tabularcolumns:: |p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{11.5cm}|
 
@@ -195,5 +195,5 @@ appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes <gen-errors>` chapter.
 
 EINVAL
-    The struct :ref:`media_entity_desc <media-entity-desc>` ``id``
+    The struct :c:type:`media_entity_desc` ``id``
     references a non-existing entity.
Documentation/media/uapi/mediactl/media-ioc-enum-links.rst +11 -11
index c81765f14b9f..d05be16ffaf6 100644
@@ -32,10 +32,10 @@ Description
 ===========
 
 To enumerate pads and/or links for a given entity, applications set the
-entity field of a struct :ref:`media_links_enum <media-links-enum>`
+entity field of a struct :c:type:`media_links_enum`
 structure and initialize the struct
-:ref:`media_pad_desc <media-pad-desc>` and struct
-:ref:`media_link_desc <media-link-desc>` structure arrays pointed by
+:c:type:`media_pad_desc` and struct
+:c:type:`media_link_desc` structure arrays pointed by
 the ``pads`` and ``links`` fields. They then call the
 MEDIA_IOC_ENUM_LINKS ioctl with a pointer to this structure.
 
@@ -53,7 +53,7 @@ Only forward links that originate at one of the entity's source pads are
 returned during the enumeration process.
 
 
-.. _media-links-enum:
+.. c:type:: media_links_enum
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -73,7 +73,7 @@ returned during the enumeration process.
 
     -  .. row 2
 
-       -  struct :ref:`media_pad_desc <media-pad-desc>`
+       -  struct :c:type:`media_pad_desc`
 
        -  \*\ ``pads``
 
@@ -82,7 +82,7 @@ returned during the enumeration process.
 
     -  .. row 3
 
-       -  struct :ref:`media_link_desc <media-link-desc>`
+       -  struct :c:type:`media_link_desc`
 
        -  \*\ ``links``
 
@@ -91,7 +91,7 @@ returned during the enumeration process.
 
 
 
-.. _media-pad-desc:
+.. c:type:: media_pad_desc
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -127,7 +127,7 @@ returned during the enumeration process.
 
 
 
-.. _media-link-desc:
+.. c:type:: media_link_desc
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -139,7 +139,7 @@ returned during the enumeration process.
 
     -  .. row 1
 
-       -  struct :ref:`media_pad_desc <media-pad-desc>`
+       -  struct :c:type:`media_pad_desc`
 
        -  ``source``
 
@@ -147,7 +147,7 @@ returned during the enumeration process.
 
     -  .. row 2
 
-       -  struct :ref:`media_pad_desc <media-pad-desc>`
+       -  struct :c:type:`media_pad_desc`
 
        -  ``sink``
 
@@ -170,5 +170,5 @@ appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes <gen-errors>` chapter.
 
 EINVAL
-    The struct :ref:`media_links_enum <media-links-enum>` ``id``
+    The struct :c:type:`media_links_enum` ``id``
     references a non-existing entity.
Documentation/media/uapi/mediactl/media-ioc-g-topology.rst +7 -7
index c246df06ff7f..0b26fd865b72 100644
@@ -33,7 +33,7 @@ Description
 
 The typical usage of this ioctl is to call it twice. On the first call,
 the structure defined at struct
-:ref:`media_v2_topology <media-v2-topology>` should be zeroed. At
+:c:type:`media_v2_topology` should be zeroed. At
 return, if no errors happen, this ioctl will return the
 ``topology_version`` and the total number of entities, interfaces, pads
 and links.
@@ -48,7 +48,7 @@ desired arrays with the media graph elements.
 
 .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
 
-.. _media-v2-topology:
+.. c:type:: media_v2_topology
 
 .. flat-table:: struct media_v2_topology
     :header-rows:  0
@@ -143,7 +143,7 @@ desired arrays with the media graph elements.
 
 .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
 
-.. _media-v2-entity:
+.. c:type:: media_v2_entity
 
 .. flat-table:: struct media_v2_entity
     :header-rows:  0
@@ -187,7 +187,7 @@ desired arrays with the media graph elements.
 
 .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
 
-.. _media-v2-interface:
+.. c:type:: media_v2_interface
 
 .. flat-table:: struct media_v2_interface
     :header-rows:  0
@@ -239,7 +239,7 @@ desired arrays with the media graph elements.
 
 .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
 
-.. _media-v2-intf-devnode:
+.. c:type:: media_v2_intf_devnode
 
 .. flat-table:: struct media_v2_interface
     :header-rows:  0
@@ -266,7 +266,7 @@ desired arrays with the media graph elements.
 
 .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
 
-.. _media-v2-pad:
+.. c:type:: media_v2_pad
 
 .. flat-table:: struct media_v2_pad
     :header-rows:  0
@@ -310,7 +310,7 @@ desired arrays with the media graph elements.
 
 .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
 
-.. _media-v2-link:
+.. c:type:: media_v2_link
 
 .. flat-table:: struct media_v2_pad
     :header-rows:  0
Documentation/media/uapi/mediactl/media-ioc-setup-link.rst +2 -2
index 35a189e19962..ae5194940100 100644
@@ -32,7 +32,7 @@ Description
 ===========
 
 To change link properties applications fill a struct
-:ref:`media_link_desc <media-link-desc>` with link identification
+:c:type:`media_link_desc` with link identification
 information (source and sink pad) and the new requested link flags. They
 then call the MEDIA_IOC_SETUP_LINK ioctl with a pointer to that
 structure.
@@ -61,6 +61,6 @@ appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes <gen-errors>` chapter.
 
 EINVAL
-    The struct :ref:`media_link_desc <media-link-desc>` references a
+    The struct :c:type:`media_link_desc` references a
     non-existing link, or the link is immutable and an attempt to modify
     its configuration was made.
Documentation/media/uapi/v4l/audio.rst +6 -6
index b8059fb05372..5ec99a2809fe 100644
@@ -21,15 +21,15 @@ more than one video input or output. Assumed two composite video inputs
 and two audio inputs exist, there may be up to four valid combinations.
 The relation of video and audio connectors is defined in the
 ``audioset`` field of the respective struct
-:ref:`v4l2_input <v4l2-input>` or struct
-:ref:`v4l2_output <v4l2-output>`, where each bit represents the index
+:c:type:`v4l2_input` or struct
+:c:type:`v4l2_output`, where each bit represents the index
 number, starting at zero, of one audio input or output.
 
 To learn about the number and attributes of the available inputs and
 outputs applications can enumerate them with the
 :ref:`VIDIOC_ENUMAUDIO` and
 :ref:`VIDIOC_ENUMAUDOUT <VIDIOC_ENUMAUDOUT>` ioctl, respectively.
-The struct :ref:`v4l2_audio <v4l2-audio>` returned by the
+The struct :c:type:`v4l2_audio` returned by the
 :ref:`VIDIOC_ENUMAUDIO` ioctl also contains signal
 :status information applicable when the current audio input is queried.
 
@@ -53,7 +53,7 @@ Drivers must implement all audio input ioctls when the device has
 multiple selectable audio inputs, all audio output ioctls when the
 device has multiple selectable audio outputs. When the device has any
 audio inputs or outputs the driver must set the ``V4L2_CAP_AUDIO`` flag
-in the struct :ref:`v4l2_capability <v4l2-capability>` returned by
+in the struct :c:type:`v4l2_capability` returned by
 the :ref:`VIDIOC_QUERYCAP` ioctl.
 
 
@@ -91,7 +91,7 @@ Example: Switching to the first audio input
     }
 
 .. [#f1]
-   Actually struct :ref:`v4l2_audio <v4l2-audio>` ought to have a
-   ``tuner`` field like struct :ref:`v4l2_input <v4l2-input>`, not
+   Actually struct :c:type:`v4l2_audio` ought to have a
+   ``tuner`` field like struct :c:type:`v4l2_input`, not
    only making the API more consistent but also permitting radio devices
    with multiple tuners.
Documentation/media/uapi/v4l/buffer.rst +20 -20
index 7bab30b59eae..a52a586b0b41 100644
@@ -11,14 +11,14 @@ the Streaming I/O methods. In the multi-planar API, the data is held in
 planes, while the buffer structure acts as a container for the planes.
 Only pointers to buffers (planes) are exchanged, the data itself is not
 copied. These pointers, together with meta-information like timestamps
-or field parity, are stored in a struct :ref:`struct v4l2_buffer <v4l2-buffer>`,
+or field parity, are stored in a struct :c:type:`struct v4l2_buffer <v4l2_buffer>`,
 argument to the :ref:`VIDIOC_QUERYBUF`,
 :ref:`VIDIOC_QBUF` and
 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. In the multi-planar API,
-some plane-specific members of struct :ref:`struct v4l2_buffer <v4l2-buffer>`,
+some plane-specific members of struct :c:type:`struct v4l2_buffer <v4l2_buffer>`,
 such as pointers and sizes for each plane, are stored in struct
-:ref:`struct v4l2_plane <v4l2-plane>` instead. In that case, struct
-:ref:`struct v4l2_buffer <v4l2-buffer>` contains an array of plane structures.
+:c:type:`struct v4l2_plane <v4l2_plane>` instead. In that case, struct
+:c:type:`struct v4l2_buffer <v4l2_buffer>` contains an array of plane structures.
 
 Dequeued video buffers come with timestamps. The driver decides at which
 part of the frame and with which clock the timestamp is taken. Please
@@ -34,7 +34,7 @@ flags are copied from the OUTPUT video buffer to the CAPTURE video
 buffer.
 
 
-.. _v4l2-buffer:
+.. c:type:: v4l2_buffer
 
 struct v4l2_buffer
 ==================
@@ -60,7 +60,7 @@ struct v4l2_buffer
 	  :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`, then it is set by the
 	  driver. This field can range from zero to the number of buffers
 	  allocated with the :ref:`VIDIOC_REQBUFS` ioctl
-	  (struct :ref:`v4l2_requestbuffers <v4l2-requestbuffers>`
+	  (struct :c:type:`v4l2_requestbuffers`
 	  ``count``), plus any buffers allocated with
 	  :ref:`VIDIOC_CREATE_BUFS` minus one.
 
@@ -72,8 +72,8 @@ struct v4l2_buffer
 
        -
        -  Type of the buffer, same as struct
-	  :ref:`v4l2_format <v4l2-format>` ``type`` or struct
-	  :ref:`v4l2_requestbuffers <v4l2-requestbuffers>` ``type``, set
+	  :c:type:`v4l2_format` ``type`` or struct
+	  :c:type:`v4l2_requestbuffers` ``type``, set
 	  by the application. See :ref:`v4l2-buf-type`
 
     -  .. row 3
@@ -134,7 +134,7 @@ struct v4l2_buffer
 
     -  .. row 7
 
-       -  struct :ref:`v4l2_timecode <v4l2-timecode>`
+       -  struct :c:type:`v4l2_timecode`
 
        -  ``timecode``
 
@@ -229,9 +229,9 @@ struct v4l2_buffer
        -  ``*planes``
 
        -  When using the multi-planar API, contains a userspace pointer to
-	  an array of struct :ref:`v4l2_plane <v4l2-plane>`. The size of
+	  an array of struct :c:type:`v4l2_plane`. The size of
 	  the array should be put in the ``length`` field of this
-	  :ref:`struct v4l2_buffer <v4l2-buffer>` structure.
+	  :c:type:`struct v4l2_buffer <v4l2_buffer>` structure.
 
     -  .. row 15
 
@@ -281,7 +281,7 @@ struct v4l2_buffer
 
 
 
-.. _v4l2-plane:
+.. c:type:: v4l2_plane
 
 struct v4l2_plane
 =================
@@ -344,10 +344,10 @@ struct v4l2_plane
        -  ``mem_offset``
 
        -  When the memory type in the containing struct
-	  :ref:`v4l2_buffer <v4l2-buffer>` is ``V4L2_MEMORY_MMAP``, this
+	  :c:type:`v4l2_buffer` is ``V4L2_MEMORY_MMAP``, this
 	  is the value that should be passed to :ref:`mmap() <func-mmap>`,
 	  similar to the ``offset`` field in struct
-	  :ref:`v4l2_buffer <v4l2-buffer>`.
+	  :c:type:`v4l2_buffer`.
 
     -  .. row 5
 
@@ -357,7 +357,7 @@ struct v4l2_plane
        -  ``userptr``
 
        -  When the memory type in the containing struct
-	  :ref:`v4l2_buffer <v4l2-buffer>` is ``V4L2_MEMORY_USERPTR``,
+	  :c:type:`v4l2_buffer` is ``V4L2_MEMORY_USERPTR``,
 	  this is a userspace pointer to the memory allocated for this plane
 	  by an application.
 
@@ -369,9 +369,9 @@ struct v4l2_plane
        -  ``fd``
 
        -  When the memory type in the containing struct
-	  :ref:`v4l2_buffer <v4l2-buffer>` is ``V4L2_MEMORY_DMABUF``,
+	  :c:type:`v4l2_buffer` is ``V4L2_MEMORY_DMABUF``,
 	  this is a file descriptor associated with a DMABUF buffer, similar
-	  to the ``fd`` field in struct :ref:`v4l2_buffer <v4l2-buffer>`.
+	  to the ``fd`` field in struct :c:type:`v4l2_buffer`.
 
     -  .. row 7
 
@@ -823,13 +823,13 @@ enum v4l2_memory
 Timecodes
 =========
 
-The :ref:`struct v4l2_timecode <v4l2-timecode>` structure is designed to hold a
+The :c:type:`struct v4l2_timecode <v4l2_timecode>` structure is designed to hold a
 :ref:`smpte12m` or similar timecode. (struct
 :c:type:`struct timeval` timestamps are stored in struct
-:ref:`v4l2_buffer <v4l2-buffer>` field ``timestamp``.)
+:c:type:`v4l2_buffer` field ``timestamp``.)
 
 
-.. _v4l2-timecode:
+.. c:type:: v4l2_timecode
 
 struct v4l2_timecode
 --------------------
Documentation/media/uapi/v4l/crop.rst +7 -7
index 4622884b06ea..3ea733a8eef8 100644
@@ -65,7 +65,7 @@ Cropping Structures
 
 For capture devices the coordinates of the top left corner, width and
 height of the area which can be sampled is given by the ``bounds``
-substructure of the struct :ref:`v4l2_cropcap <v4l2-cropcap>` returned
+substructure of the struct :c:type:`v4l2_cropcap` returned
 by the :ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>` ioctl. To support a wide
 range of hardware this specification does not define an origin or units.
 However by convention drivers should horizontally count unscaled samples
@@ -77,8 +77,8 @@ can capture both fields.
 
 The top left corner, width and height of the source rectangle, that is
 the area actually sampled, is given by struct
-:ref:`v4l2_crop <v4l2-crop>` using the same coordinate system as
-struct :ref:`v4l2_cropcap <v4l2-cropcap>`. Applications can use the
+:c:type:`v4l2_crop` using the same coordinate system as
+struct :c:type:`v4l2_cropcap`. Applications can use the
 :ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and :ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>`
 ioctls to get and set this rectangle. It must lie completely within the
 capture boundaries and the driver may further adjust the requested size
@@ -86,7 +86,7 @@ and/or position according to hardware limitations.
 
 Each capture device has a default source rectangle, given by the
 ``defrect`` substructure of struct
-:ref:`v4l2_cropcap <v4l2-cropcap>`. The center of this rectangle
+:c:type:`v4l2_cropcap`. The center of this rectangle
 shall align with the center of the active picture area of the video
 signal, and cover what the driver writer considers the complete picture.
 Drivers shall reset the source rectangle to the default when the driver
@@ -104,11 +104,11 @@ Video hardware can have various cropping, insertion and scaling
 limitations. It may only scale up or down, support only discrete scaling
 factors, or have different scaling abilities in horizontal and vertical
 direction. Also it may not support scaling at all. At the same time the
-struct :ref:`v4l2_crop <v4l2-crop>` rectangle may have to be aligned,
+struct :c:type:`v4l2_crop` rectangle may have to be aligned,
 and both the source and target rectangles may have arbitrary upper and
 lower size limits. In particular the maximum ``width`` and ``height`` in
-struct :ref:`v4l2_crop <v4l2-crop>` may be smaller than the struct
-:ref:`v4l2_cropcap <v4l2-cropcap>`. ``bounds`` area. Therefore, as
+struct :c:type:`v4l2_crop` may be smaller than the struct
+:c:type:`v4l2_cropcap`. ``bounds`` area. Therefore, as
 usual, drivers are expected to adjust the requested parameters and
 return the actual values selected.
 
Documentation/media/uapi/v4l/dev-capture.rst +8 -8
index 8d049471e1c2..32b32055d070 100644
@@ -26,7 +26,7 @@ Querying Capabilities
 Devices supporting the video capture interface set the
 ``V4L2_CAP_VIDEO_CAPTURE`` or ``V4L2_CAP_VIDEO_CAPTURE_MPLANE`` flag in
 the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl. As secondary device
 functions they may also support the :ref:`video overlay <overlay>`
 (``V4L2_CAP_VIDEO_OVERLAY``) and the :ref:`raw VBI capture <raw-vbi>`
@@ -64,18 +64,18 @@ Cropping initialization at minimum requires to reset the parameters to
 defaults. An example is given in :ref:`crop`.
 
 To query the current image format applications set the ``type`` field of
-a struct :ref:`v4l2_format <v4l2-format>` to
+a struct :c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` or
 ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE`` and call the
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl with a pointer to this
 structure. Drivers fill the struct
-:ref:`v4l2_pix_format <v4l2-pix-format>` ``pix`` or the struct
-:ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` ``pix_mp``
+:c:type:`v4l2_pix_format` ``pix`` or the struct
+:c:type:`v4l2_pix_format_mplane` ``pix_mp``
 member of the ``fmt`` union.
 
 To request different parameters applications set the ``type`` field of a
-struct :ref:`v4l2_format <v4l2-format>` as above and initialize all
-fields of the struct :ref:`v4l2_pix_format <v4l2-pix-format>`
+struct :c:type:`v4l2_format` as above and initialize all
+fields of the struct :c:type:`v4l2_pix_format`
 ``vbi`` member of the ``fmt`` union, or better just modify the results
 of :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, and call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
 ioctl with a pointer to this structure. Drivers may adjust the
@@ -86,8 +86,8 @@ Like :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` the :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>`
 can be used to learn about hardware limitations without disabling I/O or
 possibly time consuming hardware preparations.
 
-The contents of struct :ref:`v4l2_pix_format <v4l2-pix-format>` and
-struct :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` are
+The contents of struct :c:type:`v4l2_pix_format` and
+struct :c:type:`v4l2_pix_format_mplane` are
 discussed in :ref:`pixfmt`. See also the specification of the
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctls for
 details. Video capture devices must implement both the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`
Documentation/media/uapi/v4l/dev-osd.rst +9 -9
index 4e1ee79ec334..a6aaf28807a4 100644
@@ -28,7 +28,7 @@ Querying Capabilities
 
 Devices supporting the *Video Output Overlay* interface set the
 ``V4L2_CAP_VIDEO_OUTPUT_OVERLAY`` flag in the ``capabilities`` field of
-struct :ref:`v4l2_capability <v4l2-capability>` returned by the
+struct :c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl.
 
 
@@ -41,7 +41,7 @@ accessible as a framebuffer device (``/dev/fbN``). Given a V4L2 device,
 applications can find the corresponding framebuffer device by calling
 the :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` ioctl. It returns, amongst
 other information, the physical address of the framebuffer in the
-``base`` field of struct :ref:`v4l2_framebuffer <v4l2-framebuffer>`.
+``base`` field of struct :c:type:`v4l2_framebuffer`.
 The framebuffer device ioctl ``FBIOGET_FSCREENINFO`` returns the same
 address in the ``smem_start`` field of struct
 :c:type:`struct fb_fix_screeninfo`. The ``FBIOGET_FSCREENINFO``
@@ -114,18 +114,18 @@ sizes and positions of these rectangles. Further drivers may support any
 (or none) of the clipping/blending methods defined for the
 :ref:`Video Overlay <overlay>` interface.
 
-A struct :ref:`v4l2_window <v4l2-window>` defines the size of the
+A struct :c:type:`v4l2_window` defines the size of the
 source rectangle, its position in the framebuffer and the
 clipping/blending method to be used for the overlay. To get the current
 parameters applications set the ``type`` field of a struct
-:ref:`v4l2_format <v4l2-format>` to
+:c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY`` and call the
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl. The driver fills the
-:ref:`struct v4l2_window <v4l2-window>` substructure named ``win``. It is not
+:c:type:`struct v4l2_window <v4l2_window>` substructure named ``win``. It is not
 possible to retrieve a previously programmed clipping list or bitmap.
 
 To program the source rectangle applications set the ``type`` field of a
-struct :ref:`v4l2_format <v4l2-format>` to
+struct :c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY``, initialize the ``win``
 substructure and call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
 The driver adjusts the parameters against hardware limits and returns
@@ -134,10 +134,10 @@ the :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl can be used to learn
 about driver capabilities without actually changing driver state. Unlike
 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` this also works after the overlay has been enabled.
 
-A struct :ref:`v4l2_crop <v4l2-crop>` defines the size and position
+A struct :c:type:`v4l2_crop` defines the size and position
 of the target rectangle. The scaling factor of the overlay is implied by
-the width and height given in struct :ref:`v4l2_window <v4l2-window>`
-and struct :ref:`v4l2_crop <v4l2-crop>`. The cropping API applies to
+the width and height given in struct :c:type:`v4l2_window`
+and struct :c:type:`v4l2_crop`. The cropping API applies to
 *Video Output* and *Video Output Overlay* devices in the same way as to
 *Video Capture* and *Video Overlay* devices, merely reversing the
 direction of the data flow. For more information see :ref:`crop`.
Documentation/media/uapi/v4l/dev-output.rst +8 -8
index dfb8207c21cc..25ae8ec96fdf 100644
@@ -25,7 +25,7 @@ Querying Capabilities
 Devices supporting the video output interface set the
 ``V4L2_CAP_VIDEO_OUTPUT`` or ``V4L2_CAP_VIDEO_OUTPUT_MPLANE`` flag in
 the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl. As secondary device
 functions they may also support the :ref:`raw VBI output <raw-vbi>`
 (``V4L2_CAP_VBI_OUTPUT``) interface. At least one of the read/write or
@@ -62,17 +62,17 @@ Cropping initialization at minimum requires to reset the parameters to
 defaults. An example is given in :ref:`crop`.
 
 To query the current image format applications set the ``type`` field of
-a struct :ref:`v4l2_format <v4l2-format>` to
+a struct :c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_VIDEO_OUTPUT`` or ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``
 and call the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl with a pointer
 to this structure. Drivers fill the struct
-:ref:`v4l2_pix_format <v4l2-pix-format>` ``pix`` or the struct
-:ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` ``pix_mp``
+:c:type:`v4l2_pix_format` ``pix`` or the struct
+:c:type:`v4l2_pix_format_mplane` ``pix_mp``
 member of the ``fmt`` union.
 
 To request different parameters applications set the ``type`` field of a
-struct :ref:`v4l2_format <v4l2-format>` as above and initialize all
-fields of the struct :ref:`v4l2_pix_format <v4l2-pix-format>`
+struct :c:type:`v4l2_format` as above and initialize all
+fields of the struct :c:type:`v4l2_pix_format`
 ``vbi`` member of the ``fmt`` union, or better just modify the results
 of :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, and call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
 ioctl with a pointer to this structure. Drivers may adjust the
@@ -83,8 +83,8 @@ Like :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` the :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>`
 can be used to learn about hardware limitations without disabling I/O or
 possibly time consuming hardware preparations.
 
-The contents of struct :ref:`v4l2_pix_format <v4l2-pix-format>` and
-struct :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` are
+The contents of struct :c:type:`v4l2_pix_format` and
+struct :c:type:`v4l2_pix_format_mplane` are
 discussed in :ref:`pixfmt`. See also the specification of the
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` and :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctls for
 details. Video output devices must implement both the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`
Documentation/media/uapi/v4l/dev-overlay.rst +11 -11
index 50e2d52fcae6..4962947bd8a2 100644
@@ -43,7 +43,7 @@ Querying Capabilities
 
 Devices supporting the video overlay interface set the
 ``V4L2_CAP_VIDEO_OVERLAY`` flag in the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl. The overlay I/O
 method specified below must be supported. Tuners and audio inputs are
 optional.
@@ -119,17 +119,17 @@ at minimum requires to reset the parameters to defaults. An example is
 given in :ref:`crop`.
 
 The overlay window is described by a struct
-:ref:`v4l2_window <v4l2-window>`. It defines the size of the image,
+:c:type:`v4l2_window`. It defines the size of the image,
 its position over the graphics surface and the clipping to be applied.
 To get the current parameters applications set the ``type`` field of a
-struct :ref:`v4l2_format <v4l2-format>` to
+struct :c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_VIDEO_OVERLAY`` and call the
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl. The driver fills the
-:ref:`struct v4l2_window <v4l2-window>` substructure named ``win``. It is not
+:c:type:`struct v4l2_window <v4l2_window>` substructure named ``win``. It is not
 possible to retrieve a previously programmed clipping list or bitmap.
 
 To program the overlay window applications set the ``type`` field of a
-struct :ref:`v4l2_format <v4l2-format>` to
+struct :c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_VIDEO_OVERLAY``, initialize the ``win`` substructure and
 call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl. The driver
 adjusts the parameters against hardware limits and returns the actual
@@ -139,7 +139,7 @@ about driver capabilities without actually changing driver state. Unlike
 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` this also works after the overlay has been enabled.
 
 The scaling factor of the overlaid image is implied by the width and
-height given in struct :ref:`v4l2_window <v4l2-window>` and the size
+height given in struct :c:type:`v4l2_window` and the size
 of the cropping rectangle. For more information see :ref:`crop`.
 
 When simultaneous capturing and overlay is supported and the hardware
@@ -149,7 +149,7 @@ takes precedence. The attempt to capture or overlay as well
 code or return accordingly modified parameters.
 
 
-.. _v4l2-window:
+.. c:type:: v4l2_window
 
 struct v4l2_window
 ------------------
@@ -175,7 +175,7 @@ struct v4l2_window
     :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` applications set this field
     to the desired pixel value for the chroma key. The format is the
     same as the pixel format of the framebuffer (struct
-    :ref:`v4l2_framebuffer <v4l2-framebuffer>` ``fmt.pixelformat``
+    :c:type:`v4l2_framebuffer` ``fmt.pixelformat``
     field), with bytes in host order. E. g. for
     :ref:`V4L2_PIX_FMT_BGR24 <V4L2-PIX-FMT-BGR32>` the value should
     be 0xRRGGBB on a little endian, 0xBBGGRR on a big endian host.
@@ -242,11 +242,11 @@ exceeded are undefined. [#f3]_
 
    This field was added in Linux 2.6.23, extending the
    structure. However the :ref:`VIDIOC_[G|S|TRY]_FMT <VIDIOC_G_FMT>`
-   ioctls, which take a pointer to a :ref:`v4l2_format <v4l2-format>`
+   ioctls, which take a pointer to a :c:type:`v4l2_format`
    parent structure with padding bytes at the end, are not affected.
 
 
-.. _v4l2-clip:
+.. c:type:: v4l2_clip
 
 struct v4l2_clip [#f4]_
 -----------------------
@@ -262,7 +262,7 @@ struct v4l2_clip [#f4]_
     linked list of clipping rectangles.
 
 
-.. _v4l2-rect:
+.. c:type:: v4l2_rect
 
 struct v4l2_rect
 ----------------
Documentation/media/uapi/v4l/dev-radio.rst +1 -1
index 5ff7cded2591..2b5b836574eb 100644
@@ -20,7 +20,7 @@ Querying Capabilities
 Devices supporting the radio interface set the ``V4L2_CAP_RADIO`` and
 ``V4L2_CAP_TUNER`` or ``V4L2_CAP_MODULATOR`` flag in the
 ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl. Other combinations of
 capability flags are reserved for future extensions.
 
Documentation/media/uapi/v4l/dev-raw-vbi.rst +7 -7
index 3cf44869a425..26ec24a94103 100644
@@ -39,7 +39,7 @@ Querying Capabilities
 Devices supporting the raw VBI capturing or output API set the
 ``V4L2_CAP_VBI_CAPTURE`` or ``V4L2_CAP_VBI_OUTPUT`` flags, respectively,
 in the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl. At least one of the
 read/write, streaming or asynchronous I/O methods must be supported. VBI
 devices may or may not have a tuner or modulator.
@@ -69,16 +69,16 @@ always ensure they really get what they want, requesting reasonable
 parameters and then checking if the actual parameters are suitable.
 
 To query the current raw VBI capture parameters applications set the
-``type`` field of a struct :ref:`v4l2_format <v4l2-format>` to
+``type`` field of a struct :c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_VBI_CAPTURE`` or ``V4L2_BUF_TYPE_VBI_OUTPUT``, and call
 the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl with a pointer to this
 structure. Drivers fill the struct
-:ref:`v4l2_vbi_format <v4l2-vbi-format>` ``vbi`` member of the
+:c:type:`v4l2_vbi_format` ``vbi`` member of the
 ``fmt`` union.
 
 To request different parameters applications set the ``type`` field of a
-struct :ref:`v4l2_format <v4l2-format>` as above and initialize all
-fields of the struct :ref:`v4l2_vbi_format <v4l2-vbi-format>`
+struct :c:type:`v4l2_format` as above and initialize all
+fields of the struct :c:type:`v4l2_vbi_format`
 ``vbi`` member of the ``fmt`` union, or better just modify the results
 of :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, and call the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`
 ioctl with a pointer to this structure. Drivers return an ``EINVAL`` error
@@ -101,7 +101,7 @@ and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does
 
 .. tabularcolumns:: |p{2.4cm}|p{4.4cm}|p{10.7cm}|
 
-.. _v4l2-vbi-format:
+.. c:type:: v4l2_vbi_format
 
 .. cssclass:: longtable
 
@@ -204,7 +204,7 @@ and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does
 	  To initialize the ``start`` and ``count`` fields, applications
 	  must first determine the current video standard selection. The
 	  :ref:`v4l2_std_id <v4l2-std-id>` or the ``framelines`` field
-	  of struct :ref:`v4l2_standard <v4l2-standard>` can be evaluated
+	  of struct :c:type:`v4l2_standard` can be evaluated
 	  for this purpose.
 
     -  .. row 8
Documentation/media/uapi/v4l/dev-rds.rst +7 -7
index 841761a3ea59..4a8e1d2efd06 100644
@@ -34,10 +34,10 @@ Querying Capabilities
 
 Devices supporting the RDS capturing API set the
 ``V4L2_CAP_RDS_CAPTURE`` flag in the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl. Any tuner that
 supports RDS will set the ``V4L2_TUNER_CAP_RDS`` flag in the
-``capability`` field of struct :ref:`v4l2_tuner <v4l2-tuner>`. If the
+``capability`` field of struct :c:type:`v4l2_tuner`. If the
 driver only passes RDS blocks without interpreting the data the
 ``V4L2_TUNER_CAP_RDS_BLOCK_IO`` flag has to be set, see
 :ref:`Reading RDS data <reading-rds-data>`. For future use the flag
@@ -48,19 +48,19 @@ linux-media mailing list:
 `https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.
 
 Whether an RDS signal is present can be detected by looking at the
-``rxsubchans`` field of struct :ref:`v4l2_tuner <v4l2-tuner>`: the
+``rxsubchans`` field of struct :c:type:`v4l2_tuner`: the
 ``V4L2_TUNER_SUB_RDS`` will be set if RDS data was detected.
 
 Devices supporting the RDS output API set the ``V4L2_CAP_RDS_OUTPUT``
 flag in the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl. Any modulator that
 supports RDS will set the ``V4L2_TUNER_CAP_RDS`` flag in the
 ``capability`` field of struct
-:ref:`v4l2_modulator <v4l2-modulator>`. In order to enable the RDS
+:c:type:`v4l2_modulator`. In order to enable the RDS
 transmission one must set the ``V4L2_TUNER_SUB_RDS`` bit in the
 ``txsubchans`` field of struct
-:ref:`v4l2_modulator <v4l2-modulator>`. If the driver only passes RDS
+:c:type:`v4l2_modulator`. If the driver only passes RDS
 blocks without interpreting the data the ``V4L2_TUNER_CAP_RDS_BLOCK_IO``
 flag has to be set. If the tuner is capable of handling RDS entities
 like program identification codes and radio text, the flag
@@ -93,7 +93,7 @@ RDS datastructures
 ==================
 
 
-.. _v4l2-rds-data:
+.. c:type:: v4l2_rds_data
 
 .. tabularcolumns:: |p{2.5cm}|p{2.5cm}|p{12.5cm}|
 
Documentation/media/uapi/v4l/dev-sdr.rst +6 -6
index 3b6aa2a58430..5f82d760e188 100644
@@ -21,7 +21,7 @@ Querying Capabilities
 Devices supporting the SDR receiver interface set the
 ``V4L2_CAP_SDR_CAPTURE`` and ``V4L2_CAP_TUNER`` flag in the
 ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl. That flag means the
 device has an Analog to Digital Converter (ADC), which is a mandatory
 element for the SDR receiver.
@@ -29,7 +29,7 @@ element for the SDR receiver.
 Devices supporting the SDR transmitter interface set the
 ``V4L2_CAP_SDR_OUTPUT`` and ``V4L2_CAP_MODULATOR`` flag in the
 ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl. That flag means the
 device has an Digital to Analog Converter (DAC), which is a mandatory
 element for the SDR transmitter.
@@ -67,18 +67,18 @@ basic :ref:`format` ioctls, the
 well.
 
 To use the :ref:`format` ioctls applications set the ``type``
-field of a struct :ref:`v4l2_format <v4l2-format>` to
+field of a struct :c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_SDR_CAPTURE`` or ``V4L2_BUF_TYPE_SDR_OUTPUT`` and use
-the struct :ref:`v4l2_sdr_format <v4l2-sdr-format>` ``sdr`` member
+the struct :c:type:`v4l2_sdr_format` ``sdr`` member
 of the ``fmt`` union as needed per the desired operation. Currently
 there is two fields, ``pixelformat`` and ``buffersize``, of struct
-struct :ref:`v4l2_sdr_format <v4l2-sdr-format>` which are used.
+struct :c:type:`v4l2_sdr_format` which are used.
 Content of the ``pixelformat`` is V4L2 FourCC code of the data format.
 The ``buffersize`` field is maximum buffer size in bytes required for
 data transfer, set by the driver in order to inform application.
 
 
-.. _v4l2-sdr-format:
+.. c:type:: v4l2_sdr_format
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
Documentation/media/uapi/v4l/dev-sliced-vbi.rst +18 -18
index 86d2d698d2af..2a979aa138bd 100644
@@ -34,7 +34,7 @@ Querying Capabilities
 Devices supporting the sliced VBI capturing or output API set the
 ``V4L2_CAP_SLICED_VBI_CAPTURE`` or ``V4L2_CAP_SLICED_VBI_OUTPUT`` flag
 respectively, in the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl. At least one of the
 read/write, streaming or asynchronous :ref:`I/O methods <io>` must be
 supported. Sliced VBI devices may have a tuner or modulator.
@@ -67,17 +67,17 @@ line 16 the hardware may be able to look for a VPS or Teletext signal,
 but not both at the same time.
 
 To determine the currently selected services applications set the
-``type`` field of struct :ref:`v4l2_format <v4l2-format>` to
+``type`` field of struct :c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
 ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``, and the
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl fills the ``fmt.sliced``
 member, a struct
-:ref:`v4l2_sliced_vbi_format <v4l2-sliced-vbi-format>`.
+:c:type:`v4l2_sliced_vbi_format`.
 
 Applications can request different parameters by initializing or
 modifying the ``fmt.sliced`` member and calling the
 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl with a pointer to the
-:ref:`struct v4l2_format <v4l2-format>` structure.
+:c:type:`struct v4l2_format <v4l2_format>` structure.
 
 The sliced VBI API is more complicated than the raw VBI API because the
 hardware must be told which VBI service to expect on each scan line. Not
@@ -100,7 +100,7 @@ which may return ``EBUSY`` can be the
 :ref:`select() <func-select>` call.
 
 
-.. _v4l2-sliced-vbi-format:
+.. c:type:: v4l2_sliced_vbi_format
 
 struct v4l2_sliced_vbi_format
 -----------------------------
@@ -233,7 +233,7 @@ struct v4l2_sliced_vbi_format
 	  :ref:`VIDIOC_QBUF` and
 	  :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. Drivers set this field
 	  to the size of struct
-	  :ref:`v4l2_sliced_vbi_data <v4l2-sliced-vbi-data>` times the
+	  :c:type:`v4l2_sliced_vbi_data` times the
 	  number of non-zero elements in the returned ``service_lines``
 	  array (that is the number of lines potentially carrying data).
 
@@ -376,14 +376,14 @@ Reading and writing sliced VBI data
 
 A single :ref:`read() <func-read>` or :ref:`write() <func-write>`
 call must pass all data belonging to one video frame. That is an array
-of :ref:`struct v4l2_sliced_vbi_data <v4l2-sliced-vbi-data>` structures with one or
+of :c:type:`struct v4l2_sliced_vbi_data <v4l2_sliced_vbi_data>` structures with one or
 more elements and a total size not exceeding ``io_size`` bytes. Likewise
 in streaming I/O mode one buffer of ``io_size`` bytes must contain data
 of one video frame. The ``id`` of unused
-:ref:`struct v4l2_sliced_vbi_data <v4l2-sliced-vbi-data>` elements must be zero.
+:c:type:`struct v4l2_sliced_vbi_data <v4l2_sliced_vbi_data>` elements must be zero.
 
 
-.. _v4l2-sliced-vbi-data:
+.. c:type:: v4l2_sliced_vbi_data
 
 struct v4l2_sliced_vbi_data
 ---------------------------
@@ -561,7 +561,7 @@ refer to the MPEG-2 specifications for details on those packet headers.)
 
 The payload of the MPEG-2 *Private Stream 1 PES* packets that contain
 sliced VBI data is specified by struct
-:ref:`v4l2_mpeg_vbi_fmt_ivtv <v4l2-mpeg-vbi-fmt-ivtv>`. The
+:c:type:`v4l2_mpeg_vbi_fmt_ivtv`. The
 payload is variable length, depending on the actual number of lines of
 sliced VBI data present in a video frame. The payload may be padded at
 the end with unspecified fill bytes to align the end of the payload to a
@@ -570,7 +570,7 @@ with 18 lines/field with 43 bytes of data/line and a 4 byte magic
 number).
 
 
-.. _v4l2-mpeg-vbi-fmt-ivtv:
+.. c:type:: v4l2_mpeg_vbi_fmt_ivtv
 
 struct v4l2_mpeg_vbi_fmt_ivtv
 -----------------------------
@@ -604,7 +604,7 @@ struct v4l2_mpeg_vbi_fmt_ivtv
     -  .. row 3
 
        -
-       -  struct :ref:`v4l2_mpeg_vbi_itv0 <v4l2-mpeg-vbi-itv0>`
+       -  struct :c:type:`v4l2_mpeg_vbi_itv0`
 
        -  ``itv0``
 
@@ -655,7 +655,7 @@ Magic Constants for struct v4l2_mpeg_vbi_fmt_ivtv magic field
        -  "itv0"
 
        -  Indicates the ``itv0`` member of the union in struct
-	  :ref:`v4l2_mpeg_vbi_fmt_ivtv <v4l2-mpeg-vbi-fmt-ivtv>` is
+	  :c:type:`v4l2_mpeg_vbi_fmt_ivtv` is
 	  valid.
 
     -  .. row 3
@@ -665,12 +665,12 @@ Magic Constants for struct v4l2_mpeg_vbi_fmt_ivtv magic field
        -  "ITV0"
 
        -  Indicates the ``ITV0`` member of the union in struct
-	  :ref:`v4l2_mpeg_vbi_fmt_ivtv <v4l2-mpeg-vbi-fmt-ivtv>` is
+	  :c:type:`v4l2_mpeg_vbi_fmt_ivtv` is
 	  valid and that 36 lines of sliced VBI data are present.
 
 
 
-.. _v4l2-mpeg-vbi-itv0:
+.. c:type:: v4l2_mpeg_vbi_itv0
 
 struct v4l2_mpeg_vbi_itv0
 -------------------------
@@ -711,7 +711,7 @@ struct v4l2_mpeg_vbi_itv0
     -  .. row 2
 
        -  struct
-	  :ref:`v4l2_mpeg_vbi_itv0_line <v4l2-mpeg-vbi-itv0-line>`
+	  :c:type:`v4l2_mpeg_vbi_itv0_line`
 
        -  ``line``\ [35]
 
@@ -745,7 +745,7 @@ struct v4l2_mpeg_vbi_ITV0
     -  .. row 1
 
        -  struct
-	  :ref:`v4l2_mpeg_vbi_itv0_line <v4l2-mpeg-vbi-itv0-line>`
+	  :c:type:`v4l2_mpeg_vbi_itv0_line`
 
        -  ``line``\ [36]
 
@@ -756,7 +756,7 @@ struct v4l2_mpeg_vbi_ITV0
 
 
 
-.. _v4l2-mpeg-vbi-itv0-line:
+.. c:type:: v4l2_mpeg_vbi_itv0_line
 
 struct v4l2_mpeg_vbi_itv0_line
 ------------------------------
Documentation/media/uapi/v4l/dev-subdev.rst +2 -2
index 1045b3c61031..6dc7f13780ba 100644
@@ -341,7 +341,7 @@ It can also be used as part of digital zoom implementations to select
 the area of the image that will be scaled up.
 
 Crop settings are defined by a crop rectangle and represented in a
-struct :ref:`v4l2_rect <v4l2-rect>` by the coordinates of the top
+struct :c:type:`v4l2_rect` by the coordinates of the top
 left corner and the rectangle size. Both the coordinates and sizes are
 expressed in pixels.
 
@@ -357,7 +357,7 @@ sub-device for processing.
 The scaling operation changes the size of the image by scaling it to new
 dimensions. The scaling ratio isn't specified explicitly, but is implied
 from the original and scaled image sizes. Both sizes are represented by
-struct :ref:`v4l2_rect <v4l2-rect>`.
+struct :c:type:`v4l2_rect`.
 
 Scaling support is optional. When supported by a subdev, the crop
 rectangle on the subdev's sink pad is scaled to the size configured
Documentation/media/uapi/v4l/dev-touch.rst +1 -1
index 1f4e75243a47..98797f255ce0 100644
@@ -41,7 +41,7 @@ Querying Capabilities
 
 Devices supporting the touch interface set the ``V4L2_CAP_VIDEO_CAPTURE`` flag
 and the ``V4L2_CAP_TOUCH`` flag in the ``capabilities`` field of
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl.
 
 At least one of the read/write or streaming I/O methods must be
Documentation/media/uapi/v4l/diff-v4l.rst +33 -33

225 lines not on this page · raw message

Documentation/media/uapi/v4l/dmabuf.rst +4 -4
index 675768f7c66a..4e980a7e9c9c 100644
@@ -19,7 +19,7 @@ exporting V4L2 buffers as DMABUF file descriptors.
 
 Input and output devices support the streaming I/O method when the
 ``V4L2_CAP_STREAMING`` flag in the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP <VIDIOC_QUERYCAP>` ioctl is set. Whether
 importing DMA buffers through DMABUF file descriptors is supported is
 determined by calling the :ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`
@@ -31,8 +31,8 @@ DRM). Buffers (planes) are allocated by a driver on behalf of an
 application. Next, these buffers are exported to the application as file
 descriptors using an API which is specific for an allocator driver. Only
 such file descriptor are exchanged. The descriptors and meta-information
-are passed in struct :ref:`v4l2_buffer <v4l2-buffer>` (or in struct
-:ref:`v4l2_plane <v4l2-plane>` in the multi-planar API case). The
+are passed in struct :c:type:`v4l2_buffer` (or in struct
+:c:type:`v4l2_plane` in the multi-planar API case). The
 driver must be switched into DMABUF I/O mode by calling the
 :ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>` with the desired buffer type.
 
@@ -151,7 +151,7 @@ To start and stop capturing or displaying applications call the
    both queues and unlocks all buffers as a side effect. Since there is no
    notion of doing anything "now" on a multitasking system, if an
    application needs to synchronize with another event it should examine
-   the struct :ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured or
+   the struct :c:type:`v4l2_buffer` ``timestamp`` of captured or
    outputted buffers.
 
 Drivers implementing DMABUF importing I/O must support the
Documentation/media/uapi/v4l/extended-controls.rst +5 -5
index 1f1518e4859d..75359739eb52 100644
@@ -49,7 +49,7 @@ control). This is needed since it is often required to atomically change
 several controls at once.
 
 Each of the new ioctls expects a pointer to a struct
-:ref:`v4l2_ext_controls <v4l2-ext-controls>`. This structure
+:c:type:`v4l2_ext_controls`. This structure
 contains a pointer to the control array, a count of the number of
 controls in that array and a control class. Control classes are used to
 group similar controls into a single class. For example, control class
@@ -65,12 +65,12 @@ It is also possible to use an empty control array (``count`` == 0) to check
 whether the specified control class is supported.
 
 The control array is a struct
-:ref:`v4l2_ext_control <v4l2-ext-control>` array. The
-:ref:`struct v4l2_ext_control <v4l2-ext-control>` structure is very similar to
-struct :ref:`v4l2_control <v4l2-control>`, except for the fact that
+:c:type:`v4l2_ext_control` array. The
+:c:type:`struct v4l2_ext_control <v4l2_ext_control>` structure is very similar to
+struct :c:type:`v4l2_control`, except for the fact that
 it also allows for 64-bit values and pointers to be passed.
 
-Since the struct :ref:`v4l2_ext_control <v4l2-ext-control>` supports
+Since the struct :c:type:`v4l2_ext_control` supports
 pointers it is now also possible to have controls with compound types
 such as N-dimensional arrays and/or structures. You need to specify the
 ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` when enumerating controls to actually
Documentation/media/uapi/v4l/field-order.rst +4 -4
index 95e9d2a41f1d..1fa082f34c6f 100644
@@ -47,7 +47,7 @@ clearer.
 All video capture and output devices must report the current field
 order. Some drivers may permit the selection of a different order, to
 this end applications initialize the ``field`` field of struct
-:ref:`v4l2_pix_format <v4l2-pix-format>` before calling the
+:c:type:`v4l2_pix_format` before calling the
 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl. If this is not desired it
 should have the value ``V4L2_FIELD_ANY`` (0).
 
@@ -80,7 +80,7 @@ enum v4l2_field
 	  driver must choose one of the possible field orders during
 	  :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` or
 	  :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>`. struct
-	  :ref:`v4l2_buffer <v4l2-buffer>` ``field`` can never be
+	  :c:type:`v4l2_buffer` ``field`` can never be
 	  ``V4L2_FIELD_ANY``.
 
     -  .. row 2
@@ -156,12 +156,12 @@ enum v4l2_field
 	  temporal order, i. e. the older one first. To indicate the field
 	  parity (whether the current field is a top or bottom field) the
 	  driver or application, depending on data direction, must set
-	  struct :ref:`v4l2_buffer <v4l2-buffer>` ``field`` to
+	  struct :c:type:`v4l2_buffer` ``field`` to
 	  ``V4L2_FIELD_TOP`` or ``V4L2_FIELD_BOTTOM``. Any two successive
 	  fields pair to build a frame. If fields are successive, without
 	  any dropped fields between them (fields can drop individually),
 	  can be determined from the struct
-	  :ref:`v4l2_buffer <v4l2-buffer>` ``sequence`` field. This
+	  :c:type:`v4l2_buffer` ``sequence`` field. This
 	  format cannot be selected when using the read/write I/O method
 	  since there is no way to communicate if a field was a top or
 	  bottom field.
Documentation/media/uapi/v4l/format.rst +1 -1
index 7c73278849ca..452c6d59cad5 100644
@@ -22,7 +22,7 @@ to satisfy the request. Of course applications can also just query the
 current selection.
 
 A single mechanism exists to negotiate all data formats using the
-aggregate struct :ref:`v4l2_format <v4l2-format>` and the
+aggregate struct :c:type:`v4l2_format` and the
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and
 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctls. Additionally the
 :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` ioctl can be used to examine
Documentation/media/uapi/v4l/func-mmap.rst +4 -4
index bd19cef952f5..6d2ce539bd72 100644
@@ -37,9 +37,9 @@ Arguments
 ``length``
     Length of the memory area to map. This must be the same value as
     returned by the driver in the struct
-    :ref:`v4l2_buffer <v4l2-buffer>` ``length`` field for the
+    :c:type:`v4l2_buffer` ``length`` field for the
     single-planar API, and the same value as returned by the driver in
-    the struct :ref:`v4l2_plane <v4l2-plane>` ``length`` field for
+    the struct :c:type:`v4l2_plane` ``length`` field for
     the multi-planar API.
 
 ``prot``
@@ -92,9 +92,9 @@ Arguments
 ``offset``
     Offset of the buffer in device memory. This must be the same value
     as returned by the driver in the struct
-    :ref:`v4l2_buffer <v4l2-buffer>` ``m`` union ``offset`` field for
+    :c:type:`v4l2_buffer` ``m`` union ``offset`` field for
     the single-planar API, and the same value as returned by the driver
-    in the struct :ref:`v4l2_plane <v4l2-plane>` ``m`` union
+    in the struct :c:type:`v4l2_plane` ``m`` union
     ``mem_offset`` field for the multi-planar API.
 
 
Documentation/media/uapi/v4l/func-munmap.rst +2 -2
index a1a4d8cb6c4b..c2f4043d7d2b 100644
@@ -34,9 +34,9 @@ Arguments
 ``length``
     Length of the mapped buffer. This must be the same value as given to
     :ref:`mmap() <func-mmap>` and returned by the driver in the struct
-    :ref:`v4l2_buffer <v4l2-buffer>` ``length`` field for the
+    :c:type:`v4l2_buffer` ``length`` field for the
     single-planar API and in the struct
-    :ref:`v4l2_plane <v4l2-plane>` ``length`` field for the
+    :c:type:`v4l2_plane` ``length`` field for the
     multi-planar API.
 
 
Documentation/media/uapi/v4l/hist-v4l2.rst +54 -54

342 lines not on this page · raw message

Documentation/media/uapi/v4l/mmap.rst +6 -6
index 7ad5d5e76163..670596c1a4f7 100644
@@ -8,7 +8,7 @@ Streaming I/O (Memory Mapping)
 
 Input and output devices support this I/O method when the
 ``V4L2_CAP_STREAMING`` flag in the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl is set. There are two
 streaming methods, to determine if the memory mapping flavor is
 supported applications must call the :ref:`VIDIOC_REQBUFS` ioctl
@@ -39,10 +39,10 @@ address space with the :ref:`mmap() <func-mmap>` function. The
 location of the buffers in device memory can be determined with the
 :ref:`VIDIOC_QUERYBUF` ioctl. In the single-planar
 API case, the ``m.offset`` and ``length`` returned in a struct
-:ref:`v4l2_buffer <v4l2-buffer>` are passed as sixth and second
+:c:type:`v4l2_buffer` are passed as sixth and second
 parameter to the :ref:`mmap() <func-mmap>` function. When using the
-multi-planar API, struct :ref:`v4l2_buffer <v4l2-buffer>` contains an
-array of struct :ref:`v4l2_plane <v4l2-plane>` structures, each
+multi-planar API, struct :c:type:`v4l2_buffer` contains an
+array of struct :c:type:`v4l2_plane` structures, each
 containing its own ``m.offset`` and ``length``. When using the
 multi-planar API, every plane of every buffer has to be mapped
 separately, so the number of calls to :ref:`mmap() <func-mmap>` should
@@ -218,7 +218,7 @@ to function, apart of this no limit exists on the number of buffers
 applications can enqueue in advance, or dequeue and process. They can
 also enqueue in a different order than buffers have been dequeued, and
 the driver can *fill* enqueued *empty* buffers in any order.  [#f2]_ The
-index number of a buffer (struct :ref:`v4l2_buffer <v4l2-buffer>`
+index number of a buffer (struct :c:type:`v4l2_buffer`
 ``index``) plays no role here, it only identifies the buffer.
 
 Initially all mapped buffers are in dequeued state, inaccessible by the
@@ -251,7 +251,7 @@ To start and stop capturing or output applications call the
    removes all buffers from both queues as a side effect. Since there is
    no notion of doing anything "now" on a multitasking system, if an
    application needs to synchronize with another event it should examine
-   the struct ::ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured
+   the struct ::c:type:`v4l2_buffer` ``timestamp`` of captured
    or outputted buffers.
 
 Drivers implementing memory mapping I/O must support the
Documentation/media/uapi/v4l/pixfmt-002.rst +3 -3
index 58e872f66a07..789937900d14 100644
@@ -6,7 +6,7 @@ Single-planar format structure
 
 .. tabularcolumns:: |p{4.0cm}|p{2.5cm}|p{11.0cm}|
 
-.. _v4l2-pix-format:
+.. c:type:: v4l2_pix_format
 
 .. cssclass:: longtable
 
@@ -136,7 +136,7 @@ Single-planar format structure
        -  ``priv``
 
        -  This field indicates whether the remaining fields of the
-	  :ref:`struct v4l2_pix_format <v4l2-pix-format>` structure, also called the
+	  :c:type:`struct v4l2_pix_format <v4l2_pix_format>` structure, also called the
 	  extended fields, are valid. When set to
 	  ``V4L2_PIX_FMT_PRIV_MAGIC``, it indicates that the extended fields
 	  have been correctly initialized. When set to any other value it
@@ -152,7 +152,7 @@ Single-planar format structure
 	  To use the extended fields, applications must set the ``priv``
 	  field to ``V4L2_PIX_FMT_PRIV_MAGIC``, initialize all the extended
 	  fields and zero the unused bytes of the
-	  :ref:`struct v4l2_format <v4l2-format>` ``raw_data`` field.
+	  :c:type:`struct v4l2_format <v4l2_format>` ``raw_data`` field.
 
 	  When the ``priv`` field isn't set to ``V4L2_PIX_FMT_PRIV_MAGIC``
 	  drivers must act as if all the extended fields were set to zero.
Documentation/media/uapi/v4l/pixfmt-003.rst +11 -11
index 6ec8ce639764..b214b818baa7 100644
@@ -4,17 +4,17 @@
 Multi-planar format structures
 ******************************
 
-The :ref:`struct v4l2_plane_pix_format <v4l2-plane-pix-format>` structures define size
+The :c:type:`struct v4l2_plane_pix_format <v4l2_plane_pix_format>` structures define size
 and layout for each of the planes in a multi-planar format. The
-:ref:`struct v4l2_pix_format_mplane <v4l2-pix-format-mplane>` structure contains
+:c:type:`struct v4l2_pix_format_mplane <v4l2_pix_format_mplane>` structure contains
 information common to all planes (such as image width and height) and an
-array of :ref:`struct v4l2_plane_pix_format <v4l2-plane-pix-format>` structures,
+array of :c:type:`struct v4l2_plane_pix_format <v4l2_plane_pix_format>` structures,
 describing all planes of that format.
 
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-plane-pix-format:
+.. c:type:: v4l2_plane_pix_format
 
 .. flat-table:: struct v4l2_plane_pix_format
     :header-rows:  0
@@ -37,7 +37,7 @@ describing all planes of that format.
        -  ``bytesperline``
 
        -  Distance in bytes between the leftmost pixels in two adjacent
-	  lines. See struct :ref:`v4l2_pix_format <v4l2-pix-format>`.
+	  lines. See struct :c:type:`v4l2_pix_format`.
 
     -  .. row 3
 
@@ -51,7 +51,7 @@ describing all planes of that format.
 
 .. tabularcolumns:: |p{4.4cm}|p{5.6cm}|p{7.5cm}|
 
-.. _v4l2-pix-format-mplane:
+.. c:type:: v4l2_pix_format_mplane
 
 .. flat-table:: struct v4l2_pix_format_mplane
     :header-rows:  0
@@ -66,7 +66,7 @@ describing all planes of that format.
        -  ``width``
 
        -  Image width in pixels. See struct
-	  :ref:`v4l2_pix_format <v4l2-pix-format>`.
+	  :c:type:`v4l2_pix_format`.
 
     -  .. row 2
 
@@ -75,7 +75,7 @@ describing all planes of that format.
        -  ``height``
 
        -  Image height in pixels. See struct
-	  :ref:`v4l2_pix_format <v4l2-pix-format>`.
+	  :c:type:`v4l2_pix_format`.
 
     -  .. row 3
 
@@ -92,7 +92,7 @@ describing all planes of that format.
 
        -  ``field``
 
-       -  See struct :ref:`v4l2_pix_format <v4l2-pix-format>`.
+       -  See struct :c:type:`v4l2_pix_format`.
 
     -  .. row 5
 
@@ -100,11 +100,11 @@ describing all planes of that format.
 
        -  ``colorspace``
 
-       -  See struct :ref:`v4l2_pix_format <v4l2-pix-format>`.
+       -  See struct :c:type:`v4l2_pix_format`.
 
     -  .. row 6
 
-       -  struct :ref:`v4l2_plane_pix_format <v4l2-plane-pix-format>`
+       -  struct :c:type:`v4l2_plane_pix_format`
 
        -  ``plane_fmt[VIDEO_MAX_PLANES]``
 
Documentation/media/uapi/v4l/pixfmt-006.rst +2 -2
index 574294ec0a89..a97fc28e039d 100644
@@ -15,8 +15,8 @@ transfer functions. The third is the Y'CbCr encoding identifier (enum
 non-standard Y'CbCr encodings and the fourth is the quantization
 identifier (enum :ref:`v4l2_quantization <v4l2-quantization>`) to
 specify non-standard quantization methods. Most of the time only the
-colorspace field of struct :ref:`v4l2_pix_format <v4l2-pix-format>`
-or struct :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>`
+colorspace field of struct :c:type:`v4l2_pix_format`
+or struct :c:type:`v4l2_pix_format_mplane`
 needs to be filled in.
 
 .. note::
Documentation/media/uapi/v4l/pixfmt.rst +2 -2
index 6866bcb7d229..a6b7871e39e7 100644
@@ -6,8 +6,8 @@
 Image Formats
 #############
 The V4L2 API was primarily designed for devices exchanging image data
-with applications. The :ref:`struct v4l2_pix_format <v4l2-pix-format>` and
-:ref:`struct v4l2_pix_format_mplane <v4l2-pix-format-mplane>` structures define the
+with applications. The :c:type:`struct v4l2_pix_format <v4l2_pix_format>` and
+:c:type:`struct v4l2_pix_format_mplane <v4l2_pix_format_mplane>` structures define the
 format and layout of an image in memory. The former is used with the
 single-planar API, while the latter is used with the multi-planar
 version (see :ref:`planar-apis`). Image formats are negotiated with
Documentation/media/uapi/v4l/planar-apis.rst +4 -4
index 5fe2e1188230..bd0f88b01c9a 100644
@@ -46,16 +46,16 @@ Calls that distinguish between single and multi-planar APIs
 
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>`, :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>`
     New structures for describing multi-planar formats are added: struct
-    :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` and
-    struct :ref:`v4l2_plane_pix_format <v4l2-plane-pix-format>`.
+    :c:type:`v4l2_pix_format_mplane` and
+    struct :c:type:`v4l2_plane_pix_format`.
     Drivers may define new multi-planar formats, which have distinct
     FourCC codes from the existing single-planar ones.
 
 :ref:`VIDIOC_QBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_QUERYBUF <VIDIOC_QUERYBUF>`
-    A new struct :ref:`v4l2_plane <v4l2-plane>` structure for
+    A new struct :c:type:`v4l2_plane` structure for
     describing planes is added. Arrays of this structure are passed in
     the new ``m.planes`` field of struct
-    :ref:`v4l2_buffer <v4l2-buffer>`.
+    :c:type:`v4l2_buffer`.
 
 :ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`
     Will allocate multi-planar buffers as requested.
Documentation/media/uapi/v4l/rw.rst +1 -1
index dcac379c484f..91596c0cc2f3 100644
@@ -9,7 +9,7 @@ Read/Write
 Input and output devices support the :ref:`read() <func-read>` and
 :ref:`write() <func-write>` function, respectively, when the
 ``V4L2_CAP_READWRITE`` flag in the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl is set.
 
 Drivers may need the CPU to copy the data, but they may also support DMA
Documentation/media/uapi/v4l/selection-api-005.rst +5 -5
index 94731a13efdb..5b47a28ac6d7 100644
@@ -16,19 +16,19 @@ cropping from an image inside a memory buffer. The application could
 configure a capture device to fill only a part of an image by abusing
 V4L2 API. Cropping a smaller image from a larger one is achieved by
 setting the field ``bytesperline`` at struct
-:ref:`v4l2_pix_format <v4l2-pix-format>`.
+:c:type:`v4l2_pix_format`.
 Introducing an image offsets could be done by modifying field ``m_userptr``
 at struct
-:ref:`v4l2_buffer <v4l2-buffer>` before calling
+:c:type:`v4l2_buffer` before calling
 :ref:`VIDIOC_QBUF`. Those operations should be avoided because they are not
 portable (endianness), and do not work for macroblock and Bayer formats
 and mmap buffers. The selection API deals with configuration of buffer
 cropping/composing in a clear, intuitive and portable way. Next, with
 the selection API the concepts of the padded target and constraints
-flags are introduced. Finally, struct :ref:`v4l2_crop <v4l2-crop>`
-and struct :ref:`v4l2_cropcap <v4l2-cropcap>` have no reserved
+flags are introduced. Finally, struct :c:type:`v4l2_crop`
+and struct :c:type:`v4l2_cropcap` have no reserved
 fields. Therefore there is no way to extend their functionality. The new
-struct :ref:`v4l2_selection <v4l2-selection>` provides a lot of place
+struct :c:type:`v4l2_selection` provides a lot of place
 for future extensions. Driver developers are encouraged to implement
 only selection API. The former cropping API would be simulated using the
 new one.
Documentation/media/uapi/v4l/standard.rst +4 -4
index 2320008f6063..75a14895aed7 100644
@@ -9,8 +9,8 @@ Video Standards
 Video devices typically support one or more different video standards or
 variations of standards. Each video input and output may support another
 set of standards. This set is reported by the ``std`` field of struct
-:ref:`v4l2_input <v4l2-input>` and struct
-:ref:`v4l2_output <v4l2-output>` returned by the
+:c:type:`v4l2_input` and struct
+:c:type:`v4l2_output` returned by the
 :ref:`VIDIOC_ENUMINPUT` and
 :ref:`VIDIOC_ENUMOUTPUT` ioctls, respectively.
 
@@ -58,8 +58,8 @@ output device which is:
 -  that does not support the video standard formats at all.
 
 Here the driver shall set the ``std`` field of struct
-:ref:`v4l2_input <v4l2-input>` and struct
-:ref:`v4l2_output <v4l2-output>` to zero and the :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`,
+:c:type:`v4l2_input` and struct
+:c:type:`v4l2_output` to zero and the :ref:`VIDIOC_G_STD <VIDIOC_G_STD>`,
 :ref:`VIDIOC_S_STD <VIDIOC_G_STD>`, :ref:`VIDIOC_QUERYSTD` and :ref:`VIDIOC_ENUMSTD` ioctls
 shall return the ``ENOTTY`` error code or the ``EINVAL`` error code.
 
Documentation/media/uapi/v4l/streaming-par.rst +1 -1
index b07b0f0b35d4..f9b93c53f75c 100644
@@ -25,7 +25,7 @@ section discussing the :ref:`read() <func-read>` function.
 To get and set the streaming parameters applications call the
 :ref:`VIDIOC_G_PARM <VIDIOC_G_PARM>` and
 :ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctl, respectively. They take
-a pointer to a struct :ref:`v4l2_streamparm <v4l2-streamparm>`, which
+a pointer to a struct :c:type:`v4l2_streamparm`, which
 contains a union holding separate parameters for input and output
 devices.
 
Documentation/media/uapi/v4l/tuner.rst +5 -5
index c3df65c2e320..4064841d8963 100644
@@ -13,7 +13,7 @@ Tuners
 Video input devices can have one or more tuners demodulating a RF
 signal. Each tuner is associated with one or more video inputs,
 depending on the number of RF connectors on the tuner. The ``type``
-field of the respective struct :ref:`v4l2_input <v4l2-input>`
+field of the respective struct :c:type:`v4l2_input`
 returned by the :ref:`VIDIOC_ENUMINPUT` ioctl is
 set to ``V4L2_INPUT_TYPE_TUNER`` and its ``tuner`` field contains the
 index number of the tuner.
@@ -24,7 +24,7 @@ inputs.
 To query and change tuner properties applications use the
 :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` and
 :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` ioctls, respectively. The
-struct :ref:`v4l2_tuner <v4l2-tuner>` returned by :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>`
+struct :c:type:`v4l2_tuner` returned by :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>`
 also contains signal status information applicable when the tuner of the
 current video or radio input is queried.
 
@@ -46,7 +46,7 @@ video signal for radiation or connection to the antenna input of a TV
 set or video recorder. Each modulator is associated with one or more
 video outputs, depending on the number of RF connectors on the
 modulator. The ``type`` field of the respective struct
-:ref:`v4l2_output <v4l2-output>` returned by the
+:c:type:`v4l2_output` returned by the
 :ref:`VIDIOC_ENUMOUTPUT` ioctl is set to
 ``V4L2_OUTPUT_TYPE_MODULATOR`` and its ``modulator`` field contains the
 index number of the modulator.
@@ -68,7 +68,7 @@ To query and change modulator properties applications use the
 is more than one at all. The modulator is solely determined by the
 current video output. Drivers must support both ioctls and set the
 ``V4L2_CAP_MODULATOR`` flag in the struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl when the device has
 one or more modulators.
 
@@ -79,7 +79,7 @@ Radio Frequency
 To get and set the tuner or modulator radio frequency applications use
 the :ref:`VIDIOC_G_FREQUENCY <VIDIOC_G_FREQUENCY>` and
 :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl which both take
-a pointer to a struct :ref:`v4l2_frequency <v4l2-frequency>`. These
+a pointer to a struct :c:type:`v4l2_frequency`. These
 ioctls are used for TV and radio devices alike. Drivers must support
 both ioctls when the tuner or modulator ioctls are supported, or when
 the device is a radio device.
Documentation/media/uapi/v4l/userp.rst +4 -4
index 0371e068c50b..dc2893a60d65 100644
@@ -8,7 +8,7 @@ Streaming I/O (User Pointers)
 
 Input and output devices support this I/O method when the
 ``V4L2_CAP_STREAMING`` flag in the ``capabilities`` field of struct
-:ref:`v4l2_capability <v4l2-capability>` returned by the
+:c:type:`v4l2_capability` returned by the
 :ref:`VIDIOC_QUERYCAP` ioctl is set. If the
 particular user pointer method (not only memory mapping) is supported
 must be determined by calling the :ref:`VIDIOC_REQBUFS` ioctl
@@ -18,8 +18,8 @@ This I/O method combines advantages of the read/write and memory mapping
 methods. Buffers (planes) are allocated by the application itself, and
 can reside for example in virtual or shared memory. Only pointers to
 data are exchanged, these pointers and meta-information are passed in
-struct :ref:`v4l2_buffer <v4l2-buffer>` (or in struct
-:ref:`v4l2_plane <v4l2-plane>` in the multi-planar API case). The
+struct :c:type:`v4l2_buffer` (or in struct
+:c:type:`v4l2_plane` in the multi-planar API case). The
 driver must be switched into user pointer I/O mode by calling the
 :ref:`VIDIOC_REQBUFS` with the desired buffer type.
 No buffers (planes) are allocated beforehand, consequently they are not
@@ -94,7 +94,7 @@ To start and stop capturing or output applications call the
    both queues and unlocks all buffers as a side effect. Since there is no
    notion of doing anything "now" on a multitasking system, if an
    application needs to synchronize with another event it should examine
-   the struct :ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured or
+   the struct :c:type:`v4l2_buffer` ``timestamp`` of captured or
    outputted buffers.
 
 Drivers implementing user pointer I/O must support the
Documentation/media/uapi/v4l/v4l2.rst +3 -3
index 5e41a8505301..785d4cdd2f85 100644
@@ -114,14 +114,14 @@ DVB device nodes. Add support for Tuner sub-device.
 Rewrote Colorspace chapter, added new enum
 :ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>` and enum
 :ref:`v4l2_quantization <v4l2-quantization>` fields to struct
-:ref:`v4l2_pix_format <v4l2-pix-format>`, struct
-:ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` and struct
+:c:type:`v4l2_pix_format`, struct
+:c:type:`v4l2_pix_format_mplane` and struct
 :ref:`v4l2_mbus_framefmt <v4l2-mbus-framefmt>`.
 
 
 :revision: 3.17 / 2014-08-04 (*lp, hv*)
 
-Extended struct :ref:`v4l2_pix_format <v4l2-pix-format>`. Added
+Extended struct :c:type:`v4l2_pix_format`. Added
 format flags. Added compound control types and VIDIOC_QUERY_EXT_CTRL.
 
 
Documentation/media/uapi/v4l/video.rst +1 -1
index d3f00715fbc1..a205fb87d566 100644
@@ -16,7 +16,7 @@ To learn about the number and attributes of the available inputs and
 outputs applications can enumerate them with the
 :ref:`VIDIOC_ENUMINPUT` and
 :ref:`VIDIOC_ENUMOUTPUT` ioctl, respectively. The
-struct :ref:`v4l2_input <v4l2-input>` returned by the
+struct :c:type:`v4l2_input` returned by the
 :ref:`VIDIOC_ENUMINPUT` ioctl also contains signal
 :status information applicable when the current video input is queried.
 
Documentation/media/uapi/v4l/vidioc-create-bufs.rst +4 -4
index dc75f21e4b4c..c53fdcc3666a 100644
@@ -39,14 +39,14 @@ over buffers is required. This ioctl can be called multiple times to
 create buffers of different sizes.
 
 To allocate the device buffers applications must initialize the relevant
-fields of the :ref:`struct v4l2_create_buffers <v4l2-create-buffers>` structure. The
+fields of the :c:type:`struct v4l2_create_buffers <v4l2_create_buffers>` structure. The
 ``count`` field must be set to the number of requested buffers, the
 ``memory`` field specifies the requested I/O method and the ``reserved``
 array must be zeroed.
 
 The ``format`` field specifies the image format that the buffers must be
 able to handle. The application has to fill in this struct
-:ref:`v4l2_format <v4l2-format>`. Usually this will be done using the
+:c:type:`v4l2_format`. Usually this will be done using the
 :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` or
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctls to ensure that the
 requested format is supported by the driver. Based on the format's
@@ -71,7 +71,7 @@ the ``index`` fields respectively. On return ``count`` can be smaller
 than the number requested.
 
 
-.. _v4l2-create-buffers:
+.. c:type:: v4l2_create_buffers
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -115,7 +115,7 @@ than the number requested.
 
     -  .. row 4
 
-       -  struct :ref:`v4l2_format <v4l2-format>`
+       -  struct :c:type:`v4l2_format`
 
        -  ``format``
 
Documentation/media/uapi/v4l/vidioc-cropcap.rst +3 -3
index 9b7c99eef717..945596fcd65f 100644
@@ -50,7 +50,7 @@ support cropping and/or scaling and/or have non-square pixels, and for
 overlay devices.
 
 
-.. _v4l2-cropcap:
+.. c:type:: v4l2_cropcap
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -98,7 +98,7 @@ overlay devices.
 
     -  .. row 4
 
-       -  struct :ref:`v4l2_fract <v4l2-fract>`
+       -  struct :c:type:`v4l2_fract`
 
        -  ``pixelaspect``
 
@@ -165,7 +165,7 @@ appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes <gen-errors>` chapter.
 
 EINVAL
-    The struct :ref:`v4l2_cropcap <v4l2-cropcap>` ``type`` is
+    The struct :c:type:`v4l2_cropcap` ``type`` is
     invalid.
 
 ENODATA
Documentation/media/uapi/v4l/vidioc-dbg-g-chip-info.rst +2 -2
index 9c97527dc2cf..f9d76f3d519d 100644
@@ -48,7 +48,7 @@ Additionally the Linux kernel must be compiled with the
 
 To query the driver applications must initialize the ``match.type`` and
 ``match.addr`` or ``match.name`` fields of a struct
-:ref:`v4l2_dbg_chip_info <v4l2-dbg-chip-info>` and call
+:c:type:`v4l2_dbg_chip_info` and call
 :ref:`VIDIOC_DBG_G_CHIP_INFO` with a pointer to this structure. On success
 the driver stores information about the selected chip in the ``name``
 and ``flags`` fields.
@@ -124,7 +124,7 @@ instructions.
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-dbg-chip-info:
+.. c:type:: v4l2_dbg_chip_info
 
 .. flat-table:: struct v4l2_dbg_chip_info
     :header-rows:  0
Documentation/media/uapi/v4l/vidioc-dbg-g-register.rst +3 -3
index 6eeb0de24b50..08f3c510e440 100644
@@ -49,7 +49,7 @@ superuser privileges. Additionally the Linux kernel must be compiled
 with the ``CONFIG_VIDEO_ADV_DEBUG`` option to enable these ioctls.
 
 To write a register applications must initialize all fields of a struct
-:ref:`v4l2_dbg_register <v4l2-dbg-register>` except for ``size`` and
+:c:type:`v4l2_dbg_register` except for ``size`` and
 call ``VIDIOC_DBG_S_REGISTER`` with a pointer to this structure. The
 ``match.type`` and ``match.addr`` or ``match.name`` fields select a chip
 on the TV card, the ``reg`` field specifies a register number and the
@@ -87,7 +87,7 @@ instructions.
 
 .. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{7.0cm}|
 
-.. _v4l2-dbg-match:
+.. c:type:: v4l2_dbg_match
 
 .. flat-table:: struct v4l2_dbg_match
     :header-rows:  0
@@ -131,7 +131,7 @@ instructions.
 
 
 
-.. _v4l2-dbg-register:
+.. c:type:: v4l2_dbg_register
 
 .. flat-table:: struct v4l2_dbg_register
     :header-rows:  0
Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst +3 -3
index 6077caac6086..cade4603e138 100644
@@ -30,7 +30,7 @@ Arguments
     File descriptor returned by :ref:`open() <func-open>`.
 
 ``argp``
-    pointer to struct :ref:`v4l2_decoder_cmd <v4l2-decoder-cmd>`.
+    pointer to struct :c:type:`v4l2_decoder_cmd`.
 
 
 Description
@@ -40,7 +40,7 @@ These ioctls control an audio/video (usually MPEG-) decoder.
 ``VIDIOC_DECODER_CMD`` sends a command to the decoder,
 ``VIDIOC_TRY_DECODER_CMD`` can be used to try a command without actually
 executing it. To send a command applications must initialize all fields
-of a struct :ref:`v4l2_decoder_cmd <v4l2-decoder-cmd>` and call
+of a struct :c:type:`v4l2_decoder_cmd` and call
 ``VIDIOC_DECODER_CMD`` or ``VIDIOC_TRY_DECODER_CMD`` with a pointer to
 this structure.
 
@@ -61,7 +61,7 @@ introduced in Linux 3.3.
 
 .. tabularcolumns:: |p{1.1cm}|p{2.4cm}|p{1.2cm}|p{1.6cm}|p{10.6cm}|
 
-.. _v4l2-decoder-cmd:
+.. c:type:: v4l2_decoder_cmd
 
 .. cssclass:: longtable
 
Documentation/media/uapi/v4l/vidioc-dqevent.rst +20 -20
index 067e0aa27918..cf0e98f5112f 100644
@@ -32,7 +32,7 @@ Description
 ===========
 
 Dequeue an event from a video device. No input is required for this
-ioctl. All the fields of the struct :ref:`v4l2_event <v4l2-event>`
+ioctl. All the fields of the struct :c:type:`v4l2_event`
 structure are filled by the driver. The file handle will also receive
 exceptions which the application may get by e.g. using the select system
 call.
@@ -40,7 +40,7 @@ call.
 
 .. tabularcolumns:: |p{3.0cm}|p{4.3cm}|p{2.5cm}|p{7.7cm}|
 
-.. _v4l2-event:
+.. c:type:: v4l2_event
 
 .. cssclass: longtable
 
@@ -71,7 +71,7 @@ call.
     -  .. row 3
 
        -
-       -  struct :ref:`v4l2_event_vsync <v4l2-event-vsync>`
+       -  struct :c:type:`v4l2_event_vsync`
 
        -  ``vsync``
 
@@ -80,7 +80,7 @@ call.
     -  .. row 4
 
        -
-       -  struct :ref:`v4l2_event_ctrl <v4l2-event-ctrl>`
+       -  struct :c:type:`v4l2_event_ctrl`
 
        -  ``ctrl``
 
@@ -89,7 +89,7 @@ call.
     -  .. row 5
 
        -
-       -  struct :ref:`v4l2_event_frame_sync <v4l2-event-frame-sync>`
+       -  struct :c:type:`v4l2_event_frame_sync`
 
        -  ``frame_sync``
 
@@ -98,7 +98,7 @@ call.
     -  .. row 6
 
        -
-       -  struct :ref:`v4l2_event_motion_det <v4l2-event-motion-det>`
+       -  struct :c:type:`v4l2_event_motion_det`
 
        -  ``motion_det``
 
@@ -107,7 +107,7 @@ call.
     -  .. row 7
 
        -
-       -  struct :ref:`v4l2_event_src_change <v4l2-event-src-change>`
+       -  struct :c:type:`v4l2_event_src_change`
 
        -  ``src_change``
 
@@ -205,7 +205,7 @@ call.
        -  1
 
        -  This event is triggered on the vertical sync. This event has a
-	  struct :ref:`v4l2_event_vsync <v4l2-event-vsync>` associated
+	  struct :c:type:`v4l2_event_vsync` associated
 	  with it.
 
     -  .. row 3
@@ -228,10 +228,10 @@ call.
 	  which you want to receive events. This event is triggered if the
 	  control's value changes, if a button control is pressed or if the
 	  control's flags change. This event has a struct
-	  :ref:`v4l2_event_ctrl <v4l2-event-ctrl>` associated with it.
+	  :c:type:`v4l2_event_ctrl` associated with it.
 	  This struct contains much of the same information as struct
 	  :ref:`v4l2_queryctrl <v4l2-queryctrl>` and struct
-	  :ref:`v4l2_control <v4l2-control>`.
+	  :c:type:`v4l2_control`.
 
 	  If the event is generated due to a call to
 	  :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` or
@@ -243,7 +243,7 @@ call.
 
 	  This event type will ensure that no information is lost when more
 	  events are raised than there is room internally. In that case the
-	  struct :ref:`v4l2_event_ctrl <v4l2-event-ctrl>` of the
+	  struct :c:type:`v4l2_event_ctrl` of the
 	  second-oldest event is kept, but the ``changes`` field of the
 	  second-oldest event is ORed with the ``changes`` field of the
 	  oldest event.
@@ -256,13 +256,13 @@ call.
 
        -  Triggered immediately when the reception of a frame has begun.
 	  This event has a struct
-	  :ref:`v4l2_event_frame_sync <v4l2-event-frame-sync>`
+	  :c:type:`v4l2_event_frame_sync`
 	  associated with it.
 
 	  If the hardware needs to be stopped in the case of a buffer
 	  underrun it might not be able to generate this event. In such
 	  cases the ``frame_sequence`` field in struct
-	  :ref:`v4l2_event_frame_sync <v4l2-event-frame-sync>` will not
+	  :c:type:`v4l2_event_frame_sync` will not
 	  be incremented. This causes two consecutive frame sequence numbers
 	  to have n times frame interval in between them.
 
@@ -281,7 +281,7 @@ call.
 	  receive events.
 
 	  This event has a struct
-	  :ref:`v4l2_event_src_change <v4l2-event-src-change>`
+	  :c:type:`v4l2_event_src_change`
 	  associated with it. The ``changes`` bitfield denotes what has
 	  changed for the subscribed pad. If multiple events occurred before
 	  application could dequeue them, then the changes will have the
@@ -295,7 +295,7 @@ call.
 
        -  Triggered whenever the motion detection state for one or more of
 	  the regions changes. This event has a struct
-	  :ref:`v4l2_event_motion_det <v4l2-event-motion-det>`
+	  :c:type:`v4l2_event_motion_det`
 	  associated with it.
 
     -  .. row 8
@@ -310,7 +310,7 @@ call.
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-event-vsync:
+.. c:type:: v4l2_event_vsync
 
 .. flat-table:: struct v4l2_event_vsync
     :header-rows:  0
@@ -330,7 +330,7 @@ call.
 
 .. tabularcolumns:: |p{3.5cm}|p{3.0cm}|p{1.8cm}|p{8.5cm}|
 
-.. _v4l2-event-ctrl:
+.. c:type:: v4l2_event_ctrl
 
 .. flat-table:: struct v4l2_event_ctrl
     :header-rows:  0
@@ -439,7 +439,7 @@ call.
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-event-frame-sync:
+.. c:type:: v4l2_event_frame_sync
 
 .. flat-table:: struct v4l2_event_frame_sync
     :header-rows:  0
@@ -459,7 +459,7 @@ call.
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-event-src-change:
+.. c:type:: v4l2_event_src_change
 
 .. flat-table:: struct v4l2_event_src_change
     :header-rows:  0
@@ -480,7 +480,7 @@ call.
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-event-motion-det:
+.. c:type:: v4l2_event_motion_det
 
 .. flat-table:: struct v4l2_event_motion_det
     :header-rows:  0
Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst +5 -5
index 741718baf14b..7cb78a0067ac 100644
@@ -36,7 +36,7 @@ Description
 
 To query the capabilities of the DV receiver/transmitter applications
 initialize the ``pad`` field to 0, zero the reserved array of struct
-:ref:`v4l2_dv_timings_cap <v4l2-dv-timings-cap>` and call the
+:c:type:`v4l2_dv_timings_cap` and call the
 ``VIDIOC_DV_TIMINGS_CAP`` ioctl on a video node and the driver will fill
 in the structure.
 
@@ -50,14 +50,14 @@ queried by calling the ``VIDIOC_SUBDEV_DV_TIMINGS_CAP`` ioctl directly
 on a subdevice node. The capabilities are specific to inputs (for DV
 receivers) or outputs (for DV transmitters), applications must specify
 the desired pad number in the struct
-:ref:`v4l2_dv_timings_cap <v4l2-dv-timings-cap>` ``pad`` field and
+:c:type:`v4l2_dv_timings_cap` ``pad`` field and
 zero the ``reserved`` array. Attempts to query capabilities on a pad
 that doesn't support them will return an ``EINVAL`` error code.
 
 
 .. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.3cm}|
 
-.. _v4l2-bt-timings-cap:
+.. c:type:: v4l2_bt_timings_cap
 
 .. flat-table:: struct v4l2_bt_timings_cap
     :header-rows:  0
@@ -144,7 +144,7 @@ that doesn't support them will return an ``EINVAL`` error code.
 
 .. tabularcolumns:: |p{1.0cm}|p{3.5cm}|p{3.5cm}|p{9.5cm}|
 
-.. _v4l2-dv-timings-cap:
+.. c:type:: v4l2_dv_timings_cap
 
 .. flat-table:: struct v4l2_dv_timings_cap
     :header-rows:  0
@@ -190,7 +190,7 @@ that doesn't support them will return an ``EINVAL`` error code.
     -  .. row 5
 
        -
-       -  struct :ref:`v4l2_bt_timings_cap <v4l2-bt-timings-cap>`
+       -  struct :c:type:`v4l2_bt_timings_cap`
 
        -  ``bt``
 
Documentation/media/uapi/v4l/vidioc-encoder-cmd.rst +2 -2
index 802eac3ca9ec..b724ec36a25c 100644
@@ -40,7 +40,7 @@ These ioctls control an audio/video (usually MPEG-) encoder.
 executing it.
 
 To send a command applications must initialize all fields of a struct
-:ref:`v4l2_encoder_cmd <v4l2-encoder-cmd>` and call
+:c:type:`v4l2_encoder_cmd` and call
 ``VIDIOC_ENCODER_CMD`` or ``VIDIOC_TRY_ENCODER_CMD`` with a pointer to
 this structure.
 
@@ -67,7 +67,7 @@ introduced in Linux 2.6.21.
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-encoder-cmd:
+.. c:type:: v4l2_encoder_cmd
 
 .. flat-table:: struct v4l2_encoder_cmd
     :header-rows:  0
Documentation/media/uapi/v4l/vidioc-enum-dv-timings.rst +5 -5
index db9613c9b4bd..dfe4d737b0aa 100644
@@ -43,7 +43,7 @@ this list.
 
 To query the available timings, applications initialize the ``index``
 field, set the ``pad`` field to 0, zero the reserved array of struct
-:ref:`v4l2_enum_dv_timings <v4l2-enum-dv-timings>` and call the
+:c:type:`v4l2_enum_dv_timings` and call the
 ``VIDIOC_ENUM_DV_TIMINGS`` ioctl on a video node with a pointer to this
 structure. Drivers fill the rest of the structure or return an ``EINVAL``
 error code when the index is out of bounds. To enumerate all supported
@@ -60,12 +60,12 @@ by calling the ``VIDIOC_SUBDEV_ENUM_DV_TIMINGS`` ioctl directly on a
 subdevice node. The DV timings are specific to inputs (for DV receivers)
 or outputs (for DV transmitters), applications must specify the desired
 pad number in the struct
-:ref:`v4l2_enum_dv_timings <v4l2-enum-dv-timings>` ``pad`` field.
+:c:type:`v4l2_enum_dv_timings` ``pad`` field.
 Attempts to enumerate timings on a pad that doesn't support them will
 return an ``EINVAL`` error code.
 
 
-.. _v4l2-enum-dv-timings:
+.. c:type:: v4l2_enum_dv_timings
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -104,7 +104,7 @@ return an ``EINVAL`` error code.
 
     -  .. row 4
 
-       -  struct :ref:`v4l2_dv_timings <v4l2-dv-timings>`
+       -  struct :c:type:`v4l2_dv_timings`
 
        -  ``timings``
 
@@ -119,7 +119,7 @@ appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes <gen-errors>` chapter.
 
 EINVAL
-    The struct :ref:`v4l2_enum_dv_timings <v4l2-enum-dv-timings>`
+    The struct :c:type:`v4l2_enum_dv_timings`
     ``index`` is out of bounds or the ``pad`` number is invalid.
 
 ENODATA
Documentation/media/uapi/v4l/vidioc-enum-fmt.rst +3 -3
index 1a4834934085..1df8fccf067f 100644
@@ -32,7 +32,7 @@ Description
 ===========
 
 To enumerate image formats applications initialize the ``type`` and
-``index`` field of struct :ref:`v4l2_fmtdesc <v4l2-fmtdesc>` and call
+``index`` field of struct :c:type:`v4l2_fmtdesc` and call
 the :ref:`VIDIOC_ENUM_FMT` ioctl with a pointer to this structure. Drivers
 fill the rest of the structure or return an ``EINVAL`` error code. All
 formats are enumerable by beginning at index zero and incrementing by
@@ -46,7 +46,7 @@ one until ``EINVAL`` is returned.
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-fmtdesc:
+.. c:type:: v4l2_fmtdesc
 
 .. flat-table:: struct v4l2_fmtdesc
     :header-rows:  0
@@ -167,5 +167,5 @@ appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes <gen-errors>` chapter.
 
 EINVAL
-    The struct :ref:`v4l2_fmtdesc <v4l2-fmtdesc>` ``type`` is not
+    The struct :c:type:`v4l2_fmtdesc` ``type`` is not
     supported or the ``index`` is out of bounds.
Documentation/media/uapi/v4l/vidioc-enum-frameintervals.rst +8 -8
index f9bb6fb4ca8e..07e94420c4c5 100644
@@ -26,7 +26,7 @@ Arguments
     File descriptor returned by :ref:`open() <func-open>`.
 
 ``argp``
-    Pointer to a struct :ref:`v4l2_frmivalenum <v4l2-frmivalenum>`
+    Pointer to a struct :c:type:`v4l2_frmivalenum`
     structure that contains a pixel format and size and receives a frame
     interval.
 
@@ -101,7 +101,7 @@ the application, *OUT* denotes values that the driver fills in. The
 application should zero out all members except for the *IN* fields.
 
 
-.. _v4l2-frmival-stepwise:
+.. c:type:: v4l2_frmival_stepwise
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -113,7 +113,7 @@ application should zero out all members except for the *IN* fields.
 
     -  .. row 1
 
-       -  struct :ref:`v4l2_fract <v4l2-fract>`
+       -  struct :c:type:`v4l2_fract`
 
        -  ``min``
 
@@ -121,7 +121,7 @@ application should zero out all members except for the *IN* fields.
 
     -  .. row 2
 
-       -  struct :ref:`v4l2_fract <v4l2-fract>`
+       -  struct :c:type:`v4l2_fract`
 
        -  ``max``
 
@@ -129,7 +129,7 @@ application should zero out all members except for the *IN* fields.
 
     -  .. row 3
 
-       -  struct :ref:`v4l2_fract <v4l2-fract>`
+       -  struct :c:type:`v4l2_fract`
 
        -  ``step``
 
@@ -137,7 +137,7 @@ application should zero out all members except for the *IN* fields.
 
 
 
-.. _v4l2-frmivalenum:
+.. c:type:: v4l2_frmivalenum
 
 .. flat-table:: struct v4l2_frmivalenum
     :header-rows:  0
@@ -200,7 +200,7 @@ application should zero out all members except for the *IN* fields.
     -  .. row 7
 
        -
-       -  struct :ref:`v4l2_fract <v4l2-fract>`
+       -  struct :c:type:`v4l2_fract`
 
        -  ``discrete``
 
@@ -209,7 +209,7 @@ application should zero out all members except for the *IN* fields.
     -  .. row 8
 
        -
-       -  struct :ref:`v4l2_frmival_stepwise <v4l2-frmival-stepwise>`
+       -  struct :c:type:`v4l2_frmival_stepwise`
 
        -  ``stepwise``
 
Documentation/media/uapi/v4l/vidioc-enum-framesizes.rst +6 -6
index 4fb19b75abf1..a4ddfe9f8956 100644
@@ -26,7 +26,7 @@ Arguments
     File descriptor returned by :ref:`open() <func-open>`.
 
 ``argp``
-    Pointer to a struct :ref:`v4l2_frmsizeenum <v4l2-frmsizeenum>`
+    Pointer to a struct :c:type:`v4l2_frmsizeenum`
     that contains an index and pixel format and receives a frame width
     and height.
 
@@ -90,7 +90,7 @@ the application, *OUT* denotes values that the driver fills in. The
 application should zero out all members except for the *IN* fields.
 
 
-.. _v4l2-frmsize-discrete:
+.. c:type:: v4l2_frmsize_discrete
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -118,7 +118,7 @@ application should zero out all members except for the *IN* fields.
 
 
 
-.. _v4l2-frmsize-stepwise:
+.. c:type:: v4l2_frmsize_stepwise
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -178,7 +178,7 @@ application should zero out all members except for the *IN* fields.
 
 
 
-.. _v4l2-frmsizeenum:
+.. c:type:: v4l2_frmsizeenum
 
 .. flat-table:: struct v4l2_frmsizeenum
     :header-rows:  0
@@ -223,7 +223,7 @@ application should zero out all members except for the *IN* fields.
     -  .. row 5
 
        -
-       -  struct :ref:`v4l2_frmsize_discrete <v4l2-frmsize-discrete>`
+       -  struct :c:type:`v4l2_frmsize_discrete`
 
        -  ``discrete``
 
@@ -232,7 +232,7 @@ application should zero out all members except for the *IN* fields.
     -  .. row 6
 
        -
-       -  struct :ref:`v4l2_frmsize_stepwise <v4l2-frmsize-stepwise>`
+       -  struct :c:type:`v4l2_frmsize_stepwise`
 
        -  ``stepwise``
 
Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst +7 -7
index 60ae938d5ef8..c38478227031 100644
@@ -34,7 +34,7 @@ Description
 Enumerates the frequency bands that a tuner or modulator supports. To do
 this applications initialize the ``tuner``, ``type`` and ``index``
 fields, and zero out the ``reserved`` array of a struct
-:ref:`v4l2_frequency_band <v4l2-frequency-band>` and call the
+:c:type:`v4l2_frequency_band` and call the
 :ref:`VIDIOC_ENUM_FREQ_BANDS` ioctl with a pointer to this structure.
 
 This ioctl is supported if the ``V4L2_TUNER_CAP_FREQ_BANDS`` capability
@@ -43,7 +43,7 @@ of the corresponding tuner/modulator is set.
 
 .. tabularcolumns:: |p{2.9cm}|p{2.9cm}|p{5.8cm}|p{2.9cm}|p{3.0cm}|
 
-.. _v4l2-frequency-band:
+.. c:type:: v4l2_frequency_band
 
 .. flat-table:: struct v4l2_frequency_band
     :header-rows:  0
@@ -58,10 +58,10 @@ of the corresponding tuner/modulator is set.
        -  ``tuner``
 
        -  The tuner or modulator index number. This is the same value as in
-	  the struct :ref:`v4l2_input <v4l2-input>` ``tuner`` field and
-	  the struct :ref:`v4l2_tuner <v4l2-tuner>` ``index`` field, or
-	  the struct :ref:`v4l2_output <v4l2-output>` ``modulator`` field
-	  and the struct :ref:`v4l2_modulator <v4l2-modulator>` ``index``
+	  the struct :c:type:`v4l2_input` ``tuner`` field and
+	  the struct :c:type:`v4l2_tuner` ``index`` field, or
+	  the struct :c:type:`v4l2_output` ``modulator`` field
+	  and the struct :c:type:`v4l2_modulator` ``index``
 	  field.
 
     -  .. row 2
@@ -71,7 +71,7 @@ of the corresponding tuner/modulator is set.
        -  ``type``
 
        -  The tuner type. This is the same value as in the struct
-	  :ref:`v4l2_tuner <v4l2-tuner>` ``type`` field. The type must be
+	  :c:type:`v4l2_tuner` ``type`` field. The type must be
 	  set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and
 	  to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to
 	  ``V4L2_TUNER_RADIO`` for modulators (currently only radio
Documentation/media/uapi/v4l/vidioc-enumaudio.rst +2 -2
index c9d9eb60551e..74bc3ed0bdd8 100644
@@ -33,14 +33,14 @@ Description
 
 To query the attributes of an audio input applications initialize the
 ``index`` field and zero out the ``reserved`` array of a struct
-:ref:`v4l2_audio <v4l2-audio>` and call the :ref:`VIDIOC_ENUMAUDIO`
+:c:type:`v4l2_audio` and call the :ref:`VIDIOC_ENUMAUDIO`
 ioctl with a pointer to this structure. Drivers fill the rest of the
 structure or return an ``EINVAL`` error code when the index is out of
 bounds. To enumerate all audio inputs applications shall begin at index
 zero, incrementing by one until the driver returns ``EINVAL``.
 
 See :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` for a description of struct
-:ref:`v4l2_audio <v4l2-audio>`.
+:c:type:`v4l2_audio`.
 
 
 Return Value
Documentation/media/uapi/v4l/vidioc-enumaudioout.rst +2 -2
index a7a27327fe88..4470a1ece5cf 100644
@@ -33,7 +33,7 @@ Description
 
 To query the attributes of an audio output applications initialize the
 ``index`` field and zero out the ``reserved`` array of a struct
-:ref:`v4l2_audioout <v4l2-audioout>` and call the ``VIDIOC_G_AUDOUT``
+:c:type:`v4l2_audioout` and call the ``VIDIOC_G_AUDOUT``
 ioctl with a pointer to this structure. Drivers fill the rest of the
 structure or return an ``EINVAL`` error code when the index is out of
 bounds. To enumerate all audio outputs applications shall begin at index
@@ -45,7 +45,7 @@ zero, incrementing by one until the driver returns ``EINVAL``.
     to a sound card are not audio outputs in this sense.
 
 See :ref:`VIDIOC_G_AUDIOout <VIDIOC_G_AUDOUT>` for a description of struct
-:ref:`v4l2_audioout <v4l2-audioout>`.
+:c:type:`v4l2_audioout`.
 
 
 Return Value
Documentation/media/uapi/v4l/vidioc-enuminput.rst +4 -4
index 8f6c603819d8..be03e04e3dac 100644
@@ -32,7 +32,7 @@ Description
 ===========
 
 To query the attributes of a video input applications initialize the
-``index`` field of struct :ref:`v4l2_input <v4l2-input>` and call the
+``index`` field of struct :c:type:`v4l2_input` and call the
 :ref:`VIDIOC_ENUMINPUT` ioctl with a pointer to this structure. Drivers
 fill the rest of the structure or return an ``EINVAL`` error code when the
 index is out of bounds. To enumerate all inputs applications shall begin
@@ -41,7 +41,7 @@ at index zero, incrementing by one until the driver returns ``EINVAL``.
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-input:
+.. c:type:: v4l2_input
 
 .. flat-table:: struct v4l2_input
     :header-rows:  0
@@ -104,7 +104,7 @@ at index zero, incrementing by one until the driver returns ``EINVAL``.
        -  Capture devices can have zero or more tuners (RF demodulators).
 	  When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an
 	  RF connector and this field identifies the tuner. It corresponds
-	  to struct :ref:`v4l2_tuner <v4l2-tuner>` field ``index``. For
+	  to struct :c:type:`v4l2_tuner` field ``index``. For
 	  details on tuners see :ref:`tuner`.
 
     -  .. row 6
@@ -377,5 +377,5 @@ appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes <gen-errors>` chapter.
 
 EINVAL
-    The struct :ref:`v4l2_input <v4l2-input>` ``index`` is out of
+    The struct :c:type:`v4l2_input` ``index`` is out of
     bounds.
Documentation/media/uapi/v4l/vidioc-enumoutput.rst +4 -4
index d660c37d3516..763066ab99b6 100644
@@ -32,7 +32,7 @@ Description
 ===========
 
 To query the attributes of a video outputs applications initialize the
-``index`` field of struct :ref:`v4l2_output <v4l2-output>` and call
+``index`` field of struct :c:type:`v4l2_output` and call
 the :ref:`VIDIOC_ENUMOUTPUT` ioctl with a pointer to this structure.
 Drivers fill the rest of the structure or return an ``EINVAL`` error code
 when the index is out of bounds. To enumerate all outputs applications
@@ -42,7 +42,7 @@ EINVAL.
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-output:
+.. c:type:: v4l2_output
 
 .. flat-table:: struct v4l2_output
     :header-rows:  0
@@ -105,7 +105,7 @@ EINVAL.
        -  Output devices can have zero or more RF modulators. When the
 	  ``type`` is ``V4L2_OUTPUT_TYPE_MODULATOR`` this is an RF connector
 	  and this field identifies the modulator. It corresponds to struct
-	  :ref:`v4l2_modulator <v4l2-modulator>` field ``index``. For
+	  :c:type:`v4l2_modulator` field ``index``. For
 	  details on modulators see :ref:`tuner`.
 
     -  .. row 6
@@ -222,5 +222,5 @@ appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes <gen-errors>` chapter.
 
 EINVAL
-    The struct :ref:`v4l2_output <v4l2-output>` ``index`` is out of
+    The struct :c:type:`v4l2_output` ``index`` is out of
     bounds.
Documentation/media/uapi/v4l/vidioc-enumstd.rst +6 -6
index 5bd85932d33b..eaac7a2e14c4 100644
@@ -33,7 +33,7 @@ Description
 
 To query the attributes of a video standard, especially a custom (driver
 defined) one, applications initialize the ``index`` field of struct
-:ref:`v4l2_standard <v4l2-standard>` and call the :ref:`VIDIOC_ENUMSTD`
+:c:type:`v4l2_standard` and call the :ref:`VIDIOC_ENUMSTD`
 ioctl with a pointer to this structure. Drivers fill the rest of the
 structure or return an ``EINVAL`` error code when the index is out of
 bounds. To enumerate all standards applications shall begin at index
@@ -42,7 +42,7 @@ enumerate a different set of standards after switching the video input
 or output. [#f1]_
 
 
-.. _v4l2-standard:
+.. c:type:: v4l2_standard
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -71,7 +71,7 @@ or output. [#f1]_
 	  set as custom standards. Multiple bits can be set if the hardware
 	  does not distinguish between these standards, however separate
 	  indices do not indicate the opposite. The ``id`` must be unique.
-	  No other enumerated :ref:`struct v4l2_standard <v4l2-standard>` structure,
+	  No other enumerated :c:type:`struct v4l2_standard <v4l2_standard>` structure,
 	  for this input or output anyway, can contain the same set of bits.
 
     -  .. row 3
@@ -86,7 +86,7 @@ or output. [#f1]_
 
     -  .. row 4
 
-       -  struct :ref:`v4l2_fract <v4l2-fract>`
+       -  struct :c:type:`v4l2_fract`
 
        -  ``frameperiod``
 
@@ -112,7 +112,7 @@ or output. [#f1]_
 
 
 
-.. _v4l2-fract:
+.. c:type:: v4l2_fract
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -411,7 +411,7 @@ appropriately. The generic error codes are described at the
 :ref:`Generic Error Codes <gen-errors>` chapter.
 
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-expbuf.rst +6 -6
index f7b8d643fd28..650757ad8aed 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-audio.rst +3 -3
index 224a09c2c53d..ebf2514464fc 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-audioout.rst +3 -3
index da8db3b42262..b21794300efd 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-crop.rst +5 -5
index 1689b0c523d7..b99032e59ebe 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-ctrl.rst +5 -5
index 6ced76016246..53a6ebe6f744 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst +5 -5
index f143a6b3d927..379f2be0bc92 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-enc-index.rst +4 -4
index 3decb810c8bb..6b5727439db2 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst +13 -13
index ee72c69f902a..01561ddfe73b 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-fbuf.rst +9 -9
index 00f783692752..7ade2f7d62be 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-fmt.rst +12 -12
index ebeb7e9a48ea..dd6c062d267c 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-frequency.rst +10 -10
index d517c7bb2182..9cbe70098b2b 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-input.rst +1 -1
index 32735d20066c..1364a918fbce 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst +1 -1
index 387c71c209bc..c56c5bc7beb5 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-modulator.rst +4 -4
index c7729e67e8d9..5d209efa0965 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-output.rst +1 -1
index e0613e2d667f..7750948fc61b 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-parm.rst +11 -11
index 9e9af1dd4f29..021b96ee641d 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-selection.rst +14 -14
index 85b5afa48474..af38b2568e3b 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst +2 -2
index abda04b07999..4df7227e0490 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-std.rst +2 -2
index 91162f5ea6b2..c351eb9f6b0e 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-g-tuner.rst +6 -6
index 4658a4715a5e..01b7f26bf22f 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-prepare-buf.rst +1 -1
index c3f6c1c615f6..c20e1c7d5f89 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-qbuf.rst +10 -10
index dd3f2e069fcb..727238fc2337 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-query-dv-timings.rst +1 -1
index 230ebcb8aa4b..0d16853b1b51 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-querybuf.rst +7 -7
index 8edfc7931ec6..1edd76c06e0a 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-querycap.rst +4 -4
index 97a394bbcc9c..2824ead350b9 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-queryctrl.rst +2 -2
index db3ad928ec1c..ef32e28e57c7 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-reqbufs.rst +3 -3
index 39c9bf8af47a..195f0a3d783c 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst +11 -11
index efbe3a1f1134..e33969b9d3da 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-streamon.rst +1 -1
index 25dfaa44af3b..972d5b3c74aa 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-interval.rst +1 -1
index 3df2099ceeb9..db7145016571 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-subdev-g-crop.rst +1 -1
index b0fb5203e65f..80517ec8a847 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-subdev-g-frame-interval.rst +1 -1
index f8405bf344fa..7580174a6ed1 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-subdev-g-selection.rst +1 -1
index 697fc40434cc..d581ff6cf458 100644

Lines of this file are not shown. View the raw message.

Documentation/media/uapi/v4l/vidioc-subscribe-event.rst +1 -1
index 04eee095952b..0202a78cbeb0 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.7.4

Part of the diff is not shown here. View the raw message.

#17 lore raw

PATCH 16/47 diff-v4l.rst: Fix V4L version 1 references

In reply to Mauro Carvalho Chehab

The V4L version 1 structures had long gone from the Linux Kernel. It doesn't make sense to use cross-references for them, as they won't be found.

So, get rid of them.

---
 Documentation/media/uapi/v4l/diff-v4l.rst | 38 +++++++++++++++----------------
 1 file changed, 19 insertions(+), 19 deletions(-)
Documentation/media/uapi/v4l/diff-v4l.rst +19 -19
index 93794e015e7c..0419e2051759 100644
@@ -87,7 +87,7 @@ Querying Capabilities
 The V4L ``VIDIOCGCAP`` ioctl is equivalent to V4L2's
 :ref:`VIDIOC_QUERYCAP`.
 
-The ``name`` field in struct :c:type:`struct video_capability` became
+The ``name`` field in struct ``video_capability`` became
 ``card`` in struct :c:type:`v4l2_capability`, ``type``
 was replaced by ``capabilities``. Note V4L2 does not distinguish between
 device types like this, better think of basic video input, video output
@@ -264,7 +264,7 @@ Video Sources
 =============
 
 V4L provides the ``VIDIOCGCHAN`` and ``VIDIOCSCHAN`` ioctl using struct
-:c:type:`struct video_channel` to enumerate the video inputs of a V4L
+``video_channel`` to enumerate the video inputs of a V4L
 device. The equivalent V4L2 ioctls are
 :ref:`VIDIOC_ENUMINPUT`,
 :ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` and
@@ -283,7 +283,7 @@ video input types were renamed as follows:
 
     -  .. row 1
 
-       -  struct :c:type:`struct video_channel` ``type``
+       -  struct ``video_channel`` ``type``
 
        -  struct :c:type:`v4l2_input` ``type``
 
@@ -328,7 +328,7 @@ Tuning
 ======
 
 The V4L ``VIDIOCGTUNER`` and ``VIDIOCSTUNER`` ioctl and struct
-:c:type:`struct video_tuner` can be used to enumerate the tuners of a
+``video_tuner`` can be used to enumerate the tuners of a
 V4L TV or radio device. The equivalent V4L2 ioctls are
 :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` and
 :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` using struct
@@ -374,7 +374,7 @@ Image Properties
 ================
 
 V4L2 has no equivalent of the ``VIDIOCGPICT`` and ``VIDIOCSPICT`` ioctl
-and struct :c:type:`struct video_picture`. The following fields where
+and struct ``video_picture``. The following fields where
 replaced by V4L2 controls accessible with the
 :ref:`VIDIOC_QUERYCTRL`,
 :ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` and
@@ -389,7 +389,7 @@ replaced by V4L2 controls accessible with the
 
     -  .. row 1
 
-       -  struct :c:type:`struct video_picture`
+       -  struct ``video_picture``
 
        -  V4L2 Control ID
 
@@ -445,7 +445,7 @@ into the struct :c:type:`v4l2_pix_format`:
 
     -  .. row 1
 
-       -  struct :c:type:`struct video_picture` ``palette``
+       -  struct ``video_picture`` ``palette``
 
        -  struct :c:type:`v4l2_pix_format` ``pixfmt``
 
@@ -554,7 +554,7 @@ Audio
 =====
 
 The ``VIDIOCGAUDIO`` and ``VIDIOCSAUDIO`` ioctl and struct
-:c:type:`struct video_audio` are used to enumerate the audio inputs
+``video_audio`` are used to enumerate the audio inputs
 of a V4L device. The equivalent V4L2 ioctls are
 :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` and
 :ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>` using struct
@@ -591,7 +591,7 @@ The following fields where replaced by V4L2 controls accessible with the
 
     -  .. row 1
 
-       -  struct :c:type:`struct video_audio`
+       -  struct ``video_audio``
 
        -  V4L2 Control ID
 
@@ -629,7 +629,7 @@ and ``VIDEO_AUDIO_MUTE`` flags where replaced by the boolean
 ``V4L2_CID_AUDIO_MUTE`` control.
 
 All V4L2 controls have a ``step`` attribute replacing the struct
-:c:type:`struct video_audio` ``step`` field. The V4L audio controls
+``video_audio`` ``step`` field. The V4L audio controls
 are assumed to range from 0 to 65535 with no particular reset value. The
 V4L2 API permits arbitrary limits and defaults which can be queried with
 the :ref:`VIDIOC_QUERYCTRL` ioctl. For general
@@ -642,7 +642,7 @@ Frame Buffer Overlay
 The V4L2 ioctls equivalent to ``VIDIOCGFBUF`` and ``VIDIOCSFBUF`` are
 :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>` and
 :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>`. The ``base`` field of struct
-:c:type:`struct video_buffer` remained unchanged, except V4L2 defines
+``video_buffer`` remained unchanged, except V4L2 defines
 a flag to indicate non-destructive overlays instead of a ``NULL``
 pointer. All other fields moved into the struct
 :c:type:`v4l2_pix_format` ``fmt`` substructure of
@@ -659,13 +659,13 @@ of the ``fmt`` union is used, a struct
 :c:type:`v4l2_window`.
 
 The ``x``, ``y``, ``width`` and ``height`` fields of struct
-:c:type:`struct video_window` moved into struct
+``video_window`` moved into struct
 :c:type:`v4l2_rect` substructure ``w`` of struct
-:c:type:`struct v4l2_window`. The ``chromakey``, ``clips``, and
+:c:type:`v4l2_window`. The ``chromakey``, ``clips``, and
 ``clipcount`` fields remained unchanged. Struct
-:c:type:`struct video_clip` was renamed to struct
+``video_clip`` was renamed to struct
 :c:type:`v4l2_clip`, also containing a struct
-:c:type:`struct v4l2_rect`, but the semantics are still the same.
+:c:type:`v4l2_rect`, but the semantics are still the same.
 
 The ``VIDEO_WINDOW_INTERLACE`` flag was dropped. Instead applications
 must set the ``field`` field to ``V4L2_FIELD_ANY`` or
@@ -675,7 +675,7 @@ name ``V4L2_FBUF_FLAG_CHROMAKEY``.
 
 In V4L, storing a bitmap pointer in ``clips`` and setting ``clipcount``
 to ``VIDEO_CLIP_BITMAP`` (-1) requests bitmap clipping, using a fixed
-size bitmap of 1024 × 625 bits. Struct :c:type:`struct v4l2_window`
+size bitmap of 1024 × 625 bits. Struct :c:type:`v4l2_window`
 has a separate ``bitmap`` pointer field for this purpose and the bitmap
 size is determined by ``w.width`` and ``w.height``.
 
@@ -688,7 +688,7 @@ Cropping
 
 To capture only a subsection of the full picture V4L defines the
 ``VIDIOCGCAPTURE`` and ``VIDIOCSCAPTURE`` ioctls using struct
-:c:type:`struct video_capture`. The equivalent V4L2 ioctls are
+``video_capture``. The equivalent V4L2 ioctls are
 :ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and
 :ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` using struct
 :c:type:`v4l2_crop`, and the related
@@ -697,7 +697,7 @@ complex matter, see :ref:`crop` for details.
 
 The ``x``, ``y``, ``width`` and ``height`` fields moved into struct
 :c:type:`v4l2_rect` substructure ``c`` of struct
-:c:type:`struct v4l2_crop`. The ``decimation`` field was dropped. In
+:c:type:`v4l2_crop`. The ``decimation`` field was dropped. In
 the V4L2 API the scaling factor is implied by the size of the cropping
 rectangle and the size of the captured or overlaid image.
 
@@ -889,7 +889,7 @@ with the following parameters:
 
 Undocumented in the V4L specification, in Linux 2.3 the
 ``VIDIOCGVBIFMT`` and ``VIDIOCSVBIFMT`` ioctls using struct
-:c:type:`struct vbi_format` were added to determine the VBI image
+``vbi_format`` were added to determine the VBI image
 parameters. These ioctls are only partially compatible with the V4L2 VBI
 interface specified in :ref:`raw-vbi`.
 
Signature · 1 line
2.7.4
#18 lore raw

PATCH 17/47 v4l2-ctrls.h: fix doc reference for prepare_ext_ctrls()

In reply to Mauro Carvalho Chehab

The prepare_ext_ctrls() function is actually internal to the v4l2-ctrls.c implementation, so it doesn't have a declaration for the kAPI header to reference it.

---
 include/media/v4l2-ctrls.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/media/v4l2-ctrls.h +1 -1
index a63f37044f1c..ff2847705dac 100644
@@ -239,7 +239,7 @@ struct v4l2_ctrl {
  * @next:	Single-link list node for the hash.
  * @ctrl:	The actual control information.
  * @helper:	Pointer to helper struct. Used internally in
- *		prepare_ext_ctrls().
+ *		``prepare_ext_ctrls`` function at ``v4l2-ctrl.c``.
  *
  * Each control handler has a list of these refs. The list_head is used to
  * keep a sorted-by-control-ID list of all controls, while the next pointer
Signature · 1 line
2.7.4
#19 lore raw

PATCH 18/47 docs-rst: use C domain for enum references on uapi

In reply to Mauro Carvalho Chehab

Change the parse-headers.pl and the corresponding files to use the C domain for enum references.

---
 Documentation/media/uapi/v4l/hist-v4l2.rst           |  2 +-
 Documentation/media/uapi/v4l/subdev-formats.rst      |  2 +-
 Documentation/media/uapi/v4l/v4l2.rst                |  2 +-
 Documentation/media/uapi/v4l/vidioc-dqevent.rst      |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-priority.rst   |  2 +-
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst    | 14 +++++++-------
 Documentation/media/uapi/v4l/vidioc-subdev-g-fmt.rst | 10 +++++-----
 include/media/v4l2-dev.h                             | 12 ++++++------
 8 files changed, 23 insertions(+), 23 deletions(-)
Documentation/media/uapi/v4l/hist-v4l2.rst +1 -1
index a84895968349..bd45431ed00e 100644
@@ -1361,7 +1361,7 @@ V4L2 in Linux 3.19
    :ref:`v4l2_quantization <v4l2-quantization>` fields to struct
    :c:type:`v4l2_pix_format`, struct
    :c:type:`v4l2_pix_format_mplane` and
-   struct :ref:`v4l2_mbus_framefmt <v4l2-mbus-framefmt>`.
+   struct :c:type:`v4l2_mbus_framefmt`.
 
 
 V4L2 in Linux 4.4
Documentation/media/uapi/v4l/subdev-formats.rst +1 -1
index 52013b55ea80..f0d7754f1906 100644
@@ -7,7 +7,7 @@ Media Bus Formats
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-mbus-framefmt:
+.. c:type:: v4l2_mbus_framefmt
 
 .. flat-table:: struct v4l2_mbus_framefmt
     :header-rows:  0
Documentation/media/uapi/v4l/v4l2.rst +1 -1
index 785d4cdd2f85..e020c57f98d4 100644
@@ -116,7 +116,7 @@ Rewrote Colorspace chapter, added new enum
 :ref:`v4l2_quantization <v4l2-quantization>` fields to struct
 :c:type:`v4l2_pix_format`, struct
 :c:type:`v4l2_pix_format_mplane` and struct
-:ref:`v4l2_mbus_framefmt <v4l2-mbus-framefmt>`.
+:c:type:`v4l2_mbus_framefmt`.
 
 
 :revision: 3.17 / 2014-08-04 (*lp, hv*)
Documentation/media/uapi/v4l/vidioc-dqevent.rst +1 -1
index cf0e98f5112f..3038f349049c 100644
@@ -356,7 +356,7 @@ call.
 
        -
        -  The type of the control. See enum
-	  :ref:`v4l2_ctrl_type <v4l2-ctrl-type>`.
+	  :c:type:`v4l2_ctrl_type`.
 
     -  .. row 3
 
Documentation/media/uapi/v4l/vidioc-g-priority.rst +1 -1
index d6a07c076837..cbd2a3cbb18e 100644
@@ -44,7 +44,7 @@ an enum v4l2_priority variable and call :ref:`VIDIOC_S_PRIORITY <VIDIOC_G_PRIORI
 with a pointer to this variable.
 
 
-.. _v4l2-priority:
+.. c:type:: v4l2_priority
 
 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
 
Documentation/media/uapi/v4l/vidioc-queryctrl.rst +7 -7
index ef32e28e57c7..1a798be69e10 100644
@@ -142,7 +142,7 @@ See also the examples in :ref:`control`.
        -  ``minimum``
 
        -  Minimum value, inclusive. This field gives a lower bound for the
-	  control. See enum :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how
+	  control. See enum :c:type:`v4l2_ctrl_type` how
 	  the minimum value is to be used for each possible control type.
 	  Note that this a signed 32-bit value.
 
@@ -153,7 +153,7 @@ See also the examples in :ref:`control`.
        -  ``maximum``
 
        -  Maximum value, inclusive. This field gives an upper bound for the
-	  control. See enum :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how
+	  control. See enum :c:type:`v4l2_ctrl_type` how
 	  the maximum value is to be used for each possible control type.
 	  Note that this a signed 32-bit value.
 
@@ -164,7 +164,7 @@ See also the examples in :ref:`control`.
        -  ``step``
 
        -  This field gives a step size for the control. See enum
-	  :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how the step value is
+	  :c:type:`v4l2_ctrl_type` how the step value is
 	  to be used for each possible control type. Note that this an
 	  unsigned 32-bit value.
 
@@ -269,7 +269,7 @@ See also the examples in :ref:`control`.
        -  ``minimum``
 
        -  Minimum value, inclusive. This field gives a lower bound for the
-	  control. See enum :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how
+	  control. See enum :c:type:`v4l2_ctrl_type` how
 	  the minimum value is to be used for each possible control type.
 	  Note that this a signed 64-bit value.
 
@@ -280,7 +280,7 @@ See also the examples in :ref:`control`.
        -  ``maximum``
 
        -  Maximum value, inclusive. This field gives an upper bound for the
-	  control. See enum :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how
+	  control. See enum :c:type:`v4l2_ctrl_type` how
 	  the maximum value is to be used for each possible control type.
 	  Note that this a signed 64-bit value.
 
@@ -291,7 +291,7 @@ See also the examples in :ref:`control`.
        -  ``step``
 
        -  This field gives a step size for the control. See enum
-	  :ref:`v4l2_ctrl_type <v4l2-ctrl-type>` how the step value is
+	  :c:type:`v4l2_ctrl_type` how the step value is
 	  to be used for each possible control type. Note that this an
 	  unsigned 64-bit value.
 
@@ -456,7 +456,7 @@ See also the examples in :ref:`control`.
 
 .. tabularcolumns:: |p{5.8cm}|p{1.4cm}|p{1.0cm}|p{1.4cm}|p{6.9cm}|
 
-.. _v4l2-ctrl-type:
+.. c:type:: v4l2_ctrl_type
 
 .. cssclass:: longtable
 
Documentation/media/uapi/v4l/vidioc-subdev-g-fmt.rst +5 -5
index 2df1342ac6ea..90d876faa5b9 100644
@@ -38,7 +38,7 @@ These ioctls are used to negotiate the frame format at specific subdev
 pads in the image pipeline.
 
 To retrieve the current format applications set the ``pad`` field of a
-struct :ref:`v4l2_subdev_format <v4l2-subdev-format>` to the desired
+struct :c:type:`v4l2_subdev_format` to the desired
 pad number as reported by the media API and the ``which`` field to
 ``V4L2_SUBDEV_FORMAT_ACTIVE``. When they call the
 ``VIDIOC_SUBDEV_G_FMT`` ioctl with a pointer to this structure the
@@ -49,7 +49,7 @@ To change the current format applications set both the ``pad`` and
 the ``VIDIOC_SUBDEV_S_FMT`` ioctl with a pointer to this structure the
 driver verifies the requested format, adjusts it based on the hardware
 capabilities and configures the device. Upon return the struct
-:ref:`v4l2_subdev_format <v4l2-subdev-format>` contains the current
+:c:type:`v4l2_subdev_format` contains the current
 format as would be returned by a ``VIDIOC_SUBDEV_G_FMT`` call.
 
 Applications can query the device capabilities by setting the ``which``
@@ -78,7 +78,7 @@ should be as close as possible to the original request.
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
-.. _v4l2-subdev-format:
+.. c:type:: v4l2_subdev_format
 
 .. flat-table:: struct v4l2_subdev_format
     :header-rows:  0
@@ -105,7 +105,7 @@ should be as close as possible to the original request.
 
     -  .. row 3
 
-       -  struct :ref:`v4l2_mbus_framefmt <v4l2-mbus-framefmt>`
+       -  struct :c:type:`v4l2_mbus_framefmt`
 
        -  ``format``
 
@@ -164,7 +164,7 @@ EBUSY
     fix the problem first. Only returned by ``VIDIOC_SUBDEV_S_FMT``
 
 EINVAL
-    The struct :ref:`v4l2_subdev_format <v4l2-subdev-format>`
+    The struct :c:type:`v4l2_subdev_format`
     ``pad`` references a non-existing pad, or the ``which`` field
     references a non-existing format.
 
include/media/v4l2-dev.h +6 -6
index 5272aeec0cec..477e90d89a04 100644
@@ -56,7 +56,7 @@ struct v4l2_ctrl_handler;
  *
  * .. note::
  *    The size of @prios array matches the number of priority types defined
- *    by :ref:`enum v4l2_priority <v4l2-priority>`.
+ *    by enum &v4l2_priority.
  */
 struct v4l2_prio_state {
 	atomic_t prios[4];
@@ -73,8 +73,8 @@ void v4l2_prio_init(struct v4l2_prio_state *global);
  * v4l2_prio_change - changes the v4l2 file handler priority
  *
  * @global: pointer to the &struct v4l2_prio_state of the device node.
- * @local: pointer to the desired priority, as defined by :ref:`enum v4l2_priority <v4l2-priority>`
- * @new: Priority type requested, as defined by :ref:`enum v4l2_priority <v4l2-priority>`.
+ * @local: pointer to the desired priority, as defined by enum &v4l2_priority
+ * @new: Priority type requested, as defined by enum &v4l2_priority.
  *
  * .. note::
  *	This function should be used only by the V4L2 core.
@@ -86,7 +86,7 @@ int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
  * v4l2_prio_open - Implements the priority logic for a file handler open
  *
  * @global: pointer to the &struct v4l2_prio_state of the device node.
- * @local: pointer to the desired priority, as defined by :ref:`enum v4l2_priority <v4l2-priority>`
+ * @local: pointer to the desired priority, as defined by enum &v4l2_priority
  *
  * .. note::
  *	This function should be used only by the V4L2 core.
@@ -97,7 +97,7 @@ void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
  * v4l2_prio_close - Implements the priority logic for a file handler close
  *
  * @global: pointer to the &struct v4l2_prio_state of the device node.
- * @local: priority to be released, as defined by :ref:`enum v4l2_priority <v4l2-priority>`
+ * @local: priority to be released, as defined by enum &v4l2_priority
  *
  * .. note::
  *	This function should be used only by the V4L2 core.
@@ -118,7 +118,7 @@ enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
  * v4l2_prio_close - Implements the priority logic for a file handler close
  *
  * @global: pointer to the &struct v4l2_prio_state of the device node.
- * @local: desired priority, as defined by :ref:`enum v4l2_priority <v4l2-priority>` local
+ * @local: desired priority, as defined by enum &v4l2_priority local
  *
  * .. note::
  *	This function should be used only by the V4L2 core.
Signature · 1 line
2.7.4
#20 lore raw

PATCH 19/47 v4l2-ctrls.h: Fix some c:type references

In reply to Mauro Carvalho Chehab

Now that the uAPI is using c:type, let's use it here too.

---
 include/media/v4l2-ctrls.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/media/v4l2-ctrls.h +4 -4
index ff2847705dac..86702037cf5d 100644
@@ -973,9 +973,9 @@ extern const struct v4l2_subscribed_event_ops v4l2_ctrl_sub_ev_ops;
  * v4l2_ctrl_replace - Function to be used as a callback to
  *	&struct v4l2_subscribed_event_ops replace\(\)
  *
- * @old: pointer to :ref:`struct v4l2_event <v4l2-event>` with the reported
+ * @old: pointer to struct &v4l2_event with the reported
  *	 event;
- * @new: pointer to :ref:`struct v4l2_event <v4l2-event>` with the modified
+ * @new: pointer to struct &v4l2_event with the modified
  *	 event;
  */
 void v4l2_ctrl_replace(struct v4l2_event *old, const struct v4l2_event *new);
@@ -984,9 +984,9 @@ void v4l2_ctrl_replace(struct v4l2_event *old, const struct v4l2_event *new);
  * v4l2_ctrl_merge - Function to be used as a callback to
  *	&struct v4l2_subscribed_event_ops merge(\)
  *
- * @old: pointer to :ref:`struct v4l2_event <v4l2-event>` with the reported
+ * @old: pointer to struct &v4l2_event with the reported
  *	 event;
- * @new: pointer to :ref:`struct v4l2_event <v4l2-event>` with the merged
+ * @new: pointer to struct &v4l2_event with the merged
  *	 event;
  */
 void v4l2_ctrl_merge(const struct v4l2_event *old, struct v4l2_event *new);
Signature · 1 line
2.7.4
#21 lore raw

PATCH 20/47 cec-ioc-dqevent.rst: fix some undefined references

In reply to Mauro Carvalho Chehab

Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_state_change Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_state_change Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_lost_msgs Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_lost_msgs Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_state_change Documentation/output/cec.h.rst:6: WARNING: c:type reference target not found: cec_event_lost_msgs

---
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/media/uapi/cec/cec-ioc-dqevent.rst +2 -2
index 10228eb0fd4a..06b79361254c 100644
@@ -51,7 +51,7 @@ it is guaranteed that the state did change in between the two events.
 
 .. tabularcolumns:: |p{1.2cm}|p{2.9cm}|p{13.4cm}|
 
-.. _cec-event-state-change_s:
+.. c:type:: cec_event_state_change
 
 .. flat-table:: struct cec_event_state_change
     :header-rows:  0
@@ -78,7 +78,7 @@ it is guaranteed that the state did change in between the two events.
 
 .. tabularcolumns:: |p{1.0cm}|p{2.0cm}|p{14.5cm}|
 
-.. _cec-event-lost-msgs_s:
+.. c:type:: cec_event_lost_msgs
 
 .. flat-table:: struct cec_event_lost_msgs
     :header-rows:  0
Signature · 1 line
2.7.4
#22 lore raw

PATCH 21/47 v4l2-ioctl.h: document the remaining functions

In reply to Mauro Carvalho Chehab

There are several undocumented functions here; document them.

While here, make checkpatch.pl happy.

---
 Documentation/media/conf_nitpick.py |   1 +
 include/media/v4l2-ioctl.h          | 502 +++++++++++++++++++++---------------
 2 files changed, 301 insertions(+), 202 deletions(-)
Documentation/media/conf_nitpick.py +1 -0
index 1c7928abace5..1f3ef3ded2d4 100644
@@ -96,5 +96,6 @@ nitpick_ignore = [
     ("c:type", "__user"),
     ("c:type", "usb_device"),
     ("c:type", "usb_interface"),
+    ("c:type", "v4l2_std_id"),
     ("c:type", "video_system_t"),
 ]
include/media/v4l2-ioctl.h +300 -202

611 lines not on this page · raw message

Signature · 1 line
2.7.4
#23 lore raw

PATCH 22/47 v4l2-dev.rst: fix a broken c domain reference

In reply to Mauro Carvalho Chehab

The "struct" were inside the reference, causing it to break.

---
 Documentation/media/kapi/v4l2-dev.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/media/kapi/v4l2-dev.rst +1 -1
index 5782be725334..0a3b4503a89f 100644
@@ -56,7 +56,7 @@ You should also set these fields of :c:type:`video_device`:
   :c:type:`video_device`->vfl_dir fields are used to disable ops that do not
   match the type/dir combination. E.g. VBI ops are disabled for non-VBI nodes,
   and output ops  are disabled for a capture device. This makes it possible to
-  provide just one :c:type:`v4l2_ioctl_ops struct` for both vbi and
+  provide just one :c:type:`v4l2_ioctl_ops` struct for both vbi and
   video nodes.
 
 - :c:type:`video_device`->lock: leave to ``NULL`` if you want to do all the
Signature · 1 line
2.7.4
maintainer Acked-by on v1 22/47
#24 lore raw

Re: [PATCH 22/47] [media] v4l2-dev.rst: fix a broken c domain reference

Hi Mauro,

Thank you for the patch.

Quoted 3 lines · On Thursday 08 Sep 2016 09:03:44 Mauro Carvalho Chehab wrote:

The "struct" were inside the reference, causing it to break.

Documentation/media/kapi/v4l2-dev.rst You should also set these fields of

Quoted 11 lines
---
 Documentation/media/kapi/v4l2-dev.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/Documentation/media/kapi/v4l2-dev.rst index 5782be725334..0a3b4503a89f 100644

Documentation/media/kapi/v4l2-dev.rst +0 -0
@@ -56,7 +56,7 @@ You should also set these fields of 

:c:type:video_device:

Quoted 10 lines
Documentation/media/kapi/v4l2-dev.rst +0 -0
   :c:type:`video_device`->vfl_dir fields are used to disable ops that do
   :not
 
   match the type/dir combination. E.g. VBI ops are disabled for non-VBI

nodes, and output ops are disabled for a capture device. This makes it possible to - provide just one :c:type:v4l2_ioctl_ops struct for both vbi and + provide just one :c:type:v4l2_ioctl_ops struct for both vbi and video nodes.

- :c:type:video_device->lock: leave to ``NULL`` if you want to do all the

Signature · 3 lines
Regards,

Laurent Pinchart
#25 lore raw

PATCH 23/47 v4l2-device.h: fix some doc tags

In reply to Mauro Carvalho Chehab

Fix some minor issues at the documentation tags on this file, adding cross-references where needed, and fixing some broken ones.

---
 include/media/v4l2-device.h | 54 ++++++++++++++++++++++-----------------------
 1 file changed, 27 insertions(+), 27 deletions(-)
include/media/v4l2-device.h +27 -27
index a9d6aa41790e..781cbfd168f0 100644
@@ -39,7 +39,7 @@ struct v4l2_ctrl_handler;
  *	if this struct is embedded into a larger struct.
  * @name: unique device name, by default the driver name + bus ID
  * @notify: notify callback called by some sub-devices.
- * @ctrl_handler: The control handler. May be NULL.
+ * @ctrl_handler: The control handler. May be %NULL.
  * @prio: Device's priority state
  * @ref: Keep track of the references to this struct.
  * @release: Release function that is called when the ref count
@@ -53,8 +53,8 @@ struct v4l2_ctrl_handler;
  *
  * .. note::
  *
- *    #) dev->driver_data points to this struct.
- *    #) dev might be NULL if there is no parent device
+ *    #) @dev->driver_data points to this struct.
+ *    #) @dev might be %NULL if there is no parent device
  */
 
 struct v4l2_device {
@@ -76,10 +76,10 @@ struct v4l2_device {
 /**
  * v4l2_device_get - gets a V4L2 device reference
  *
- * @v4l2_dev: pointer to struct v4l2_device
+ * @v4l2_dev: pointer to struct &v4l2_device
  *
  * This is an ancillary routine meant to increment the usage for the
- * struct v4l2_device pointed by @v4l2_dev.
+ * struct &v4l2_device pointed by @v4l2_dev.
  */
 static inline void v4l2_device_get(struct v4l2_device *v4l2_dev)
 {
@@ -89,23 +89,23 @@ static inline void v4l2_device_get(struct v4l2_device *v4l2_dev)
 /**
  * v4l2_device_put - putss a V4L2 device reference
  *
- * @v4l2_dev: pointer to struct v4l2_device
+ * @v4l2_dev: pointer to struct &v4l2_device
  *
  * This is an ancillary routine meant to decrement the usage for the
- * struct v4l2_device pointed by @v4l2_dev.
+ * struct &v4l2_device pointed by @v4l2_dev.
  */
 int v4l2_device_put(struct v4l2_device *v4l2_dev);
 
 /**
- * v4l2_device_register -Initialize v4l2_dev and make dev->driver_data
- * 	point to v4l2_dev.
+ * v4l2_device_register - Initialize v4l2_dev and make @dev->driver_data
+ * 	point to @v4l2_dev.
  *
- * @dev: pointer to struct device
- * @v4l2_dev: pointer to struct v4l2_device
+ * @dev: pointer to struct &device
+ * @v4l2_dev: pointer to struct &v4l2_device
  *
  * .. note::
- *	dev may be NULL in rare cases (ISA devices).
- *	In such case the caller must fill in the v4l2_dev->name field
+ *	@dev may be %NULL in rare cases (ISA devices).
+ *	In such case the caller must fill in the @v4l2_dev->name field
  *	before calling this function.
  */
 int __must_check v4l2_device_register(struct device *dev,
@@ -113,14 +113,14 @@ int __must_check v4l2_device_register(struct device *dev,
 
 /**
  * v4l2_device_set_name - Optional function to initialize the
- * 	name field of struct v4l2_device
+ * 	name field of struct &v4l2_device
  *
- * @v4l2_dev: pointer to struct v4l2_device
+ * @v4l2_dev: pointer to struct &v4l2_device
  * @basename: base name for the device name
  * @instance: pointer to a static atomic_t var with the instance usage for
  * 	the device driver.
  *
- * v4l2_device_set_name() initializes the name field of struct v4l2_device
+ * v4l2_device_set_name() initializes the name field of struct &v4l2_device
  * using the driver name and a driver-global atomic_t instance.
  *
  * This function will increment the instance counter and returns the
@@ -132,7 +132,7 @@ int __must_check v4l2_device_register(struct device *dev,
  *
  *   ...
  *
- *   instance = v4l2_device_set_name(&v4l2_dev, "foo", &drv_instance);
+ *   instance = v4l2_device_set_name(&\ v4l2_dev, "foo", &\ drv_instance);
  *
  * The first time this is called the name field will be set to foo0 and
  * this function returns 0. If the name ends with a digit (e.g. cx18),
@@ -147,16 +147,16 @@ int v4l2_device_set_name(struct v4l2_device *v4l2_dev, const char *basename,
  * @v4l2_dev: pointer to struct v4l2_device
  *
  * Should be called when the USB parent disconnects.
- * Since the parent disappears, this ensures that v4l2_dev doesn't have
+ * Since the parent disappears, this ensures that @v4l2_dev doesn't have
  * an invalid parent pointer.
  *
- * .. note:: This function sets v4l2_dev->dev to NULL.
+ * .. note:: This function sets @v4l2_dev->dev to NULL.
  */
 void v4l2_device_disconnect(struct v4l2_device *v4l2_dev);
 
 /**
  *  v4l2_device_unregister - Unregister all sub-devices and any other
- *	 resources related to v4l2_dev.
+ *	 resources related to @v4l2_dev.
  *
  * @v4l2_dev: pointer to struct v4l2_device
  */
@@ -165,8 +165,8 @@ void v4l2_device_unregister(struct v4l2_device *v4l2_dev);
 /**
  * v4l2_device_register_subdev - Registers a subdev with a v4l2 device.
  *
- * @v4l2_dev: pointer to struct v4l2_device
- * @sd: pointer to struct v4l2_subdev
+ * @v4l2_dev: pointer to struct &v4l2_device
+ * @sd: pointer to struct &v4l2_subdev
  *
  * While registered, the subdev module is marked as in-use.
  *
@@ -179,7 +179,7 @@ int __must_check v4l2_device_register_subdev(struct v4l2_device *v4l2_dev,
 /**
  * v4l2_device_unregister_subdev - Unregisters a subdev with a v4l2 device.
  *
- * @sd: pointer to struct v4l2_subdev
+ * @sd: pointer to struct &v4l2_subdev
  *
  * .. note ::
  *
@@ -191,7 +191,7 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd);
 /**
  * v4l2_device_register_subdev_nodes - Registers device nodes for all subdevs
  *	of the v4l2 device that are marked with
- * 	the V4L2_SUBDEV_FL_HAS_DEVNODE flag.
+ * 	the %V4L2_SUBDEV_FL_HAS_DEVNODE flag.
  *
  * @v4l2_dev: pointer to struct v4l2_device
  */
@@ -201,7 +201,7 @@ v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev);
 /**
  * v4l2_subdev_notify - Sends a notification to v4l2_device.
  *
- * @sd: pointer to struct v4l2_subdev
+ * @sd: pointer to struct &v4l2_subdev
  * @notification: type of notification. Please notice that the notification
  * 	type is driver-specific.
  * @arg: arguments for the notification. Those are specific to each
@@ -300,8 +300,8 @@ static inline void v4l2_subdev_notify(struct v4l2_subdev *sd,
 
 /*
  * Call the specified callback for all subdevs where grp_id & grpmsk != 0
- * (if grpmsk == `0, then match them all). If the callback returns an error
- * other than 0 or -ENOIOCTLCMD, then return with that error code. Note that
+ * (if grpmsk == 0, then match them all). If the callback returns an error
+ * other than 0 or %-ENOIOCTLCMD, then return with that error code. Note that
  * you cannot add or delete a subdev while walking the subdevs list.
  */
 #define v4l2_device_mask_call_until_err(v4l2_dev, grpmsk, o, f, args...) \
Signature · 1 line
2.7.4
#26 lore raw

PATCH 24/47 v4l2-dv-timings.h: let kernel-doc parte the typedef argument

In reply to Mauro Carvalho Chehab

Now that scripts/kernel-doc was fixed to parse the typedef argument used here, let it produce documentation.

---
 include/media/v4l2-dv-timings.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/media/v4l2-dv-timings.h +2 -2
index 65caadf13eec..0a7d9e1fc8c8 100644
@@ -28,8 +28,8 @@
  */
 extern const struct v4l2_dv_timings v4l2_dv_timings_presets[];
 
-/*
- * v4l2_check_dv_timings_fnc - timings check callback
+/**
+ * typedef v4l2_check_dv_timings_fnc - timings check callback
  *
  * @t: the v4l2_dv_timings struct.
  * @handle: a handle from the driver.
Signature · 1 line
2.7.4
#27 lore raw

PATCH 25/47 v4l2-subdev.rst: get rid of legacy functions

In reply to Mauro Carvalho Chehab

There are two warnings that are due to functions that has long gone:

Documentation/media/kapi/v4l2-subdev.rst:417: WARNING: c:func reference target not found: v4l2_i2c_new_subdev_cfg Documentation/media/kapi/v4l2-subdev.rst:436: WARNING: c:func reference target not found: v4l2_i2c_new_probed_subdev

Update the documentation to remove those.

---
 Documentation/media/kapi/v4l2-subdev.rst | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)
Documentation/media/kapi/v4l2-subdev.rst +5 -16
index fcecce01a35c..e1f0b726e438 100644
@@ -412,19 +412,7 @@ later date. It differs between i2c drivers and as such can be confusing.
 To see which chip variants are supported you can look in the i2c driver code
 for the i2c_device_id table. This lists all the possibilities.
 
-There are two more helper functions:
-
-:c:func:`v4l2_i2c_new_subdev_cfg`: this function adds new irq and
-platform_data arguments and has both 'addr' and 'probed_addrs' arguments:
-if addr is not 0 then that will be used (non-probing variant), otherwise the
-probed_addrs are probed.
-
-For example: this will probe for address 0x10:
-
-.. code-block:: c
-
-	struct v4l2_subdev *sd = v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter,
-			  "module_foo", "chipid", 0, NULL, 0, I2C_ADDRS(0x10));
+There are one more helper function:
 
 :c:func:`v4l2_i2c_new_subdev_board` uses an :c:type:`i2c_board_info` struct
 which is passed to the i2c driver and replaces the irq, platform_data and addr
@@ -433,9 +421,10 @@ arguments.
 If the subdev supports the s_config core ops, then that op is called with
 the irq and platform_data arguments after the subdev was setup.
 
-The older :c:func:`v4l2_i2c_new_subdev` and
-:c:func:`v4l2_i2c_new_probed_subdev` functions will call ``s_config`` as
-well, but with irq set to 0 and platform_data set to ``NULL``.
+The :c:func:`v4l2_i2c_new_subdev` function will call
+:c:func:`v4l2_i2c_new_subdev_board`, internally filling a
+:c:type:`i2c_board_info` structure using the ``client_type`` and the
+``addr`` to fill it.
 
 V4L2 sub-device functions and data structures
 ---------------------------------------------
Signature · 1 line
2.7.4
#28 lore raw

PATCH 26/47 v4l2-subdev.h: fix a doc nitpick warning

In reply to Mauro Carvalho Chehab

One markup tag is wrong here.

---
 include/media/v4l2-subdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/media/v4l2-subdev.h +1 -1
index 6e1d044e3ee8..2c1e328ccb1d 100644
@@ -226,7 +226,7 @@ struct v4l2_subdev_core_ops {
  *
  * @g_tuner: callback for %VIDIOC_G_TUNER ioctl handler code.
  *
- * @s_tuner: callback for %VIDIOC_S_TUNER ioctl handler code. &vt->type must be
+ * @s_tuner: callback for %VIDIOC_S_TUNER ioctl handler code. @vt->type must be
  *	     filled in. Normally done by video_ioctl2 or the
  *	     bridge driver.
  *
Signature · 1 line
2.7.4
#29 lore raw

PATCH 27/47 docs-rst exceptions: use C domain references for DVB headers

In reply to Mauro Carvalho Chehab

Now that we moved away from the :ref: type of references, we need to update the exceptions lists.

---
 Documentation/media/audio.h.rst.exceptions         |  6 +-
 Documentation/media/ca.h.rst.exceptions            | 32 ++++----
 Documentation/media/dmx.h.rst.exceptions           | 85 +++++++++++-----------
 Documentation/media/frontend.h.rst.exceptions      |  8 +-
 Documentation/media/intro.rst                      |  2 +-
 Documentation/media/net.h.rst.exceptions           |  4 +-
 .../uapi/dvb/audio-bilingual-channel-select.rst    |  2 +-
 .../media/uapi/dvb/audio-channel-select.rst        |  2 +-
 .../media/uapi/dvb/audio-select-source.rst         |  2 +-
 .../media/uapi/dvb/audio-set-attributes.rst        |  2 +-
 Documentation/media/uapi/dvb/audio-set-karaoke.rst |  2 +-
 Documentation/media/uapi/dvb/audio-set-mixer.rst   |  2 +-
 Documentation/media/uapi/dvb/audio_data_types.rst  | 31 +-------
 Documentation/media/uapi/dvb/dmx_types.rst         | 39 ++++------
 Documentation/media/uapi/dvb/fe-bandwidth-t.rst    |  5 +-
 .../media/uapi/dvb/fe-diseqc-recv-slave-reply.rst  |  3 -
 .../media/uapi/dvb/fe-diseqc-send-burst.rst        |  9 +--
 .../media/uapi/dvb/fe-diseqc-send-master-cmd.rst   |  4 +-
 Documentation/media/uapi/dvb/fe-get-info.rst       | 11 +--
 Documentation/media/uapi/dvb/fe-read-status.rst    |  8 +-
 Documentation/media/uapi/dvb/fe-set-tone.rst       |  9 +--
 Documentation/media/uapi/dvb/fe-set-voltage.rst    |  4 +-
 Documentation/media/uapi/dvb/fe-type-t.rst         |  4 +-
 .../media/uapi/dvb/fe_property_parameters.rst      | 69 ++++++------------
 Documentation/media/uapi/dvb/net-add-if.rst        |  6 --
 Documentation/media/video.h.rst.exceptions         | 20 ++---
 26 files changed, 144 insertions(+), 227 deletions(-)
Documentation/media/audio.h.rst.exceptions +3 -3
index 8330edcd906d..f40f3cbfe4c9 100644
@@ -2,7 +2,7 @@
 ignore define _DVBAUDIO_H_
 
 # Typedef pointing to structs
-replace typedef audio_karaoke_t audio-karaoke
+replace typedef audio_karaoke_t :c:type:`audio_karaoke`
 
 # Undocumented audio caps, as this is a deprecated API anyway
 ignore define AUDIO_CAP_DTS
@@ -16,5 +16,5 @@ 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
+replace typedef audio_mixer_t :c:type:`audio_mixer`
+replace typedef audio_status_t :c:type:`audio_status`
Documentation/media/ca.h.rst.exceptions +16 -16
index 09c13be67527..d7c9fed8c004 100644
@@ -2,23 +2,23 @@
 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
+replace define CA_CI :c:type:`ca_slot_info`
+replace define CA_CI_LINK :c:type:`ca_slot_info`
+replace define CA_CI_PHYS :c:type:`ca_slot_info`
+replace define CA_DESCR :c:type:`ca_slot_info`
+replace define CA_SC :c:type:`ca_slot_info`
+replace define CA_CI_MODULE_PRESENT :c:type:`ca_slot_info`
+replace define CA_CI_MODULE_READY :c:type:`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
+replace define CA_ECD :c:type:`ca_descr_info`
+replace define CA_NDS :c:type:`ca_descr_info`
+replace define CA_DSS :c:type:`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
+replace typedef ca_pid_t :c:type:`ca_pid`
+replace typedef ca_slot_info_t :c:type:`ca_slot_info`
+replace typedef ca_descr_info_t :c:type:`ca_descr_info`
+replace typedef ca_caps_t :c:type:`ca_caps`
+replace typedef ca_msg_t :c:type:`ca_msg`
+replace typedef ca_descr_t :c:type:`ca_descr`
Documentation/media/dmx.h.rst.exceptions +44 -41

101 lines not on this page · raw message

Documentation/media/frontend.h.rst.exceptions +4 -4
index 60f2cbb92656..7656770f1936 100644
@@ -26,22 +26,22 @@ 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 enum fecap_scale_params :ref:`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
+replace ioctl FE_SET_PROPERTY :c:type:`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
+replace typedef fe_sec_voltage_t :c:type:`fe_sec_voltage`
 
 # Replaces for flag constants
-replace define FE_TUNE_MODE_ONESHOT fe_set_frontend_tune_mode
+replace define FE_TUNE_MODE_ONESHOT :c:func:`FE_SET_FRONTEND_TUNE_MODE`
 replace define LNA_AUTO dtv-lna
 replace define NO_STREAM_ID_FILTER dtv-stream-id
Documentation/media/intro.rst +1 -1
index be90bda5b3f3..f6086c159772 100644
@@ -30,7 +30,7 @@ divided into five parts.
    called as DVB API, in fact it covers several different video standards
    including DVB-T/T2, DVB-S/S2, DVB-C, ATSC, ISDB-T, ISDB-S, DTMB, etc. The
    complete list of supported standards can be found at
-   :ref:`fe-delivery-system-t`.
+   :c:type:`fe_delivery_system`.
 
 3. The :ref:`third part <remote_controllers>` covers the Remote Controller API.
 
Documentation/media/net.h.rst.exceptions +2 -2
index 30a267483aa9..afe6bef91567 100644
@@ -7,5 +7,5 @@ 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
+replace define DVB_NET_FEEDTYPE_MPE :c:type:`dvb_net_if`
+replace define DVB_NET_FEEDTYPE_ULE :c:type:`dvb_net_if`
Documentation/media/uapi/dvb/audio-bilingual-channel-select.rst +1 -1
index e048ee8f4d65..1279bd21dbd0 100644
@@ -16,7 +16,7 @@ AUDIO_BILINGUAL_CHANNEL_SELECT
 Synopsis
 --------
 
-.. c:function:: int ioctl(int fd, AUDIO_BILINGUAL_CHANNEL_SELECT, audio_channel_select_t)
+.. c:function:: int ioctl(int fd, AUDIO_BILINGUAL_CHANNEL_SELECT, struct *audio_channel_select)
     :name: AUDIO_BILINGUAL_CHANNEL_SELECT
 
 
Documentation/media/uapi/dvb/audio-channel-select.rst +1 -1
index 03dcdbbfbbc6..2ceb4efebdf0 100644
@@ -16,7 +16,7 @@ AUDIO_CHANNEL_SELECT
 Synopsis
 --------
 
-.. c:function:: int ioctl(int fd, AUDIO_CHANNEL_SELECT, audio_channel_select_t)
+.. c:function:: int ioctl(int fd, AUDIO_CHANNEL_SELECT, struct *audio_channel_select)
     :name: AUDIO_CHANNEL_SELECT
 
 
Documentation/media/uapi/dvb/audio-select-source.rst +1 -1
index e4ea98787619..c0434a0bd324 100644
@@ -16,7 +16,7 @@ AUDIO_SELECT_SOURCE
 Synopsis
 --------
 
-.. c:function:: int ioctl(int fd, AUDIO_SELECT_SOURCE, audio_stream_source_t source)
+.. c:function:: int ioctl(int fd, AUDIO_SELECT_SOURCE, struct audio_stream_source *source)
     :name: AUDIO_SELECT_SOURCE
 
 
Documentation/media/uapi/dvb/audio-set-attributes.rst +1 -1
index ad89a37cf83c..f0c6153ca80f 100644
@@ -17,7 +17,7 @@ AUDIO_SET_ATTRIBUTES
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, AUDIO_SET_ATTRIBUTES, audio_attributes_t attr )
+.. c:function:: int ioctl(fd, AUDIO_SET_ATTRIBUTES, struct audio_attributes *attr )
     :name: AUDIO_SET_ATTRIBUTES
 
 Arguments
Documentation/media/uapi/dvb/audio-set-karaoke.rst +1 -1
index 78571abdd93a..c759952d88aa 100644
@@ -16,7 +16,7 @@ AUDIO_SET_KARAOKE
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, AUDIO_SET_KARAOKE, audio_karaoke_t *karaoke)
+.. c:function:: int ioctl(fd, AUDIO_SET_KARAOKE, struct audio_karaoke *karaoke)
     :name: AUDIO_SET_KARAOKE
 
 
Documentation/media/uapi/dvb/audio-set-mixer.rst +1 -1
index 657bd89b8a6a..248aab8c8909 100644
@@ -16,7 +16,7 @@ AUDIO_SET_MIXER
 Synopsis
 --------
 
-.. c:function:: int ioctl(int fd, AUDIO_SET_MIXER, audio_mixer_t *mix)
+.. c:function:: int ioctl(int fd, AUDIO_SET_MIXER, struct audio_mixer *mix)
     :name: AUDIO_SET_MIXER
 
 Arguments
Documentation/media/uapi/dvb/audio_data_types.rst +4 -27
index 0b14c2dfc98c..6b93359d64f7 100644
@@ -9,11 +9,7 @@ Audio Data Types
 This section describes the structures, data types and defines used when
 talking to the audio device.
 
-
-.. _audio-stream-source-t:
-
-audio_stream_source_t
-=====================
+.. c:type:: audio_stream_source
 
 The audio stream source is set through the AUDIO_SELECT_SOURCE call
 and can take the following values, depending on whether we are replaying
@@ -33,10 +29,7 @@ AUDIO_SOURCE_MEMORY is selected the stream comes from the application
 through the ``write()`` system call.
 
 
-.. _audio-play-state-t:
-
-audio_play_state_t
-==================
+.. c:type:: audio_play_state
 
 The following values can be returned by the AUDIO_GET_STATUS call
 representing the state of audio playback.
@@ -51,10 +44,7 @@ representing the state of audio playback.
     } audio_play_state_t;
 
 
-.. _audio-channel-select-t:
-
-audio_channel_select_t
-======================
+.. c:type:: audio_channel_select
 
 The audio channel selected via AUDIO_CHANNEL_SELECT is determined by
 the following values.
@@ -73,9 +63,6 @@ the following values.
 
 .. c:type:: audio_status
 
-struct audio_status
-===================
-
 The AUDIO_GET_STATUS call returns the following structure informing
 about various states of the playback operation.
 
@@ -95,9 +82,6 @@ about various states of the playback operation.
 
 .. c:type:: audio_mixer
 
-struct audio_mixer
-==================
-
 The following structure is used by the AUDIO_SET_MIXER call to set the
 audio volume.
 
@@ -131,12 +115,8 @@ following bits set according to the hardwares capabilities.
      #define AUDIO_CAP_SDDS 128
      #define AUDIO_CAP_AC3  256
 
-
 .. c:type:: audio_karaoke
 
-struct audio_karaoke
-====================
-
 The ioctl AUDIO_SET_KARAOKE uses the following format:
 
 
@@ -155,10 +135,7 @@ into the left channel and Vocal2 into the right channel at 100% each. Ff
 Melody is non-zero, the melody channel gets mixed into left and right.
 
 
-.. _audio-attributes-t:
-
-audio attributes
-================
+.. c:type:: audio_attributes
 
 The following attributes can be set by a call to AUDIO_SET_ATTRIBUTES:
 
Documentation/media/uapi/dvb/dmx_types.rst +14 -25
index 65de705fa1ef..80dd659860d7 100644
@@ -6,16 +6,13 @@
 Demux Data Types
 ****************
 
-
-.. _dmx-output-t:
-
 Output for the demux
 ====================
 
+.. c:type:: dmx_output
+
 .. tabularcolumns:: |p{5.0cm}|p{12.5cm}|
 
-.. _dmx-output:
-
 .. flat-table:: enum dmx_output
     :header-rows:  1
     :stub-columns: 0
@@ -66,12 +63,10 @@ Output for the demux
 	  from the DMX device.
 
 
-
-.. _dmx-input-t:
-
 dmx_input_t
 ===========
 
+.. c:type:: dmx_input
 
 .. code-block:: c
 
@@ -82,11 +77,11 @@ dmx_input_t
     } dmx_input_t;
 
 
-.. _dmx-pes-type-t:
-
 dmx_pes_type_t
 ==============
 
+.. c:type:: dmx_pes_type
+
 
 .. code-block:: c
 
@@ -120,11 +115,10 @@ dmx_pes_type_t
     } dmx_pes_type_t;
 
 
-.. c:type:: dmx_filter
-
 struct dmx_filter
 =================
 
+.. c:type:: dmx_filter
 
 .. code-block:: c
 
@@ -157,11 +151,10 @@ struct dmx_sct_filter_params
     };
 
 
-.. c:type:: dmx_pes_filter_params
-
 struct dmx_pes_filter_params
 ============================
 
+.. c:type:: dmx_pes_filter_params
 
 .. code-block:: c
 
@@ -175,11 +168,10 @@ struct dmx_pes_filter_params
     };
 
 
-.. _dmx-event:
-
 struct dmx_event
 ================
 
+.. c:type:: dmx_event
 
 .. code-block:: c
 
@@ -194,11 +186,10 @@ struct dmx_event
      };
 
 
-.. c:type:: dmx_stc
-
 struct dmx_stc
 ==============
 
+.. c:type:: dmx_stc
 
 .. code-block:: c
 
@@ -209,11 +200,10 @@ struct dmx_stc
     };
 
 
-.. c:type:: dmx_caps
-
 struct dmx_caps
 ===============
 
+.. c:type:: dmx_caps
 
 .. code-block:: c
 
@@ -223,15 +213,14 @@ struct dmx_caps
     } dmx_caps_t;
 
 
-.. _dmx-source-t:
-
-enum dmx_source_t
-=================
+enum dmx_source
+===============
 
+.. c:type:: dmx_source
 
 .. code-block:: c
 
-    typedef enum {
+    typedef enum dmx_source {
 	DMX_SOURCE_FRONT0 = 0,
 	DMX_SOURCE_FRONT1,
 	DMX_SOURCE_FRONT2,
Documentation/media/uapi/dvb/fe-bandwidth-t.rst +1 -4
index 8edaf1a8fbc8..70256180e9b3 100644
@@ -1,13 +1,10 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _fe-bandwidth-t:
-
 ******************
 Frontend bandwidth
 ******************
 
-
-.. _fe-bandwidth:
+.. c:type:: fe_bandwidth
 
 .. flat-table:: enum fe_bandwidth
     :header-rows:  1
Documentation/media/uapi/dvb/fe-diseqc-recv-slave-reply.rst +0 -3
index 9fda5546d8c1..302db2857f90 100644
@@ -37,9 +37,6 @@ Receives reply from a DiSEqC 2.0 command.
 
 .. c:type:: dvb_diseqc_slave_reply
 
-struct dvb_diseqc_slave_reply
------------------------------
-
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
 .. flat-table:: struct dvb_diseqc_slave_reply
Documentation/media/uapi/dvb/fe-diseqc-send-burst.rst +2 -7
index 0e55614bc987..26272f2860bc 100644
@@ -26,7 +26,7 @@ Arguments
     File descriptor returned by :ref:`open() <frontend_f_open>`.
 
 ``tone``
-    pointer to enum :ref:`fe_sec_mini_cmd <fe-sec-mini-cmd>`
+    pointer to enum :c:type:`fe_sec_mini_cmd`
 
 
 Description
@@ -39,12 +39,7 @@ read/write permissions.
 It provides support for what's specified at
 `Digital Satellite Equipment Control (DiSEqC) - Simple "ToneBurst" Detection Circuit specification. <http://www.eutelsat.com/files/contributed/satellites/pdf/Diseqc/associated%20docs/simple_tone_burst_detec.pdf>`__
 
-.. _fe-sec-mini-cmd-t:
-
-enum fe_sec_mini_cmd
-====================
-
-.. _fe-sec-mini-cmd:
+.. c:type:: fe_sec_mini_cmd
 
 .. flat-table:: enum fe_sec_mini_cmd
     :header-rows:  1
Documentation/media/uapi/dvb/fe-diseqc-send-master-cmd.rst +1 -3
index 72cb4ebd95c0..bbcab3df39b5 100644
@@ -35,11 +35,9 @@ Description
 
 Sends a DiSEqC command to the antenna subsystem.
 
+
 .. c:type:: dvb_diseqc_master_cmd
 
-struct dvb_diseqc_master_cmd
-============================
-
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
 .. flat-table:: struct dvb_diseqc_master_cmd
Documentation/media/uapi/dvb/fe-get-info.rst +3 -8
index 3557b756ef27..e3d64b251f61 100644
@@ -42,9 +42,6 @@ returns an error.
 
 .. c:type:: dvb_frontend_info
 
-struct dvb_frontend_info
-========================
-
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
 .. flat-table:: struct dvb_frontend_info
@@ -137,7 +134,7 @@ struct dvb_frontend_info
 
     -  .. row 11
 
-       -  enum :ref:`fe_caps <fe-caps>`
+       -  enum :c:type:`fe_caps`
 
        -  caps
 
@@ -150,18 +147,16 @@ struct dvb_frontend_info
    systems. They're specified in kHz for Satellite systems
 
 
-.. _fe-caps-t:
-
 frontend capabilities
 =====================
 
 Capabilities describe what a frontend can do. Some capabilities are
 supported only on some specific frontend types.
 
+.. c:type:: fe_caps
+
 .. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
 
-.. _fe-caps:
-
 .. flat-table:: enum fe_caps
     :header-rows:  1
     :stub-columns: 0
Documentation/media/uapi/dvb/fe-read-status.rst +4 -4
index c65cec3a35c9..812f086c20f5 100644
@@ -27,7 +27,7 @@ Arguments
 
 ``status``
     pointer to a bitmask integer filled with the values defined by enum
-    :ref:`fe_status <fe-status>`.
+    :c:type:`fe_status`.
 
 
 Description
@@ -45,14 +45,14 @@ written.
    future.
 
 
-.. _fe-status-t:
-
 int fe_status
 =============
 
 The fe_status parameter is used to indicate the current state and/or
 state changes of the frontend hardware. It is produced using the enum
-:ref:`fe_status <fe-status>` values on a bitmask
+:c:type:`fe_status` values on a bitmask
+
+.. c:type:: fe_status
 
 .. tabularcolumns:: |p{3.5cm}|p{14.0cm}|
 
Documentation/media/uapi/dvb/fe-set-tone.rst +2 -7
index 4cfd532d3dc5..bea193234cb4 100644
@@ -26,7 +26,7 @@ Arguments
     File descriptor returned by :ref:`open() <frontend_f_open>`.
 
 ``tone``
-    pointer to enum :ref:`fe_sec_tone_mode <fe-sec-tone-mode>`
+    pointer to enum :c:type:`fe_sec_tone_mode`
 
 
 Description
@@ -45,12 +45,7 @@ this is done using the DiSEqC ioctls.
    capability of selecting the band. So, it is recommended that applications
    would change to SEC_TONE_OFF when the device is not used.
 
-.. _fe-sec-tone-mode-t:
-
-enum fe_sec_tone_mode
-=====================
-
-.. _fe-sec-tone-mode:
+.. c:type:: fe_sec_tone_mode
 
 .. flat-table:: enum fe_sec_tone_mode
     :header-rows:  1
Documentation/media/uapi/dvb/fe-set-voltage.rst +2 -2
index b8b23c51ec7d..fcf6f38ef18e 100644
@@ -26,10 +26,10 @@ Arguments
     File descriptor returned by :ref:`open() <frontend_f_open>`.
 
 ``voltage``
-    pointer to enum :ref:`fe_sec_voltage <fe-sec-voltage>`
+    pointer to enum :c:type:`fe_sec_voltage`
 
     Valid values are described at enum
-    :ref:`fe_sec_voltage <fe-sec-voltage>`.
+    :c:type:`fe_sec_voltage`.
 
 
 Description
Documentation/media/uapi/dvb/fe-type-t.rst +1 -3
index 03a6c75bf5de..548b965188d0 100644
@@ -1,7 +1,5 @@
 .. -*- coding: utf-8; mode: rst -*-
 
-.. _fe-type-t:
-
 *************
 Frontend type
 *************
@@ -11,7 +9,7 @@ modulation used in transmission. The fontend types are given by
 fe_type_t type, defined as:
 
 
-.. _fe-type:
+.. c:type:: fe_type
 
 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
 
Documentation/media/uapi/dvb/fe_property_parameters.rst +24 -45

257 lines not on this page · raw message

Documentation/media/uapi/dvb/net-add-if.rst +0 -6
index dbe80c91bdb0..82ce2438213f 100644
@@ -41,12 +41,6 @@ created.
 The struct :c:type:`dvb_net_if`::ifnum field will be
 filled with the number of the created interface.
 
-
-.. _dvb-net-if-t:
-
-struct dvb_net_if description
-=============================
-
 .. c:type:: dvb_net_if
 
 .. flat-table:: struct dvb_net_if
Documentation/media/video.h.rst.exceptions +10 -10
index 8866145e8269..a91aa884ce0e 100644
@@ -28,13 +28,13 @@ 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
+replace typedef video_format_t :c:type:`video_format`
+replace typedef video_system_t :c:type:`video_system`
+replace typedef video_displayformat_t :c:type:`video_displayformat`
+replace typedef video_size_t :c:type:`video_size`
+replace typedef video_stream_source_t :c:type:`video_stream_source`
+replace typedef video_play_state_t :c:type:`video_play_state`
+replace typedef video_highlight_t :c:type:`video_highlight`
+replace typedef video_spu_t :c:type:`video_spu`
+replace typedef video_spu_palette_t :c:type:`video_spu_palette`
+replace typedef video_navi_pack_t :c:type:`video_navi_pack`
Signature · 1 line
2.7.4
#30 lore raw

PATCH 28/47 ca-get-cap.rst: add a table for struct ca_caps

In reply to Mauro Carvalho Chehab

Add a flat-table describing struct ca_caps, as found at the source file.

---
 Documentation/media/uapi/dvb/ca-get-cap.rst | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
Documentation/media/uapi/dvb/ca-get-cap.rst +28 -1
index 3486805b62a9..77c57ac59535 100644
@@ -26,7 +26,34 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
 
 ``caps``
-  Undocumented.
+  struct :c:type:`ca_caps` pointer
+
+.. c:type:: struct ca_caps
+
+.. flat-table:: struct ca_caps
+    :header-rows:  1
+    :stub-columns: 0
+
+    -
+      - type
+      - name
+      - description
+    -
+      -	unsigned int
+      - slot_num
+      - total number of CA card and module slots
+    -
+      - unsigned int
+      - slot_type
+      - bitmask with all supported slot types
+    -
+      - unsigned int
+      - descr_num
+      - total number of descrambler slots (keys)
+    -
+      - unsigned int
+      - descr_type
+      - bit mask with all supported descr types
 
 
 Description
Signature · 1 line
2.7.4
#31 lore raw

PATCH 29/47 ca-get-descr-info.rst: add doc for for struct ca_descr_info

In reply to Mauro Carvalho Chehab

The documentation follows what's there at the ca.h header.

---
 Documentation/media/uapi/dvb/ca-get-descr-info.rst | 23 +++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
Documentation/media/uapi/dvb/ca-get-descr-info.rst +22 -1
index b007f10b4910..b4a31940cec0 100644
@@ -25,7 +25,28 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
 
 ``desc``
-  Undocumented.
+  Pointer to struct :c:type:`ca_descr_info`.
+
+.. c:type:: struct ca_descr_info
+
+.. flat-table:: struct ca_descr_info
+    :header-rows:  1
+    :stub-columns: 0
+
+    -
+      - type
+      - name
+      - description
+
+    -
+      - unsigned int
+      - num
+      - number of available descramblers (keys)
+    -
+      - unsigned int
+      - type
+      - type of supported scrambling system. Valid values are:
+	``CA_ECD``, ``CA_NDS`` and ``CA_DSS``.
 
 
 Description
Signature · 1 line
2.7.4
#32 lore raw

PATCH 30/47 ca-get-msg.rst: add a boilerplate for struct ca_msg

In reply to Mauro Carvalho Chehab

There are no descriptions at ca.h header for this struct. Yet, as we want to get rid of the warnings, let's add a boilerplate, with just the struct types and fields.

---
 Documentation/media/uapi/dvb/ca-get-msg.rst | 33 ++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)
Documentation/media/uapi/dvb/ca-get-msg.rst +32 -1
index 880995230909..03b2a602f02a 100644
@@ -26,7 +26,38 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
 
 ``msg``
-  Undocumented.
+  Pointer to struct :c:type:`ca_msg`.
+
+
+.. c:type:: struct ca_msg
+
+.. flat-table:: struct ca_msg
+    :header-rows:  1
+    :stub-columns: 0
+
+    -
+      - type
+      - name
+      - description
+    -
+       - unsigned int
+       - index
+       -
+
+    -
+       - unsigned int
+       - type
+       -
+
+    -
+       - unsigned int
+       - length
+       -
+
+    -
+       - unsigned char
+       - msg[256]
+       -
 
 
 Description
Signature · 1 line
2.7.4
#33 lore raw

PATCH 31/47 ca-get-slot-info.rst: document struct ca_slot_info

In reply to Mauro Carvalho Chehab

Add documentation for struct ca_slot_info and for the two sets of define used by it, according with what's there at the ca.h header.

---
 Documentation/media/uapi/dvb/ca-get-slot-info.rst | 84 ++++++++++++++++++++++-
 1 file changed, 83 insertions(+), 1 deletion(-)
Documentation/media/uapi/dvb/ca-get-slot-info.rst +83 -1
index fcecd80e30d4..4398aeb83eb7 100644
@@ -26,7 +26,89 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() <cec-open>`.
 
 ``info``
-  Undocumented.
+  Pointer to struct c:type:`ca_slot_info`.
+
+.. _ca_slot_info_type:
+
+.. flat-table:: ca_slot_info types
+    :header-rows:  1
+    :stub-columns: 0
+
+    -
+      - type
+      - name
+      - description
+    -
+       - CA_CI
+       - 1
+       - CI high level interface
+
+    -
+       - CA_CI_LINK
+       - 2
+       - CI link layer level interface
+
+    -
+       - CA_CI_PHYS
+       - 4
+       - CI physical layer level interface
+
+    -
+       - CA_DESCR
+       - 8
+       - built-in descrambler
+
+    -
+       - CA_SC
+       - 128
+       - simple smart card interface
+
+.. _ca_slot_info_flag:
+
+.. flat-table:: ca_slot_info flags
+    :header-rows:  1
+    :stub-columns: 0
+
+    -
+      - type
+      - name
+      - description
+
+    -
+       - CA_CI_MODULE_PRESENT
+       - 1
+       - module (or card) inserted
+
+    -
+       - CA_CI_MODULE_READY
+       - 2
+       -
+
+.. c:type:: ca_slot_info
+
+.. flat-table:: struct ca_slot_info
+    :header-rows:  1
+    :stub-columns: 0
+
+    -
+      - type
+      - name
+      - description
+
+    -
+       - int
+       - num
+       - slot number
+
+    -
+       - int
+       - type
+       - CA interface this slot supports, as defined at :ref:`ca_slot_info_type`.
+
+    -
+       - unsigned int
+       - flags
+       - flags as defined at :ref:`ca_slot_info_flag`.
 
 
 Description
Signature · 1 line
2.7.4
#34 lore raw

PATCH 32/47 ca-set-pid.rst: document struct ca_pid

In reply to Mauro Carvalho Chehab

Add a table describing the fields on this struct, based on ca.h header.

---
 Documentation/media/uapi/dvb/ca-set-pid.rst | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
Documentation/media/uapi/dvb/ca-set-pid.rst +18 -1
index 8e13ad9595d3..06bdaf4afada 100644
@@ -26,7 +26,24 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
 
 ``pid``
-  Undocumented.
+  Pointer to struct :c:type:`ca_pid`.
+
+.. c:type:: ca_pid
+
+.. flat-table:: struct ca_pid
+    :header-rows:  1
+    :stub-columns: 0
+
+    -
+       - unsigned int
+       - pid
+       - Program ID
+
+    -
+       - int
+       - index
+       - PID index. Use -1 to disable.
+
 
 
 Description
Signature · 1 line
2.7.4
#35 lore raw

PATCH 33/47 docs-rst: fix the remaining broken links for DVB CA API

In reply to Mauro Carvalho Chehab

Several links are broken, as they were using the typedef name, instead of using the corresponding structs. Fix them.

---
 Documentation/media/uapi/dvb/ca-get-cap.rst        | 4 ++--
 Documentation/media/uapi/dvb/ca-get-descr-info.rst | 2 +-
 Documentation/media/uapi/dvb/ca-get-msg.rst        | 2 +-
 Documentation/media/uapi/dvb/ca-get-slot-info.rst  | 2 +-
 Documentation/media/uapi/dvb/ca-send-msg.rst       | 4 ++--
 Documentation/media/uapi/dvb/ca-set-descr.rst      | 6 +++---
 Documentation/media/uapi/dvb/ca-set-pid.rst        | 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)
Documentation/media/uapi/dvb/ca-get-cap.rst +2 -2
index 77c57ac59535..fbf7e359cb8a 100644
@@ -15,7 +15,7 @@ CA_GET_CAP
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, CA_GET_CAP, ca_caps_t *caps)
+.. c:function:: int ioctl(fd, CA_GET_CAP, struct ca_caps *caps)
     :name: CA_GET_CAP
 
 
@@ -26,7 +26,7 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
 
 ``caps``
-  struct :c:type:`ca_caps` pointer
+  Pointer to struct :c:type:`ca_caps`.
 
 .. c:type:: struct ca_caps
 
Documentation/media/uapi/dvb/ca-get-descr-info.rst +1 -1
index b4a31940cec0..7bf327a3d0e3 100644
@@ -15,7 +15,7 @@ CA_GET_DESCR_INFO
 Synopsis
 --------
 
-.. c:function:: int  ioctl(fd, CA_GET_DESCR_INFO, ca_descr_info_t *desc)
+.. c:function:: int  ioctl(fd, CA_GET_DESCR_INFO, struct ca_descr_info *desc)
     :name: CA_GET_DESCR_INFO
 
 Arguments
Documentation/media/uapi/dvb/ca-get-msg.rst +1 -1
index 03b2a602f02a..121588da3ef1 100644
@@ -15,7 +15,7 @@ CA_GET_MSG
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, CA_GET_MSG, ca_msg_t *msg)
+.. c:function:: int ioctl(fd, CA_GET_MSG, struct ca_msg *msg)
     :name: CA_GET_MSG
 
 
Documentation/media/uapi/dvb/ca-get-slot-info.rst +1 -1
index 4398aeb83eb7..54e5dc78a2dc 100644
@@ -15,7 +15,7 @@ CA_GET_SLOT_INFO
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, CA_GET_SLOT_INFO, ca_slot_info_t *info)
+.. c:function:: int ioctl(fd, CA_GET_SLOT_INFO, struct ca_slot_info *info)
     :name: CA_GET_SLOT_INFO
 
 
Documentation/media/uapi/dvb/ca-send-msg.rst +2 -2
index 0c42b10cf4f4..532ef5f9d6ac 100644
@@ -15,7 +15,7 @@ CA_SEND_MSG
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, CA_SEND_MSG, ca_msg_t *msg)
+.. c:function:: int ioctl(fd, CA_SEND_MSG, struct ca_msg *msg)
     :name: CA_SEND_MSG
 
 
@@ -26,7 +26,7 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() <cec-open>`.
 
 ``msg``
-  Undocumented.
+  Pointer to struct :c:type:`ca_msg`.
 
 
 Description
Documentation/media/uapi/dvb/ca-set-descr.rst +3 -3
index 63dcc2b751ef..70f7b3cf12ad 100644
@@ -15,8 +15,8 @@ CA_SET_DESCR
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, CA_SET_DESCR, ca_descr_t *desc)
-    :name:
+.. c:function:: int ioctl(fd, CA_SET_DESCR, struct ca_descr *desc)
+    :name: CA_SET_DESCR
 
 
 Arguments
@@ -26,7 +26,7 @@ Arguments
   File descriptor returned by a previous call to :c:func:`open() <cec-open>`.
 
 ``msg``
-  Undocumented.
+  Pointer to struct :c:type:`ca_descr`.
 
 
 Description
Documentation/media/uapi/dvb/ca-set-pid.rst +1 -1
index 06bdaf4afada..891c1c72ef24 100644
@@ -15,7 +15,7 @@ CA_SET_PID
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, CA_SET_PID, ca_pid_t *pid)
+.. c:function:: int ioctl(fd, CA_SET_PID, struct ca_pid *pid)
     :name: CA_SET_PID
 
 
Signature · 1 line
2.7.4
#36 lore raw

PATCH 34/47 fix broken references on dvb/video*rst

In reply to Mauro Carvalho Chehab

Trivially fix those broken references, by copying the structs fron the header, just like other API documentation at the DVB side.

This doesn't have the level of quality used at the V4L2 side of the API, but, as this documents a deprecated API, used only by av7110 driver, it doesn't make much sense to invest time making it better.

---
 Documentation/media/uapi/dvb/video-command.rst     | 30 ++++++++++++++++++++++
 Documentation/media/uapi/dvb/video-get-event.rst   | 17 ++++++++++++
 Documentation/media/uapi/dvb/video-get-navi.rst    | 10 +++++++-
 Documentation/media/uapi/dvb/video-get-size.rst    | 10 ++++++++
 Documentation/media/uapi/dvb/video-get-status.rst  | 11 ++++++++
 .../media/uapi/dvb/video-select-source.rst         | 10 ++++++++
 .../media/uapi/dvb/video-set-attributes.rst        | 16 ++++++++++++
 .../media/uapi/dvb/video-set-display-format.rst    |  2 +-
 Documentation/media/uapi/dvb/video-set-format.rst  |  9 +++++++
 .../media/uapi/dvb/video-set-highlight.rst         | 26 ++++++++++++++++++-
 .../media/uapi/dvb/video-set-spu-palette.rst       | 10 +++++++-
 Documentation/media/uapi/dvb/video-set-spu.rst     | 11 +++++++-
 include/uapi/linux/dvb/video.h                     |  3 ++-
 13 files changed, 159 insertions(+), 6 deletions(-)
Documentation/media/uapi/dvb/video-command.rst +30 -0
index 4772562036f1..536d0fdd8399 100644
@@ -59,6 +59,36 @@ subset of the ``v4l2_decoder_cmd`` struct, so refer to the
 :ref:`VIDIOC_DECODER_CMD` documentation for
 more information.
 
+.. c:type:: struct video_command
+
+.. code-block:: c
+
+	/* The structure must be zeroed before use by the application
+	This ensures it can be extended safely in the future. */
+	struct video_command {
+		__u32 cmd;
+		__u32 flags;
+		union {
+			struct {
+				__u64 pts;
+			} stop;
+
+			struct {
+				/* 0 or 1000 specifies normal speed,
+				1 specifies forward single stepping,
+				-1 specifies backward single stepping,
+				>1: playback at speed/1000 of the normal speed,
+				<-1: reverse playback at (-speed/1000) of the normal speed. */
+				__s32 speed;
+				__u32 format;
+			} play;
+
+			struct {
+				__u32 data[16];
+			} raw;
+		};
+	};
+
 
 Return Value
 ------------
Documentation/media/uapi/dvb/video-get-event.rst +17 -0
index 8c0c622c380b..6ad14cdb894a 100644
@@ -64,6 +64,23 @@ included in the exceptfds argument, and for poll(), POLLPRI should be
 specified as the wake-up condition. Read-only permissions are sufficient
 for this ioctl call.
 
+.. c:type:: video_event
+
+.. code-block:: c
+
+	struct video_event {
+		__s32 type;
+	#define VIDEO_EVENT_SIZE_CHANGED	1
+	#define VIDEO_EVENT_FRAME_RATE_CHANGED	2
+	#define VIDEO_EVENT_DECODER_STOPPED 	3
+	#define VIDEO_EVENT_VSYNC 		4
+		__kernel_time_t timestamp;
+		union {
+			video_size_t size;
+			unsigned int frame_rate;	/* in frames per 1000sec */
+			unsigned char vsync_field;	/* unknown/odd/even/progressive */
+		} u;
+	};
 
 Return Value
 ------------
Documentation/media/uapi/dvb/video-get-navi.rst +9 -1
index b8de9ccf38c2..114a9ac48b9e 100644
@@ -16,7 +16,7 @@ VIDEO_GET_NAVI
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, VIDEO_GET_NAVI , video_navi_pack_t *navipack)
+.. c:function:: int ioctl(fd, VIDEO_GET_NAVI , struct video_navi_pack *navipack)
     :name: VIDEO_GET_NAVI
 
 
@@ -54,6 +54,14 @@ This ioctl returns navigational information from the DVD stream. This is
 especially needed if an encoded stream has to be decoded by the
 hardware.
 
+.. c:type:: video_navi_pack
+
+.. code-block::c
+
+	typedef struct video_navi_pack {
+		int length;          /* 0 ... 1024 */
+		__u8 data[1024];
+	} video_navi_pack_t;
 
 Return Value
 ------------
Documentation/media/uapi/dvb/video-get-size.rst +10 -0
index ce8b4c6b41a5..d077fe2305a0 100644
@@ -52,6 +52,16 @@ Description
 
 This ioctl returns the size and aspect ratio.
 
+.. c:type:: video_size_t
+
+.. code-block::c
+
+	typedef struct {
+		int w;
+		int h;
+		video_format_t aspect_ratio;
+	} video_size_t;
+
 
 Return Value
 ------------
Documentation/media/uapi/dvb/video-get-status.rst +11 -0
index 7b6a278b5246..ed6ea19827a6 100644
@@ -53,6 +53,17 @@ Description
 This ioctl call asks the Video Device to return the current status of
 the device.
 
+.. c:type:: video_status
+
+.. code-block:: c
+
+	struct video_status {
+		int                   video_blank;   /* blank video on freeze? */
+		video_play_state_t    play_state;    /* current state of playback */
+		video_stream_source_t stream_source; /* current source (demux/memory) */
+		video_format_t        video_format;  /* current aspect ratio of stream*/
+		video_displayformat_t display_format;/* selected cropping mode */
+	};
 
 Return Value
 ------------
Documentation/media/uapi/dvb/video-select-source.rst +10 -0
index eaa1088f07da..2f4fbf4b490c 100644
@@ -58,6 +58,16 @@ This ioctl call informs the video device which source shall be used for
 the input data. The possible sources are demux or memory. If memory is
 selected, the data is fed to the video device through the write command.
 
+.. c:type:: video_stream_source_t
+
+.. code-block:: c
+
+	typedef enum {
+		VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */
+		VIDEO_SOURCE_MEMORY /* If this source is selected, the stream
+				comes from the user through the write
+				system call */
+	} video_stream_source_t;
 
 Return Value
 ------------
Documentation/media/uapi/dvb/video-set-attributes.rst +16 -0
index 8901520d7e43..b2f11a6746e9 100644
@@ -55,6 +55,22 @@ information about the stream. Some hardware may not need this
 information, but the call also tells the hardware to prepare for DVD
 playback.
 
+.. c:type:: video_attributes_t
+
+.. code-block::c
+
+	typedef __u16 video_attributes_t;
+	/*   bits: descr. */
+	/*   15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */
+	/*   13-12 TV system (0=525/60, 1=625/50) */
+	/*   11-10 Aspect ratio (0=4:3, 3=16:9) */
+	/*    9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */
+	/*    7    line 21-1 data present in GOP (1=yes, 0=no) */
+	/*    6    line 21-2 data present in GOP (1=yes, 0=no) */
+	/*    5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
+	/*    2    source letterboxed (1=yes, 0=no) */
+	/*    0    film/camera mode (0=camera, 1=film (625/50 only)) */
+
 
 Return Value
 ------------
Documentation/media/uapi/dvb/video-set-display-format.rst +1 -1
index 6abf19479939..2ef7401781be 100644
@@ -16,7 +16,7 @@ VIDEO_SET_DISPLAY_FORMAT
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, VIDEO_SET_DISPLAY_FORMAT, video_display_format_t format)
+.. c:function:: int ioctl(fd, VIDEO_SET_DISPLAY_FORMAT)
     :name: VIDEO_SET_DISPLAY_FORMAT
 
 
Documentation/media/uapi/dvb/video-set-format.rst +9 -0
index 117618525538..4239a4e365bb 100644
@@ -54,6 +54,15 @@ This ioctl sets the screen format (aspect ratio) of the connected output
 device (TV) so that the output of the decoder can be adjusted
 accordingly.
 
+.. c:type:: video_format_t
+
+.. code-block:: c
+
+	typedef enum {
+		VIDEO_FORMAT_4_3,     /* Select 4:3 format */
+		VIDEO_FORMAT_16_9,    /* Select 16:9 format. */
+		VIDEO_FORMAT_221_1    /* 2.21:1 */
+	} video_format_t;
 
 Return Value
 ------------
Documentation/media/uapi/dvb/video-set-highlight.rst +25 -1
index d93b69eef15b..90aeafd923b7 100644
@@ -16,7 +16,7 @@ VIDEO_SET_HIGHLIGHT
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, VIDEO_SET_HIGHLIGHT ,video_highlight_t *vhilite)
+.. c:function:: int ioctl(fd, VIDEO_SET_HIGHLIGHT, struct video_highlight *vhilite)
     :name: VIDEO_SET_HIGHLIGHT
 
 
@@ -53,6 +53,30 @@ Description
 This ioctl sets the SPU highlight information for the menu access of a
 DVD.
 
+.. c:type:: video_highlight
+
+.. code-block:: c
+
+	typedef
+	struct video_highlight {
+		int     active;      /*    1=show highlight, 0=hide highlight */
+		__u8    contrast1;   /*    7- 4  Pattern pixel contrast */
+				/*    3- 0  Background pixel contrast */
+		__u8    contrast2;   /*    7- 4  Emphasis pixel-2 contrast */
+				/*    3- 0  Emphasis pixel-1 contrast */
+		__u8    color1;      /*    7- 4  Pattern pixel color */
+				/*    3- 0  Background pixel color */
+		__u8    color2;      /*    7- 4  Emphasis pixel-2 color */
+				/*    3- 0  Emphasis pixel-1 color */
+		__u32    ypos;       /*   23-22  auto action mode */
+				/*   21-12  start y */
+				/*    9- 0  end y */
+		__u32    xpos;       /*   23-22  button color number */
+				/*   21-12  start x */
+				/*    9- 0  end x */
+	} video_highlight_t;
+
+
 
 Return Value
 ------------
Documentation/media/uapi/dvb/video-set-spu-palette.rst +9 -1
index b24f7882089a..51a1913d21d2 100644
@@ -16,7 +16,7 @@ VIDEO_SET_SPU_PALETTE
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, VIDEO_SET_SPU_PALETTE, video_spu_palette_t *palette )
+.. c:function:: int ioctl(fd, VIDEO_SET_SPU_PALETTE, struct video_spu_palette *palette )
     :name: VIDEO_SET_SPU_PALETTE
 
 
@@ -52,6 +52,14 @@ Description
 
 This ioctl sets the SPU color palette.
 
+.. c:type:: video_spu_palette
+
+.. code-block::c
+
+	typedef struct video_spu_palette {      /* SPU Palette information */
+		int length;
+		__u8 __user *palette;
+	} video_spu_palette_t;
 
 Return Value
 ------------
Documentation/media/uapi/dvb/video-set-spu.rst +10 -1
index 2a7f0625de38..739e5e7bd133 100644
@@ -16,7 +16,7 @@ VIDEO_SET_SPU
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, VIDEO_SET_SPU , video_spu_t *spu)
+.. c:function:: int ioctl(fd, VIDEO_SET_SPU , struct video_spu *spu)
     :name: VIDEO_SET_SPU
 
 
@@ -54,6 +54,15 @@ Description
 This ioctl activates or deactivates SPU decoding in a DVD input stream.
 It can only be used, if the driver is able to handle a DVD stream.
 
+.. c:type:: struct video_spu
+
+.. code-block:: c
+
+	typedef struct video_spu {
+		int active;
+		int stream_id;
+	} video_spu_t;
+
 
 Return Value
 ------------
include/uapi/linux/dvb/video.h +2 -1
index 49392564f9d6..260f033a5b54 100644
@@ -206,7 +206,8 @@ typedef __u16 video_attributes_t;
 /*    6    line 21-2 data present in GOP (1=yes, 0=no) */
 /*    5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */
 /*    2    source letterboxed (1=yes, 0=no) */
-/*    0    film/camera mode (0=camera, 1=film (625/50 only)) */
+/*    0    film/camera mode (0=
+ *camera, 1=film (625/50 only)) */
 
 
 /* bit definitions for capabilities: */
Signature · 1 line
2.7.4
#37 lore raw

PATCH 35/47 docs-rst: fix dmx bad cross-references

In reply to Mauro Carvalho Chehab

Some structs are pointed via the typedef. As we replaced those references, fix them.

---
 Documentation/media/uapi/dvb/dmx-get-caps.rst   | 5 ++---
 Documentation/media/uapi/dvb/dmx-set-source.rst | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
Documentation/media/uapi/dvb/dmx-get-caps.rst +2 -3
index aaf084a245fd..145fb520d779 100644
@@ -15,7 +15,7 @@ DMX_GET_CAPS
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, DMX_GET_CAPS, dmx_caps_t *caps)
+.. c:function:: int ioctl(fd, DMX_GET_CAPS, struct dmx_caps *caps)
     :name: DMX_GET_CAPS
 
 Arguments
@@ -25,7 +25,7 @@ Arguments
     File descriptor returned by :c:func:`open() <dvb-dmx-open>`.
 
 ``caps``
-    Undocumented.
+    Pointer to struct :c:type:`dmx_caps`
 
 
 Description
@@ -33,7 +33,6 @@ Description
 
 .. note:: This ioctl is undocumented. Documentation is welcome.
 
-
 Return Value
 ------------
 
Documentation/media/uapi/dvb/dmx-set-source.rst +1 -1
index a232fd6e5f52..ac7f77b25e06 100644
@@ -15,7 +15,7 @@ DMX_SET_SOURCE
 Synopsis
 --------
 
-.. c:function:: int ioctl(fd, DMX_SET_SOURCE, dmx_source_t *src)
+.. c:function:: int ioctl(fd, DMX_SET_SOURCE, struct dmx_source *src)
     :name: DMX_SET_SOURCE
 
 
Signature · 1 line
2.7.4
#38 lore raw

PATCH 36/47 docs-rst: fix cec bad cross-references

In reply to Mauro Carvalho Chehab

Fix some CEC cross references that are broken.

---
 Documentation/media/cec.h.rst.exceptions                  |  6 ------
 Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst | 10 +++++-----
 Documentation/media/uapi/cec/cec-ioc-receive.rst          |  9 +++++----
 3 files changed, 10 insertions(+), 15 deletions(-)
Documentation/media/cec.h.rst.exceptions +0 -6
index b79339433718..b1687532742f 100644
@@ -1,12 +1,6 @@
 # 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
Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst +5 -5
index bd0756ff022e..6c314c2db73e 100644
@@ -30,7 +30,7 @@ Arguments
     File descriptor returned by :c:func:`open() <cec-open>`.
 
 ``argp``
-    Pointer to struct cec_log_addrs
+    Pointer to struct :c:type:`cec_log_addrs`.
 
 Description
 ===========
@@ -42,10 +42,10 @@ Description
 
 To query the current CEC logical addresses, applications call
 :ref:`ioctl CEC_ADAP_G_LOG_ADDRS <CEC_ADAP_G_LOG_ADDRS>` with a pointer to a
-:c:type:`struct cec_log_addrs` where the driver stores the logical addresses.
+struct :c:type:`cec_log_addrs` where the driver stores the logical addresses.
 
 To set new logical addresses, applications fill in
-:c:type:`struct cec_log_addrs` and call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`
+struct :c:type:`cec_log_addrs` and call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`
 with a pointer to this struct. The :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`
 is only available if ``CEC_CAP_LOG_ADDRS`` is set (the ``ENOTTY`` error code is
 returned otherwise). The :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>`
@@ -66,10 +66,10 @@ logical addresses are claimed or cleared.
 Attempting to call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>` when
 logical address types are already defined will return with error ``EBUSY``.
 
-.. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}|
-
 .. c:type:: cec_log_addrs
 
+.. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}|
+
 .. cssclass:: longtable
 
 .. flat-table:: struct cec_log_addrs
Documentation/media/uapi/cec/cec-ioc-receive.rst +5 -4
index f015f1259b27..18620f81b7d9 100644
@@ -40,7 +40,8 @@ Description
    and is currently only available as a staging kernel module.
 
 To receive a CEC message the application has to fill in the
-``timeout`` field of :c:type:`struct cec_msg` and pass it to :ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`.
+``timeout`` field of struct :c:type:`cec_msg` and pass it to
+:ref:`ioctl CEC_RECEIVE <CEC_RECEIVE>`.
 If the file descriptor is in non-blocking mode and there are no received
 messages pending, then it will return -1 and set errno to the ``EAGAIN``
 error code. If the file descriptor is in blocking mode and ``timeout``
@@ -54,9 +55,9 @@ A received message can be:
 2. the result of an earlier non-blocking transmit (the ``sequence`` field will
    be non-zero).
 
-To send a CEC message the application has to fill in the
-:c:type:`struct cec_msg` and pass it to
-:ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`. The :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` is only available if
+To send a CEC message the application has to fill in the struct
+:c:type:` cec_msg` and pass it to :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>`.
+The :ref:`ioctl CEC_TRANSMIT <CEC_TRANSMIT>` is only available if
 ``CEC_CAP_TRANSMIT`` is set. If there is no more room in the transmit
 queue, then it will return -1 and set errno to the ``EBUSY`` error code.
 The transmit queue has enough room for 18 messages (about 1 second worth
Signature · 1 line
2.7.4
#39 lore raw

PATCH 37/47 docs-rst: simplify c:type: cross references

In reply to Mauro Carvalho Chehab

Instead of using c:type:struct foo <foo>, use:
struct c:type:foo

This patch was generated via this shell script:

	for i in `find Documentation/media -type f`; do perl -ne 'if (m/\:c\:type\:\`struct\s+(\S+)\s*\<(\S+)\>\`/) { $s=$1; $r=$2; if ($s eq $r) { s/\:c\:type\:\`struct\s+(\S+)\s*\<(\S+)\>\`/struct :c:type:`$2`/; s/struct\s+struct/struct/;  s/(struct\s+\:c\:type\:\`\S+\`)\s+structure/$1/;  }} print $_' <$i >a && mv a $i; done
---
 Documentation/media/kapi/mc-core.rst               | 24 +++++++++++-----------
 Documentation/media/uapi/dvb/dvbproperty.rst       |  2 +-
 Documentation/media/uapi/v4l/buffer.rst            | 12 +++++------
 Documentation/media/uapi/v4l/dev-osd.rst           |  2 +-
 Documentation/media/uapi/v4l/dev-overlay.rst       |  2 +-
 Documentation/media/uapi/v4l/dev-sliced-vbi.rst    |  6 +++---
 Documentation/media/uapi/v4l/extended-controls.rst |  2 +-
 Documentation/media/uapi/v4l/pixfmt-002.rst        |  4 ++--
 Documentation/media/uapi/v4l/pixfmt-003.rst        |  6 +++---
 Documentation/media/uapi/v4l/pixfmt.rst            |  4 ++--
 .../media/uapi/v4l/vidioc-create-bufs.rst          |  2 +-
 Documentation/media/uapi/v4l/vidioc-enumstd.rst    |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-audio.rst    |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-audioout.rst |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-crop.rst     |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-ctrl.rst     |  4 ++--
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst     |  4 ++--
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst      |  4 ++--
 Documentation/media/uapi/v4l/vidioc-g-parm.rst     |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-std.rst      |  2 +-
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst    |  2 +-
 .../media/uapi/v4l/vidioc-prepare-buf.rst          |  2 +-
 Documentation/media/uapi/v4l/vidioc-qbuf.rst       |  4 ++--
 Documentation/media/uapi/v4l/vidioc-querybuf.rst   |  2 +-
 Documentation/media/uapi/v4l/vidioc-reqbufs.rst    |  2 +-
 25 files changed, 51 insertions(+), 51 deletions(-)
Documentation/media/kapi/mc-core.rst +12 -12
index fb839a6c1f46..1a738e5f6056 100644
@@ -34,7 +34,7 @@ pad to a sink pad.
 Media device
 ^^^^^^^^^^^^
 
-A media device is represented by a :c:type:`struct media_device <media_device>`
+A media device is represented by a struct :c:type:`media_device`
 instance, defined in ``include/media/media-device.h``.
 Allocation of the structure is handled by the media device driver, usually by
 embedding the :c:type:`media_device` instance in a larger driver-specific
@@ -47,7 +47,7 @@ and unregistered by calling :c:func:`media_device_unregister()`.
 Entities
 ^^^^^^^^
 
-Entities are represented by a :c:type:`struct media_entity <media_entity>`
+Entities are represented by a struct :c:type:`media_entity`
 instance, defined in ``include/media/media-entity.h``. The structure is usually
 embedded into a higher-level structure, such as
 :c:type:`v4l2_subdev` or :c:type:`video_device`
@@ -65,10 +65,10 @@ Interfaces
 ^^^^^^^^^^
 
 Interfaces are represented by a
-:c:type:`struct media_interface <media_interface>` instance, defined in
+struct :c:type:`media_interface` instance, defined in
 ``include/media/media-entity.h``. Currently, only one type of interface is
 defined: a device node. Such interfaces are represented by a
-:c:type:`struct media_intf_devnode <media_intf_devnode>`.
+struct :c:type:`media_intf_devnode`.
 
 Drivers initialize and create device node interfaces by calling
 :c:func:`media_devnode_create()`
@@ -77,7 +77,7 @@ and remove them by calling:
 
 Pads
 ^^^^
-Pads are represented by a :c:type:`struct media_pad <media_pad>` instance,
+Pads are represented by a struct :c:type:`media_pad` instance,
 defined in ``include/media/media-entity.h``. Each entity stores its pads in
 a pads array managed by the entity driver. Drivers usually embed the array in
 a driver-specific structure.
@@ -85,8 +85,8 @@ a driver-specific structure.
 Pads are identified by their entity and their 0-based index in the pads
 array.
 
-Both information are stored in the :c:type:`struct media_pad <media_pad>`,
-making the :c:type:`struct media_pad <media_pad>` pointer the canonical way
+Both information are stored in the struct :c:type:`media_pad`,
+making the struct :c:type:`media_pad` pointer the canonical way
 to store and pass link references.
 
 Pads have flags that describe the pad capabilities and state.
@@ -102,7 +102,7 @@ Pads have flags that describe the pad capabilities and state.
 Links
 ^^^^^
 
-Links are represented by a :c:type:`struct media_link <media_link>` instance,
+Links are represented by a struct :c:type:`media_link` instance,
 defined in ``include/media/media-entity.h``. There are two types of links:
 
 **1. pad to pad links**:
@@ -185,7 +185,7 @@ Use count and power handling
 
 Due to the wide differences between drivers regarding power management
 needs, the media controller does not implement power management. However,
-the :c:type:`struct media_entity <media_entity>` includes a ``use_count``
+the struct :c:type:`media_entity` includes a ``use_count``
 field that media drivers
 can use to track the number of users of every entity for power management
 needs.
@@ -211,11 +211,11 @@ prevent link states from being modified during streaming by calling
 The function will mark all entities connected to the given entity through
 enabled links, either directly or indirectly, as streaming.
 
-The :c:type:`struct media_pipeline <media_pipeline>` instance pointed to by
+The struct :c:type:`media_pipeline` instance pointed to by
 the pipe argument will be stored in every entity in the pipeline.
-Drivers should embed the :c:type:`struct media_pipeline <media_pipeline>`
+Drivers should embed the struct :c:type:`media_pipeline`
 in higher-level pipeline structures and can then access the
-pipeline through the :c:type:`struct media_entity <media_entity>`
+pipeline through the struct :c:type:`media_entity`
 pipe field.
 
 Calls to :c:func:`media_entity_pipeline_start()` can be nested.
Documentation/media/uapi/dvb/dvbproperty.rst +1 -1
index 906f3e651e10..dd2d71ce43fa 100644
@@ -23,7 +23,7 @@ union/struct based approach, in favor of a properties set approach.
 .. note::
 
    On Linux DVB API version 3, setting a frontend were done via
-   :c:type:`struct dvb_frontend_parameters <dvb_frontend_parameters>`.
+   struct :c:type:`dvb_frontend_parameters`.
    This got replaced on version 5 (also called "S2API", as this API were
    added originally_enabled to provide support for DVB-S2), because the
    old API has a very limited support to new standards and new hardware.
Documentation/media/uapi/v4l/buffer.rst +6 -6
index a52a586b0b41..7b64a1986d66 100644
@@ -11,14 +11,14 @@ the Streaming I/O methods. In the multi-planar API, the data is held in
 planes, while the buffer structure acts as a container for the planes.
 Only pointers to buffers (planes) are exchanged, the data itself is not
 copied. These pointers, together with meta-information like timestamps
-or field parity, are stored in a struct :c:type:`struct v4l2_buffer <v4l2_buffer>`,
+or field parity, are stored in a struct :c:type:`v4l2_buffer`,
 argument to the :ref:`VIDIOC_QUERYBUF`,
 :ref:`VIDIOC_QBUF` and
 :ref:`VIDIOC_DQBUF <VIDIOC_QBUF>` ioctl. In the multi-planar API,
-some plane-specific members of struct :c:type:`struct v4l2_buffer <v4l2_buffer>`,
+some plane-specific members of struct :c:type:`v4l2_buffer`,
 such as pointers and sizes for each plane, are stored in struct
-:c:type:`struct v4l2_plane <v4l2_plane>` instead. In that case, struct
-:c:type:`struct v4l2_buffer <v4l2_buffer>` contains an array of plane structures.
+struct :c:type:`v4l2_plane` instead. In that case, struct
+struct :c:type:`v4l2_buffer` contains an array of plane structures.
 
 Dequeued video buffers come with timestamps. The driver decides at which
 part of the frame and with which clock the timestamp is taken. Please
@@ -231,7 +231,7 @@ struct v4l2_buffer
        -  When using the multi-planar API, contains a userspace pointer to
 	  an array of struct :c:type:`v4l2_plane`. The size of
 	  the array should be put in the ``length`` field of this
-	  :c:type:`struct v4l2_buffer <v4l2_buffer>` structure.
+	  struct :c:type:`v4l2_buffer` structure.
 
     -  .. row 15
 
@@ -823,7 +823,7 @@ enum v4l2_memory
 Timecodes
 =========
 
-The :c:type:`struct v4l2_timecode <v4l2_timecode>` structure is designed to hold a
+The struct :c:type:`v4l2_timecode` structure is designed to hold a
 :ref:`smpte12m` or similar timecode. (struct
 :c:type:`struct timeval` timestamps are stored in struct
 :c:type:`v4l2_buffer` field ``timestamp``.)
Documentation/media/uapi/v4l/dev-osd.rst +1 -1
index a6aaf28807a4..0b246c31b6a3 100644
@@ -121,7 +121,7 @@ parameters applications set the ``type`` field of a struct
 :c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY`` and call the
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl. The driver fills the
-:c:type:`struct v4l2_window <v4l2_window>` substructure named ``win``. It is not
+struct :c:type:`v4l2_window` substructure named ``win``. It is not
 possible to retrieve a previously programmed clipping list or bitmap.
 
 To program the source rectangle applications set the ``type`` field of a
Documentation/media/uapi/v4l/dev-overlay.rst +1 -1
index 4962947bd8a2..9be14b55e305 100644
@@ -125,7 +125,7 @@ To get the current parameters applications set the ``type`` field of a
 struct :c:type:`v4l2_format` to
 ``V4L2_BUF_TYPE_VIDEO_OVERLAY`` and call the
 :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` ioctl. The driver fills the
-:c:type:`struct v4l2_window <v4l2_window>` substructure named ``win``. It is not
+struct :c:type:`v4l2_window` substructure named ``win``. It is not
 possible to retrieve a previously programmed clipping list or bitmap.
 
 To program the overlay window applications set the ``type`` field of a
Documentation/media/uapi/v4l/dev-sliced-vbi.rst +3 -3
index 2a979aa138bd..7f159c3d4942 100644
@@ -77,7 +77,7 @@ member, a struct
 Applications can request different parameters by initializing or
 modifying the ``fmt.sliced`` member and calling the
 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl with a pointer to the
-:c:type:`struct v4l2_format <v4l2_format>` structure.
+struct :c:type:`v4l2_format` structure.
 
 The sliced VBI API is more complicated than the raw VBI API because the
 hardware must be told which VBI service to expect on each scan line. Not
@@ -376,11 +376,11 @@ Reading and writing sliced VBI data
 
 A single :ref:`read() <func-read>` or :ref:`write() <func-write>`
 call must pass all data belonging to one video frame. That is an array
-of :c:type:`struct v4l2_sliced_vbi_data <v4l2_sliced_vbi_data>` structures with one or
+of struct :c:type:`v4l2_sliced_vbi_data` structures with one or
 more elements and a total size not exceeding ``io_size`` bytes. Likewise
 in streaming I/O mode one buffer of ``io_size`` bytes must contain data
 of one video frame. The ``id`` of unused
-:c:type:`struct v4l2_sliced_vbi_data <v4l2_sliced_vbi_data>` elements must be zero.
+struct :c:type:`v4l2_sliced_vbi_data` elements must be zero.
 
 
 .. c:type:: v4l2_sliced_vbi_data
Documentation/media/uapi/v4l/extended-controls.rst +1 -1
index 75359739eb52..85e536971923 100644
@@ -66,7 +66,7 @@ whether the specified control class is supported.
 
 The control array is a struct
 :c:type:`v4l2_ext_control` array. The
-:c:type:`struct v4l2_ext_control <v4l2_ext_control>` structure is very similar to
+struct :c:type:`v4l2_ext_control` is very similar to
 struct :c:type:`v4l2_control`, except for the fact that
 it also allows for 64-bit values and pointers to be passed.
 
Documentation/media/uapi/v4l/pixfmt-002.rst +2 -2
index 789937900d14..28f14e41631c 100644
@@ -136,7 +136,7 @@ Single-planar format structure
        -  ``priv``
 
        -  This field indicates whether the remaining fields of the
-	  :c:type:`struct v4l2_pix_format <v4l2_pix_format>` structure, also called the
+	  struct :c:type:`v4l2_pix_format`, also called the
 	  extended fields, are valid. When set to
 	  ``V4L2_PIX_FMT_PRIV_MAGIC``, it indicates that the extended fields
 	  have been correctly initialized. When set to any other value it
@@ -152,7 +152,7 @@ Single-planar format structure
 	  To use the extended fields, applications must set the ``priv``
 	  field to ``V4L2_PIX_FMT_PRIV_MAGIC``, initialize all the extended
 	  fields and zero the unused bytes of the
-	  :c:type:`struct v4l2_format <v4l2_format>` ``raw_data`` field.
+	  struct :c:type:`v4l2_format` ``raw_data`` field.
 
 	  When the ``priv`` field isn't set to ``V4L2_PIX_FMT_PRIV_MAGIC``
 	  drivers must act as if all the extended fields were set to zero.
Documentation/media/uapi/v4l/pixfmt-003.rst +3 -3
index b214b818baa7..e39fa2b732d7 100644
@@ -4,11 +4,11 @@
 Multi-planar format structures
 ******************************
 
-The :c:type:`struct v4l2_plane_pix_format <v4l2_plane_pix_format>` structures define size
+The struct :c:type:`v4l2_plane_pix_format` structures define size
 and layout for each of the planes in a multi-planar format. The
-:c:type:`struct v4l2_pix_format_mplane <v4l2_pix_format_mplane>` structure contains
+struct :c:type:`v4l2_pix_format_mplane` structure contains
 information common to all planes (such as image width and height) and an
-array of :c:type:`struct v4l2_plane_pix_format <v4l2_plane_pix_format>` structures,
+array of struct :c:type:`v4l2_plane_pix_format` structures,
 describing all planes of that format.
 
 
Documentation/media/uapi/v4l/pixfmt.rst +2 -2
index a6b7871e39e7..4d297f6eb5f1 100644
@@ -6,8 +6,8 @@
 Image Formats
 #############
 The V4L2 API was primarily designed for devices exchanging image data
-with applications. The :c:type:`struct v4l2_pix_format <v4l2_pix_format>` and
-:c:type:`struct v4l2_pix_format_mplane <v4l2_pix_format_mplane>` structures define the
+with applications. The struct :c:type:`v4l2_pix_format` and
+struct :c:type:`v4l2_pix_format_mplane` structures define the
 format and layout of an image in memory. The former is used with the
 single-planar API, while the latter is used with the multi-planar
 version (see :ref:`planar-apis`). Image formats are negotiated with
Documentation/media/uapi/v4l/vidioc-create-bufs.rst +1 -1
index c53fdcc3666a..b93422400608 100644
@@ -39,7 +39,7 @@ over buffers is required. This ioctl can be called multiple times to
 create buffers of different sizes.
 
 To allocate the device buffers applications must initialize the relevant
-fields of the :c:type:`struct v4l2_create_buffers <v4l2_create_buffers>` structure. The
+fields of the struct :c:type:`v4l2_create_buffers` structure. The
 ``count`` field must be set to the number of requested buffers, the
 ``memory`` field specifies the requested I/O method and the ``reserved``
 array must be zeroed.
Documentation/media/uapi/v4l/vidioc-enumstd.rst +1 -1
index eaac7a2e14c4..7a3a6d6aeb17 100644
@@ -71,7 +71,7 @@ or output. [#f1]_
 	  set as custom standards. Multiple bits can be set if the hardware
 	  does not distinguish between these standards, however separate
 	  indices do not indicate the opposite. The ``id`` must be unique.
-	  No other enumerated :c:type:`struct v4l2_standard <v4l2_standard>` structure,
+	  No other enumerated struct :c:type:`v4l2_standard` structure,
 	  for this input or output anyway, can contain the same set of bits.
 
     -  .. row 3
Documentation/media/uapi/v4l/vidioc-g-audio.rst +1 -1
index ebf2514464fc..60520318cb4a 100644
@@ -43,7 +43,7 @@ has no audio inputs, or none which combine with the current video input.
 Audio inputs have one writable property, the audio mode. To select the
 current audio input *and* change the audio mode, applications initialize
 the ``index`` and ``mode`` fields, and the ``reserved`` array of a
-:c:type:`struct v4l2_audio <v4l2_audio>` structure and call the :ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>`
+struct :c:type:`v4l2_audio` structure and call the :ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>`
 ioctl. Drivers may switch to a different audio mode if the request
 cannot be satisfied. However, this is a write-only ioctl, it does not
 return the actual new audio mode.
Documentation/media/uapi/v4l/vidioc-g-audioout.rst +1 -1
index b21794300efd..e9d264590788 100644
@@ -44,7 +44,7 @@ output.
 Audio outputs have no writable properties. Nevertheless, to select the
 current audio output applications can initialize the ``index`` field and
 ``reserved`` array (which in the future may contain writable properties)
-of a :c:type:`struct v4l2_audioout <v4l2_audioout>` structure and call the
+of a struct :c:type:`v4l2_audioout` structure and call the
 ``VIDIOC_S_AUDOUT`` ioctl. Drivers switch to the requested output or
 return the ``EINVAL`` error code when the index is out of bounds. This is a
 write-only ioctl, it does not return the current audio output attributes
Documentation/media/uapi/v4l/vidioc-g-crop.rst +1 -1
index b99032e59ebe..4ddd8c08fd1c 100644
@@ -35,7 +35,7 @@ Description
 ===========
 
 To query the cropping rectangle size and position applications set the
-``type`` field of a :c:type:`struct v4l2_crop <v4l2_crop>` structure to the
+``type`` field of a struct :c:type:`v4l2_crop` structure to the
 respective buffer (stream) type and call the :ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` ioctl
 with a pointer to this structure. The driver fills the rest of the
 structure or returns the ``EINVAL`` error code if cropping is not supported.
Documentation/media/uapi/v4l/vidioc-g-ctrl.rst +2 -2
index 53a6ebe6f744..78c191a89360 100644
@@ -35,10 +35,10 @@ Description
 ===========
 
 To get the current value of a control applications initialize the ``id``
-field of a struct :c:type:`struct v4l2_control <v4l2_control>` and call the
+field of a struct :c:type:`v4l2_control` and call the
 :ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` ioctl with a pointer to this structure. To change the
 value of a control applications initialize the ``id`` and ``value``
-fields of a struct :c:type:`struct v4l2_control <v4l2_control>` and call the
+fields of a struct :c:type:`v4l2_control` and call the
 :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` ioctl.
 
 When the ``id`` is invalid drivers return an ``EINVAL`` error code. When the
Documentation/media/uapi/v4l/vidioc-g-fbuf.rst +2 -2
index 7ade2f7d62be..4ac2625e545d 100644
@@ -49,13 +49,13 @@ VGA signal or graphics into a video signal. *Video Output Overlays* are
 always non-destructive.
 
 To get the current parameters applications call the :ref:`VIDIOC_G_FBUF <VIDIOC_G_FBUF>`
-ioctl with a pointer to a :c:type:`struct v4l2_framebuffer <v4l2_framebuffer>`
+ioctl with a pointer to a struct :c:type:`v4l2_framebuffer`
 structure. The driver fills all fields of the structure or returns an
 EINVAL error code when overlays are not supported.
 
 To set the parameters for a *Video Output Overlay*, applications must
 initialize the ``flags`` field of a struct
-:c:type:`struct v4l2_framebuffer <v4l2_framebuffer>`. Since the framebuffer is
+struct :c:type:`v4l2_framebuffer`. Since the framebuffer is
 implemented on the TV card all other parameters are determined by the
 driver. When an application calls :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>` with a pointer to
 this structure, the driver prepares for the overlay and returns the
Documentation/media/uapi/v4l/vidioc-g-fmt.rst +2 -2
index dd6c062d267c..037437d66f08 100644
@@ -40,7 +40,7 @@ These ioctls are used to negotiate the format of data (typically image
 format) exchanged between driver and application.
 
 To query the current parameters applications set the ``type`` field of a
-struct :c:type:`struct v4l2_format <v4l2_format>` to the respective buffer (stream)
+struct :c:type:`v4l2_format` to the respective buffer (stream)
 type. For example video capture devices use
 ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` or
 ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``. When the application calls the
@@ -58,7 +58,7 @@ For details see the documentation of the various devices types in
 :ref:`devices`. Good practice is to query the current parameters
 first, and to modify only those parameters not suitable for the
 application. When the application calls the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl with
-a pointer to a :c:type:`struct v4l2_format <v4l2_format>` structure the driver
+a pointer to a struct :c:type:`v4l2_format` structure the driver
 checks and adjusts the parameters against hardware abilities. Drivers
 should not return an error code unless the ``type`` field is invalid,
 this is a mechanism to fathom device capabilities and to approach
Documentation/media/uapi/v4l/vidioc-g-parm.rst +1 -1
index 021b96ee641d..689b5d92aeae 100644
@@ -47,7 +47,7 @@ section discussing the :ref:`read() <func-read>` function.
 
 To get and set the streaming parameters applications call the
 :ref:`VIDIOC_G_PARM <VIDIOC_G_PARM>` and :ref:`VIDIOC_S_PARM <VIDIOC_G_PARM>` ioctl, respectively. They take a
-pointer to a struct :c:type:`struct v4l2_streamparm <v4l2_streamparm>` which contains a
+pointer to a struct :c:type:`v4l2_streamparm` which contains a
 union holding separate parameters for input and output devices.
 
 
Documentation/media/uapi/v4l/vidioc-g-std.rst +1 -1
index c351eb9f6b0e..cd856ad21a28 100644
@@ -40,7 +40,7 @@ To query and select the current video standard applications use the
 can return a single flag or a set of flags as in struct
 :c:type:`v4l2_standard` field ``id``. The flags must be
 unambiguous such that they appear in only one enumerated
-:c:type:`struct v4l2_standard <v4l2_standard>` structure.
+struct :c:type:`v4l2_standard` structure.
 
 :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` accepts one or more flags, being a write-only ioctl it
 does not return the actual new standard as :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` does. When
Documentation/media/uapi/v4l/vidioc-g-tuner.rst +1 -1
index 01b7f26bf22f..077da39f3ae6 100644
@@ -226,7 +226,7 @@ To change the radio frequency the
 	  received audio programs do not match.
 
 	  Currently this is the only field of struct
-	  :c:type:`struct v4l2_tuner <v4l2_tuner>` applications can change.
+	  struct :c:type:`v4l2_tuner` applications can change.
 
     -  .. row 15
 
Documentation/media/uapi/v4l/vidioc-prepare-buf.rst +1 -1
index c20e1c7d5f89..bdcfd9fe550d 100644
@@ -40,7 +40,7 @@ operations are not required, the application can use one of
 ``V4L2_BUF_FLAG_NO_CACHE_INVALIDATE`` and
 ``V4L2_BUF_FLAG_NO_CACHE_CLEAN`` flags to skip the respective step.
 
-The :c:type:`struct v4l2_buffer <v4l2_buffer>` structure is specified in
+The struct :c:type:`v4l2_buffer` structure is specified in
 :ref:`buffer`.
 
 
Documentation/media/uapi/v4l/vidioc-qbuf.rst +2 -2
index 727238fc2337..1f3612637200 100644
@@ -46,7 +46,7 @@ Applications must also set the ``index`` field. Valid index numbers
 range from zero to the number of buffers allocated with
 :ref:`VIDIOC_REQBUFS` (struct
 :c:type:`v4l2_requestbuffers` ``count``) minus
-one. The contents of the struct :c:type:`struct v4l2_buffer <v4l2_buffer>` returned
+one. The contents of the struct :c:type:`v4l2_buffer` returned
 by a :ref:`VIDIOC_QUERYBUF` ioctl will do as well.
 When the buffer is intended for output (``type`` is
 ``V4L2_BUF_TYPE_VIDEO_OUTPUT``, ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE``,
@@ -114,7 +114,7 @@ queue. When the ``O_NONBLOCK`` flag was given to the
 :ref:`open() <func-open>` function, ``VIDIOC_DQBUF`` returns
 immediately with an ``EAGAIN`` error code when no buffer is available.
 
-The :c:type:`struct v4l2_buffer <v4l2_buffer>` structure is specified in
+The struct :c:type:`v4l2_buffer` structure is specified in
 :ref:`buffer`.
 
 
Documentation/media/uapi/v4l/vidioc-querybuf.rst +1 -1
index 1edd76c06e0a..0bdc8e0abddc 100644
@@ -63,7 +63,7 @@ elements will be used instead and the ``length`` field of struct
 array elements. The driver may or may not set the remaining fields and
 flags, they are meaningless in this context.
 
-The :c:type:`struct v4l2_buffer <v4l2_buffer>` structure is specified in
+The struct :c:type:`v4l2_buffer` structure is specified in
 :ref:`buffer`.
 
 
Documentation/media/uapi/v4l/vidioc-reqbufs.rst +1 -1
index 195f0a3d783c..fc63045f4143 100644
@@ -43,7 +43,7 @@ configures the driver into DMABUF I/O mode without performing any direct
 allocation.
 
 To allocate device buffers applications initialize all fields of the
-:c:type:`struct v4l2_requestbuffers <v4l2_requestbuffers>` structure. They set the ``type``
+struct :c:type:`v4l2_requestbuffers` structure. They set the ``type``
 field to the respective stream or buffer type, the ``count`` field to
 the desired number of buffers, ``memory`` must be set to the requested
 I/O method and the ``reserved`` array must be zeroed. When the ioctl is
Signature · 1 line
2.7.4
#40 lore raw

PATCH 38/47 docs-rst: fix some broken struct references

In reply to Mauro Carvalho Chehab

The :c:type: references point to the structure name, and not to struct foo.

Fixed via this shell script:

	for i in `find Documentation/media -type f`; do perl -ne 'if (s/\:c\:type\:\`struct\s*(\S+)\`/struct :c:type:`$1`/) { s/struct\s+struct/struct/;  s/(struct\s+\:c\:type\:\`\S+\`)\s+structure/$1/;  } print $_' <$i >a && mv a $i; done
---
 Documentation/media/uapi/cec/cec-func-poll.rst |  2 +-
 Documentation/media/uapi/v4l/buffer.rst        |  2 +-
 Documentation/media/uapi/v4l/dev-osd.rst       |  4 +--
 Documentation/media/uapi/v4l/hist-v4l2.rst     | 34 +++++++++++++-------------
 4 files changed, 21 insertions(+), 21 deletions(-)
Documentation/media/uapi/cec/cec-func-poll.rst +1 -1
index 5bacb7c6f33b..cfb73e6027a5 100644
@@ -49,7 +49,7 @@ events.
 
 On success :c:func:`poll()` returns the number of file descriptors
 that have been selected (that is, file descriptors for which the
-``revents`` field of the respective :c:type:`struct pollfd` structure
+``revents`` field of the respective struct :c:type:`pollfd`
 is non-zero). CEC devices set the ``POLLIN`` and ``POLLRDNORM`` flags in
 the ``revents`` field if there are messages in the receive queue. If the
 transmit queue has room for new messages, the ``POLLOUT`` and
Documentation/media/uapi/v4l/buffer.rst +1 -1
index 7b64a1986d66..7d2d81a771b1 100644
@@ -825,7 +825,7 @@ Timecodes
 
 The struct :c:type:`v4l2_timecode` structure is designed to hold a
 :ref:`smpte12m` or similar timecode. (struct
-:c:type:`struct timeval` timestamps are stored in struct
+struct :c:type:`timeval` timestamps are stored in struct
 :c:type:`v4l2_buffer` field ``timestamp``.)
 
 
Documentation/media/uapi/v4l/dev-osd.rst +2 -2
index 0b246c31b6a3..71da85ed7e4b 100644
@@ -44,8 +44,8 @@ other information, the physical address of the framebuffer in the
 ``base`` field of struct :c:type:`v4l2_framebuffer`.
 The framebuffer device ioctl ``FBIOGET_FSCREENINFO`` returns the same
 address in the ``smem_start`` field of struct
-:c:type:`struct fb_fix_screeninfo`. The ``FBIOGET_FSCREENINFO``
-ioctl and struct :c:type:`struct fb_fix_screeninfo` are defined in
+struct :c:type:`fb_fix_screeninfo`. The ``FBIOGET_FSCREENINFO``
+ioctl and struct :c:type:`fb_fix_screeninfo` are defined in
 the ``linux/fb.h`` header file.
 
 The width and height of the framebuffer depends on the current video
Documentation/media/uapi/v4l/hist-v4l2.rst +17 -17
index bd45431ed00e..b18fb7e6c39a 100644
@@ -37,7 +37,7 @@ transmission arguments.
 enumerable.
 
 1998-10-02: The ``id`` field was removed from struct
-:c:type:`struct video_standard` and the color subcarrier fields were
+struct :c:type:`video_standard` and the color subcarrier fields were
 renamed. The :ref:`VIDIOC_QUERYSTD` ioctl was
 renamed to :ref:`VIDIOC_ENUMSTD`,
 :ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` to
@@ -151,7 +151,7 @@ common Linux driver API conventions.
    This change obsoletes the following ioctls: ``VIDIOC_S_INFMT``,
    ``VIDIOC_G_INFMT``, ``VIDIOC_S_OUTFMT``, ``VIDIOC_G_OUTFMT``,
    ``VIDIOC_S_VBIFMT`` and ``VIDIOC_G_VBIFMT``. The image format
-   structure :c:type:`struct v4l2_format` was renamed to struct
+   structure struct :c:type:`v4l2_format` was renamed to struct
    :c:type:`v4l2_pix_format`, while struct
    :c:type:`v4l2_format` is now the envelopping structure
    for all format negotiations.
@@ -254,7 +254,7 @@ multiple tuners into account.)
 2000-09-18: ``V4L2_BUF_TYPE_VBI`` was added. This may *break
 compatibility* as the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and
 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctls may fail now if the struct
-:c:type:`struct v4l2_fmt` ``type`` field does not contain
+struct :c:type:`v4l2_fmt` ``type`` field does not contain
 ``V4L2_BUF_TYPE_VBI``. In the documentation of the struct
 :c:type:`v4l2_vbi_format` ``offset`` field the
 ambiguous phrase "rising edge" was changed to "leading edge".
@@ -415,7 +415,7 @@ This unnamed version was finally merged into Linux 2.5.46.
     originally needed to distguish between variations of standards, were
     removed.
 
-    Struct :c:type:`struct v4l2_enumstd` ceased to be.
+    Struct struct :c:type:`v4l2_enumstd` ceased to be.
     :ref:`VIDIOC_ENUMSTD` now takes a pointer to a
     struct :c:type:`v4l2_standard` directly. The
     information which standards are supported by a particular video
@@ -636,7 +636,7 @@ This unnamed version was finally merged into Linux 2.5.46.
     removed. Since no unadjusted system time clock was added to the
     kernel as planned, the ``timestamp`` field changed back from type
     stamp_t, an unsigned 64 bit integer expressing the sample time in
-    nanoseconds, to struct :c:type:`struct timeval`. With the addition
+    nanoseconds, to struct :c:type:`timeval`. With the addition
     of a second memory mapping method the ``offset`` field moved into
     union ``m``, and a new ``memory`` field of type enum
     :ref:`v4l2_memory <v4l2-memory>` was added to distinguish between
@@ -671,11 +671,11 @@ This unnamed version was finally merged into Linux 2.5.46.
     distinguish between field and frame (interlaced) overlay.
 
 17. The digital zoom interface, including struct
-    :c:type:`struct v4l2_zoomcap`, struct
-    :c:type:`struct v4l2_zoom`, ``V4L2_ZOOM_NONCAP`` and
+    struct :c:type:`v4l2_zoomcap`, struct
+    struct :c:type:`v4l2_zoom`, ``V4L2_ZOOM_NONCAP`` and
     ``V4L2_ZOOM_WHILESTREAMING`` was replaced by a new cropping and
     scaling interface. The previously unused struct
-    :c:type:`struct v4l2_cropcap` and :c:type:`struct v4l2_crop`
+    struct :c:type:`v4l2_cropcap` and :c:type:`struct v4l2_crop`
     where redefined for this purpose. See :ref:`crop` for details.
 
 18. In struct :c:type:`v4l2_vbi_format` the
@@ -694,7 +694,7 @@ This unnamed version was finally merged into Linux 2.5.46.
     Similar changes were made to struct
     :c:type:`v4l2_outputparm`.
 
-20. The struct :c:type:`struct v4l2_performance` and
+20. The struct :c:type:`v4l2_performance` and
     ``VIDIOC_G_PERF`` ioctl were dropped. Except when using the
     :ref:`read/write I/O method <rw>`, which is limited anyway, this
     information is already available to applications.
@@ -882,7 +882,7 @@ V4L2 in Linux 2.6.15
 3. The ``VIDIOC_G_COMP`` and ``VIDIOC_S_COMP`` ioctl were renamed to
    ``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` respectively. Their
    argument was replaced by a struct
-   :c:type:`struct v4l2_mpeg_compression` pointer. (The
+   struct :c:type:`v4l2_mpeg_compression` pointer. (The
    ``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` ioctls where removed
    in Linux 2.6.25.)
 
@@ -925,7 +925,7 @@ V4L2 spec erratum 2006-02-04
 1. The ``clips`` field in struct :c:type:`v4l2_window`
    must point to an array of struct :c:type:`v4l2_clip`, not
    a linked list, because drivers ignore the struct
-   :c:type:`struct v4l2_clip`. ``next`` pointer.
+   struct :c:type:`v4l2_clip`. ``next`` pointer.
 
 
 V4L2 in Linux 2.6.17
@@ -1040,7 +1040,7 @@ V4L2 in Linux 2.6.22
    A new ``global_alpha`` field was added to
    :c:type:`v4l2_window`, extending the structure. This
    may *break compatibility* with applications using a struct
-   :c:type:`struct v4l2_window` directly. However the
+   struct :c:type:`v4l2_window` directly. However the
    :ref:`VIDIOC_G/S/TRY_FMT <VIDIOC_G_FMT>` ioctls, which take a
    pointer to a :c:type:`v4l2_format` parent structure
    with padding bytes at the end, are not affected.
@@ -1127,8 +1127,8 @@ V4L2 in Linux 2.6.29
 1. The ``VIDIOC_G_CHIP_IDENT`` ioctl was renamed to
    ``VIDIOC_G_CHIP_IDENT_OLD`` and ``VIDIOC_DBG_G_CHIP_IDENT`` was
    introduced in its place. The old struct
-   :c:type:`struct v4l2_chip_ident` was renamed to
-   :c:type:`struct v4l2_chip_ident_old`.
+   struct :c:type:`v4l2_chip_ident` was renamed to
+   struct :c:type:`v4l2_chip_ident_old`.
 
 2. The pixel formats ``V4L2_PIX_FMT_VYUY``, ``V4L2_PIX_FMT_NV16`` and
    ``V4L2_PIX_FMT_NV61`` were added.
@@ -1279,7 +1279,7 @@ V4L2 in Linux 3.5
 V4L2 in Linux 3.6
 =================
 
-1. Replaced ``input`` in :c:type:`struct v4l2_buffer` by
+1. Replaced ``input`` in struct :c:type:`v4l2_buffer` by
    ``reserved2`` and removed ``V4L2_BUF_FLAG_INPUT``.
 
 2. Added V4L2_CAP_VIDEO_M2M and V4L2_CAP_VIDEO_M2M_MPLANE
@@ -1293,7 +1293,7 @@ V4L2 in Linux 3.9
 =================
 
 1. Added timestamp types to ``flags`` field in
-   :c:type:`struct v4l2_buffer`. See :ref:`buffer-flags`.
+   struct :c:type:`v4l2_buffer`. See :ref:`buffer-flags`.
 
 2. Added ``V4L2_EVENT_CTRL_CH_RANGE`` control event changes flag. See
    :ref:`ctrl-changes-flags`.
@@ -1320,7 +1320,7 @@ V4L2 in Linux 3.11
 V4L2 in Linux 3.14
 ==================
 
-1. In struct :c:type:`struct v4l2_rect`, the type of ``width`` and
+1. In struct :c:type:`v4l2_rect`, the type of ``width`` and
    ``height`` fields changed from _s32 to _u32.
 
 
Signature · 1 line
2.7.4
#41 lore raw

PATCH 39/47 fix clock_gettime cross-references

In reply to Mauro Carvalho Chehab

Fix those warnings:

Documentation/media/uapi/cec/cec-ioc-dqevent.rst:124: WARNING: c:func reference target not found: clock_gettime(2)

By replacing it with the right function name, using this shell script:

	for i in `find Documentation/media -type f`; do sed 's,clock_gettime(2),clock_gettime,' <$i >a && mv a $i; done

Please notice that this will make the nitpick mode to shut up complaining about that, becasue clock_gettime is on its exclude list, but the cross reference will be undefined until someone documents this function at the core documentation.

---
 Documentation/media/uapi/cec/cec-ioc-dqevent.rst | 2 +-
 Documentation/media/uapi/cec/cec-ioc-receive.rst | 4 ++--
 Documentation/media/uapi/v4l/buffer.rst          | 4 ++--
 Documentation/media/uapi/v4l/vidioc-dqevent.rst  | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
Documentation/media/uapi/cec/cec-ioc-dqevent.rst +1 -1
index 06b79361254c..060c455380ce 100644
@@ -122,7 +122,7 @@ it is guaranteed that the state did change in between the two events.
        -  :cspan:`1` Timestamp of the event in ns.
 
 	  The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To access
-	  the same clock from userspace use :c:func:`clock_gettime(2)`.
+	  the same clock from userspace use :c:func:`clock_gettime`.
 
     -  .. row 2
 
Documentation/media/uapi/cec/cec-ioc-receive.rst +2 -2
index 18620f81b7d9..d585b1bba6ac 100644
@@ -95,7 +95,7 @@ result.
 
        -  Timestamp in ns of when the last byte of the message was transmitted.
 	  The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To access
-	  the same clock from userspace use :c:func:`clock_gettime(2)`.
+	  the same clock from userspace use :c:func:`clock_gettime`.
 
     -  .. row 2
 
@@ -105,7 +105,7 @@ result.
 
        -  Timestamp in ns of when the last byte of the message was received.
 	  The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To access
-	  the same clock from userspace use :c:func:`clock_gettime(2)`.
+	  the same clock from userspace use :c:func:`clock_gettime`.
 
     -  .. row 3
 
Documentation/media/uapi/v4l/buffer.rst +2 -2
index 7d2d81a771b1..e71a458712d3 100644
@@ -712,7 +712,7 @@ Buffer Flags
 	  clock). Monotonic clock has been favoured in embedded systems
 	  whereas most of the drivers use the realtime clock. Either kinds
 	  of timestamps are available in user space via
-	  :c:func:`clock_gettime(2)` using clock IDs ``CLOCK_MONOTONIC``
+	  :c:func:`clock_gettime` using clock IDs ``CLOCK_MONOTONIC``
 	  and ``CLOCK_REALTIME``, respectively.
 
     -  .. _`V4L2-BUF-FLAG-TIMESTAMP-MONOTONIC`:
@@ -723,7 +723,7 @@ Buffer Flags
 
        -  The buffer timestamp has been taken from the ``CLOCK_MONOTONIC``
 	  clock. To access the same clock outside V4L2, use
-	  :c:func:`clock_gettime(2)`.
+	  :c:func:`clock_gettime`.
 
     -  .. _`V4L2-BUF-FLAG-TIMESTAMP-COPY`:
 
Documentation/media/uapi/v4l/vidioc-dqevent.rst +1 -1
index 3038f349049c..1e435ab674a2 100644
@@ -152,7 +152,7 @@ call.
        -
        -  Event timestamp. The timestamp has been taken from the
 	  ``CLOCK_MONOTONIC`` clock. To access the same clock outside V4L2,
-	  use :c:func:`clock_gettime(2)`.
+	  use :c:func:`clock_gettime`.
 
     -  .. row 12
 
Signature · 1 line
2.7.4
#42 lore raw

PATCH 40/47 libv4l-introdution.rst: fix function definitions

In reply to Mauro Carvalho Chehab

c:type is not the right tag for function definitions. Replace them by .. c:function::

---
 .../media/uapi/v4l/libv4l-introduction.rst         | 62 ++++++++++++----------
 1 file changed, 35 insertions(+), 27 deletions(-)
Documentation/media/uapi/v4l/libv4l-introduction.rst +35 -27
index 61d085f9f105..1c1278d17fa7 100644
@@ -116,45 +116,53 @@ The common file operation methods are provided by libv4l.
 Those functions operate just like glibc
 open/close/dup/ioctl/read/mmap/munmap:
 
--  :c:type:`int v4l2_open(const char *file, int oflag, ...)` - operates like the
-   standard :ref:`open() <func-open>` function.
+.. c:function:: int v4l2_open(const char *file, int oflag, ...)
 
--  :c:type:`int v4l2_close(int fd)` - operates like the standard
-   :ref:`close() <func-close>` function.
+   operates like the standard :ref:`open() <func-open>` function.
 
--  :c:type:`int v4l2_dup(int fd)` - operates like the standard dup() function,
-   duplicating a file handler.
+.. c:function:: int v4l2_close(int fd)
 
--  :c:type:`int v4l2_ioctl (int fd, unsigned long int request, ...)` - operates
-   like the standard :ref:`ioctl() <func-ioctl>` function.
+   operates like the standard :ref:`close() <func-close>` function.
 
--  :c:type:`int v4l2_read (int fd, void* buffer, size_t n)` - operates like the
-   standard :ref:`read() <func-read>` function.
+.. c:function:: int v4l2_dup(int fd)
 
--  :c:type:`void v4l2_mmap(void *start, size_t length, int prot, int flags, int
-   fd, int64_t offset);` - operates like the standard
-   :ref:`mmap() <func-mmap>` function.
+   operates like the standard dup() function, duplicating a file handler.
 
--  :c:type:`int v4l2_munmap(void *_start, size_t length);` - operates like the
-   standard :ref:`munmap() <func-munmap>` function.
+.. c:function:: int v4l2_ioctl (int fd, unsigned long int request, ...)
+
+   operates like the standard :ref:`ioctl() <func-ioctl>` function.
+
+.. c:function:: int v4l2_read (int fd, void* buffer, size_t n)
+
+   operates like the standard :ref:`read() <func-read>` function.
+
+.. c:function:: void v4l2_mmap(void *start, size_t length, int prot, int flags, int fd, int64_t offset);
+
+   operates like the standard :ref:`mmap() <func-mmap>` function.
+
+.. c:function:: int v4l2_munmap(void *_start, size_t length);
+   operates like the standard :ref:`munmap() <func-munmap>` function.
 
 Those functions provide additional control:
 
--  :c:type:`int v4l2_fd_open(int fd, int v4l2_flags)` - opens an already opened
-   fd for further use through v4l2lib and possibly modify libv4l2's
-   default behavior through the v4l2_flags argument. Currently,
-   v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable format
-   conversion.
+.. c:function:: int v4l2_fd_open(int fd, int v4l2_flags)
 
--  :c:type:`int v4l2_set_control(int fd, int cid, int value)` - This function
-   takes a value of 0 - 65535, and then scales that range to the actual
-   range of the given v4l control id, and then if the cid exists and is
+   opens an already opened fd for further use through v4l2lib and possibly
+   modify libv4l2's default behavior through the v4l2_flags argument.
+   Currently, v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable
+   format conversion.
+
+.. c:function:: int v4l2_set_control(int fd, int cid, int value)
+
+   This function takes a value of 0 - 65535, and then scales that range to the
+   actual range of the given v4l control id, and then if the cid exists and is
    not locked sets the cid to the scaled value.
 
--  :c:type:`int v4l2_get_control(int fd, int cid)` - This function returns a
-   value of 0 - 65535, scaled to from the actual range of the given v4l
-   control id. when the cid does not exist, could not be accessed for
-   some reason, or some error occurred 0 is returned.
+.. c:function:: int v4l2_get_control(int fd, int cid)
+
+   This function returns a value of 0 - 65535, scaled to from the actual range
+   of the given v4l control id. when the cid does not exist, could not be
+   accessed for some reason, or some error occurred 0 is returned.
 
 
 v4l1compat.so wrapper library
Signature · 1 line
2.7.4
#43 lore raw

PATCH 41/47 libv4l-introduction.rst: improve crossr-references

In reply to Mauro Carvalho Chehab

Use C cross-references to mention the V4L2 API calls on all places it occurs inside this file.

While here, also mark constants as such.

---
 .../media/uapi/v4l/libv4l-introduction.rst         | 33 +++++++++++++---------
 1 file changed, 20 insertions(+), 13 deletions(-)
Documentation/media/uapi/v4l/libv4l-introduction.rst +20 -13
index 1c1278d17fa7..ccc3c4d2fc0f 100644
@@ -113,43 +113,47 @@ Libv4l device control functions
 
 The common file operation methods are provided by libv4l.
 
-Those functions operate just like glibc
-open/close/dup/ioctl/read/mmap/munmap:
+Those functions operate just like the gcc function ``dup()`` and
+V4L2 functions
+:c:func:`open() <v4l2-open>`, :c:func:`close() <v4l2-close>`,
+:c:func:`ioctl() <v4l2-ioctl>`, :c:func:`read() <v4l2-read>`,
+:c:func:`mmap() <v4l2-mmap>` and :c:func:`munmap() <v4l2-munmap>`:
 
 .. c:function:: int v4l2_open(const char *file, int oflag, ...)
 
-   operates like the standard :ref:`open() <func-open>` function.
+   operates like the :c:func:`open() <v4l2-open>` function.
 
 .. c:function:: int v4l2_close(int fd)
 
-   operates like the standard :ref:`close() <func-close>` function.
+   operates like the :c:func:`close() <v4l2-close>` function.
 
 .. c:function:: int v4l2_dup(int fd)
 
-   operates like the standard dup() function, duplicating a file handler.
+   operates like the libc ``dup()`` function, duplicating a file handler.
 
 .. c:function:: int v4l2_ioctl (int fd, unsigned long int request, ...)
 
-   operates like the standard :ref:`ioctl() <func-ioctl>` function.
+   operates like the :c:func:`ioctl() <v4l2-ioctl>` function.
 
 .. c:function:: int v4l2_read (int fd, void* buffer, size_t n)
 
-   operates like the standard :ref:`read() <func-read>` function.
+   operates like the :c:func:`read() <v4l2-read>` function.
 
 .. c:function:: void v4l2_mmap(void *start, size_t length, int prot, int flags, int fd, int64_t offset);
 
-   operates like the standard :ref:`mmap() <func-mmap>` function.
+   operates like the :c:func:`munmap() <v4l2-munmap>` function.
 
 .. c:function:: int v4l2_munmap(void *_start, size_t length);
-   operates like the standard :ref:`munmap() <func-munmap>` function.
+
+   operates like the :c:func:`munmap() <v4l2-munmap>` function.
 
 Those functions provide additional control:
 
 .. c:function:: int v4l2_fd_open(int fd, int v4l2_flags)
 
    opens an already opened fd for further use through v4l2lib and possibly
-   modify libv4l2's default behavior through the v4l2_flags argument.
-   Currently, v4l2_flags can be ``V4L2_DISABLE_CONVERSION``, to disable
+   modify libv4l2's default behavior through the ``v4l2_flags`` argument.
+   Currently, ``v4l2_flags`` can be ``V4L2_DISABLE_CONVERSION``, to disable
    format conversion.
 
 .. c:function:: int v4l2_set_control(int fd, int cid, int value)
@@ -168,9 +172,12 @@ Those functions provide additional control:
 v4l1compat.so wrapper library
 =============================
 
-This library intercepts calls to open/close/ioctl/mmap/mmunmap
+This library intercepts calls to
+:c:func:`open() <v4l2-open>`, :c:func:`close() <v4l2-close>`,
+:c:func:`ioctl() <v4l2-ioctl>`, :c:func:`mmap() <v4l2-mmap>` and
+:c:func:`munmap() <v4l2-munmap>`
 operations and redirects them to the libv4l counterparts, by using
-LD_PRELOAD=/usr/lib/v4l1compat.so. It also emulates V4L1 calls via V4L2
+``LD_PRELOAD=/usr/lib/v4l1compat.so``. It also emulates V4L1 calls via V4L2
 API.
 
 It allows usage of binary legacy applications that still don't use
Signature · 1 line
2.7.4
#44 lore raw

PATCH 42/47 hist-v4l2.rst: don't do refs to old structures

In reply to Mauro Carvalho Chehab

Several structs were renamed or removed during V4L2 development. Don't try to cross-reference the legacy ones.

---
 Documentation/media/uapi/v4l/hist-v4l2.rst | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
Documentation/media/uapi/v4l/hist-v4l2.rst +12 -12
index b18fb7e6c39a..d86d6343a20a 100644
@@ -30,14 +30,14 @@ aliases ``O_NONCAP`` and ``O_NOIO`` were defined. Applications can set
 this flag if they intend to access controls only, as opposed to capture
 applications which need exclusive access. The ``VIDEO_STD_XXX``
 identifiers are now ordinals instead of flags, and the
-:c:func:`video_std_construct()` helper function takes id and
+``video_std_construct()`` helper function takes id and
 transmission arguments.
 
 1998-09-28: Revamped video standard. Made video controls individually
 enumerable.
 
 1998-10-02: The ``id`` field was removed from struct
-struct :c:type:`video_standard` and the color subcarrier fields were
+struct ``video_standard`` and the color subcarrier fields were
 renamed. The :ref:`VIDIOC_QUERYSTD` ioctl was
 renamed to :ref:`VIDIOC_ENUMSTD`,
 :ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` to
@@ -254,7 +254,7 @@ multiple tuners into account.)
 2000-09-18: ``V4L2_BUF_TYPE_VBI`` was added. This may *break
 compatibility* as the :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` and
 :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctls may fail now if the struct
-struct :c:type:`v4l2_fmt` ``type`` field does not contain
+struct ``v4l2_fmt`` ``type`` field does not contain
 ``V4L2_BUF_TYPE_VBI``. In the documentation of the struct
 :c:type:`v4l2_vbi_format` ``offset`` field the
 ambiguous phrase "rising edge" was changed to "leading edge".
@@ -415,7 +415,7 @@ This unnamed version was finally merged into Linux 2.5.46.
     originally needed to distguish between variations of standards, were
     removed.
 
-    Struct struct :c:type:`v4l2_enumstd` ceased to be.
+    Struct ``v4l2_enumstd`` ceased to be.
     :ref:`VIDIOC_ENUMSTD` now takes a pointer to a
     struct :c:type:`v4l2_standard` directly. The
     information which standards are supported by a particular video
@@ -671,11 +671,11 @@ This unnamed version was finally merged into Linux 2.5.46.
     distinguish between field and frame (interlaced) overlay.
 
 17. The digital zoom interface, including struct
-    struct :c:type:`v4l2_zoomcap`, struct
-    struct :c:type:`v4l2_zoom`, ``V4L2_ZOOM_NONCAP`` and
+    struct ``v4l2_zoomcap``, struct
+    struct ``v4l2_zoom``, ``V4L2_ZOOM_NONCAP`` and
     ``V4L2_ZOOM_WHILESTREAMING`` was replaced by a new cropping and
     scaling interface. The previously unused struct
-    struct :c:type:`v4l2_cropcap` and :c:type:`struct v4l2_crop`
+    struct :c:type:`v4l2_cropcap` and struct :c:type:`v4l2_crop`
     where redefined for this purpose. See :ref:`crop` for details.
 
 18. In struct :c:type:`v4l2_vbi_format` the
@@ -694,7 +694,7 @@ This unnamed version was finally merged into Linux 2.5.46.
     Similar changes were made to struct
     :c:type:`v4l2_outputparm`.
 
-20. The struct :c:type:`v4l2_performance` and
+20. The struct ``v4l2_performance`` and
     ``VIDIOC_G_PERF`` ioctl were dropped. Except when using the
     :ref:`read/write I/O method <rw>`, which is limited anyway, this
     information is already available to applications.
@@ -882,7 +882,7 @@ V4L2 in Linux 2.6.15
 3. The ``VIDIOC_G_COMP`` and ``VIDIOC_S_COMP`` ioctl were renamed to
    ``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` respectively. Their
    argument was replaced by a struct
-   struct :c:type:`v4l2_mpeg_compression` pointer. (The
+   ``v4l2_mpeg_compression`` pointer. (The
    ``VIDIOC_G_MPEGCOMP`` and ``VIDIOC_S_MPEGCOMP`` ioctls where removed
    in Linux 2.6.25.)
 
@@ -982,7 +982,7 @@ V4L2 in Linux 2.6.18
    flag to skip unsupported controls with
    :ref:`VIDIOC_QUERYCTRL`, new control types
    ``V4L2_CTRL_TYPE_INTEGER64`` and ``V4L2_CTRL_TYPE_CTRL_CLASS``
-   (:ref:`v4l2-ctrl-type`), and new control flags
+   (:c:type:`v4l2_ctrl_type`), and new control flags
    ``V4L2_CTRL_FLAG_READ_ONLY``, ``V4L2_CTRL_FLAG_UPDATE``,
    ``V4L2_CTRL_FLAG_INACTIVE`` and ``V4L2_CTRL_FLAG_SLIDER``
    (:ref:`control-flags`). See :ref:`extended-controls` for details.
@@ -1127,8 +1127,8 @@ V4L2 in Linux 2.6.29
 1. The ``VIDIOC_G_CHIP_IDENT`` ioctl was renamed to
    ``VIDIOC_G_CHIP_IDENT_OLD`` and ``VIDIOC_DBG_G_CHIP_IDENT`` was
    introduced in its place. The old struct
-   struct :c:type:`v4l2_chip_ident` was renamed to
-   struct :c:type:`v4l2_chip_ident_old`.
+   struct ``v4l2_chip_ident`` was renamed to
+   struct ``v4l2_chip_ident_old``.
 
 2. The pixel formats ``V4L2_PIX_FMT_VYUY``, ``V4L2_PIX_FMT_NV16`` and
    ``V4L2_PIX_FMT_NV61`` were added.
Signature · 1 line
2.7.4
#45 lore raw

PATCH 43/47 docs-rst: fix cross-references for videodev2.h

In reply to Mauro Carvalho Chehab

There are several broken references there, due to the conversion to C domain. Fix them using this shell script and manually adjust what's broken:

	# funcs is a file with the broken functions/references
	for i in $(cat funcs|sort|uniq|perl -ne 'print "$1\n" if (m/(\S+)$/)'); do
		i=${i//-/_}
		echo $i
		j=${i//_/-}
		for k in $(git grep -l "_$j:" Documentation/); do
			sed s,\_$j\:,"c\:type\:\: $i", <$k >a && mv a $k
		done
		for k in $(git grep -l "$j" Documentation/media/*.exceptions); do
			sed s,$j,":c\:type\:\`$i\`", <$k >a && mv a $k
		done
		for k in $(git grep -l "$j" Documentation/); do
			sed "s,:ref:\`$i <$j>\`,:c:type:\`$i\`," <$k >a && mv a $k
			sed "s,:ref:\`$j\`,:c:type:\`$i\`," <$k >a && mv a $k
			sed -E "s,:ref:\`(.*)<$j>\`,:c:type:\`\1<$i>\`," <$k >a && mv a $k
		done
		for k in $(git grep -l "<$j>" include/media); do
			sed -E "s,:ref:\`(.*)<$j>\`,enum \&$i," <$k >a && mv a $k
		done
	done
---
 Documentation/media/uapi/v4l/buffer.rst            |  14 +-
 Documentation/media/uapi/v4l/field-order.rst       |   4 +-
 Documentation/media/uapi/v4l/hist-v4l2.rst         |  30 +--
 Documentation/media/uapi/v4l/pixfmt-002.rst        |  10 +-
 Documentation/media/uapi/v4l/pixfmt-003.rst        |  10 +-
 Documentation/media/uapi/v4l/pixfmt-006.rst        |  16 +-
 Documentation/media/uapi/v4l/planar-apis.rst       |   2 +-
 Documentation/media/uapi/v4l/subdev-formats.rst    |  10 +-
 Documentation/media/uapi/v4l/tuner.rst             |   4 +-
 Documentation/media/uapi/v4l/v4l2.rst              |   4 +-
 .../media/uapi/v4l/vidioc-create-bufs.rst          |   2 +-
 Documentation/media/uapi/v4l/vidioc-cropcap.rst    |   2 +-
 .../media/uapi/v4l/vidioc-dbg-g-register.rst       |   2 +-
 Documentation/media/uapi/v4l/vidioc-dqevent.rst    |   2 +-
 Documentation/media/uapi/v4l/vidioc-enum-fmt.rst   |   2 +-
 .../media/uapi/v4l/vidioc-enum-frameintervals.rst  |   2 +-
 .../media/uapi/v4l/vidioc-enum-framesizes.rst      |   2 +-
 .../media/uapi/v4l/vidioc-enum-freq-bands.rst      |   2 +-
 Documentation/media/uapi/v4l/vidioc-expbuf.rst     |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-crop.rst     |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-edid.rst     |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-fbuf.rst     |   4 +-
 Documentation/media/uapi/v4l/vidioc-g-fmt.rst      |   2 +-
 .../media/uapi/v4l/vidioc-g-frequency.rst          |   2 +-
 .../media/uapi/v4l/vidioc-g-modulator.rst          |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-parm.rst     |   2 +-
 .../media/uapi/v4l/vidioc-g-selection.rst          |   2 +-
 .../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst     |   2 +-
 Documentation/media/uapi/v4l/vidioc-g-tuner.rst    |   4 +-
 Documentation/media/uapi/v4l/vidioc-querycap.rst   |   2 +-
 Documentation/media/uapi/v4l/vidioc-queryctrl.rst  |   4 +-
 Documentation/media/uapi/v4l/vidioc-reqbufs.rst    |   4 +-
 .../media/uapi/v4l/vidioc-s-hw-freq-seek.rst       |   2 +-
 .../uapi/v4l/vidioc-subdev-enum-frame-interval.rst |   7 +-
 .../uapi/v4l/vidioc-subdev-enum-frame-size.rst     |   6 +-
 .../uapi/v4l/vidioc-subdev-enum-mbus-code.rst      |   6 +-
 .../media/uapi/v4l/vidioc-subdev-g-crop.rst        |   8 +-
 .../media/uapi/v4l/vidioc-subdev-g-fmt.rst         |   2 +-
 .../uapi/v4l/vidioc-subdev-g-frame-interval.rst    |   8 +-
 .../media/uapi/v4l/vidioc-subdev-g-selection.rst   |   4 +-
 Documentation/media/videodev2.h.rst.exceptions     | 204 ++++++++++-----------
 41 files changed, 201 insertions(+), 202 deletions(-)
Documentation/media/uapi/v4l/buffer.rst +7 -7
index e71a458712d3..21893ee1384a 100644
@@ -74,7 +74,7 @@ struct v4l2_buffer
        -  Type of the buffer, same as struct
 	  :c:type:`v4l2_format` ``type`` or struct
 	  :c:type:`v4l2_requestbuffers` ``type``, set
-	  by the application. See :ref:`v4l2-buf-type`
+	  by the application. See :c:type:`v4l2_buf_type`
 
     -  .. row 3
 
@@ -110,7 +110,7 @@ struct v4l2_buffer
 
        -
        -  Indicates the field order of the image in the buffer, see
-	  :ref:`v4l2-field`. This field is not used when the buffer
+	  :c:type:`v4l2_field`. This field is not used when the buffer
 	  contains VBI data. Drivers must set it when ``type`` refers to a
 	  capture stream, applications when it refers to an output stream.
 
@@ -142,7 +142,7 @@ struct v4l2_buffer
        -  When ``type`` is ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` and the
 	  ``V4L2_BUF_FLAG_TIMECODE`` flag is set in ``flags``, this
 	  structure contains a frame timecode. In
-	  :ref:`V4L2_FIELD_ALTERNATE <v4l2-field>` mode the top and
+	  :c:type:`V4L2_FIELD_ALTERNATE <v4l2_field>` mode the top and
 	  bottom field contain the same timecode. Timecodes are intended to
 	  help video editing and are typically recorded on video tapes, but
 	  also embedded in compressed formats like MPEG. This field is
@@ -162,7 +162,7 @@ struct v4l2_buffer
 
        -  :cspan:`3`
 
-	  In :ref:`V4L2_FIELD_ALTERNATE <v4l2-field>` mode the top and
+	  In :c:type:`V4L2_FIELD_ALTERNATE <v4l2_field>` mode the top and
 	  bottom field have the same sequence number. The count starts at
 	  zero and includes dropped or repeated frames. A dropped frame was
 	  received by an input device but could not be stored due to lack of
@@ -187,7 +187,7 @@ struct v4l2_buffer
 
        -
        -  This field must be set by applications and/or drivers in
-	  accordance with the selected I/O method. See :ref:`v4l2-memory`
+	  accordance with the selected I/O method. See :c:type:`v4l2_memory`
 
     -  .. row 11
 
@@ -402,7 +402,7 @@ struct v4l2_plane
 
 
 
-.. _v4l2-buf-type:
+.. c:type:: v4l2_buf_type
 
 enum v4l2_buf_type
 ==================
@@ -773,7 +773,7 @@ Buffer Flags
 
 
 
-.. _v4l2-memory:
+.. c:type:: v4l2_memory
 
 enum v4l2_memory
 ================
Documentation/media/uapi/v4l/field-order.rst +2 -2
index 1fa082f34c6f..0d71d5a3fbde 100644
@@ -52,11 +52,11 @@ this end applications initialize the ``field`` field of struct
 should have the value ``V4L2_FIELD_ANY`` (0).
 
 
-.. _v4l2-field:
-
 enum v4l2_field
 ===============
 
+.. c:type:: v4l2_field
+
 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
 
 .. flat-table::
Documentation/media/uapi/v4l/hist-v4l2.rst +15 -15
index d86d6343a20a..dfd55e9066b3 100644
@@ -438,7 +438,7 @@ This unnamed version was finally merged into Linux 2.5.46.
     ``VIDIOC_S_FMT`` and ``VIDIOC_TRY_FMT``; ioctl. The ``VIDIOC_G_WIN``
     and ``VIDIOC_S_WIN`` ioctls to prepare for a video overlay were
     removed. The ``type`` field changed to type enum
-    :ref:`v4l2_buf_type <v4l2-buf-type>` and the buffer type names
+    :c:type:`v4l2_buf_type` and the buffer type names
     changed as follows.
 
 
@@ -452,7 +452,7 @@ This unnamed version was finally merged into Linux 2.5.46.
 
 	   -  Old defines
 
-	   -  enum :ref:`v4l2_buf_type <v4l2-buf-type>`
+	   -  enum :c:type:`v4l2_buf_type`
 
 	-  .. row 2
 
@@ -534,7 +534,7 @@ This unnamed version was finally merged into Linux 2.5.46.
 
 
 10. In struct :c:type:`v4l2_fmtdesc` a enum
-    :ref:`v4l2_buf_type <v4l2-buf-type>` field named ``type`` was
+    :c:type:`v4l2_buf_type` field named ``type`` was
     added as in struct :c:type:`v4l2_format`. The
     ``VIDIOC_ENUM_FBUFFMT`` ioctl is no longer needed and was removed.
     These calls can be replaced by
@@ -555,7 +555,7 @@ This unnamed version was finally merged into Linux 2.5.46.
     itself was removed.
 
     The interlace flags were replaced by a enum
-    :ref:`v4l2_field <v4l2-field>` value in a newly added ``field``
+    :c:type:`v4l2_field` value in a newly added ``field``
     field.
 
 
@@ -569,7 +569,7 @@ This unnamed version was finally merged into Linux 2.5.46.
 
 	   -  Old flag
 
-	   -  enum :ref:`v4l2_field <v4l2-field>`
+	   -  enum :c:type:`v4l2_field`
 
 	-  .. row 2
 
@@ -615,23 +615,23 @@ This unnamed version was finally merged into Linux 2.5.46.
 
 
     The color space flags were replaced by a enum
-    :ref:`v4l2_colorspace <v4l2-colorspace>` value in a newly added
+    :c:type:`v4l2_colorspace` value in a newly added
     ``colorspace`` field, where one of ``V4L2_COLORSPACE_SMPTE170M``,
     ``V4L2_COLORSPACE_BT878``, ``V4L2_COLORSPACE_470_SYSTEM_M`` or
     ``V4L2_COLORSPACE_470_SYSTEM_BG`` replaces ``V4L2_FMT_CS_601YUV``.
 
 12. In struct :c:type:`v4l2_requestbuffers` the
     ``type`` field was properly defined as enum
-    :ref:`v4l2_buf_type <v4l2-buf-type>`. Buffer types changed as
+    :c:type:`v4l2_buf_type`. Buffer types changed as
     mentioned above. A new ``memory`` field of type enum
-    :ref:`v4l2_memory <v4l2-memory>` was added to distinguish between
+    :c:type:`v4l2_memory` was added to distinguish between
     I/O methods using buffers allocated by the driver or the
     application. See :ref:`io` for details.
 
 13. In struct :c:type:`v4l2_buffer` the ``type`` field was
-    properly defined as enum :ref:`v4l2_buf_type <v4l2-buf-type>`.
+    properly defined as enum :c:type:`v4l2_buf_type`.
     Buffer types changed as mentioned above. A ``field`` field of type
-    enum :ref:`v4l2_field <v4l2-field>` was added to indicate if a
+    enum :c:type:`v4l2_field` was added to indicate if a
     buffer contains a top or bottom field. The old field flags were
     removed. Since no unadjusted system time clock was added to the
     kernel as planned, the ``timestamp`` field changed back from type
@@ -639,7 +639,7 @@ This unnamed version was finally merged into Linux 2.5.46.
     nanoseconds, to struct :c:type:`timeval`. With the addition
     of a second memory mapping method the ``offset`` field moved into
     union ``m``, and a new ``memory`` field of type enum
-    :ref:`v4l2_memory <v4l2-memory>` was added to distinguish between
+    :c:type:`v4l2_memory` was added to distinguish between
     I/O methods. See :ref:`io` for details.
 
     The ``V4L2_BUF_REQ_CONTIG`` flag was used by the V4L compatibility
@@ -667,7 +667,7 @@ This unnamed version was finally merged into Linux 2.5.46.
 
 16. In struct :c:type:`v4l2_window` the ``x``, ``y``,
     ``width`` and ``height`` field moved into a ``w`` substructure as
-    above. A ``field`` field of type %v4l2-field; was added to
+    above. A ``field`` field of type :c:type:`v4l2_field` was added to
     distinguish between field and frame (interlaced) overlay.
 
 17. The digital zoom interface, including struct
@@ -1029,7 +1029,7 @@ V4L2 in Linux 2.6.22
 ====================
 
 1. Two new field orders ``V4L2_FIELD_INTERLACED_TB`` and
-   ``V4L2_FIELD_INTERLACED_BT`` were added. See :ref:`v4l2-field` for
+   ``V4L2_FIELD_INTERLACED_BT`` were added. See :c:type:`v4l2_field` for
    details.
 
 2. Three new clipping/blending methods with a global or straight or
@@ -1357,8 +1357,8 @@ V4L2 in Linux 3.19
 ==================
 
 1. Rewrote Colorspace chapter, added new enum
-   :ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>` and enum
-   :ref:`v4l2_quantization <v4l2-quantization>` fields to struct
+   :c:type:`v4l2_ycbcr_encoding` and enum
+   :c:type:`v4l2_quantization` fields to struct
    :c:type:`v4l2_pix_format`, struct
    :c:type:`v4l2_pix_format_mplane` and
    struct :c:type:`v4l2_mbus_framefmt`.
Documentation/media/uapi/v4l/pixfmt-002.rst +5 -5
index 28f14e41631c..fd73f4697878 100644
@@ -61,7 +61,7 @@ Single-planar format structure
 
     -  .. row 5
 
-       -  enum :ref:`v4l2_field <v4l2-field>`
+       -  enum :c:type::`v4l2_field`
 
        -  ``field``
 
@@ -121,7 +121,7 @@ Single-planar format structure
 
     -  .. row 9
 
-       -  enum :ref:`v4l2_colorspace <v4l2-colorspace>`
+       -  enum :c:type:`v4l2_colorspace`
 
        -  ``colorspace``
 
@@ -170,7 +170,7 @@ Single-planar format structure
 
     -  .. row 12
 
-       -  enum :ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>`
+       -  enum :c:type:`v4l2_ycbcr_encoding`
 
        -  ``ycbcr_enc``
 
@@ -180,7 +180,7 @@ Single-planar format structure
 
     -  .. row 13
 
-       -  enum :ref:`v4l2_quantization <v4l2-quantization>`
+       -  enum :c:type:`v4l2_quantization`
 
        -  ``quantization``
 
@@ -190,7 +190,7 @@ Single-planar format structure
 
     -  .. row 14
 
-       -  enum :ref:`v4l2_xfer_func <v4l2-xfer-func>`
+       -  enum :c:type:`v4l2_xfer_func`
 
        -  ``xfer_func``
 
Documentation/media/uapi/v4l/pixfmt-003.rst +5 -5
index e39fa2b732d7..a3c83df3bce5 100644
@@ -88,7 +88,7 @@ describing all planes of that format.
 
     -  .. row 4
 
-       -  enum :ref:`v4l2_field <v4l2-field>`
+       -  enum :c:type:`v4l2_field`
 
        -  ``field``
 
@@ -96,7 +96,7 @@ describing all planes of that format.
 
     -  .. row 5
 
-       -  enum :ref:`v4l2_colorspace <v4l2-colorspace>`
+       -  enum :c:type:`v4l2_colorspace`
 
        -  ``colorspace``
 
@@ -131,7 +131,7 @@ describing all planes of that format.
 
     -  .. row 9
 
-       -  enum :ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>`
+       -  enum :c:type:`v4l2_ycbcr_encoding`
 
        -  ``ycbcr_enc``
 
@@ -141,7 +141,7 @@ describing all planes of that format.
 
     -  .. row 10
 
-       -  enum :ref:`v4l2_quantization <v4l2-quantization>`
+       -  enum :c:type:`v4l2_quantization`
 
        -  ``quantization``
 
@@ -151,7 +151,7 @@ describing all planes of that format.
 
     -  .. row 11
 
-       -  enum :ref:`v4l2_xfer_func <v4l2-xfer-func>`
+       -  enum :c:type:`v4l2_xfer_func`
 
        -  ``xfer_func``
 
Documentation/media/uapi/v4l/pixfmt-006.rst +8 -8
index a97fc28e039d..819299d0291a 100644
@@ -5,15 +5,15 @@ Defining Colorspaces in V4L2
 ****************************
 
 In V4L2 colorspaces are defined by four values. The first is the
-colorspace identifier (enum :ref:`v4l2_colorspace <v4l2-colorspace>`)
+colorspace identifier (enum :c:type:`v4l2_colorspace`)
 which defines the chromaticities, the default transfer function, the
 default Y'CbCr encoding and the default quantization method. The second
 is the transfer function identifier (enum
-:ref:`v4l2_xfer_func <v4l2-xfer-func>`) to specify non-standard
+:c:type:`v4l2_xfer_func`) to specify non-standard
 transfer functions. The third is the Y'CbCr encoding identifier (enum
-:ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>`) to specify
+:c:type:`v4l2_ycbcr_encoding`) to specify
 non-standard Y'CbCr encodings and the fourth is the quantization
-identifier (enum :ref:`v4l2_quantization <v4l2-quantization>`) to
+identifier (enum :c:type:`v4l2_quantization`) to
 specify non-standard quantization methods. Most of the time only the
 colorspace field of struct :c:type:`v4l2_pix_format`
 or struct :c:type:`v4l2_pix_format_mplane`
@@ -27,7 +27,7 @@ needs to be filled in.
 
 .. tabularcolumns:: |p{6.0cm}|p{11.5cm}|
 
-.. _v4l2-colorspace:
+.. c:type:: v4l2_colorspace
 
 .. flat-table:: V4L2 Colorspaces
     :header-rows:  1
@@ -119,7 +119,7 @@ needs to be filled in.
 
 
 
-.. _v4l2-xfer-func:
+.. c:type:: v4l2_xfer_func
 
 .. flat-table:: V4L2 Transfer Function
     :header-rows:  1
@@ -182,7 +182,7 @@ needs to be filled in.
 
 
 
-.. _v4l2-ycbcr-encoding:
+.. c:type:: v4l2_ycbcr_encoding
 
 .. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
 
@@ -247,7 +247,7 @@ needs to be filled in.
 
 
 
-.. _v4l2-quantization:
+.. c:type:: v4l2_quantization
 
 .. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
 
Documentation/media/uapi/v4l/planar-apis.rst +1 -1
index bd0f88b01c9a..4e059fb44153 100644
@@ -22,7 +22,7 @@ application can choose whether to use one or the other by passing a
 corresponding buffer type to its ioctl calls. Multi-planar versions of
 buffer types are suffixed with an ``_MPLANE`` string. For a list of
 available multi-planar buffer types see enum
-:ref:`v4l2_buf_type <v4l2-buf-type>`.
+:c:type:`v4l2_buf_type`.
 
 
 Multi-planar formats
Documentation/media/uapi/v4l/subdev-formats.rst +5 -5
index f0d7754f1906..568d5dd56561 100644
@@ -46,7 +46,7 @@ Media Bus Formats
 
        -  ``field``
 
-       -  Field order, from enum :ref:`v4l2_field <v4l2-field>`. See
+       -  Field order, from enum :c:type:`v4l2_field`. See
 	  :ref:`field-order` for details.
 
     -  .. row 5
@@ -56,12 +56,12 @@ Media Bus Formats
        -  ``colorspace``
 
        -  Image colorspace, from enum
-	  :ref:`v4l2_colorspace <v4l2-colorspace>`. See
+	  :c:type:`v4l2_colorspace`. See
 	  :ref:`colorspaces` for details.
 
     -  .. row 6
 
-       -  enum :ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>`
+       -  enum :c:type:`v4l2_ycbcr_encoding`
 
        -  ``ycbcr_enc``
 
@@ -71,7 +71,7 @@ Media Bus Formats
 
     -  .. row 7
 
-       -  enum :ref:`v4l2_quantization <v4l2-quantization>`
+       -  enum :c:type:`v4l2_quantization`
 
        -  ``quantization``
 
@@ -81,7 +81,7 @@ Media Bus Formats
 
     -  .. row 8
 
-       -  enum :ref:`v4l2_xfer_func <v4l2-xfer-func>`
+       -  enum :c:type:`v4l2_xfer_func`
 
        -  ``xfer_func``
 
Documentation/media/uapi/v4l/tuner.rst +2 -2
index 4064841d8963..ad117b068831 100644
@@ -33,8 +33,8 @@ current video or radio input is queried.
    :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` does not switch the
    current tuner, when there is more than one at all. The tuner is solely
    determined by the current video input. Drivers must support both ioctls
-   and set the ``V4L2_CAP_TUNER`` flag in the struct :ref:`v4l2_capability
-   <v4l2-capability>` returned by the :ref:`VIDIOC_QUERYCAP` ioctl when the
+   and set the ``V4L2_CAP_TUNER`` flag in the struct :c:type:`v4l2_capability`
+   returned by the :ref:`VIDIOC_QUERYCAP` ioctl when the
    device has one or more tuners.
 
 
Documentation/media/uapi/v4l/v4l2.rst +2 -2
index e020c57f98d4..55b959dda07e 100644
@@ -112,8 +112,8 @@ DVB device nodes. Add support for Tuner sub-device.
 :revision: 3.19 / 2014-12-05 (*hv*)
 
 Rewrote Colorspace chapter, added new enum
-:ref:`v4l2_ycbcr_encoding <v4l2-ycbcr-encoding>` and enum
-:ref:`v4l2_quantization <v4l2-quantization>` fields to struct
+:c:type:`v4l2_ycbcr_encoding` and enum
+:c:type:`v4l2_quantization` fields to struct
 :c:type:`v4l2_pix_format`, struct
 :c:type:`v4l2_pix_format_mplane` and struct
 :c:type:`v4l2_mbus_framefmt`.
Documentation/media/uapi/v4l/vidioc-create-bufs.rst +1 -1
index b93422400608..810634e47d54 100644
@@ -111,7 +111,7 @@ than the number requested.
 
        -  Applications set this field to ``V4L2_MEMORY_MMAP``,
 	  ``V4L2_MEMORY_DMABUF`` or ``V4L2_MEMORY_USERPTR``. See
-	  :ref:`v4l2-memory`
+	  :c:type:`v4l2_memory`
 
     -  .. row 4
 
Documentation/media/uapi/v4l/vidioc-cropcap.rst +1 -1
index 945596fcd65f..f7d448cad4eb 100644
@@ -69,7 +69,7 @@ overlay devices.
        -  Type of the data stream, set by the application. Only these types
 	  are valid here: ``V4L2_BUF_TYPE_VIDEO_CAPTURE``,
 	  ``V4L2_BUF_TYPE_VIDEO_OUTPUT`` and
-	  ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :ref:`v4l2-buf-type`.
+	  ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :c:type:`v4l2_buf_type`.
 
     -  .. row 2
 
Documentation/media/uapi/v4l/vidioc-dbg-g-register.rst +1 -1
index 08f3c510e440..b875ee2aece7 100644
@@ -144,7 +144,7 @@ instructions.
 
        -  ``match``
 
-       -  How to match the chip, see :ref:`v4l2-dbg-match`.
+       -  How to match the chip, see :c:type:`v4l2_dbg_match`.
 
     -  .. row 2
 
Documentation/media/uapi/v4l/vidioc-dqevent.rst +1 -1
index 1e435ab674a2..6347d2f83a44 100644
@@ -324,7 +324,7 @@ call.
 
        -  ``field``
 
-       -  The upcoming field. See enum :ref:`v4l2_field <v4l2-field>`.
+       -  The upcoming field. See enum :c:type:`v4l2_field`.
 
 
 
Documentation/media/uapi/v4l/vidioc-enum-fmt.rst +1 -1
index 1df8fccf067f..91fbc4ba209c 100644
@@ -73,7 +73,7 @@ one until ``EINVAL`` is returned.
 	  ``V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE``,
 	  ``V4L2_BUF_TYPE_VIDEO_OUTPUT``,
 	  ``V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE`` and
-	  ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :ref:`v4l2-buf-type`.
+	  ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :c:type:`v4l2_buf_type`.
 
     -  .. row 3
 
Documentation/media/uapi/v4l/vidioc-enum-frameintervals.rst +1 -1
index 07e94420c4c5..83f641f9f231 100644
@@ -231,7 +231,7 @@ Enums
 =====
 
 
-.. _v4l2-frmivaltypes:
+.. c:type:: v4l2_frmivaltypes
 
 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
 
Documentation/media/uapi/v4l/vidioc-enum-framesizes.rst +1 -1
index a4ddfe9f8956..9a9571d11f7d 100644
@@ -254,7 +254,7 @@ Enums
 =====
 
 
-.. _v4l2-frmsizetypes:
+.. c:type:: v4l2_frmsizetypes
 
 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
 
Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst +1 -1
index c38478227031..cc27ad4e2fa7 100644
@@ -75,7 +75,7 @@ of the corresponding tuner/modulator is set.
 	  set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and
 	  to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to
 	  ``V4L2_TUNER_RADIO`` for modulators (currently only radio
-	  modulators are supported). See :ref:`v4l2-tuner-type`
+	  modulators are supported). See :c:type:`v4l2_tuner_type`
 
     -  .. row 3
 
Documentation/media/uapi/v4l/vidioc-expbuf.rst +1 -1
index 650757ad8aed..2ae2f5483351 100644
@@ -133,7 +133,7 @@ Examples
        -  Type of the buffer, same as struct
 	  :c:type:`v4l2_format` ``type`` or struct
 	  :c:type:`v4l2_requestbuffers` ``type``, set
-	  by the application. See :ref:`v4l2-buf-type`
+	  by the application. See :c:type:`v4l2_buf_type`
 
     -  .. row 2
 
Documentation/media/uapi/v4l/vidioc-g-crop.rst +1 -1
index 4ddd8c08fd1c..9b24ca591ea4 100644
@@ -94,7 +94,7 @@ When cropping is not supported then no parameters are changed and
        -  Type of the data stream, set by the application. Only these types
 	  are valid here: ``V4L2_BUF_TYPE_VIDEO_CAPTURE``,
 	  ``V4L2_BUF_TYPE_VIDEO_OUTPUT`` and
-	  ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :ref:`v4l2-buf-type`.
+	  ``V4L2_BUF_TYPE_VIDEO_OVERLAY``. See :c:type:`v4l2_buf_type`.
 
     -  .. row 2
 
Documentation/media/uapi/v4l/vidioc-g-edid.rst +1 -1
index b288d8ee49ef..1fffca7cc38f 100644
@@ -97,7 +97,7 @@ the EDID data in some way. In any case, the end result is the same: the
 EDID is no longer available.
 
 
-.. _v4l2-edid:
+.. c:type:: v4l2_edid
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
Documentation/media/uapi/v4l/vidioc-g-fbuf.rst +2 -2
index 4ac2625e545d..1ad40a9dd743 100644
@@ -200,7 +200,7 @@ destructive video overlay.
     -  .. row 12
 
        -
-       -  enum :ref:`v4l2_field <v4l2-field>`
+       -  enum :c:type:`v4l2_field`
 
        -  ``field``
 
@@ -266,7 +266,7 @@ destructive video overlay.
     -  .. row 16
 
        -
-       -  enum :ref:`v4l2_colorspace <v4l2-colorspace>`
+       -  enum :c:type:`v4l2_colorspace`
 
        -  ``colorspace``
 
Documentation/media/uapi/v4l/vidioc-g-fmt.rst +1 -1
index 037437d66f08..f11dce6dc543 100644
@@ -101,7 +101,7 @@ The format as returned by :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` must be identical
        -  ``type``
 
        -
-       -  Type of the data stream, see :ref:`v4l2-buf-type`.
+       -  Type of the data stream, see :c:type:`v4l2_buf_type`.
 
     -  .. row 2
 
Documentation/media/uapi/v4l/vidioc-g-frequency.rst +1 -1
index 9cbe70098b2b..37ac69acf113 100644
@@ -85,7 +85,7 @@ write-only ioctl, it does not return the actual new frequency.
 	  set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and
 	  to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to
 	  ``V4L2_TUNER_RADIO`` for modulators (currently only radio
-	  modulators are supported). See :ref:`v4l2-tuner-type`
+	  modulators are supported). See :c:type:`v4l2_tuner_type`
 
     -  .. row 3
 
Documentation/media/uapi/v4l/vidioc-g-modulator.rst +1 -1
index 5d209efa0965..a8a542dc8a40 100644
@@ -147,7 +147,7 @@ To change the radio frequency the
 
        -  ``type``
 
-       -  :cspan:`2` Type of the modulator, see :ref:`v4l2-tuner-type`.
+       -  :cspan:`2` Type of the modulator, see :c:type:`v4l2_tuner_type`.
 
     -  .. row 8
 
Documentation/media/uapi/v4l/vidioc-g-parm.rst +1 -1
index 689b5d92aeae..eb68c34bb9ac 100644
@@ -70,7 +70,7 @@ union holding separate parameters for input and output devices.
        -
        -  The buffer (stream) type, same as struct
 	  :c:type:`v4l2_format` ``type``, set by the
-	  application. See :ref:`v4l2-buf-type`
+	  application. See :c:type:`v4l2_buf_type`
 
     -  .. row 2
 
Documentation/media/uapi/v4l/vidioc-g-selection.rst +1 -1
index af38b2568e3b..a687e236d0f1 100644
@@ -157,7 +157,7 @@ Selection targets and flags are documented in
        -  ``type``
 
        -  Type of the buffer (from enum
-	  :ref:`v4l2_buf_type <v4l2-buf-type>`).
+	  :c:type:`v4l2_buf_type`).
 
     -  .. row 2
 
Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst +1 -1
index 4df7227e0490..04fae524850a 100644
@@ -158,7 +158,7 @@ the sliced VBI API is unsupported or ``type`` is invalid.
 
        -  ``type``
 
-       -  Type of the data stream, see :ref:`v4l2-buf-type`. Should be
+       -  Type of the data stream, see :c:type:`v4l2_buf_type`. Should be
 	  ``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
 	  ``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``.
 
Documentation/media/uapi/v4l/vidioc-g-tuner.rst +2 -2
index 077da39f3ae6..bfeeeb22c41f 100644
@@ -96,7 +96,7 @@ To change the radio frequency the
 
        -  ``type``
 
-       -  :cspan:`1` Type of the tuner, see :ref:`v4l2-tuner-type`.
+       -  :cspan:`1` Type of the tuner, see :c:type:`v4l2_tuner_type`.
 
     -  .. row 4
 
@@ -263,7 +263,7 @@ To change the radio frequency the
 
 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
 
-.. _v4l2-tuner-type:
+.. c:type:: v4l2_tuner_type
 
 .. flat-table:: enum v4l2_tuner_type
     :header-rows:  0
Documentation/media/uapi/v4l/vidioc-querycap.rst +1 -1
index 2824ead350b9..f2785cad2e57 100644
@@ -436,5 +436,5 @@ appropriately. The generic error codes are described at the
 
 .. [#f1]
    The struct :c:type:`v4l2_framebuffer` lacks an
-   enum :ref:`v4l2_buf_type <v4l2-buf-type>` field, therefore the
+   enum :c:type:`v4l2_buf_type` field, therefore the
    type of overlay is implied by the driver capabilities.
Documentation/media/uapi/v4l/vidioc-queryctrl.rst +2 -2
index 1a798be69e10..f3ce0ab53bae 100644
@@ -124,7 +124,7 @@ See also the examples in :ref:`control`.
 
        -  ``type``
 
-       -  Type of control, see :ref:`v4l2-ctrl-type`.
+       -  Type of control, see :c:type:`v4l2_ctrl_type`.
 
     -  .. row 3
 
@@ -251,7 +251,7 @@ See also the examples in :ref:`control`.
 
        -  ``type``
 
-       -  Type of control, see :ref:`v4l2-ctrl-type`.
+       -  Type of control, see :c:type:`v4l2_ctrl_type`.
 
     -  .. row 3
 
Documentation/media/uapi/v4l/vidioc-reqbufs.rst +2 -2
index fc63045f4143..2c5291b42592 100644
@@ -91,7 +91,7 @@ any DMA in progress, an implicit
 
        -  Type of the stream or buffers, this is the same as the struct
 	  :c:type:`v4l2_format` ``type`` field. See
-	  :ref:`v4l2-buf-type` for valid values.
+	  :c:type:`v4l2_buf_type` for valid values.
 
     -  .. row 3
 
@@ -101,7 +101,7 @@ any DMA in progress, an implicit
 
        -  Applications set this field to ``V4L2_MEMORY_MMAP``,
 	  ``V4L2_MEMORY_DMABUF`` or ``V4L2_MEMORY_USERPTR``. See
-	  :ref:`v4l2-memory`.
+	  :c:type:`v4l2_memory`.
 
     -  .. row 4
 
Documentation/media/uapi/v4l/vidioc-s-hw-freq-seek.rst +1 -1
index e33969b9d3da..fc5e31c63b95 100644
@@ -87,7 +87,7 @@ error code is returned and no seek takes place.
 
        -  The tuner type. This is the same value as in the struct
 	  :c:type:`v4l2_tuner` ``type`` field. See
-	  :ref:`v4l2-tuner-type`
+	  :c:type:`v4l2_tuner_type`
 
     -  .. row 3
 
Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-interval.rst +3 -4
index db7145016571..16f2945b73dc 100644
@@ -43,7 +43,7 @@ when enumerating frame intervals.
 
 To enumerate frame intervals applications initialize the ``index``,
 ``pad``, ``which``, ``code``, ``width`` and ``height`` fields of struct
-:ref:`v4l2_subdev_frame_interval_enum <v4l2-subdev-frame-interval-enum>`
+:c:type:`v4l2_subdev_frame_interval_enum`
 and call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL` ioctl with a pointer
 to this structure. Drivers fill the rest of the structure or return an
 EINVAL error code if one of the input fields is invalid. All frame
@@ -59,8 +59,7 @@ Sub-devices that support the frame interval enumeration ioctl should
 implemented it on a single pad only. Its behaviour when supported on
 multiple pads of the same sub-device is not defined.
 
-
-.. _v4l2-subdev-frame-interval-enum:
+.. c:type:: v4l2_subdev_frame_interval_enum
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -147,7 +146,7 @@ appropriately. The generic error codes are described at the
 
 EINVAL
     The struct
-    :ref:`v4l2_subdev_frame_interval_enum <v4l2-subdev-frame-interval-enum>`
+    :c:type:`v4l2_subdev_frame_interval_enum`
     ``pad`` references a non-existing pad, one of the ``code``,
     ``width`` or ``height`` fields are invalid for the given pad or the
     ``index`` field is out of bounds.
Documentation/media/uapi/v4l/vidioc-subdev-enum-frame-size.rst +3 -3
index 8d2694a96b7d..972df0f74eae 100644
@@ -39,7 +39,7 @@ ioctl.
 
 To enumerate frame sizes applications initialize the ``pad``, ``which``
 , ``code`` and ``index`` fields of the struct
-:ref:`v4l2_subdev_mbus_code_enum <v4l2-subdev-mbus-code-enum>` and
+:c:type:`v4l2_subdev_mbus_code_enum` and
 call the :ref:`VIDIOC_SUBDEV_ENUM_FRAME_SIZE` ioctl with a pointer to the
 structure. Drivers fill the minimum and maximum frame sizes or return an
 EINVAL error code if one of the input parameters is invalid.
@@ -62,7 +62,7 @@ current values of V4L2 controls. See
 information about try formats.
 
 
-.. _v4l2-subdev-frame-size-enum:
+.. c:type:: v4l2_subdev_frame_size_enum
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -157,6 +157,6 @@ appropriately. The generic error codes are described at the
 
 EINVAL
     The struct
-    :ref:`v4l2_subdev_frame_size_enum <v4l2-subdev-frame-size-enum>`
+    :c:type:`v4l2_subdev_frame_size_enum`
     ``pad`` references a non-existing pad, the ``code`` is invalid for
     the given pad or the ``index`` field is out of bounds.
Documentation/media/uapi/v4l/vidioc-subdev-enum-mbus-code.rst +3 -3
index 5ecc33daba8b..b10da0e81268 100644
@@ -34,7 +34,7 @@ Description
 To enumerate media bus formats available at a given sub-device pad
 applications initialize the ``pad``, ``which`` and ``index`` fields of
 struct
-:ref:`v4l2_subdev_mbus_code_enum <v4l2-subdev-mbus-code-enum>` and
+:c:type:`v4l2_subdev_mbus_code_enum` and
 call the :ref:`VIDIOC_SUBDEV_ENUM_MBUS_CODE` ioctl with a pointer to this
 structure. Drivers fill the rest of the structure or return an ``EINVAL``
 error code if either the ``pad`` or ``index`` are invalid. All media bus
@@ -47,7 +47,7 @@ See :ref:`VIDIOC_SUBDEV_G_FMT` for more
 information about the try formats.
 
 
-.. _v4l2-subdev-mbus-code-enum:
+.. c:type:: v4l2_subdev_mbus_code_enum
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -110,6 +110,6 @@ appropriately. The generic error codes are described at the
 
 EINVAL
     The struct
-    :ref:`v4l2_subdev_mbus_code_enum <v4l2-subdev-mbus-code-enum>`
+    :c:type:`v4l2_subdev_mbus_code_enum`
     ``pad`` references a non-existing pad, or the ``index`` field is out
     of bounds.
Documentation/media/uapi/v4l/vidioc-subdev-g-crop.rst +4 -4
index 80517ec8a847..b5fa4ae25415 100644
@@ -41,7 +41,7 @@ Description
     :ref:`the selection API <VIDIOC_SUBDEV_G_SELECTION>`.
 
 To retrieve the current crop rectangle applications set the ``pad``
-field of a struct :ref:`v4l2_subdev_crop <v4l2-subdev-crop>` to the
+field of a struct :c:type:`v4l2_subdev_crop` to the
 desired pad number as reported by the media API and the ``which`` field
 to ``V4L2_SUBDEV_FORMAT_ACTIVE``. They then call the
 ``VIDIOC_SUBDEV_G_CROP`` ioctl with a pointer to this structure. The
@@ -54,7 +54,7 @@ and ``which`` fields and all members of the ``rect`` field. They then
 call the ``VIDIOC_SUBDEV_S_CROP`` ioctl with a pointer to this
 structure. The driver verifies the requested crop rectangle, adjusts it
 based on the hardware capabilities and configures the device. Upon
-return the struct :ref:`v4l2_subdev_crop <v4l2-subdev-crop>`
+return the struct :c:type:`v4l2_subdev_crop`
 contains the current format as would be returned by a
 ``VIDIOC_SUBDEV_G_CROP`` call.
 
@@ -71,7 +71,7 @@ modify the rectangle to match what the hardware can provide. The
 modified format should be as close as possible to the original request.
 
 
-.. _v4l2-subdev-crop:
+.. c:type:: v4l2_subdev_crop
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -131,7 +131,7 @@ EBUSY
     ``VIDIOC_SUBDEV_S_CROP``
 
 EINVAL
-    The struct :ref:`v4l2_subdev_crop <v4l2-subdev-crop>` ``pad``
+    The struct :c:type:`v4l2_subdev_crop` ``pad``
     references a non-existing pad, the ``which`` field references a
     non-existing format, or cropping is not supported on the given
     subdev pad.
Documentation/media/uapi/v4l/vidioc-subdev-g-fmt.rst +1 -1
index 90d876faa5b9..2f7ea274c4c2 100644
@@ -109,7 +109,7 @@ should be as close as possible to the original request.
 
        -  ``format``
 
-       -  Definition of an image format, see :ref:`v4l2-mbus-framefmt` for
+       -  Definition of an image format, see :c:type:`v4l2_mbus_framefmt` for
 	  details.
 
     -  .. row 4
Documentation/media/uapi/v4l/vidioc-subdev-g-frame-interval.rst +4 -4
index 7580174a6ed1..4b150cc82555 100644
@@ -42,7 +42,7 @@ don't support frame intervals must not implement these ioctls.
 
 To retrieve the current frame interval applications set the ``pad``
 field of a struct
-:ref:`v4l2_subdev_frame_interval <v4l2-subdev-frame-interval>` to
+:c:type:`v4l2_subdev_frame_interval` to
 the desired pad number as reported by the media controller API. When
 they call the ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` ioctl with a pointer to
 this structure the driver fills the members of the ``interval`` field.
@@ -53,7 +53,7 @@ field and all members of the ``interval`` field. When they call the
 structure the driver verifies the requested interval, adjusts it based
 on the hardware capabilities and configures the device. Upon return the
 struct
-:ref:`v4l2_subdev_frame_interval <v4l2-subdev-frame-interval>`
+:c:type:`v4l2_subdev_frame_interval`
 contains the current frame interval as would be returned by a
 ``VIDIOC_SUBDEV_G_FRAME_INTERVAL`` call.
 
@@ -67,7 +67,7 @@ on a single pad only. Their behaviour when supported on multiple pads of
 the same sub-device is not defined.
 
 
-.. _v4l2-subdev-frame-interval:
+.. c:type:: v4l2_subdev_frame_interval
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -119,6 +119,6 @@ EBUSY
 
 EINVAL
     The struct
-    :ref:`v4l2_subdev_frame_interval <v4l2-subdev-frame-interval>`
+    :c:type:`v4l2_subdev_frame_interval`
     ``pad`` references a non-existing pad, or the pad doesn't support
     frame intervals.
Documentation/media/uapi/v4l/vidioc-subdev-g-selection.rst +2 -2
index d581ff6cf458..94789f8f74e3 100644
@@ -65,7 +65,7 @@ Selection targets and flags are documented in
 :ref:`v4l2-selections-common`.
 
 
-.. _v4l2-subdev-selection:
+.. c:type:: v4l2_subdev_selection
 
 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
 
@@ -141,7 +141,7 @@ EBUSY
     ``VIDIOC_SUBDEV_S_SELECTION``
 
 EINVAL
-    The struct :ref:`v4l2_subdev_selection <v4l2-subdev-selection>`
+    The struct :c:type:`v4l2_subdev_selection`
     ``pad`` references a non-existing pad, the ``which`` field
     references a non-existing format, or the selection target is not
     supported on the given subdev pad.
Documentation/media/videodev2.h.rst.exceptions +102 -102

270 lines not on this page · raw message

Signature · 1 line
2.7.4
#46 lore raw

PATCH 44/47 dev-sliced-vbi.rst: fix reference for v4l2_mpeg_vbi_ITV0

In reply to Mauro Carvalho Chehab

The struct v4l2_mpeg_vbi_ITV0 is identical to struct v4l2_mpeg_vbi_itv0, except by its size, and it is documented at the same place at the book.

Fix cross reference for it.

---
 Documentation/media/uapi/v4l/dev-sliced-vbi.rst | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/media/uapi/v4l/dev-sliced-vbi.rst +4 -2
index 7f159c3d4942..019cac7e90e4 100644
@@ -672,8 +672,10 @@ Magic Constants for struct v4l2_mpeg_vbi_fmt_ivtv magic field
 
 .. c:type:: v4l2_mpeg_vbi_itv0
 
-struct v4l2_mpeg_vbi_itv0
--------------------------
+.. c:type:: v4l2_mpeg_vbi_ITV0
+
+structs v4l2_mpeg_vbi_itv0 and v4l2_mpeg_vbi_ITV0
+-------------------------------------------------
 
 .. tabularcolumns:: |p{4.4cm}|p{2.4cm}|p{10.7cm}|
 
Signature · 1 line
2.7.4
#47 lore raw

PATCH 45/47 media-ioc-g-topology.rst: fix a c domain reference

In reply to Mauro Carvalho Chehab

One reference there is still using :ref:. Fix it, to solve this
warning:
Documentation/media/uapi/mediactl/media-ioc-g-topology.rst:236: WARNING: undefined label: media-v2-intf-devnode (if the link has no caption the label must precede a section header)

---
 Documentation/media/uapi/mediactl/media-ioc-g-topology.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/media/uapi/mediactl/media-ioc-g-topology.rst +1 -1
index 0b26fd865b72..48c9531f4db0 100644
@@ -234,7 +234,7 @@ desired arrays with the media graph elements.
        -  ``devnode``
 
        -  Used only for device node interfaces. See
-	  :ref:`media-v2-intf-devnode` for details..
+	  :c:type:`media_v2_intf_devnode` for details..
 
 
 .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
Signature · 1 line
2.7.4
#48 lore raw

PATCH 46/47 docs-rst: fix two wrong :name: tags

In reply to Mauro Carvalho Chehab

There's a typo there, causing 4 warnings:

Documentation/media/uapi/rc/lirc-read.rst:26: WARNING: c:type reference target not found: name Documentation/media/uapi/rc/lirc-read.rst:26: WARNING: c:type reference target not found: lirc Documentation/media/uapi/v4l/func-poll.rst:25: WARNING: c:type reference target not found: name Documentation/media/uapi/v4l/func-poll.rst:25: WARNING: c:type reference target not found: v4l2

Fix them.

---
 Documentation/media/uapi/rc/lirc-read.rst  | 2 +-
 Documentation/media/uapi/v4l/func-poll.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/media/uapi/rc/lirc-read.rst +1 -1
index 62bd3d8c9c67..4c678f60e872 100644
@@ -21,7 +21,7 @@ Synopsis
 
 
 .. c:function:: ssize_t read( int fd, void *buf, size_t count )
-    :name lirc-read
+    :name: lirc-read
 
 
 Arguments
Documentation/media/uapi/v4l/func-poll.rst +1 -1
index 186cd61b6cd1..d0432dc09b05 100644
@@ -21,7 +21,7 @@ Synopsis
 
 
 .. c:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout )
-    name: v4l2-poll
+    :name: v4l2-poll
 
 Arguments
 =========
Signature · 1 line
2.7.4
#49 lore raw

PATCH 47/47 rc-map.h: fix a Sphinx warning

In reply to Mauro Carvalho Chehab

./include/media/rc-map.h:121: WARNING: Inline emphasis start-string without end-string.

---
 include/media/rc-map.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/media/rc-map.h +1 -1
index 173ad58fb61b..3c8edb34f84a 100644
@@ -117,7 +117,7 @@ struct rc_map_table {
  * @scan: pointer to struct &rc_map_table
  * @size: Max number of entries
  * @len: Number of entries that are in use
- * @alloc: size of *scan, in bytes
+ * @alloc: size of \*scan, in bytes
  * @rc_type: type of the remote controller protocol, as defined at
  *	     enum &rc_type
  * @name: name of the key map table
Signature · 1 line
2.7.4
maintainer Acked-by on the v1 series
#50 lore raw
In reply to Mauro Carvalho Chehab
Quoted 6 lines · On Thu, 8 Sep 2016 09:03:22 -0300 Mauro Carvalho Chehab…

Please notice that patches 2 and 3 touches at Documentation/sphinx/parse-headers.pl.

If it is ok for you, I intend to merge those patches (except for patch 1) on my tree, including the two patches that touch at the parse-headers.pl script, as, currently, the only user for it is media. I'm also OK if you prefer to merge patches 2 and 3 on your tree instead.

Go ahead and keep them with the rest.

jon