1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef __LINUX_UVCVIDEO_H_
3 #define __LINUX_UVCVIDEO_H_
5 #include <linux/ioctl.h>
6 #include <linux/types.h>
12 /* Data types for UVC control data */
13 #define UVC_CTRL_DATA_TYPE_RAW 0
14 #define UVC_CTRL_DATA_TYPE_SIGNED 1
15 #define UVC_CTRL_DATA_TYPE_UNSIGNED 2
16 #define UVC_CTRL_DATA_TYPE_BOOLEAN 3
17 #define UVC_CTRL_DATA_TYPE_ENUM 4
18 #define UVC_CTRL_DATA_TYPE_BITMASK 5
21 #define UVC_CTRL_FLAG_SET_CUR (1 << 0)
22 #define UVC_CTRL_FLAG_GET_CUR (1 << 1)
23 #define UVC_CTRL_FLAG_GET_MIN (1 << 2)
24 #define UVC_CTRL_FLAG_GET_MAX (1 << 3)
25 #define UVC_CTRL_FLAG_GET_RES (1 << 4)
26 #define UVC_CTRL_FLAG_GET_DEF (1 << 5)
27 /* Control should be saved at suspend and restored at resume. */
28 #define UVC_CTRL_FLAG_RESTORE (1 << 6)
29 /* Control can be updated by the camera. */
30 #define UVC_CTRL_FLAG_AUTO_UPDATE (1 << 7)
31 /* Control supports asynchronous reporting */
32 #define UVC_CTRL_FLAG_ASYNCHRONOUS (1 << 8)
34 #define UVC_CTRL_FLAG_GET_RANGE \
35 (UVC_CTRL_FLAG_GET_CUR | UVC_CTRL_FLAG_GET_MIN | \
36 UVC_CTRL_FLAG_GET_MAX | UVC_CTRL_FLAG_GET_RES | \
37 UVC_CTRL_FLAG_GET_DEF)
39 struct uvc_menu_info {
44 struct uvc_xu_control_mapping {
55 struct uvc_menu_info __user *menu_info;
61 struct uvc_xu_control_query {
64 __u8 query; /* Video Class-Specific Request Code, */
65 /* defined in linux/usb/video.h A.8. */
70 #define UVCIOC_CTRL_MAP _IOWR('u', 0x20, struct uvc_xu_control_mapping)
71 #define UVCIOC_CTRL_QUERY _IOWR('u', 0x21, struct uvc_xu_control_query)
78 * struct uvc_meta_buf - metadata buffer building block
79 * @ns - system timestamp of the payload in nanoseconds
80 * @sof - USB Frame Number
81 * @length - length of the payload header
82 * @flags - payload header flags
83 * @buf - optional device-specific header data
85 * UVC metadata nodes fill buffers with possibly multiple instances of this
86 * struct. The first two fields are added by the driver, they can be used for
87 * clock synchronisation. The rest is an exact copy of a UVC payload header.
88 * Only complete objects with complete buffers are included. Therefore it's
89 * always sizeof(meta->ts) + sizeof(meta->sof) + meta->length bytes large.