1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3.. _VIDIOC_QUERYCTRL:
4
5*******************************************************************
6ioctls VIDIOC_QUERYCTRL, VIDIOC_QUERY_EXT_CTRL and VIDIOC_QUERYMENU
7*******************************************************************
8
9Name
10====
11
12VIDIOC_QUERYCTRL - VIDIOC_QUERY_EXT_CTRL - VIDIOC_QUERYMENU - Enumerate controls and menu control items
13
14
15Synopsis
16========
17
18.. c:function:: int ioctl( int fd, int VIDIOC_QUERYCTRL, struct v4l2_queryctrl *argp )
19    :name: VIDIOC_QUERYCTRL
20
21.. c:function:: int ioctl( int fd, VIDIOC_QUERY_EXT_CTRL, struct v4l2_query_ext_ctrl *argp )
22    :name: VIDIOC_QUERY_EXT_CTRL
23
24.. c:function:: int ioctl( int fd, VIDIOC_QUERYMENU, struct v4l2_querymenu *argp )
25    :name: VIDIOC_QUERYMENU
26
27
28Arguments
29=========
30
31``fd``
32    File descriptor returned by :ref:`open() <func-open>`.
33
34``argp``
35    Pointer to struct :c:type:`v4l2_queryctrl`, :c:type:`v4l2_query_ext_ctrl`
36    or :c:type:`v4l2_querymenu` (depending on the ioctl).
37
38
39Description
40===========
41
42To query the attributes of a control applications set the ``id`` field
43of a struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` and call the
44``VIDIOC_QUERYCTRL`` ioctl with a pointer to this structure. The driver
45fills the rest of the structure or returns an ``EINVAL`` error code when the
46``id`` is invalid.
47
48It is possible to enumerate controls by calling ``VIDIOC_QUERYCTRL``
49with successive ``id`` values starting from ``V4L2_CID_BASE`` up to and
50exclusive ``V4L2_CID_LASTP1``. Drivers may return ``EINVAL`` if a control in
51this range is not supported. Further applications can enumerate private
52controls, which are not defined in this specification, by starting at
53``V4L2_CID_PRIVATE_BASE`` and incrementing ``id`` until the driver
54returns ``EINVAL``.
55
56In both cases, when the driver sets the ``V4L2_CTRL_FLAG_DISABLED`` flag
57in the ``flags`` field this control is permanently disabled and should
58be ignored by the application. [#f1]_
59
60When the application ORs ``id`` with ``V4L2_CTRL_FLAG_NEXT_CTRL`` the
61driver returns the next supported non-compound control, or ``EINVAL`` if
62there is none. In addition, the ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` flag
63can be specified to enumerate all compound controls (i.e. controls with
64type ≥ ``V4L2_CTRL_COMPOUND_TYPES`` and/or array control, in other words
65controls that contain more than one value). Specify both
66``V4L2_CTRL_FLAG_NEXT_CTRL`` and ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` in
67order to enumerate all controls, compound or not. Drivers which do not
68support these flags yet always return ``EINVAL``.
69
70The ``VIDIOC_QUERY_EXT_CTRL`` ioctl was introduced in order to better
71support controls that can use compound types, and to expose additional
72control information that cannot be returned in struct
73:ref:`v4l2_queryctrl <v4l2-queryctrl>` since that structure is full.
74
75``VIDIOC_QUERY_EXT_CTRL`` is used in the same way as
76``VIDIOC_QUERYCTRL``, except that the ``reserved`` array must be zeroed
77as well.
78
79Additional information is required for menu controls: the names of the
80menu items. To query them applications set the ``id`` and ``index``
81fields of struct :ref:`v4l2_querymenu <v4l2-querymenu>` and call the
82``VIDIOC_QUERYMENU`` ioctl with a pointer to this structure. The driver
83fills the rest of the structure or returns an ``EINVAL`` error code when the
84``id`` or ``index`` is invalid. Menu items are enumerated by calling
85``VIDIOC_QUERYMENU`` with successive ``index`` values from struct
86:ref:`v4l2_queryctrl <v4l2-queryctrl>` ``minimum`` to ``maximum``,
87inclusive.
88
89.. note::
90
91   It is possible for ``VIDIOC_QUERYMENU`` to return
92   an ``EINVAL`` error code for some indices between ``minimum`` and
93   ``maximum``. In that case that particular menu item is not supported by
94   this driver. Also note that the ``minimum`` value is not necessarily 0.
95
96See also the examples in :ref:`control`.
97
98
99.. tabularcolumns:: |p{1.2cm}|p{3.6cm}|p{12.7cm}|
100
101.. _v4l2-queryctrl:
102
103.. cssclass:: longtable
104
105.. flat-table:: struct v4l2_queryctrl
106    :header-rows:  0
107    :stub-columns: 0
108    :widths:       1 1 2
109
110    * - __u32
111      - ``id``
112      - Identifies the control, set by the application. See
113	:ref:`control-id` for predefined IDs. When the ID is ORed with
114	V4L2_CTRL_FLAG_NEXT_CTRL the driver clears the flag and
115	returns the first control with a higher ID. Drivers which do not
116	support this flag yet always return an ``EINVAL`` error code.
117    * - __u32
118      - ``type``
119      - Type of control, see :c:type:`v4l2_ctrl_type`.
120    * - __u8
121      - ``name``\ [32]
122      - Name of the control, a NUL-terminated ASCII string. This
123	information is intended for the user.
124    * - __s32
125      - ``minimum``
126      - Minimum value, inclusive. This field gives a lower bound for the
127	control. See enum :c:type:`v4l2_ctrl_type` how
128	the minimum value is to be used for each possible control type.
129	Note that this a signed 32-bit value.
130    * - __s32
131      - ``maximum``
132      - Maximum value, inclusive. This field gives an upper bound for the
133	control. See enum :c:type:`v4l2_ctrl_type` how
134	the maximum value is to be used for each possible control type.
135	Note that this a signed 32-bit value.
136    * - __s32
137      - ``step``
138      - This field gives a step size for the control. See enum
139	:c:type:`v4l2_ctrl_type` how the step value is
140	to be used for each possible control type. Note that this an
141	unsigned 32-bit value.
142
143	Generally drivers should not scale hardware control values. It may
144	be necessary for example when the ``name`` or ``id`` imply a
145	particular unit and the hardware actually accepts only multiples
146	of said unit. If so, drivers must take care values are properly
147	rounded when scaling, such that errors will not accumulate on
148	repeated read-write cycles.
149
150	This field gives the smallest change of an integer control
151	actually affecting hardware. Often the information is needed when
152	the user can change controls by keyboard or GUI buttons, rather
153	than a slider. When for example a hardware register accepts values
154	0-511 and the driver reports 0-65535, step should be 128.
155
156	Note that although signed, the step value is supposed to be always
157	positive.
158    * - __s32
159      - ``default_value``
160      - The default value of a ``V4L2_CTRL_TYPE_INTEGER``, ``_BOOLEAN``,
161	``_BITMASK``, ``_MENU`` or ``_INTEGER_MENU`` control. Not valid
162	for other types of controls.
163
164	.. note::
165
166	   Drivers reset controls to their default value only when
167	   the driver is first loaded, never afterwards.
168    * - __u32
169      - ``flags``
170      - Control flags, see :ref:`control-flags`.
171    * - __u32
172      - ``reserved``\ [2]
173      - Reserved for future extensions. Drivers must set the array to
174	zero.
175
176
177
178.. tabularcolumns:: |p{1.2cm}|p{5.0cm}|p{11.3cm}|
179
180.. _v4l2-query-ext-ctrl:
181
182.. cssclass:: longtable
183
184.. flat-table:: struct v4l2_query_ext_ctrl
185    :header-rows:  0
186    :stub-columns: 0
187    :widths:       1 1 2
188
189    * - __u32
190      - ``id``
191      - Identifies the control, set by the application. See
192	:ref:`control-id` for predefined IDs. When the ID is ORed with
193	``V4L2_CTRL_FLAG_NEXT_CTRL`` the driver clears the flag and
194	returns the first non-compound control with a higher ID. When the
195	ID is ORed with ``V4L2_CTRL_FLAG_NEXT_COMPOUND`` the driver clears
196	the flag and returns the first compound control with a higher ID.
197	Set both to get the first control (compound or not) with a higher
198	ID.
199    * - __u32
200      - ``type``
201      - Type of control, see :c:type:`v4l2_ctrl_type`.
202    * - char
203      - ``name``\ [32]
204      - Name of the control, a NUL-terminated ASCII string. This
205	information is intended for the user.
206    * - __s64
207      - ``minimum``
208      - Minimum value, inclusive. This field gives a lower bound for the
209	control. See enum :c:type:`v4l2_ctrl_type` how
210	the minimum value is to be used for each possible control type.
211	Note that this a signed 64-bit value.
212    * - __s64
213      - ``maximum``
214      - Maximum value, inclusive. This field gives an upper bound for the
215	control. See enum :c:type:`v4l2_ctrl_type` how
216	the maximum value is to be used for each possible control type.
217	Note that this a signed 64-bit value.
218    * - __u64
219      - ``step``
220      - This field gives a step size for the control. See enum
221	:c:type:`v4l2_ctrl_type` how the step value is
222	to be used for each possible control type. Note that this an
223	unsigned 64-bit value.
224
225	Generally drivers should not scale hardware control values. It may
226	be necessary for example when the ``name`` or ``id`` imply a
227	particular unit and the hardware actually accepts only multiples
228	of said unit. If so, drivers must take care values are properly
229	rounded when scaling, such that errors will not accumulate on
230	repeated read-write cycles.
231
232	This field gives the smallest change of an integer control
233	actually affecting hardware. Often the information is needed when
234	the user can change controls by keyboard or GUI buttons, rather
235	than a slider. When for example a hardware register accepts values
236	0-511 and the driver reports 0-65535, step should be 128.
237    * - __s64
238      - ``default_value``
239      - The default value of a ``V4L2_CTRL_TYPE_INTEGER``, ``_INTEGER64``,
240	``_BOOLEAN``, ``_BITMASK``, ``_MENU``, ``_INTEGER_MENU``, ``_U8``
241	or ``_U16`` control. Not valid for other types of controls.
242
243	.. note::
244
245	   Drivers reset controls to their default value only when
246	   the driver is first loaded, never afterwards.
247    * - __u32
248      - ``flags``
249      - Control flags, see :ref:`control-flags`.
250    * - __u32
251      - ``elem_size``
252      - The size in bytes of a single element of the array. Given a char
253	pointer ``p`` to a 3-dimensional array you can find the position
254	of cell ``(z, y, x)`` as follows:
255	``p + ((z * dims[1] + y) * dims[0] + x) * elem_size``.
256	``elem_size`` is always valid, also when the control isn't an
257	array. For string controls ``elem_size`` is equal to
258	``maximum + 1``.
259    * - __u32
260      - ``elems``
261      - The number of elements in the N-dimensional array. If this control
262	is not an array, then ``elems`` is 1. The ``elems`` field can
263	never be 0.
264    * - __u32
265      - ``nr_of_dims``
266      - The number of dimension in the N-dimensional array. If this
267	control is not an array, then this field is 0.
268    * - __u32
269      - ``dims[V4L2_CTRL_MAX_DIMS]``
270      - The size of each dimension. The first ``nr_of_dims`` elements of
271	this array must be non-zero, all remaining elements must be zero.
272    * - __u32
273      - ``reserved``\ [32]
274      - Reserved for future extensions. Applications and drivers must set
275	the array to zero.
276
277
278
279.. tabularcolumns:: |p{1.2cm}|p{1.0cm}|p{1.7cm}|p{13.0cm}|
280
281.. _v4l2-querymenu:
282
283.. flat-table:: struct v4l2_querymenu
284    :header-rows:  0
285    :stub-columns: 0
286    :widths:       1 1 2
287
288    * - __u32
289      - ``id``
290      - Identifies the control, set by the application from the respective
291	struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` ``id``.
292    * - __u32
293      - ``index``
294      - Index of the menu item, starting at zero, set by the application.
295    * - union {
296      - (anonymous)
297    * - __u8
298      - ``name``\ [32]
299      - Name of the menu item, a NUL-terminated ASCII string. This
300	information is intended for the user. This field is valid for
301	``V4L2_CTRL_TYPE_MENU`` type controls.
302    * - __s64
303      - ``value``
304      - Value of the integer menu item. This field is valid for
305	``V4L2_CTRL_TYPE_INTEGER_MENU`` type controls.
306    * - }
307      -
308    * - __u32
309      - ``reserved``
310      - Reserved for future extensions. Drivers must set the array to
311	zero.
312
313
314
315.. tabularcolumns:: |p{5.8cm}|p{1.4cm}|p{1.0cm}|p{1.4cm}|p{6.9cm}|
316
317.. c:type:: v4l2_ctrl_type
318
319.. cssclass:: longtable
320
321.. flat-table:: enum v4l2_ctrl_type
322    :header-rows:  1
323    :stub-columns: 0
324    :widths:       30 5 5 5 55
325
326    * - Type
327      - ``minimum``
328      - ``step``
329      - ``maximum``
330      - Description
331    * - ``V4L2_CTRL_TYPE_INTEGER``
332      - any
333      - any
334      - any
335      - An integer-valued control ranging from minimum to maximum
336	inclusive. The step value indicates the increment between values.
337    * - ``V4L2_CTRL_TYPE_BOOLEAN``
338      - 0
339      - 1
340      - 1
341      - A boolean-valued control. Zero corresponds to "disabled", and one
342	means "enabled".
343    * - ``V4L2_CTRL_TYPE_MENU``
344      - ≥ 0
345      - 1
346      - N-1
347      - The control has a menu of N choices. The names of the menu items
348	can be enumerated with the ``VIDIOC_QUERYMENU`` ioctl.
349    * - ``V4L2_CTRL_TYPE_INTEGER_MENU``
350      - ≥ 0
351      - 1
352      - N-1
353      - The control has a menu of N choices. The values of the menu items
354	can be enumerated with the ``VIDIOC_QUERYMENU`` ioctl. This is
355	similar to ``V4L2_CTRL_TYPE_MENU`` except that instead of strings,
356	the menu items are signed 64-bit integers.
357    * - ``V4L2_CTRL_TYPE_BITMASK``
358      - 0
359      - n/a
360      - any
361      - A bitmask field. The maximum value is the set of bits that can be
362	used, all other bits are to be 0. The maximum value is interpreted
363	as a __u32, allowing the use of bit 31 in the bitmask.
364    * - ``V4L2_CTRL_TYPE_BUTTON``
365      - 0
366      - 0
367      - 0
368      - A control which performs an action when set. Drivers must ignore
369	the value passed with ``VIDIOC_S_CTRL`` and return an ``EACCES`` error
370	code on a ``VIDIOC_G_CTRL`` attempt.
371    * - ``V4L2_CTRL_TYPE_INTEGER64``
372      - any
373      - any
374      - any
375      - A 64-bit integer valued control. Minimum, maximum and step size
376	cannot be queried using ``VIDIOC_QUERYCTRL``. Only
377	``VIDIOC_QUERY_EXT_CTRL`` can retrieve the 64-bit min/max/step
378	values, they should be interpreted as n/a when using
379	``VIDIOC_QUERYCTRL``.
380    * - ``V4L2_CTRL_TYPE_STRING``
381      - ≥ 0
382      - ≥ 1
383      - ≥ 0
384      - The minimum and maximum string lengths. The step size means that
385	the string must be (minimum + N * step) characters long for N ≥ 0.
386	These lengths do not include the terminating zero, so in order to
387	pass a string of length 8 to
388	:ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` you need to
389	set the ``size`` field of struct
390	:c:type:`v4l2_ext_control` to 9. For
391	:ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` you can set
392	the ``size`` field to ``maximum`` + 1. Which character encoding is
393	used will depend on the string control itself and should be part
394	of the control documentation.
395    * - ``V4L2_CTRL_TYPE_CTRL_CLASS``
396      - n/a
397      - n/a
398      - n/a
399      - This is not a control. When ``VIDIOC_QUERYCTRL`` is called with a
400	control ID equal to a control class code (see :ref:`ctrl-class`)
401	+ 1, the ioctl returns the name of the control class and this
402	control type. Older drivers which do not support this feature
403	return an ``EINVAL`` error code.
404    * - ``V4L2_CTRL_TYPE_U8``
405      - any
406      - any
407      - any
408      - An unsigned 8-bit valued control ranging from minimum to maximum
409	inclusive. The step value indicates the increment between values.
410    * - ``V4L2_CTRL_TYPE_U16``
411      - any
412      - any
413      - any
414      - An unsigned 16-bit valued control ranging from minimum to maximum
415	inclusive. The step value indicates the increment between values.
416    * - ``V4L2_CTRL_TYPE_U32``
417      - any
418      - any
419      - any
420      - An unsigned 32-bit valued control ranging from minimum to maximum
421	inclusive. The step value indicates the increment between values.
422    * - ``V4L2_CTRL_TYPE_MPEG2_SLICE_PARAMS``
423      - n/a
424      - n/a
425      - n/a
426      - A struct :c:type:`v4l2_ctrl_mpeg2_slice_params`, containing MPEG-2
427	slice parameters for stateless video decoders.
428    * - ``V4L2_CTRL_TYPE_MPEG2_QUANTIZATION``
429      - n/a
430      - n/a
431      - n/a
432      - A struct :c:type:`v4l2_ctrl_mpeg2_quantization`, containing MPEG-2
433	quantization matrices for stateless video decoders.
434    * - ``V4L2_CTRL_TYPE_AREA``
435      - n/a
436      - n/a
437      - n/a
438      - A struct :c:type:`v4l2_area`, containing the width and the height
439        of a rectangular area. Units depend on the use case.
440    * - ``V4L2_CTRL_TYPE_H264_SPS``
441      - n/a
442      - n/a
443      - n/a
444      - A struct :c:type:`v4l2_ctrl_h264_sps`, containing H264
445	sequence parameters for stateless video decoders.
446    * - ``V4L2_CTRL_TYPE_H264_PPS``
447      - n/a
448      - n/a
449      - n/a
450      - A struct :c:type:`v4l2_ctrl_h264_pps`, containing H264
451	picture parameters for stateless video decoders.
452    * - ``V4L2_CTRL_TYPE_H264_SCALING_MATRIX``
453      - n/a
454      - n/a
455      - n/a
456      - A struct :c:type:`v4l2_ctrl_h264_scaling_matrix`, containing H264
457	scaling matrices for stateless video decoders.
458    * - ``V4L2_CTRL_TYPE_H264_SLICE_PARAMS``
459      - n/a
460      - n/a
461      - n/a
462      - A struct :c:type:`v4l2_ctrl_h264_slice_params`, containing H264
463	slice parameters for stateless video decoders.
464    * - ``V4L2_CTRL_TYPE_H264_DECODE_PARAMS``
465      - n/a
466      - n/a
467      - n/a
468      - A struct :c:type:`v4l2_ctrl_h264_decode_params`, containing H264
469	decode parameters for stateless video decoders.
470    * - ``V4L2_CTRL_TYPE_HEVC_SPS``
471      - n/a
472      - n/a
473      - n/a
474      - A struct :c:type:`v4l2_ctrl_hevc_sps`, containing HEVC Sequence
475	Parameter Set for stateless video decoders.
476    * - ``V4L2_CTRL_TYPE_HEVC_PPS``
477      - n/a
478      - n/a
479      - n/a
480      - A struct :c:type:`v4l2_ctrl_hevc_pps`, containing HEVC Picture
481	Parameter Set for stateless video decoders.
482    * - ``V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS``
483      - n/a
484      - n/a
485      - n/a
486      - A struct :c:type:`v4l2_ctrl_hevc_slice_params`, containing HEVC
487	slice parameters for stateless video decoders.
488
489.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
490
491.. _control-flags:
492
493.. cssclass:: longtable
494
495.. flat-table:: Control Flags
496    :header-rows:  0
497    :stub-columns: 0
498    :widths:       3 1 4
499
500    * - ``V4L2_CTRL_FLAG_DISABLED``
501      - 0x0001
502      - This control is permanently disabled and should be ignored by the
503	application. Any attempt to change the control will result in an
504	``EINVAL`` error code.
505    * - ``V4L2_CTRL_FLAG_GRABBED``
506      - 0x0002
507      - This control is temporarily unchangeable, for example because
508	another application took over control of the respective resource.
509	Such controls may be displayed specially in a user interface.
510	Attempts to change the control may result in an ``EBUSY`` error code.
511    * - ``V4L2_CTRL_FLAG_READ_ONLY``
512      - 0x0004
513      - This control is permanently readable only. Any attempt to change
514	the control will result in an ``EINVAL`` error code.
515    * - ``V4L2_CTRL_FLAG_UPDATE``
516      - 0x0008
517      - A hint that changing this control may affect the value of other
518	controls within the same control class. Applications should update
519	their user interface accordingly.
520    * - ``V4L2_CTRL_FLAG_INACTIVE``
521      - 0x0010
522      - This control is not applicable to the current configuration and
523	should be displayed accordingly in a user interface. For example
524	the flag may be set on a MPEG audio level 2 bitrate control when
525	MPEG audio encoding level 1 was selected with another control.
526    * - ``V4L2_CTRL_FLAG_SLIDER``
527      - 0x0020
528      - A hint that this control is best represented as a slider-like
529	element in a user interface.
530    * - ``V4L2_CTRL_FLAG_WRITE_ONLY``
531      - 0x0040
532      - This control is permanently writable only. Any attempt to read the
533	control will result in an ``EACCES`` error code error code. This flag
534	is typically present for relative controls or action controls
535	where writing a value will cause the device to carry out a given
536	action (e. g. motor control) but no meaningful value can be
537	returned.
538    * - ``V4L2_CTRL_FLAG_VOLATILE``
539      - 0x0080
540      - This control is volatile, which means that the value of the
541	control changes continuously. A typical example would be the
542	current gain value if the device is in auto-gain mode. In such a
543	case the hardware calculates the gain value based on the lighting
544	conditions which can change over time.
545
546	.. note::
547
548	   Setting a new value for a volatile control will be ignored
549	   unless
550	   :ref:`V4L2_CTRL_FLAG_EXECUTE_ON_WRITE <FLAG_EXECUTE_ON_WRITE>`
551	   is also set.
552	   Setting a new value for a volatile control will *never* trigger a
553	   :ref:`V4L2_EVENT_CTRL_CH_VALUE <ctrl-changes-flags>` event.
554    * - ``V4L2_CTRL_FLAG_HAS_PAYLOAD``
555      - 0x0100
556      - This control has a pointer type, so its value has to be accessed
557	using one of the pointer fields of struct
558	:c:type:`v4l2_ext_control`. This flag is set
559	for controls that are an array, string, or have a compound type.
560	In all cases you have to set a pointer to memory containing the
561	payload of the control.
562    * .. _FLAG_EXECUTE_ON_WRITE:
563
564      - ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE``
565      - 0x0200
566      - The value provided to the control will be propagated to the driver
567	even if it remains constant. This is required when the control
568	represents an action on the hardware. For example: clearing an
569	error flag or triggering the flash. All the controls of the type
570	``V4L2_CTRL_TYPE_BUTTON`` have this flag set.
571    * .. _FLAG_MODIFY_LAYOUT:
572
573      - ``V4L2_CTRL_FLAG_MODIFY_LAYOUT``
574      - 0x0400
575      - Changing this control value may modify the layout of the
576        buffer (for video devices) or the media bus format (for sub-devices).
577
578	A typical example would be the ``V4L2_CID_ROTATE`` control.
579
580	Note that typically controls with this flag will also set the
581	``V4L2_CTRL_FLAG_GRABBED`` flag when buffers are allocated or
582	streaming is in progress since most drivers do not support changing
583	the format in that case.
584
585
586Return Value
587============
588
589On success 0 is returned, on error -1 and the ``errno`` variable is set
590appropriately. The generic error codes are described at the
591:ref:`Generic Error Codes <gen-errors>` chapter.
592
593EINVAL
594    The struct :ref:`v4l2_queryctrl <v4l2-queryctrl>` ``id`` is
595    invalid. The struct :ref:`v4l2_querymenu <v4l2-querymenu>` ``id``
596    is invalid or ``index`` is out of range (less than ``minimum`` or
597    greater than ``maximum``) or this particular menu item is not
598    supported by the driver.
599
600EACCES
601    An attempt was made to read a write-only control.
602
603.. [#f1]
604   ``V4L2_CTRL_FLAG_DISABLED`` was intended for two purposes: Drivers
605   can skip predefined controls not supported by the hardware (although
606   returning ``EINVAL`` would do as well), or disable predefined and private
607   controls after hardware detection without the trouble of reordering
608   control arrays and indices (``EINVAL`` cannot be used to skip private
609   controls because it would prematurely end the enumeration).
610