xref: /openbmc/linux/include/uapi/linux/v4l2-common.h (revision 2a12187d)
1 /* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */
2 /*
3  * include/linux/v4l2-common.h
4  *
5  * Common V4L2 and V4L2 subdev definitions.
6  *
7  * Users are advised to #include this file either through videodev2.h
8  * (V4L2) or through v4l2-subdev.h (V4L2 subdev) rather than to refer
9  * to this file directly.
10  *
11  * Copyright (C) 2012 Nokia Corporation
12  * Contact: Sakari Ailus <sakari.ailus@iki.fi>
13  */
14 
15 #ifndef __V4L2_COMMON__
16 #define __V4L2_COMMON__
17 
18 #include <linux/types.h>
19 
20 /*
21  *
22  * Selection interface definitions
23  *
24  */
25 
26 /* Current cropping area */
27 #define V4L2_SEL_TGT_CROP		0x0000
28 /* Default cropping area */
29 #define V4L2_SEL_TGT_CROP_DEFAULT	0x0001
30 /* Cropping bounds */
31 #define V4L2_SEL_TGT_CROP_BOUNDS	0x0002
32 /* Native frame size */
33 #define V4L2_SEL_TGT_NATIVE_SIZE	0x0003
34 /* Current composing area */
35 #define V4L2_SEL_TGT_COMPOSE		0x0100
36 /* Default composing area */
37 #define V4L2_SEL_TGT_COMPOSE_DEFAULT	0x0101
38 /* Composing bounds */
39 #define V4L2_SEL_TGT_COMPOSE_BOUNDS	0x0102
40 /* Current composing area plus all padding pixels */
41 #define V4L2_SEL_TGT_COMPOSE_PADDED	0x0103
42 
43 /* Selection flags */
44 #define V4L2_SEL_FLAG_GE		(1 << 0)
45 #define V4L2_SEL_FLAG_LE		(1 << 1)
46 #define V4L2_SEL_FLAG_KEEP_CONFIG	(1 << 2)
47 
48 struct v4l2_edid {
49 	__u32 pad;
50 	__u32 start_block;
51 	__u32 blocks;
52 	__u32 reserved[5];
53 	__u8  *edid;
54 };
55 
56 #ifndef __KERNEL__
57 /* Backward compatibility target definitions --- to be removed. */
58 #define V4L2_SEL_TGT_CROP_ACTIVE	V4L2_SEL_TGT_CROP
59 #define V4L2_SEL_TGT_COMPOSE_ACTIVE	V4L2_SEL_TGT_COMPOSE
60 #define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL	V4L2_SEL_TGT_CROP
61 #define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
62 #define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS	V4L2_SEL_TGT_CROP_BOUNDS
63 #define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
64 
65 /* Backward compatibility flag definitions --- to be removed. */
66 #define V4L2_SUBDEV_SEL_FLAG_SIZE_GE	V4L2_SEL_FLAG_GE
67 #define V4L2_SUBDEV_SEL_FLAG_SIZE_LE	V4L2_SEL_FLAG_LE
68 #define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
69 #endif
70 
71 #endif /* __V4L2_COMMON__ */
72