1.. Permission is granted to copy, distribute and/or modify this 2.. document under the terms of the GNU Free Documentation License, 3.. Version 1.1 or any later version published by the Free Software 4.. Foundation, with no Invariant Sections, no Front-Cover Texts 5.. and no Back-Cover Texts. A copy of the license is included at 6.. Documentation/userspace-api/media/fdl-appendix.rst. 7.. 8.. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections 9 10.. _VIDIOC_SUBDEV_ENUM_MBUS_CODE: 11 12********************************** 13ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE 14********************************** 15 16Name 17==== 18 19VIDIOC_SUBDEV_ENUM_MBUS_CODE - Enumerate media bus formats 20 21 22Synopsis 23======== 24 25.. c:function:: int ioctl( int fd, VIDIOC_SUBDEV_ENUM_MBUS_CODE, struct v4l2_subdev_mbus_code_enum * argp ) 26 :name: VIDIOC_SUBDEV_ENUM_MBUS_CODE 27 28 29Arguments 30========= 31 32``fd`` 33 File descriptor returned by :ref:`open() <func-open>`. 34 35``argp`` 36 Pointer to struct :c:type:`v4l2_subdev_mbus_code_enum`. 37 38 39Description 40=========== 41 42To enumerate media bus formats available at a given sub-device pad 43applications initialize the ``pad``, ``which`` and ``index`` fields of 44struct 45:c:type:`v4l2_subdev_mbus_code_enum` and 46call the :ref:`VIDIOC_SUBDEV_ENUM_MBUS_CODE` ioctl with a pointer to this 47structure. Drivers fill the rest of the structure or return an ``EINVAL`` 48error code if either the ``pad`` or ``index`` are invalid. All media bus 49formats are enumerable by beginning at index zero and incrementing by 50one until ``EINVAL`` is returned. 51 52Available media bus formats may depend on the current 'try' formats at 53other pads of the sub-device, as well as on the current active links. 54See :ref:`VIDIOC_SUBDEV_G_FMT` for more 55information about the try formats. 56 57 58.. c:type:: v4l2_subdev_mbus_code_enum 59 60.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}| 61 62.. flat-table:: struct v4l2_subdev_mbus_code_enum 63 :header-rows: 0 64 :stub-columns: 0 65 :widths: 1 1 2 66 67 * - __u32 68 - ``pad`` 69 - Pad number as reported by the media controller API. 70 * - __u32 71 - ``index`` 72 - Number of the format in the enumeration, set by the application. 73 * - __u32 74 - ``code`` 75 - The media bus format code, as defined in 76 :ref:`v4l2-mbus-format`. 77 * - __u32 78 - ``which`` 79 - Media bus format codes to be enumerated, from enum 80 :ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`. 81 * - __u32 82 - ``reserved``\ [8] 83 - Reserved for future extensions. Applications and drivers must set 84 the array to zero. 85 86 87Return Value 88============ 89 90On success 0 is returned, on error -1 and the ``errno`` variable is set 91appropriately. The generic error codes are described at the 92:ref:`Generic Error Codes <gen-errors>` chapter. 93 94EINVAL 95 The struct 96 :c:type:`v4l2_subdev_mbus_code_enum` 97 ``pad`` references a non-existing pad, or the ``index`` field is out 98 of bounds. 99