1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="user-func.html" title="Appendix A. Function Reference"><link rel="prev" href="vidioc-subdev-enum-frame-size.html" title="ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE"><link rel="next" href="vidioc-subdev-g-crop.html" title="ioctl VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ioctl VIDIOC_SUBDEV_ENUM_MBUS_CODE</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-subdev-enum-frame-size.html">Prev</a> </td><th width="60%" align="center">Appendix A. Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="vidioc-subdev-g-crop.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="vidioc-subdev-enum-mbus-code"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_SUBDEV_ENUM_MBUS_CODE — Enumerate media bus formats</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">request</var>, </td></tr><tr><td> </td><td>struct v4l2_subdev_mbus_code_enum * 2 <var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1116505100"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="func-open.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>VIDIOC_SUBDEV_ENUM_MBUS_CODE</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a name="idp1116579924"></a><h2>Description</h2><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Experimental</h3><p>This is an <a class="link" href="hist-v4l2.html#experimental" title="Experimental API Elements">experimental</a> 3 interface and may change in the future.</p></div><p>To enumerate media bus formats available at a given sub-device pad 4 applications initialize the <em class="structfield"><code>pad</code></em>, <em class="structfield"><code>which</code></em> 5 and <em class="structfield"><code>index</code></em> fields of struct <a class="link" href="vidioc-subdev-enum-mbus-code.html#v4l2-subdev-mbus-code-enum" title="Table A.104. struct v4l2_subdev_mbus_code_enum">v4l2_subdev_mbus_code_enum</a> and 6 call the <code class="constant">VIDIOC_SUBDEV_ENUM_MBUS_CODE</code> ioctl with a 7 pointer to this structure. Drivers fill the rest of the structure or return 8 an <span class="errorcode">EINVAL</span> error code if either the <em class="structfield"><code>pad</code></em> or 9 <em class="structfield"><code>index</code></em> are invalid. All media bus formats are 10 enumerable by beginning at index zero and incrementing by one until 11 <span class="errorcode">EINVAL</span> is returned.</p><p>Available media bus formats may depend on the current 'try' formats 12 at other pads of the sub-device, as well as on the current active links. See 13 <a class="link" href="vidioc-subdev-g-fmt.html" title="ioctl VIDIOC_SUBDEV_G_FMT, VIDIOC_SUBDEV_S_FMT"><code class="constant">VIDIOC_SUBDEV_G_FMT</code></a> for more information about the try formats.</p><div class="table"><a name="v4l2-subdev-mbus-code-enum"></a><p class="title"><b>Table A.104. struct <span class="structname">v4l2_subdev_mbus_code_enum</span></b></p><div class="table-contents"><table summary="struct v4l2_subdev_mbus_code_enum" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>pad</code></em></td><td valign="top">Pad number as reported by the media controller API.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>index</code></em></td><td valign="top">Number of the format in the enumeration, set by the 14 application.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>code</code></em></td><td valign="top">The media bus format code, as defined in 15 <a class="xref" href="subdev.html#v4l2-mbus-format" title="Media Bus Formats">the section called “Media Bus Formats”</a>.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>which</code></em></td><td valign="top">Media bus format codes to be enumerated, from enum <a class="link" href="vidioc-subdev-g-fmt.html#v4l2-subdev-format-whence" title="Table A.107. enum v4l2_subdev_format_whence">v4l2_subdev_format_whence</a>.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>reserved</code></em>[8]</td><td valign="top">Reserved for future extensions. Applications and drivers must 16 set the array to zero.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idp1116593860"></a><h2>Return Value</h2><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table 19.1. Generic error codes">Generic Error Codes</a> chapter.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The struct <a class="link" href="vidioc-subdev-enum-mbus-code.html#v4l2-subdev-mbus-code-enum" title="Table A.104. struct v4l2_subdev_mbus_code_enum">v4l2_subdev_mbus_code_enum</a> <em class="structfield"><code>pad</code></em> 17 references a non-existing pad, or the <em class="structfield"><code>index</code></em> 18 field is out of bounds.</p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="vidioc-subdev-enum-frame-size.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="vidioc-subdev-g-crop.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_SUBDEV_ENUM_FRAME_SIZE </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ioctl VIDIOC_SUBDEV_G_CROP, VIDIOC_SUBDEV_S_CROP</td></tr></table></div></body></html> 19