Fix (most of) the remaining issues with uAPI book and LaTeX
Subsystems (2)
cover Fix (most of) the remaining issues with uAPI book and LaTeX
This patch series addresses (almost all) remaining issues of texts going out of the page width.
There are just two places that need fixes:
- Two big tables at Documentation/media/uapi/v4l/subdev-formats.rst;
- some texts at Documentation/media/uapi/v4l/extended-controls.rst with very long constants (like V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE)
that are linked to very long enum types.
Yet, as mentioned on the previous patch series, some tables don't look nice. Basically, the flat-tables with cspan columns on it are not formatted well in LaTeX output. The tables go out of the left margin on several such cases. Yet, all text are at the visible area. So, the document is readable on screen. Also, on such tables, texts with more than one line on span cells are not left-margin justified, and their size is not well calculated. So, usually, it uses more lines than what would be needed.
Yet, the document output is OK for usage, IMHO.
Mauro Carvalho Chehab (15):
[media] vidioc-dqevent.rst: adjust two table columns for LaTeX output [media] vidioc-dv-timings-cap.rst: Adjust LaTeX columns [media] vidioc-enumstd.rst: adjust video standards table [media] vidioc-g-sliced-vbi-cap.rst: make tables fit on LaTeX output [media] adjust some vidioc-*rst tables with wrong columns [media] vidioc-g-tuner.rst: improve documentation for tuner type [media] vidioc-g-tuner.rst: Fix tables to fit at LaTeX output [media] fix v4l2-selection-*.rst tables for LaTeX output [media] fe_property_parameters.rst: Adjust column sizes [media] adjust remaining tables at DVB uAPI documentation [media] media-types.rst: adjust tables to fit on LaTeX output [media] docs-rst: move cec kAPI documentation to the media book [media] cec-core: Convert it to ReST format
[media] uapi/cec: adjust tables on LaTeX output
[media] gen-errors.rst fix error table column limits
Documentation/{cec.txt => media/kapi/cec-core.rst} | 145 +++++++++++++--------
Documentation/media/media_kapi.rst | 1 +
.../media/uapi/cec/cec-ioc-adap-g-caps.rst | 4 +-
.../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst | 6 +-
Documentation/media/uapi/cec/cec-ioc-dqevent.rst | 23 ++--
Documentation/media/uapi/cec/cec-ioc-g-mode.rst | 6 +-
Documentation/media/uapi/cec/cec-ioc-receive.rst | 6 +-
Documentation/media/uapi/dvb/audio-fopen.rst | 2 +
Documentation/media/uapi/dvb/ca-fopen.rst | 2 +
Documentation/media/uapi/dvb/dmx-fread.rst | 3 +-
Documentation/media/uapi/dvb/dmx-fwrite.rst | 2 +
.../media/uapi/dvb/dmx-set-pes-filter.rst | 2 +-
Documentation/media/uapi/dvb/dmx-start.rst | 2 +-
Documentation/media/uapi/dvb/dmx_types.rst | 1 +
Documentation/media/uapi/dvb/fe-get-info.rst | 1 +
Documentation/media/uapi/dvb/fe-read-status.rst | 1 +
.../media/uapi/dvb/fe_property_parameters.rst | 3 +
Documentation/media/uapi/dvb/video-fopen.rst | 2 +
Documentation/media/uapi/gen-errors.rst | 2 +-
Documentation/media/uapi/mediactl/media-types.rst | 14 +-
.../media/uapi/v4l/v4l2-selection-flags.rst | 1 +
.../media/uapi/v4l/v4l2-selection-targets.rst | 2 +
Documentation/media/uapi/v4l/vidioc-dqevent.rst | 8 +-
.../media/uapi/v4l/vidioc-dv-timings-cap.rst | 14 +-
Documentation/media/uapi/v4l/vidioc-enum-fmt.rst | 4 +-
.../media/uapi/v4l/vidioc-enum-freq-bands.rst | 5 +-
Documentation/media/uapi/v4l/vidioc-enuminput.rst | 2 +
Documentation/media/uapi/v4l/vidioc-enumoutput.rst | 2 +-
Documentation/media/uapi/v4l/vidioc-enumstd.rst | 23 +++-
.../media/uapi/v4l/vidioc-g-dv-timings.rst | 11 +-
.../media/uapi/v4l/vidioc-g-enc-index.rst | 6 +-
.../media/uapi/v4l/vidioc-g-ext-ctrls.rst | 14 +-
Documentation/media/uapi/v4l/vidioc-g-fbuf.rst | 4 +
Documentation/media/uapi/v4l/vidioc-g-fmt.rst | 2 +
Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst | 2 +-
.../media/uapi/v4l/vidioc-g-modulator.rst | 10 +-
.../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst | 30 ++++-
Documentation/media/uapi/v4l/vidioc-g-tuner.rst | 44 +++++--
Documentation/media/uapi/v4l/vidioc-queryctrl.rst | 16 ++-
39 files changed, 283 insertions(+), 145 deletions(-)
rename Documentation/{cec.txt => media/kapi/cec-core.rst} (72%)Signature · 1 line
2.7.4
PATCH 1/15 vidioc-dqevent.rst: adjust two table columns for LaTeX output
There are two tables with mangled columns. Fix it.
--- Documentation/media/uapi/v4l/vidioc-dqevent.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/media/uapi/v4l/vidioc-dqevent.rst +4 -2
@@ -42,7 +42,9 @@ call. .. _v4l2-event: -.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{7.0cm}|p{3.5cm}| +.. tabularcolumns:: |p{3.0cm}|p{4.3cm}|p{2.5cm}|p{7.7cm}| + +.. cssclass: longtable .. flat-table:: struct v4l2_event :header-rows: 0
@@ -328,7 +330,7 @@ call. .. _v4l2-event-ctrl: -.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{7.0cm}|p{3.5cm}| +.. tabularcolumns:: |p{3.5cm}|p{3.0cm}|p{1.8cm}|p{8.5cm}| .. flat-table:: struct v4l2_event_ctrl :header-rows: 0
Signature · 1 line
2.7.4
PATCH 2/15 vidioc-dv-timings-cap.rst: Adjust LaTeX columns
In reply to Mauro Carvalho ChehabSome tables are not properly displayed on LaTeX. Fix them.
--- Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
Documentation/media/uapi/v4l/vidioc-dv-timings-cap.rst +8 -6
@@ -56,7 +56,7 @@ that doesn't support them will return an ``EINVAL`` error code. .. _v4l2-bt-timings-cap: -.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| +.. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.3cm}| .. flat-table:: struct v4l2_bt_timings_cap :header-rows: 0
@@ -136,14 +136,14 @@ that doesn't support them will return an ``EINVAL`` error code. - ``reserved``\ [16] - - Reserved for future extensions. Drivers must set the array to - zero. + - Reserved for future extensions. + Drivers must set the array to zero. .. _v4l2-dv-timings-cap: -.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{7.0cm}|p{3.5cm}| +.. tabularcolumns:: |p{1.0cm}|p{3.5cm}|p{3.5cm}|p{9.5cm}| .. flat-table:: struct v4l2_dv_timings_cap :header-rows: 0
@@ -175,8 +175,9 @@ that doesn't support them will return an ``EINVAL`` error code. - ``reserved``\ [2] - - Reserved for future extensions. Drivers and applications must set - the array to zero. + - Reserved for future extensions. + + Drivers and applications must set the array to zero. - .. row 4
@@ -203,6 +204,7 @@ that doesn't support them will return an ``EINVAL`` error code. - +.. tabularcolumns:: |p{7.0cm}|p{10.5cm}| .. _dv-bt-cap-capabilities:
Signature · 1 line
2.7.4
PATCH 3/15 vidioc-enumstd.rst: adjust video standards table
In reply to Mauro Carvalho ChehabThis table is too big for LaTeX output, and lacks columns specs for LaTeX format.
Also, it has a hidden column, as there are some cell spans with the wrong values.
Fix it, so it can be displayed properly on LaTeX/PDF.
--- Documentation/media/uapi/v4l/vidioc-enumstd.rst | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)
Documentation/media/uapi/v4l/vidioc-enumstd.rst +19 -4
@@ -272,6 +272,12 @@ support digital TV. See also the Linux DVB API at #define V4L2_STD_ALL (V4L2_STD_525_60 | V4L2_STD_625_50) +.. raw:: latex + + \newline\newline\begin{adjustbox}{width=\columnwidth} + +.. NTSC/M PAL/M /N /B /D /H /I SECAM/B /D /K1 /L +.. tabularcolumns:: |p{2.7cm}|p{2.6cm}|p{3.0cm}|p{3.2cm}|p{3.2cm}|p{2.2cm}|p{1.2cm}|p{3.2cm}|p{3.0cm}|p{2.0cm}|p{2.0cm}|p{2.0cm}| .. _video-standards:
@@ -312,7 +318,7 @@ support digital TV. See also the Linux DVB API at - :cspan:`1` 525 - - :cspan:`9` 625 + - :cspan:`8` 625 - .. row 3
@@ -320,7 +326,7 @@ support digital TV. See also the Linux DVB API at - :cspan:`1` 1001/30000 - - :cspan:`9` 1/25 + - :cspan:`8` 1/25 - .. row 4
@@ -330,13 +336,17 @@ support digital TV. See also the Linux DVB API at - 3579611.49 ± 10 - - 4433618.75 ± 5 (3582056.25 ± 5) + - 4433618.75 ± 5 + + (3582056.25 ± 5) - :cspan:`3` 4433618.75 ± 5 - 4433618.75 ± 1 - - :cspan:`3` f\ :sub:`OR` = 4406250 ± 2000, f\ :sub:`OB` = 4250000 ± 2000 + - :cspan:`2` f\ :sub:`OR` = 4406250 ± 2000, + + f\ :sub:`OB` = 4250000 ± 2000 - .. row 5
@@ -390,6 +400,11 @@ support digital TV. See also the Linux DVB API at - 6.5 [#f8]_ +.. raw:: latex + + \end{adjustbox}\newline\newline + + Return Value ============
Signature · 1 line
2.7.4
PATCH 4/15 vidioc-g-sliced-vbi-cap.rst: make tables fit on LaTeX output
In reply to Mauro Carvalho ChehabThe tables don't fit at the page on this file. As noticed before, Sphinx (or LaTeX?) does a crap job on tables with cell span, and some work has to be done to make it fit.
Move the see also reference to a footnote, break one paragraph into two and adjust the table columns to make it visible.
--- .../media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst | 30 +++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-)
Documentation/media/uapi/v4l/vidioc-g-sliced-vbi-cap.rst +23 -7
@@ -48,7 +48,7 @@ the sliced VBI API is unsupported or ``type`` is invalid. .. _v4l2-sliced-vbi-cap: -.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{2.9cm}|p{2.9cm}|p{2.9cm}| +.. tabularcolumns:: |p{1.2cm}|p{4.2cm}|p{4.1cm}|p{4.0cm}|p{4.0cm}| .. flat-table:: struct v4l2_sliced_vbi_cap :header-rows: 0
@@ -63,6 +63,7 @@ the sliced VBI API is unsupported or ``type`` is invalid. - ``service_set`` - :cspan:`2` A set of all data services supported by the driver. + Equal to the union of all elements of the ``service_lines`` array. - .. row 2
@@ -74,8 +75,7 @@ the sliced VBI API is unsupported or ``type`` is invalid. - :cspan:`2` Each element of this array contains a set of data services the hardware can look for or insert into a particular scan line. Data services are defined in :ref:`vbi-services`. - Array indices map to ITU-R line numbers (see also :ref:`vbi-525` - and :ref:`vbi-625`) as follows: + Array indices map to ITU-R line numbers\ [#f1]_ as follows: - .. row 3
@@ -171,14 +171,22 @@ the sliced VBI API is unsupported or ``type`` is invalid. - ``reserved``\ [3] - :cspan:`2` This array is reserved for future extensions. + Applications and drivers must set it to zero. +.. [#f1] + See also :ref:`vbi-525` and :ref:`vbi-625`. + + +.. raw:: latex + + \newline\newline\begin{adjustbox}{width=\columnwidth} + +.. tabularcolumns:: |p{5.0cm}|p{1.4cm}|p{3.0cm}|p{2.5cm}|p{9.0cm}| .. _vbi-services: -.. tabularcolumns:: |p{4.4cm}|p{2.2cm}|p{2.2cm}|p{4.4cm}|p{4.3cm}| - .. flat-table:: Sliced VBI services :header-rows: 1 :stub-columns: 0
@@ -203,7 +211,9 @@ the sliced VBI API is unsupported or ``type`` is invalid. - 0x0001 - - :ref:`ets300706`, :ref:`itu653` + - :ref:`ets300706`, + + :ref:`itu653` - PAL/SECAM line 7-22, 320-335 (second field 7-22)
@@ -242,7 +252,9 @@ the sliced VBI API is unsupported or ``type`` is invalid. - 0x4000 - - :ref:`en300294`, :ref:`itu1119` + - :ref:`en300294`, + + :ref:`itu1119` - PAL/SECAM line 23
@@ -270,6 +282,10 @@ the sliced VBI API is unsupported or ``type`` is invalid. - :cspan:`2` Set of services applicable to 625 line systems. +.. raw:: latex + + \end{adjustbox}\newline\newline + Return Value ============
Signature · 1 line
2.7.4
PATCH 5/15 adjust some vidioc-*rst tables with wrong columns
In reply to Mauro Carvalho ChehabAdjust simple cases where the columns on some vidioc files are overriding their neighbours.
--- Documentation/media/uapi/v4l/vidioc-dqevent.rst | 2 ++ Documentation/media/uapi/v4l/vidioc-enum-fmt.rst | 4 +++- Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst | 5 +++-- Documentation/media/uapi/v4l/vidioc-enuminput.rst | 2 ++ Documentation/media/uapi/v4l/vidioc-enumoutput.rst | 2 +- Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst | 11 +---------- Documentation/media/uapi/v4l/vidioc-g-enc-index.rst | 6 +++--- Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst | 14 ++++++++++---- Documentation/media/uapi/v4l/vidioc-g-fbuf.rst | 4 ++++ Documentation/media/uapi/v4l/vidioc-g-fmt.rst | 2 ++ Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst | 2 +- Documentation/media/uapi/v4l/vidioc-g-modulator.rst | 10 ++++++---- Documentation/media/uapi/v4l/vidioc-queryctrl.rst | 16 ++++++++++++---- 13 files changed, 50 insertions(+), 30 deletions(-)
Documentation/media/uapi/v4l/vidioc-dqevent.rst +2 -0
@@ -183,6 +183,8 @@ call. .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| +.. cssclass:: longtable + .. flat-table:: Event Types :header-rows: 0 :stub-columns: 0
Documentation/media/uapi/v4l/vidioc-enum-fmt.rst +3 -1
@@ -108,7 +108,9 @@ one until ``EINVAL`` is returned. - :cspan:`2` .. _v4l2-fourcc: - ``#define v4l2_fourcc(a,b,c,d) (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))`` + ``#define v4l2_fourcc(a,b,c,d)`` + + ``(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))`` Several image formats are already defined by this specification in :ref:`pixfmt`.
Documentation/media/uapi/v4l/vidioc-enum-freq-bands.rst +3 -2
@@ -146,8 +146,9 @@ of the corresponding tuner/modulator is set. - ``reserved``\ [9] - - Reserved for future extensions. Applications and drivers must set - the array to zero. + - Reserved for future extensions. + + Applications and drivers must set the array to zero.
Documentation/media/uapi/v4l/vidioc-enuminput.rst +2 -0
@@ -181,6 +181,8 @@ at index zero, incrementing by one until the driver returns ``EINVAL``. .. _input-status: +.. tabularcolumns:: |p{4.8cm}|p{2.6cm}|p{10.1cm}| + .. flat-table:: Input Status Flags :header-rows: 0 :stub-columns: 0
Documentation/media/uapi/v4l/vidioc-enumoutput.rst +1 -1
@@ -142,7 +142,7 @@ EINVAL. .. _output-type: -.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| +.. tabularcolumns:: |p{7.0cm}|p{1.8cm}|p{8.7cm}| .. flat-table:: Output Type :header-rows: 0
Documentation/media/uapi/v4l/vidioc-g-dv-timings.rst +1 -10
@@ -316,11 +316,6 @@ EBUSY - Description - - .. row 2 - - - - - - - .. row 3 - ``V4L2_DV_BT_STD_CEA861``
@@ -346,6 +341,7 @@ EBUSY - The timings follow the VESA Generalized Timings Formula standard +.. tabularcolumns:: |p{6.0cm}|p{11.5cm}| .. _dv-bt-flags:
@@ -360,11 +356,6 @@ EBUSY - Description - - .. row 2 - - - - - - - .. row 3 - ``V4L2_DV_FL_REDUCED_BLANKING``
Documentation/media/uapi/v4l/vidioc-g-enc-index.rst +3 -3
@@ -59,12 +59,12 @@ video elementary streams. .. _v4l2-enc-idx: -.. tabularcolumns:: |p{2.9cm}|p{2.9cm}|p{5.8cm}|p{2.9cm}|p{3.0cm}| +.. tabularcolumns:: |p{3.5cm}|p{5.6cm}|p{8.4cm}| .. flat-table:: struct v4l2_enc_idx :header-rows: 0 :stub-columns: 0 - :widths: 1 1 2 1 1 + :widths: 1 3 8 - .. row 1
@@ -90,7 +90,7 @@ video elementary streams. - ``reserved``\ [4] - - :cspan:`2` Reserved for future extensions. Drivers must set the + - Reserved for future extensions. Drivers must set the array to zero. - .. row 4
Documentation/media/uapi/v4l/vidioc-g-ext-ctrls.rst +10 -4
@@ -97,7 +97,9 @@ still cause this situation. .. _v4l2-ext-control: -.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{7.0cm}| +.. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{1.5cm}|p{11.8cm}| + +.. cssclass: longtable .. flat-table:: struct v4l2_ext_control :header-rows: 0
@@ -230,7 +232,9 @@ still cause this situation. .. _v4l2-ext-controls: -.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{7.0cm}|p{3.5cm}| +.. tabularcolumns:: |p{4.0cm}|p{3.0cm}|p{2.0cm}|p{8.5cm}| + +.. cssclass:: longtable .. flat-table:: struct v4l2_ext_controls :header-rows: 0
@@ -348,8 +352,9 @@ still cause this situation. - ``reserved``\ [2] - - Reserved for future extensions. Drivers and applications must set - the array to zero. + - Reserved for future extensions. + + Drivers and applications must set the array to zero. - .. row 7
@@ -358,6 +363,7 @@ still cause this situation. - ``controls`` - Pointer to an array of ``count`` v4l2_ext_control structures. + Ignored if ``count`` equals zero.
Documentation/media/uapi/v4l/vidioc-g-fbuf.rst +4 -0
@@ -80,6 +80,8 @@ destructive video overlay. .. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{7.0cm}| +.. cssclass:: longtable + .. flat-table:: struct v4l2_framebuffer :header-rows: 0 :stub-columns: 0
@@ -377,6 +379,8 @@ destructive video overlay. .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| +.. cssclass:: longtable + .. flat-table:: Frame Buffer Flags :header-rows: 0 :stub-columns: 0
Documentation/media/uapi/v4l/vidioc-g-fmt.rst +2 -0
@@ -84,6 +84,8 @@ The format as returned by :ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` must be identical .. _v4l2-format: +.. tabularcolumns:: |p{1.2cm}|p{4.3cm}|p{3.0cm}|p{9.0cm}| + .. flat-table:: struct v4l2_format :header-rows: 0 :stub-columns: 0
Documentation/media/uapi/v4l/vidioc-g-jpegcomp.rst +1 -1
@@ -57,7 +57,7 @@ encoding. You usually do want to add them. .. _v4l2-jpegcompression: -.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| +.. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.3cm}| .. flat-table:: struct v4l2_jpegcompression :header-rows: 0
Documentation/media/uapi/v4l/vidioc-g-modulator.rst +6 -4
@@ -85,8 +85,9 @@ To change the radio frequency the - ``name``\ [32] - - Name of the modulator, a NUL-terminated ASCII string. This - information is intended for the user. + - Name of the modulator, a NUL-terminated ASCII string. + + This information is intended for the user. - .. row 3
@@ -155,8 +156,9 @@ To change the radio frequency the - ``reserved``\ [3] - - Reserved for future extensions. Drivers and applications must set - the array to zero. + - Reserved for future extensions. + + Drivers and applications must set the array to zero.
Documentation/media/uapi/v4l/vidioc-queryctrl.rst +12 -4
@@ -96,7 +96,9 @@ See also the examples in :ref:`control`. .. _v4l2-queryctrl: -.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| +.. tabularcolumns:: |p{1.2cm}|p{3.6cm}|p{12.7cm}| + +.. cssclass:: longtable .. flat-table:: struct v4l2_queryctrl :header-rows: 0
@@ -218,7 +220,9 @@ See also the examples in :ref:`control`. .. _v4l2-query-ext-ctrl: -.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| +.. tabularcolumns:: |p{1.2cm}|p{5.0cm}|p{11.3cm}| + +.. cssclass:: longtable .. flat-table:: struct v4l2_query_ext_ctrl :header-rows: 0
@@ -382,7 +386,7 @@ See also the examples in :ref:`control`. .. _v4l2-querymenu: -.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{7.0cm}|p{3.5cm}| +.. tabularcolumns:: |p{1.2cm}|p{0.6cm}|p{1.6cm}|p{13.5cm}| .. flat-table:: struct v4l2_querymenu :header-rows: 0
@@ -452,7 +456,9 @@ See also the examples in :ref:`control`. .. _v4l2-ctrl-type: -.. tabularcolumns:: |p{5.3cm}|p{0.9cm}|p{0.9cm}|p{0.9cm}|p{9.5cm}| +.. tabularcolumns:: |p{5.8cm}|p{1.4cm}|p{1.0cm}|p{1.4cm}|p{6.9cm}| + +.. cssclass:: longtable .. flat-table:: enum v4l2_ctrl_type :header-rows: 1
@@ -653,6 +659,8 @@ See also the examples in :ref:`control`. .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| +.. cssclass:: longtable + .. flat-table:: Control Flags :header-rows: 0 :stub-columns: 0
Signature · 1 line
2.7.4
PATCH 6/15 vidioc-g-tuner.rst: improve documentation for tuner type
In reply to Mauro Carvalho ChehabThe tuner type table misses descriptions for each type. While most of stuff are obvious, the two SDR definitions aren't.
So, add descriptions to all of them.
--- Documentation/media/uapi/v4l/vidioc-g-tuner.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Documentation/media/uapi/v4l/vidioc-g-tuner.rst +6 -6
@@ -260,7 +260,7 @@ To change the radio frequency the .. flat-table:: enum v4l2_tuner_type :header-rows: 0 :stub-columns: 0 - :widths: 3 1 4 + :widths: 3 1 6 - .. row 1
@@ -269,7 +269,7 @@ To change the radio frequency the - 1 - - + - Tuner supports radio - .. row 2
@@ -277,7 +277,7 @@ To change the radio frequency the - 2 - - + - Tuner supports analog TV - .. row 3
@@ -285,7 +285,8 @@ To change the radio frequency the - 4 - - + - Tuner controls the A/D and/or D/A block of a + Sofware Digital Radio (SDR) - .. row 4
@@ -293,8 +294,7 @@ To change the radio frequency the - 5 - - - + - Tuner controls the RF part of a Sofware Digital Radio (SDR) .. _tuner-capability:
Signature · 1 line
2.7.4
PATCH 7/15 vidioc-g-tuner.rst: Fix tables to fit at LaTeX output
In reply to Mauro Carvalho ChehabSeveral tables are missing column definitions and/or are too big to fit into the page. Adjust them.
--- Documentation/media/uapi/v4l/vidioc-g-tuner.rst | 32 ++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-)
Documentation/media/uapi/v4l/vidioc-g-tuner.rst +24 -8
@@ -60,8 +60,12 @@ To change the radio frequency the :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl is available. + .. tabularcolumns:: |p{1.3cm}|p{3.0cm}|p{6.6cm}|p{6.6cm}| + .. _v4l2-tuner: +.. cssclass:: longtable + .. flat-table:: struct v4l2_tuner :header-rows: 0 :stub-columns: 0
@@ -83,8 +87,9 @@ To change the radio frequency the - :cspan:`1` - Name of the tuner, a NUL-terminated ASCII string. This information - is intended for the user. + Name of the tuner, a NUL-terminated ASCII string. + + This information is intended for the user. - .. row 3
@@ -230,8 +235,9 @@ To change the radio frequency the - ``signal`` - - :cspan:`1` The signal strength if known, ranging from 0 to - 65535. Higher values indicate a better signal. + - :cspan:`1` The signal strength if known. + + Ranging from 0 to 65535. Higher values indicate a better signal. - .. row 16
@@ -239,8 +245,10 @@ To change the radio frequency the - ``afc`` - - :cspan:`1` Automatic frequency control: When the ``afc`` value - is negative, the frequency is too low, when positive too high. + - :cspan:`1` Automatic frequency control. + + When the ``afc`` value is negative, the frequency is too + low, when positive too high. - .. row 17
@@ -248,8 +256,9 @@ To change the radio frequency the - ``reserved``\ [4] - - :cspan:`1` Reserved for future extensions. Drivers and - applications must set the array to zero. + - :cspan:`1` Reserved for future extensions. + + Drivers and applications must set the array to zero.
@@ -301,6 +310,8 @@ To change the radio frequency the .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| +.. cssclass:: longtable + .. flat-table:: Tuner and Modulator Capability Flags :header-rows: 0 :stub-columns: 0
@@ -608,7 +619,9 @@ To change the radio frequency the ``MODE_MONO``. Only ``V4L2_TUNER_ANALOG_TV`` tuners support this mode. +.. raw:: latex + \newline\newline\begin{adjustbox}{width=\columnwidth} .. _tuner-matrix:
@@ -706,6 +719,9 @@ To change the radio frequency the - Lang1/Lang2 (preferred) or Lang1/Lang1 +.. raw:: latex + + \end{adjustbox}\newline\newline Return Value ============
Signature · 1 line
2.7.4
PATCH 8/15 fix v4l2-selection-*.rst tables for LaTeX output
In reply to Mauro Carvalho ChehabAdjust the tables there to fit inside the page margins.
--- Documentation/media/uapi/v4l/v4l2-selection-flags.rst | 1 + Documentation/media/uapi/v4l/v4l2-selection-targets.rst | 2 ++ 2 files changed, 3 insertions(+)
Documentation/media/uapi/v4l/v4l2-selection-flags.rst +1 -0
@@ -6,6 +6,7 @@ Selection flags *************** +.. tabularcolumns:: |p{5.2cm}|p{2.0cm}|p{6.5cm}|p{1.2cm}|p{1.6cm}| .. _v4l2-selection-flags-table:
Documentation/media/uapi/v4l/v4l2-selection-targets.rst +2 -0
@@ -12,6 +12,8 @@ of the two interfaces they are used. .. _v4l2-selection-targets-table: +.. tabularcolumns:: |p{5.8cm}|p{1.4cm}|p{6.5cm}|p{1.2cm}|p{1.6cm}| + .. flat-table:: Selection target definitions :header-rows: 1 :stub-columns: 0
Signature · 1 line
2.7.4
PATCH 9/15 fe_property_parameters.rst: Adjust column sizes
In reply to Mauro Carvalho ChehabAdd position hints for some tables, in order for them to be shown properly on LaTeX output.
--- Documentation/media/uapi/dvb/fe_property_parameters.rst | 3 +++ 1 file changed, 3 insertions(+)
Documentation/media/uapi/dvb/fe_property_parameters.rst +3 -0
@@ -1234,6 +1234,7 @@ Reed Solomon (RS) frame mode. Possible values are: +.. tabularcolumns:: |p{5.0cm}|p{12.5cm}| .. _atscmh-rs-frame-mode:
@@ -1395,6 +1396,7 @@ Series Concatenated Convolutional Code Block Mode. Possible values are: +.. tabularcolumns:: |p{4.5cm}|p{13.0cm}| .. _atscmh-sccc-block-mode:
@@ -1687,6 +1689,7 @@ on OFTM-based standards, e. g. DVB-T/T2, ISDB-T, DTMB enum fe_transmit_mode: Number of carriers per channel ----------------------------------------------------- +.. tabularcolumns:: |p{5.0cm}|p{12.5cm}| .. _fe-transmit-mode:
Signature · 1 line
2.7.4
PATCH 10/15 adjust remaining tables at DVB uAPI documentation
In reply to Mauro Carvalho ChehabThere are a few broken tables on LaTeX output at the DVB uAPI documentation. Fix them.
--- Documentation/media/uapi/dvb/audio-fopen.rst | 2 ++ Documentation/media/uapi/dvb/ca-fopen.rst | 2 ++ Documentation/media/uapi/dvb/dmx-fread.rst | 3 ++- Documentation/media/uapi/dvb/dmx-fwrite.rst | 2 ++ Documentation/media/uapi/dvb/dmx-set-pes-filter.rst | 2 +- Documentation/media/uapi/dvb/dmx-start.rst | 2 +- Documentation/media/uapi/dvb/dmx_types.rst | 1 + Documentation/media/uapi/dvb/fe-get-info.rst | 1 + Documentation/media/uapi/dvb/fe-read-status.rst | 1 + Documentation/media/uapi/dvb/video-fopen.rst | 2 ++ 10 files changed, 15 insertions(+), 3 deletions(-)
Documentation/media/uapi/dvb/audio-fopen.rst +2 -0
@@ -80,6 +80,8 @@ AUDIO_GET_STATUS. All other call will return with an error code. Return Value ------------ +.. tabularcolumns:: |p{2.5cm}|p{15.0cm}| + .. flat-table:: :header-rows: 0 :stub-columns: 0
Documentation/media/uapi/dvb/ca-fopen.rst +2 -0
@@ -79,6 +79,8 @@ the device in this mode will fail, and an error code will be returned. Return Value ------------ +.. tabularcolumns:: |p{2.5cm}|p{15.0cm}| + .. flat-table:: :header-rows: 0 :stub-columns: 0
Documentation/media/uapi/dvb/dmx-fread.rst +2 -1
@@ -53,10 +53,11 @@ data. The filtered data is transferred from the driver’s internal circular buffer to buf. The maximum amount of data to be transferred is implied by count. - Return Value ------------ +.. tabularcolumns:: |p{2.5cm}|p{15.0cm}| + .. flat-table:: :header-rows: 0 :stub-columns: 0
Documentation/media/uapi/dvb/dmx-fwrite.rst +2 -0
@@ -59,6 +59,8 @@ The amount of data to be transferred is implied by count. Return Value ------------ +.. tabularcolumns:: |p{2.5cm}|p{15.0cm}| + .. flat-table:: :header-rows: 0 :stub-columns: 0
Documentation/media/uapi/dvb/dmx-set-pes-filter.rst +1 -1
@@ -61,7 +61,7 @@ On success 0 is returned, on error -1 and the ``errno`` variable is set appropriately. The generic error codes are described at the :ref:`Generic Error Codes <gen-errors>` chapter. - +.. tabularcolumns:: |p{2.5cm}|p{15.0cm}| .. flat-table:: :header-rows: 0
Documentation/media/uapi/dvb/dmx-start.rst +1 -1
@@ -53,7 +53,7 @@ On success 0 is returned, on error -1 and the ``errno`` variable is set appropriately. The generic error codes are described at the :ref:`Generic Error Codes <gen-errors>` chapter. - +.. tabularcolumns:: |p{2.5cm}|p{15.0cm}| .. flat-table:: :header-rows: 0
Documentation/media/uapi/dvb/dmx_types.rst +1 -0
@@ -12,6 +12,7 @@ Demux Data Types Output for the demux ==================== +.. tabularcolumns:: |p{5.0cm}|p{12.5cm}| .. _dmx-output:
Documentation/media/uapi/dvb/fe-get-info.rst +1 -0
@@ -160,6 +160,7 @@ frontend capabilities Capabilities describe what a frontend can do. Some capabilities are supported only on some specific frontend types. +.. tabularcolumns:: |p{5.5cm}|p{12.0cm}| .. _fe-caps:
Documentation/media/uapi/dvb/fe-read-status.rst +1 -0
@@ -56,6 +56,7 @@ 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 +.. tabularcolumns:: |p{3.5cm}|p{14.0cm}| .. _fe-status:
Documentation/media/uapi/dvb/video-fopen.rst +2 -0
@@ -82,6 +82,8 @@ return an error code. Return Value ------------ +.. tabularcolumns:: |p{2.5cm}|p{15.0cm}| + .. flat-table:: :header-rows: 0 :stub-columns: 0
Signature · 1 line
2.7.4
PATCH 11/15 media-types.rst: adjust tables to fit on LaTeX output
In reply to Mauro Carvalho ChehabA few tables at the media uAPI documentation have columns not well dimentioned. Adjust them.
--- Documentation/media/uapi/mediactl/media-types.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
Documentation/media/uapi/mediactl/media-types.rst +12 -2
@@ -5,9 +5,12 @@ Types and flags used to represent the media graph elements ========================================================== +.. tabularcolumns:: |p{8.0cm}|p{10.5cm}| .. _media-entity-type: +.. cssclass:: longtable + .. flat-table:: Media entity types :header-rows: 0 :stub-columns: 0
@@ -15,10 +18,12 @@ Types and flags used to represent the media graph elements - .. row 1 - .. _MEDIA-ENT-F-UNKNOWN: + .. _MEDIA-ENT-F-UNKNOWN: .. _MEDIA-ENT-F-V4L2-SUBDEV-UNKNOWN: - - ``MEDIA_ENT_F_UNKNOWN`` and ``MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN`` + - ``MEDIA_ENT_F_UNKNOWN`` and + + ``MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN`` - Unknown entity. That generally indicates that a driver didn't initialize properly the entity, with is a Kernel bug
@@ -294,6 +299,8 @@ Types and flags used to represent the media graph elements its source pad. +.. tabularcolumns:: |p{5.5cm}|p{12.0cm}| + .. _media-entity-flag: .. flat-table:: Media entity flags
@@ -319,6 +326,7 @@ Types and flags used to represent the media graph elements - The entity represents a data conector +.. tabularcolumns:: |p{6.5cm}|p{6.0cm}|p{5.0cm}| .. _media-intf-type:
@@ -508,6 +516,7 @@ Types and flags used to represent the media graph elements - typically, /dev/snd/timer +.. tabularcolumns:: |p{5.5cm}|p{12.0cm}| .. _media-pad-flag:
@@ -551,6 +560,7 @@ Types and flags used to represent the media graph elements One and only one of ``MEDIA_PAD_FL_SINK`` and ``MEDIA_PAD_FL_SOURCE`` must be set for every pad. +.. tabularcolumns:: |p{5.5cm}|p{12.0cm}| .. _media-link-flag:
Signature · 1 line
2.7.4
PATCH 12/15 docs-rst: move cec kAPI documentation to the media book
In reply to Mauro Carvalho ChehabThe CEC kAPI documentation should also be part of the media book.
---
Documentation/{cec.txt => media/kapi/cec-core.rst} | 0
Documentation/media/media_kapi.rst | 1 +
2 files changed, 1 insertion(+)
rename Documentation/{cec.txt => media/kapi/cec-core.rst} (100%)Documentation/media/kapi/cec-core.rst renamed from Documentation/cec.txt +0 -0
Documentation/media/media_kapi.rst +1 -0
@@ -32,3 +32,4 @@ For more details see the file COPYING in the source distribution of Linux. kapi/dtv-core kapi/rc-core kapi/mc-core + kapi/cec-core
Signature · 1 line
2.7.4
PATCH 13/15 cec-core: Convert it to ReST format
In reply to Mauro Carvalho ChehabThere are some things there that aren't ok for ReST format.
Fix them.
--- Documentation/media/kapi/cec-core.rst | 145 ++++++++++++++++++++++------------ 1 file changed, 93 insertions(+), 52 deletions(-)
Documentation/media/kapi/cec-core.rst +93 -52
@@ -36,39 +36,50 @@ CEC Adapter The struct cec_adapter represents the CEC adapter hardware. It is created by calling cec_allocate_adapter() and deleted by calling cec_delete_adapter(): -struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, +.. c:function:: + struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, void *priv, const char *name, u32 caps, u8 available_las, struct device *parent); -void cec_delete_adapter(struct cec_adapter *adap); + +.. c:function:: + void cec_delete_adapter(struct cec_adapter *adap); To create an adapter you need to pass the following information: -ops: adapter operations which are called by the CEC framework and that you -have to implement. +ops: + adapter operations which are called by the CEC framework and that you + have to implement. -priv: will be stored in adap->priv and can be used by the adapter ops. +priv: + will be stored in adap->priv and can be used by the adapter ops. -name: the name of the CEC adapter. Note: this name will be copied. +name: + the name of the CEC adapter. Note: this name will be copied. -caps: capabilities of the CEC adapter. These capabilities determine the +caps: + capabilities of the CEC adapter. These capabilities determine the capabilities of the hardware and which parts are to be handled by userspace and which parts are handled by kernelspace. The capabilities are returned by CEC_ADAP_G_CAPS. -available_las: the number of simultaneous logical addresses that this +available_las: + the number of simultaneous logical addresses that this adapter can handle. Must be 1 <= available_las <= CEC_MAX_LOG_ADDRS. -parent: the parent device. +parent: + the parent device. To register the /dev/cecX device node and the remote control device (if CEC_CAP_RC is set) you call: -int cec_register_adapter(struct cec_adapter *adap); +.. c:function:: + int cec_register_adapter(struct cec_adapter \*adap); To unregister the devices call: -void cec_unregister_adapter(struct cec_adapter *adap); +.. c:function:: + void cec_unregister_adapter(struct cec_adapter \*adap); Note: if cec_register_adapter() fails, then call cec_delete_adapter() to clean up. But if cec_register_adapter() succeeded, then only call
@@ -83,18 +94,23 @@ Implementing the Low-Level CEC Adapter The following low-level adapter operations have to be implemented in your driver: -struct cec_adap_ops { - /* Low-level callbacks */ - int (*adap_enable)(struct cec_adapter *adap, bool enable); - int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable); - int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr); - int (*adap_transmit)(struct cec_adapter *adap, u8 attempts, - u32 signal_free_time, struct cec_msg *msg); - void (*adap_log_status)(struct cec_adapter *adap); +.. c:type:: struct cec_adap_ops - /* High-level callbacks */ - ... -}; +.. code-block:: none + + struct cec_adap_ops + { + /* Low-level callbacks */ + int (*adap_enable)(struct cec_adapter *adap, bool enable); + int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable); + int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr); + int (*adap_transmit)(struct cec_adapter *adap, u8 attempts, + u32 signal_free_time, struct cec_msg *msg); + void (\*adap_log_status)(struct cec_adapter *adap); + + /* High-level callbacks */ + ... + }; The three low-level ops deal with various aspects of controlling the CEC adapter hardware:
@@ -102,6 +118,7 @@ hardware: To enable/disable the hardware: +.. c:function:: int (*adap_enable)(struct cec_adapter *adap, bool enable); This callback enables or disables the CEC hardware. Enabling the CEC hardware
@@ -115,6 +132,7 @@ Note that adap_enable must return 0 if enable is false. To enable/disable the 'monitor all' mode: +.. c:function:: int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable); If enabled, then the adapter should be put in a mode to also monitor messages
@@ -127,6 +145,7 @@ Note that adap_monitor_all_enable must return 0 if enable is false. To program a new logical address: +.. c:function:: int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr); If logical_addr == CEC_LOG_ADDR_INVALID then all programmed logical addresses
@@ -140,6 +159,7 @@ Note that adap_log_addr must return 0 if logical_addr is CEC_LOG_ADDR_INVALID. To transmit a new message: +.. c:function:: int (*adap_transmit)(struct cec_adapter *adap, u8 attempts, u32 signal_free_time, struct cec_msg *msg);
@@ -158,6 +178,7 @@ microseconds (one data bit period is 2.4 ms). To log the current CEC hardware status: +.. c:function:: void (*adap_status)(struct cec_adapter *adap, struct seq_file *file); This optional callback can be used to show the status of the CEC hardware.
@@ -169,29 +190,41 @@ driven) by calling into the framework in the following situations: When a transmit finished (successfully or otherwise): -void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, +.. c:function:: + void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt); The status can be one of: -CEC_TX_STATUS_OK: the transmit was successful. -CEC_TX_STATUS_ARB_LOST: arbitration was lost: another CEC initiator -took control of the CEC line and you lost the arbitration. -CEC_TX_STATUS_NACK: the message was nacked (for a directed message) or -acked (for a broadcast message). A retransmission is needed. -CEC_TX_STATUS_LOW_DRIVE: low drive was detected on the CEC bus. This -indicates that a follower detected an error on the bus and requested a -retransmission. -CEC_TX_STATUS_ERROR: some unspecified error occurred: this can be one of -the previous two if the hardware cannot differentiate or something else -entirely. -CEC_TX_STATUS_MAX_RETRIES: could not transmit the message after -trying multiple times. Should only be set by the driver if it has hardware -support for retrying messages. If set, then the framework assumes that it -doesn't have to make another attempt to transmit the message since the -hardware did that already. +CEC_TX_STATUS_OK: + the transmit was successful. -The *_cnt arguments are the number of error conditions that were seen. +CEC_TX_STATUS_ARB_LOST: + arbitration was lost: another CEC initiator + took control of the CEC line and you lost the arbitration. + +CEC_TX_STATUS_NACK: + the message was nacked (for a directed message) or + acked (for a broadcast message). A retransmission is needed. + +CEC_TX_STATUS_LOW_DRIVE: + low drive was detected on the CEC bus. This indicates that + a follower detected an error on the bus and requested a + retransmission. + +CEC_TX_STATUS_ERROR: + some unspecified error occurred: this can be one of + the previous two if the hardware cannot differentiate or something + else entirely. + +CEC_TX_STATUS_MAX_RETRIES: + could not transmit the message after trying multiple times. + Should only be set by the driver if it has hardware support for + retrying messages. If set, then the framework assumes that it + doesn't have to make another attempt to transmit the message + since the hardware did that already. + +The \*_cnt arguments are the number of error conditions that were seen. This may be 0 if no information is available. Drivers that do not support hardware retry can just set the counter corresponding to the transmit error to 1, if the hardware does support retry then either set these counters to
@@ -200,7 +233,8 @@ times, or fill in the correct values as reported by the hardware. When a CEC message was received: -void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg); +.. c:function:: + void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg); Speaks for itself.
@@ -210,17 +244,20 @@ Implementing the High-Level CEC Adapter The low-level operations drive the hardware, the high-level operations are CEC protocol driven. The following high-level callbacks are available: -struct cec_adap_ops { - /* Low-level callbacks */ - ... +.. code-block:: none - /* High-level CEC message callback */ - int (*received)(struct cec_adapter *adap, struct cec_msg *msg); -}; + struct cec_adap_ops { + /\* Low-level callbacks \*/ + ... + + /\* High-level CEC message callback \*/ + int (\*received)(struct cec_adapter \*adap, struct cec_msg \*msg); + }; The received() callback allows the driver to optionally handle a newly received CEC message +.. c:function:: int (*received)(struct cec_adapter *adap, struct cec_msg *msg); If the driver wants to process a CEC message, then it can implement this
@@ -234,13 +271,16 @@ CEC framework functions CEC Adapter drivers can call the following CEC framework functions: -int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg, - bool block); +.. c:function:: + int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg, + bool block); Transmit a CEC message. If block is true, then wait until the message has been transmitted, otherwise just queue it and return. -void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block); +.. c:function:: + void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, + bool block); Change the physical address. This function will set adap->phys_addr and send an event if it has changed. If cec_s_log_addrs() has been called and
@@ -254,8 +294,9 @@ then the CEC adapter will be disabled. If you change a valid physical address to another valid physical address, then this function will first set the address to CEC_PHYS_ADDR_INVALID before enabling the new physical address. -int cec_s_log_addrs(struct cec_adapter *adap, - struct cec_log_addrs *log_addrs, bool block); +.. c:function:: + int cec_s_log_addrs(struct cec_adapter *adap, + struct cec_log_addrs *log_addrs, bool block); Claim the CEC logical addresses. Should never be called if CEC_CAP_LOG_ADDRS is set. If block is true, then wait until the logical addresses have been
Signature · 1 line
2.7.4
Re: [PATCH 13/15] [media] cec-core: Convert it to ReST format
Quoted 5 lines · Mauro Carvalho Chehab
There are some things there that aren't ok for ReST format.
Fix them.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
OK, so I posted a similar patch for this:
https://patchwork.linuxtv.org/patch/36376/
It's part of one of my pull requests, but I guess you can skip that patch.
Hans
Quoted 275 lines
--- Documentation/media/kapi/cec-core.rst | 145 ++++++++++++++++++++++------------ 1 file changed, 93 insertions(+), 52 deletions(-)Documentation/media/kapi/cec-core.rst +93
-52@@ -36,39 +36,50 @@ CEC Adapter The struct cec_adapter represents the CEC adapter hardware. It is created by calling cec_allocate_adapter() and deleted by calling cec_delete_adapter(): -struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, +.. c:function:: + struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, void *priv, const char *name, u32 caps, u8 available_las, struct device *parent); -void cec_delete_adapter(struct cec_adapter *adap); + +.. c:function:: + void cec_delete_adapter(struct cec_adapter *adap); To create an adapter you need to pass the following information: -ops: adapter operations which are called by the CEC framework and that you -have to implement. +ops: + adapter operations which are called by the CEC framework and that you + have to implement. -priv: will be stored in adap->priv and can be used by the adapter ops. +priv: + will be stored in adap->priv and can be used by the adapter ops. -name: the name of the CEC adapter. Note: this name will be copied. +name: + the name of the CEC adapter. Note: this name will be copied. -caps: capabilities of the CEC adapter. These capabilities determine the +caps: + capabilities of the CEC adapter. These capabilities determine the capabilities of the hardware and which parts are to be handled by userspace and which parts are handled by kernelspace. The capabilities are returned by CEC_ADAP_G_CAPS. -available_las: the number of simultaneous logical addresses that this +available_las: + the number of simultaneous logical addresses that this adapter can handle. Must be 1 <= available_las <= CEC_MAX_LOG_ADDRS. -parent: the parent device. +parent: + the parent device. To register the /dev/cecX device node and the remote control device (if CEC_CAP_RC is set) you call: -int cec_register_adapter(struct cec_adapter *adap); +.. c:function:: + int cec_register_adapter(struct cec_adapter \*adap); To unregister the devices call: -void cec_unregister_adapter(struct cec_adapter *adap); +.. c:function:: + void cec_unregister_adapter(struct cec_adapter \*adap); Note: if cec_register_adapter() fails, then call cec_delete_adapter() to clean up. But if cec_register_adapter() succeeded, then only call@@ -83,18 +94,23 @@ Implementing the Low-Level CEC Adapter The following low-level adapter operations have to be implemented in your driver: -struct cec_adap_ops { - /* Low-level callbacks */ - int (*adap_enable)(struct cec_adapter *adap, bool enable); - int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable); - int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr); - int (*adap_transmit)(struct cec_adapter *adap, u8 attempts, - u32 signal_free_time, struct cec_msg *msg); - void (*adap_log_status)(struct cec_adapter *adap); +.. c:type:: struct cec_adap_ops - /* High-level callbacks */ - ... -}; +.. code-block:: none + + struct cec_adap_ops + { + /* Low-level callbacks */ + int (*adap_enable)(struct cec_adapter *adap, bool enable); + int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable); + int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr); + int (*adap_transmit)(struct cec_adapter *adap, u8 attempts, + u32 signal_free_time, struct cec_msg *msg); + void (\*adap_log_status)(struct cec_adapter *adap); + + /* High-level callbacks */ + ... + }; The three low-level ops deal with various aspects of controlling the CEC adapter hardware:@@ -102,6 +118,7 @@ hardware: To enable/disable the hardware: +.. c:function:: int (*adap_enable)(struct cec_adapter *adap, bool enable); This callback enables or disables the CEC hardware. Enabling the CEC hardware@@ -115,6 +132,7 @@ Note that adap_enable must return 0 if enable is false. To enable/disable the 'monitor all' mode: +.. c:function:: int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable); If enabled, then the adapter should be put in a mode to also monitor messages@@ -127,6 +145,7 @@ Note that adap_monitor_all_enable must return 0 if enable is false. To program a new logical address: +.. c:function:: int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr); If logical_addr == CEC_LOG_ADDR_INVALID then all programmed logical addresses@@ -140,6 +159,7 @@ Note that adap_log_addr must return 0 if logical_addr is CEC_LOG_ADDR_INVALID. To transmit a new message: +.. c:function:: int (*adap_transmit)(struct cec_adapter *adap, u8 attempts, u32 signal_free_time, struct cec_msg *msg);@@ -158,6 +178,7 @@ microseconds (one data bit period is 2.4 ms). To log the current CEC hardware status: +.. c:function:: void (*adap_status)(struct cec_adapter *adap, struct seq_file *file); This optional callback can be used to show the status of the CEC hardware.@@ -169,29 +190,41 @@ driven) by calling into the framework in the following situations: When a transmit finished (successfully or otherwise): -void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, +.. c:function:: + void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt, u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt); The status can be one of: -CEC_TX_STATUS_OK: the transmit was successful. -CEC_TX_STATUS_ARB_LOST: arbitration was lost: another CEC initiator -took control of the CEC line and you lost the arbitration. -CEC_TX_STATUS_NACK: the message was nacked (for a directed message) or -acked (for a broadcast message). A retransmission is needed. -CEC_TX_STATUS_LOW_DRIVE: low drive was detected on the CEC bus. This -indicates that a follower detected an error on the bus and requested a -retransmission. -CEC_TX_STATUS_ERROR: some unspecified error occurred: this can be one of -the previous two if the hardware cannot differentiate or something else -entirely. -CEC_TX_STATUS_MAX_RETRIES: could not transmit the message after -trying multiple times. Should only be set by the driver if it has hardware -support for retrying messages. If set, then the framework assumes that it -doesn't have to make another attempt to transmit the message since the -hardware did that already. +CEC_TX_STATUS_OK: + the transmit was successful. -The *_cnt arguments are the number of error conditions that were seen. +CEC_TX_STATUS_ARB_LOST: + arbitration was lost: another CEC initiator + took control of the CEC line and you lost the arbitration. + +CEC_TX_STATUS_NACK: + the message was nacked (for a directed message) or + acked (for a broadcast message). A retransmission is needed. + +CEC_TX_STATUS_LOW_DRIVE: + low drive was detected on the CEC bus. This indicates that + a follower detected an error on the bus and requested a + retransmission. + +CEC_TX_STATUS_ERROR: + some unspecified error occurred: this can be one of + the previous two if the hardware cannot differentiate or something + else entirely. + +CEC_TX_STATUS_MAX_RETRIES: + could not transmit the message after trying multiple times. + Should only be set by the driver if it has hardware support for + retrying messages. If set, then the framework assumes that it + doesn't have to make another attempt to transmit the message + since the hardware did that already. + +The \*_cnt arguments are the number of error conditions that were seen. This may be 0 if no information is available. Drivers that do not support hardware retry can just set the counter corresponding to the transmit error to 1, if the hardware does support retry then either set these counters to@@ -200,7 +233,8 @@ times, or fill in the correct values as reported by the hardware. When a CEC message was received: -void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg); +.. c:function:: + void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg); Speaks for itself.@@ -210,17 +244,20 @@ Implementing the High-Level CEC Adapter The low-level operations drive the hardware, the high-level operations are CEC protocol driven. The following high-level callbacks are available: -struct cec_adap_ops { - /* Low-level callbacks */ - ... +.. code-block:: none - /* High-level CEC message callback */ - int (*received)(struct cec_adapter *adap, struct cec_msg *msg); -}; + struct cec_adap_ops { + /\* Low-level callbacks \*/ + ... + + /\* High-level CEC message callback \*/ + int (\*received)(struct cec_adapter \*adap, struct cec_msg \*msg); + }; The received() callback allows the driver to optionally handle a newly received CEC message +.. c:function:: int (*received)(struct cec_adapter *adap, struct cec_msg *msg); If the driver wants to process a CEC message, then it can implement this@@ -234,13 +271,16 @@ CEC framework functions CEC Adapter drivers can call the following CEC framework functions: -int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg, - bool block); +.. c:function:: + int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg, + bool block); Transmit a CEC message. If block is true, then wait until the message has been transmitted, otherwise just queue it and return. -void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block); +.. c:function:: + void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, + bool block); Change the physical address. This function will set adap->phys_addr and send an event if it has changed. If cec_s_log_addrs() has been called and@@ -254,8 +294,9 @@ then the CEC adapter will be disabled. If you change a valid physical address to another valid physical address, then this function will first set the address to CEC_PHYS_ADDR_INVALID before enabling the new physical address. -int cec_s_log_addrs(struct cec_adapter *adap, - struct cec_log_addrs *log_addrs, bool block); +.. c:function:: + int cec_s_log_addrs(struct cec_adapter *adap, + struct cec_log_addrs *log_addrs, bool block); Claim the CEC logical addresses. Should never be called if CEC_CAP_LOG_ADDRS is set. If block is true, then wait until the logical addresses have been
Re: [PATCH 13/15] [media] cec-core: Convert it to ReST format
Em Fri, 19 Aug 2016 15:24:16 +0200
Hans Verkuil <[email protected]> escreveu:
Quoted 5 lines · Mauro Carvalho Chehab
Quoted 4 lines
There are some things there that aren't ok for ReST format.
Fix them.
Quoted 7 lines
Quoted 1 line
Signed-off-by Mauro Carvalho Chehab <[email protected]>OK, so I posted a similar patch for this:
https://patchwork.linuxtv.org/patch/36376/
It's part of one of my pull requests, but I guess you can skip that patch.
Sorry, I didn't notice. I'm actually waiting for Jon to merge the remaining patches for the Sphinx rst core before starting handling and merging our patches. I want to avoid having a separate branch for documentation this time.
IMHO, my approach is better than you for functions, as it declares functions and struct using the proper macros that are also used by kernel-doc script.
Yet, I didn't touch at MAINTAINERS nor I used ``constant`` or :c:type:/:c:func: for references of the functions/struct. Would you care to rebase your patch on the top of mine doing such changes?
Thanks!
Mauro
Re: [PATCH 13/15] [media] cec-core: Convert it to ReST format
Em Fri, 19 Aug 2016 10:37:50 -0300
Mauro Carvalho Chehab <[email protected]> escreveu:
Quoted 21 lines
Em Fri, 19 Aug 2016 15:24:16 +0200
Hans Verkuil <[email protected]> escreveu:Quoted 5 lines · Mauro Carvalho Chehab
Quoted 4 lines
There are some things there that aren't ok for ReST format.
Fix them.
Quoted 7 lines
Quoted 1 line
Signed-off-by Mauro Carvalho Chehab <[email protected]>OK, so I posted a similar patch for this:
https://patchwork.linuxtv.org/patch/36376/
It's part of one of my pull requests, but I guess you can skip that patch.
Sorry, I didn't notice. I'm actually waiting for Jon to merge the remaining patches for the Sphinx rst core before starting handling and merging our patches. I want to avoid having a separate branch for documentation this time.
Quoted 8 lines
IMHO, my approach is better than you for functions, as it declares functions and struct using the proper macros that are also used by kernel-doc script.
Yet, I didn't touch at
MAINTAINERSnor I used ``constant`` or :c:type:/:c:func: for references of the functions/struct. Would you care to rebase your patch on the top of mine doing such changes?
Hmm... actually we should do something else...
As those functions are declared (or should be declared) using the kernel documentation macros, we should have references for them already. So, we need to actually change the text there to point to the references created by kernel-doc script.
like:
https://linuxtv.org/downloads/v4l-dvb-apis-new/_sources/media/kapi/v4l2-dev.txt
Thanks,
Mauro
PATCH 14/15 uapi/cec: adjust tables on LaTeX output
In reply to Mauro Carvalho ChehabFix tables to avoid text to overflow the cell limits.
--- .../media/uapi/cec/cec-ioc-adap-g-caps.rst | 4 ++-- .../media/uapi/cec/cec-ioc-adap-g-log-addrs.rst | 6 ++++-- Documentation/media/uapi/cec/cec-ioc-dqevent.rst | 23 +++++++++------------- Documentation/media/uapi/cec/cec-ioc-g-mode.rst | 6 +++--- Documentation/media/uapi/cec/cec-ioc-receive.rst | 6 +++--- 5 files changed, 21 insertions(+), 24 deletions(-)
Documentation/media/uapi/cec/cec-ioc-adap-g-caps.rst +2 -2
@@ -44,7 +44,7 @@ returns the information to the application. The ioctl never fails. .. _cec-caps: -.. tabularcolumns:: |p{1.0cm}|p{1.0cm}|p{15.5cm}| +.. tabularcolumns:: |p{1.2cm}|p{2.5cm}|p{13.8cm}| .. flat-table:: struct cec_caps :header-rows: 0
@@ -91,7 +91,7 @@ returns the information to the application. The ioctl never fails. .. _cec-capabilities: -.. tabularcolumns:: |p{4.4cm}|p{1.5cm}|p{11.6cm}| +.. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.6cm}| .. flat-table:: CEC Capabilities Flags :header-rows: 0
Documentation/media/uapi/cec/cec-ioc-adap-g-log-addrs.rst +4 -2
@@ -69,7 +69,9 @@ logical address types are already defined will return with error ``EBUSY``. .. _cec-log-addrs: -.. tabularcolumns:: |p{1.0cm}|p{1.0cm}|p{15.5cm}| +.. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}| + +.. cssclass:: longtable .. flat-table:: struct cec_log_addrs :header-rows: 0
@@ -311,7 +313,7 @@ logical address types are already defined will return with error ``EBUSY``. .. _cec-log-addr-types: -.. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}| +.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}| .. flat-table:: CEC Logical Address Types :header-rows: 0
Documentation/media/uapi/cec/cec-ioc-dqevent.rst +9 -14
@@ -54,7 +54,7 @@ it is guaranteed that the state did change in between the two events. .. _cec-event-state-change_s: -.. tabularcolumns:: |p{1.8cm}|p{1.8cm}|p{13.9cm}| +.. tabularcolumns:: |p{1.2cm}|p{2.9cm}|p{13.4cm}| .. flat-table:: struct cec_event_state_change :header-rows: 0
@@ -82,7 +82,7 @@ it is guaranteed that the state did change in between the two events. .. _cec-event-lost-msgs_s: -.. tabularcolumns:: |p{1.0cm}|p{1.0cm}|p{15.5cm}| +.. tabularcolumns:: |p{1.0cm}|p{2.0cm}|p{14.5cm}| .. flat-table:: struct cec_event_lost_msgs :header-rows: 0
@@ -110,7 +110,7 @@ it is guaranteed that the state did change in between the two events. .. _cec-event: -.. tabularcolumns:: |p{1.6cm}|p{1.6cm}|p{1.6cm}|p{12.7cm}| +.. tabularcolumns:: |p{1.0cm}|p{4.2cm}|p{2.5cm}|p{8.8cm}| .. flat-table:: struct cec_event :header-rows: 0
@@ -124,21 +124,18 @@ it is guaranteed that the state did change in between the two events. - ``ts`` - - Timestamp of the event in ns. + - :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)`. - - - - .. row 2 - __u32 - ``event`` - - The CEC event type, see :ref:`cec-events`. - - - + - :cspan:`1` The CEC event type, see :ref:`cec-events`. - .. row 3
@@ -146,9 +143,7 @@ it is guaranteed that the state did change in between the two events. - ``flags`` - - Event flags, see :ref:`cec-event-flags`. - - - + - :cspan:`1` Event flags, see :ref:`cec-event-flags`. - .. row 4
@@ -183,7 +178,7 @@ it is guaranteed that the state did change in between the two events. .. _cec-events: -.. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}| +.. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{11.0cm}| .. flat-table:: CEC Events Types :header-rows: 0
@@ -214,7 +209,7 @@ it is guaranteed that the state did change in between the two events. .. _cec-event-flags: -.. tabularcolumns:: |p{4.4cm}|p{1.5cm}|p{11.6cm}| +.. tabularcolumns:: |p{6.0cm}|p{0.6cm}|p{10.9cm}| .. flat-table:: CEC Event Flags :header-rows: 0
Documentation/media/uapi/cec/cec-ioc-g-mode.rst +3 -3
@@ -76,7 +76,7 @@ Available initiator modes are: .. _cec-mode-initiator_e: -.. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}| +.. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{11.0cm}| .. flat-table:: Initiator Modes :header-rows: 0
@@ -121,7 +121,7 @@ Available follower modes are: .. _cec-mode-follower_e: -.. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}| +.. tabularcolumns:: |p{6.6cm}|p{0.9cm}|p{10.0cm}| .. flat-table:: Follower Modes :header-rows: 0
@@ -215,7 +215,7 @@ Core message processing details: .. _cec-core-processing: -.. tabularcolumns:: |p{1.9cm}|p{15.6cm}| +.. tabularcolumns:: |p{6.6cm}|p{10.9cm}| .. flat-table:: Core Message Processing :header-rows: 0
Documentation/media/uapi/cec/cec-ioc-receive.rst +3 -3
@@ -75,7 +75,7 @@ result. .. _cec-msg: -.. tabularcolumns:: |p{1.0cm}|p{1.0cm}|p{15.5cm}| +.. tabularcolumns:: |p{1.0cm}|p{3.5cm}|p{13.0cm}| .. flat-table:: struct cec_msg :header-rows: 0
@@ -254,7 +254,7 @@ result. .. _cec-tx-status: -.. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}| +.. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{11.0cm}| .. flat-table:: CEC Transmit Status :header-rows: 0
@@ -324,7 +324,7 @@ result. .. _cec-rx-status: -.. tabularcolumns:: |p{2.6cm}|p{0.9cm}|p{14.0cm}| +.. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{11.0cm}| .. flat-table:: CEC Receive Status :header-rows: 0
Signature · 1 line
2.7.4
PATCH 15/15 gen-errors.rst fix error table column limits
In reply to Mauro Carvalho ChehabFix the generic errors table to avoid column overflows on LaTeX output.
--- Documentation/media/uapi/gen-errors.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/media/uapi/gen-errors.rst +1 -1
@@ -9,7 +9,7 @@ Generic Error Codes .. _gen-errors: -.. tabularcolumns:: |p{1.0cm}|p{16.5cm}| +.. tabularcolumns:: |p{2.5cm}|p{15.0cm}| .. flat-table:: Generic error codes :header-rows: 0
Signature · 1 line
2.7.4