Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) .. c:namespace:: MC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) .. _media_ioc_g_topology:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) **************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) ioctl MEDIA_IOC_G_TOPOLOGY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) **************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) ====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) MEDIA_IOC_G_TOPOLOGY - Enumerate the graph topology and graph element properties
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) .. c:macro:: MEDIA_IOC_G_TOPOLOGY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) ``int ioctl(int fd, MEDIA_IOC_G_TOPOLOGY, struct media_v2_topology *argp)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)     File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) ``argp``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)     Pointer to struct :c:type:`media_v2_topology`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) ===========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) The typical usage of this ioctl is to call it twice. On the first call,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) the structure defined at struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) :c:type:`media_v2_topology` should be zeroed. At
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) return, if no errors happen, this ioctl will return the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) ``topology_version`` and the total number of entities, interfaces, pads
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) and links.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) Before the second call, the userspace should allocate arrays to store
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) the graph elements that are desired, putting the pointers to them at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) ptr_entities, ptr_interfaces, ptr_links and/or ptr_pads, keeping the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) other values untouched.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) If the ``topology_version`` remains the same, the ioctl should fill the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) desired arrays with the media graph elements.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) .. tabularcolumns:: |p{1.6cm}|p{3.4cm}|p{12.5cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) .. c:type:: media_v2_topology
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) .. flat-table:: struct media_v2_topology
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)     :widths: 1 2 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)     *  -  __u64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59)        -  ``topology_version``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)        -  Version of the media graph topology. When the graph is created,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	  this field starts with zero. Every time a graph element is added
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	  or removed, this field is incremented.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)        -  ``num_entities``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)        -  Number of entities in the graph
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)        -  ``reserved1``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)        -  Applications and drivers shall set this to 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72)     *  -  __u64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)        -  ``ptr_entities``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)        -  A pointer to a memory area where the entities array will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	  stored, converted to a 64-bits integer. It can be zero. if zero,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	  the ioctl won't store the entities. It will just update
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	  ``num_entities``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)        -  ``num_interfaces``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)        -  Number of interfaces in the graph
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)        -  ``reserved2``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)        -  Applications and drivers shall set this to 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)     *  -  __u64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88)        -  ``ptr_interfaces``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)        -  A pointer to a memory area where the interfaces array will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	  stored, converted to a 64-bits integer. It can be zero. if zero,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	  the ioctl won't store the interfaces. It will just update
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	  ``num_interfaces``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)        -  ``num_pads``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)        -  Total number of pads in the graph
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)        -  ``reserved3``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)        -  Applications and drivers shall set this to 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)     *  -  __u64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)        -  ``ptr_pads``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)        -  A pointer to a memory area where the pads array will be stored,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	  converted to a 64-bits integer. It can be zero. if zero, the ioctl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	  won't store the pads. It will just update ``num_pads``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)        -  ``num_links``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)        -  Total number of data and interface links in the graph
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)        -  ``reserved4``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)        -  Applications and drivers shall set this to 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)     *  -  __u64
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)        -  ``ptr_links``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)        -  A pointer to a memory area where the links array will be stored,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	  converted to a 64-bits integer. It can be zero. if zero, the ioctl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	  won't store the links. It will just update ``num_links``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) .. c:type:: media_v2_entity
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) .. flat-table:: struct media_v2_entity
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)     :widths: 1 2 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)        -  ``id``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)        -  Unique ID for the entity. Do not expect that the ID will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	  always be the same for each instance of the device. In other words,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	  do not hardcode entity IDs in an application.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)     *  -  char
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)        -  ``name``\ [64]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)        -  Entity name as an UTF-8 NULL-terminated string. This name must be unique
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)           within the media topology.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)        -  ``function``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)        -  Entity main function, see :ref:`media-entity-functions` for details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)        -  ``flags``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)        -  Entity flags, see :ref:`media-entity-flag` for details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	  Only valid if ``MEDIA_V2_ENTITY_HAS_FLAGS(media_version)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	  returns true. The ``media_version`` is defined in struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	  :c:type:`media_device_info` and can be retrieved using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	  :ref:`MEDIA_IOC_DEVICE_INFO`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)        -  ``reserved``\ [5]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)        -  Reserved for future extensions. Drivers and applications must set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	  this array to zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) .. c:type:: media_v2_interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) .. flat-table:: struct media_v2_interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)     :widths: 1 2 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)        -  ``id``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)        -  Unique ID for the interface. Do not expect that the ID will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	  always be the same for each instance of the device. In other words,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	  do not hardcode interface IDs in an application.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)        -  ``intf_type``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)        -  Interface type, see :ref:`media-intf-type` for details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)        -  ``flags``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)        -  Interface flags. Currently unused.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)        -  ``reserved``\ [9]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)        -  Reserved for future extensions. Drivers and applications must set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 	  this array to zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)     *  -  struct media_v2_intf_devnode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)        -  ``devnode``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)        -  Used only for device node interfaces. See
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	  :c:type:`media_v2_intf_devnode` for details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) .. c:type:: media_v2_intf_devnode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) .. flat-table:: struct media_v2_intf_devnode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)     :widths: 1 2 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)        -  ``major``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)        -  Device node major number.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)        -  ``minor``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)        -  Device node minor number.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) .. c:type:: media_v2_pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) .. flat-table:: struct media_v2_pad
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)     :widths: 1 2 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)        -  ``id``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)        -  Unique ID for the pad. Do not expect that the ID will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 	  always be the same for each instance of the device. In other words,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	  do not hardcode pad IDs in an application.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)        -  ``entity_id``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)        -  Unique ID for the entity where this pad belongs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)        -  ``flags``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)        -  Pad flags, see :ref:`media-pad-flag` for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)        -  ``index``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)        -  Pad index, starts at 0. Only valid if ``MEDIA_V2_PAD_HAS_INDEX(media_version)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	  returns true. The ``media_version`` is defined in struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 	  :c:type:`media_device_info` and can be retrieved using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	  :ref:`MEDIA_IOC_DEVICE_INFO`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)        -  ``reserved``\ [4]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)        -  Reserved for future extensions. Drivers and applications must set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 	  this array to zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) .. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) .. c:type:: media_v2_link
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) .. flat-table:: struct media_v2_link
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)     :header-rows:  0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)     :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)     :widths: 1 2 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)        -  ``id``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)        -  Unique ID for the link. Do not expect that the ID will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	  always be the same for each instance of the device. In other words,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	  do not hardcode link IDs in an application.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)        -  ``source_id``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)        -  On pad to pad links: unique ID for the source pad.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 	  On interface to entity links: unique ID for the interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266)        -  ``sink_id``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)        -  On pad to pad links: unique ID for the sink pad.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 	  On interface to entity links: unique ID for the entity.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)        -  ``flags``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)        -  Link flags, see :ref:`media-link-flag` for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)     *  -  __u32
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)        -  ``reserved``\ [6]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)        -  Reserved for future extensions. Drivers and applications must set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 	  this array to zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) ============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) On success 0 is returned, on error -1 and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) appropriately. The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) :ref:`Generic Error Codes <gen-errors>` chapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) ENOSPC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288)     This is returned when either one or more of the num_entities,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)     num_interfaces, num_links or num_pads are non-zero and are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)     smaller than the actual number of elements inside the graph. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)     may happen if the ``topology_version`` changed when compared to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)     last time this ioctl was called. Userspace should usually free the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293)     area for the pointers, zero the struct elements and call this ioctl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)     again.