Documentation/userspace-api/media/v4l/vidioc-subdev-enum-mbus-code.rst
Source file repositories/reference/linux-study-clean/Documentation/userspace-api/media/v4l/vidioc-subdev-enum-mbus-code.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/userspace-api/media/v4l/vidioc-subdev-enum-mbus-code.rst- Extension
.rst- Size
- 5591 bytes
- Lines
- 164
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L
.. _VIDIOC_SUBDEV_ENUM_MBUS_CODE:
**********************************
ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE
**********************************
Name
====
VIDIOC_SUBDEV_ENUM_MBUS_CODE - Enumerate media bus formats
Synopsis
========
.. c:macro:: VIDIOC_SUBDEV_ENUM_MBUS_CODE
``int ioctl(int fd, VIDIOC_SUBDEV_ENUM_MBUS_CODE, struct v4l2_subdev_mbus_code_enum * argp)``
Arguments
=========
``fd``
File descriptor returned by :c:func:`open()`.
``argp``
Pointer to struct :c:type:`v4l2_subdev_mbus_code_enum`.
Description
===========
This call is used by the application to access the enumeration
of media bus formats for the selected pad.
The enumerations are defined by the driver, and indexed using the ``index`` field
of struct :c:type:`v4l2_subdev_mbus_code_enum`.
Each enumeration starts with the ``index`` of 0, and
the lowest invalid index marks the end of enumeration.
Therefore, to enumerate media bus formats available at a given sub-device pad,
initialize the ``pad``, and ``which`` fields to desired values,
and set ``index`` to 0.
Then call the :ref:`VIDIOC_SUBDEV_ENUM_MBUS_CODE` ioctl
with a pointer to this structure.
A successful call will return with the ``code`` field filled in
with a mbus code value.
Repeat with increasing ``index`` until ``EINVAL`` is received.
``EINVAL`` means that either ``pad`` is invalid,
or that there are no more codes available at this pad.
The driver must not return the same value of ``code`` for different indices
at the same pad.
Available media bus formats may depend on the current 'try' formats at
other pads of the sub-device, as well as on the current active links.
See :ref:`VIDIOC_SUBDEV_G_FMT` for more
information about the try formats.
.. c:type:: v4l2_subdev_mbus_code_enum
.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.5cm}|
.. flat-table:: struct v4l2_subdev_mbus_code_enum
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.