Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek...
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / vidioc-enum-dv-timings.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _VIDIOC_ENUM_DV_TIMINGS:
4
5 ***********************************************************
6 ioctl VIDIOC_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUM_DV_TIMINGS
7 ***********************************************************
8
9 Name
10 ====
11
12 VIDIOC_ENUM_DV_TIMINGS - VIDIOC_SUBDEV_ENUM_DV_TIMINGS - Enumerate supported Digital Video timings
13
14
15 Synopsis
16 ========
17
18 .. c:function:: int ioctl( int fd, VIDIOC_ENUM_DV_TIMINGS, struct v4l2_enum_dv_timings *argp )
19     :name: VIDIOC_ENUM_DV_TIMINGS
20
21 .. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_ENUM_DV_TIMINGS, struct v4l2_enum_dv_timings *argp )
22     :name: VIDIOC_SUBDEV_ENUM_DV_TIMINGS
23
24
25 Arguments
26 =========
27
28 ``fd``
29     File descriptor returned by :ref:`open() <func-open>`.
30
31 ``argp``
32     Pointer to struct :c:type:`v4l2_enum_dv_timings`.
33
34
35 Description
36 ===========
37
38 While some DV receivers or transmitters support a wide range of timings,
39 others support only a limited number of timings. With this ioctl
40 applications can enumerate a list of known supported timings. Call
41 :ref:`VIDIOC_DV_TIMINGS_CAP` to check if it
42 also supports other standards or even custom timings that are not in
43 this list.
44
45 To query the available timings, applications initialize the ``index``
46 field, set the ``pad`` field to 0, zero the reserved array of struct
47 :c:type:`v4l2_enum_dv_timings` and call the
48 ``VIDIOC_ENUM_DV_TIMINGS`` ioctl on a video node with a pointer to this
49 structure. Drivers fill the rest of the structure or return an ``EINVAL``
50 error code when the index is out of bounds. To enumerate all supported
51 DV timings, applications shall begin at index zero, incrementing by one
52 until the driver returns ``EINVAL``.
53
54 .. note::
55
56    Drivers may enumerate a different set of DV timings after
57    switching the video input or output.
58
59 When implemented by the driver DV timings of subdevices can be queried
60 by calling the ``VIDIOC_SUBDEV_ENUM_DV_TIMINGS`` ioctl directly on a
61 subdevice node. The DV timings are specific to inputs (for DV receivers)
62 or outputs (for DV transmitters), applications must specify the desired
63 pad number in the struct
64 :c:type:`v4l2_enum_dv_timings` ``pad`` field.
65 Attempts to enumerate timings on a pad that doesn't support them will
66 return an ``EINVAL`` error code.
67
68
69 .. c:type:: v4l2_enum_dv_timings
70
71 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
72
73 .. flat-table:: struct v4l2_enum_dv_timings
74     :header-rows:  0
75     :stub-columns: 0
76     :widths:       1 1 2
77
78     * - __u32
79       - ``index``
80       - Number of the DV timings, set by the application.
81     * - __u32
82       - ``pad``
83       - Pad number as reported by the media controller API. This field is
84         only used when operating on a subdevice node. When operating on a
85         video node applications must set this field to zero.
86     * - __u32
87       - ``reserved``\ [2]
88       - Reserved for future extensions. Drivers and applications must set
89         the array to zero.
90     * - struct :c:type:`v4l2_dv_timings`
91       - ``timings``
92       - The timings.
93
94
95 Return Value
96 ============
97
98 On success 0 is returned, on error -1 and the ``errno`` variable is set
99 appropriately. The generic error codes are described at the
100 :ref:`Generic Error Codes <gen-errors>` chapter.
101
102 EINVAL
103     The struct :c:type:`v4l2_enum_dv_timings`
104     ``index`` is out of bounds or the ``pad`` number is invalid.
105
106 ENODATA
107     Digital video presets are not supported for this input or output.