162306a36Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
262306a36Sopenharmony_ci.. c:namespace:: V4L
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci.. _VIDIOC_ENUM_DV_TIMINGS:
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci***********************************************************
762306a36Sopenharmony_ciioctl VIDIOC_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUM_DV_TIMINGS
862306a36Sopenharmony_ci***********************************************************
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciName
1162306a36Sopenharmony_ci====
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciVIDIOC_ENUM_DV_TIMINGS - VIDIOC_SUBDEV_ENUM_DV_TIMINGS - Enumerate supported Digital Video timings
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ciSynopsis
1662306a36Sopenharmony_ci========
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ci.. c:macro:: VIDIOC_ENUM_DV_TIMINGS
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_ENUM_DV_TIMINGS, struct v4l2_enum_dv_timings *argp)``
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci.. c:macro:: VIDIOC_SUBDEV_ENUM_DV_TIMINGS
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci``int ioctl(int fd, VIDIOC_SUBDEV_ENUM_DV_TIMINGS, struct v4l2_enum_dv_timings *argp)``
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ciArguments
2762306a36Sopenharmony_ci=========
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci``fd``
3062306a36Sopenharmony_ci    File descriptor returned by :c:func:`open()`.
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci``argp``
3362306a36Sopenharmony_ci    Pointer to struct :c:type:`v4l2_enum_dv_timings`.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciDescription
3662306a36Sopenharmony_ci===========
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ciWhile some DV receivers or transmitters support a wide range of timings,
3962306a36Sopenharmony_ciothers support only a limited number of timings. With this ioctl
4062306a36Sopenharmony_ciapplications can enumerate a list of known supported timings. Call
4162306a36Sopenharmony_ci:ref:`VIDIOC_DV_TIMINGS_CAP` to check if it
4262306a36Sopenharmony_cialso supports other standards or even custom timings that are not in
4362306a36Sopenharmony_cithis list.
4462306a36Sopenharmony_ci
4562306a36Sopenharmony_ciTo query the available timings, applications initialize the ``index``
4662306a36Sopenharmony_cifield, set the ``pad`` field to 0, zero the reserved array of struct
4762306a36Sopenharmony_ci:c:type:`v4l2_enum_dv_timings` and call the
4862306a36Sopenharmony_ci``VIDIOC_ENUM_DV_TIMINGS`` ioctl on a video node with a pointer to this
4962306a36Sopenharmony_cistructure. Drivers fill the rest of the structure or return an ``EINVAL``
5062306a36Sopenharmony_cierror code when the index is out of bounds. To enumerate all supported
5162306a36Sopenharmony_ciDV timings, applications shall begin at index zero, incrementing by one
5262306a36Sopenharmony_ciuntil the driver returns ``EINVAL``.
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci.. note::
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci   Drivers may enumerate a different set of DV timings after
5762306a36Sopenharmony_ci   switching the video input or output.
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ciWhen implemented by the driver DV timings of subdevices can be queried
6062306a36Sopenharmony_ciby calling the ``VIDIOC_SUBDEV_ENUM_DV_TIMINGS`` ioctl directly on a
6162306a36Sopenharmony_cisubdevice node. The DV timings are specific to inputs (for DV receivers)
6262306a36Sopenharmony_cior outputs (for DV transmitters), applications must specify the desired
6362306a36Sopenharmony_cipad number in the struct
6462306a36Sopenharmony_ci:c:type:`v4l2_enum_dv_timings` ``pad`` field.
6562306a36Sopenharmony_ciAttempts to enumerate timings on a pad that doesn't support them will
6662306a36Sopenharmony_cireturn an ``EINVAL`` error code.
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci.. c:type:: v4l2_enum_dv_timings
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_ci.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci.. flat-table:: struct v4l2_enum_dv_timings
7362306a36Sopenharmony_ci    :header-rows:  0
7462306a36Sopenharmony_ci    :stub-columns: 0
7562306a36Sopenharmony_ci    :widths:       1 1 2
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci    * - __u32
7862306a36Sopenharmony_ci      - ``index``
7962306a36Sopenharmony_ci      - Number of the DV timings, set by the application.
8062306a36Sopenharmony_ci    * - __u32
8162306a36Sopenharmony_ci      - ``pad``
8262306a36Sopenharmony_ci      - Pad number as reported by the media controller API. This field is
8362306a36Sopenharmony_ci	only used when operating on a subdevice node. When operating on a
8462306a36Sopenharmony_ci	video node applications must set this field to zero.
8562306a36Sopenharmony_ci    * - __u32
8662306a36Sopenharmony_ci      - ``reserved``\ [2]
8762306a36Sopenharmony_ci      - Reserved for future extensions. Drivers and applications must set
8862306a36Sopenharmony_ci	the array to zero.
8962306a36Sopenharmony_ci    * - struct :c:type:`v4l2_dv_timings`
9062306a36Sopenharmony_ci      - ``timings``
9162306a36Sopenharmony_ci      - The timings.
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ciReturn Value
9462306a36Sopenharmony_ci============
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ciOn success 0 is returned, on error -1 and the ``errno`` variable is set
9762306a36Sopenharmony_ciappropriately. The generic error codes are described at the
9862306a36Sopenharmony_ci:ref:`Generic Error Codes <gen-errors>` chapter.
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ciEINVAL
10162306a36Sopenharmony_ci    The struct :c:type:`v4l2_enum_dv_timings`
10262306a36Sopenharmony_ci    ``index`` is out of bounds or the ``pad`` number is invalid.
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ciENODATA
10562306a36Sopenharmony_ci    Digital video presets are not supported for this input or output.
106