blob: 5b3f685a2d50ca2146e579f81580aecb61f19922 [file] [log] [blame]
Sakari Ailus5689b282012-05-18 09:31:18 -03001/*
2 * include/linux/v4l2-common.h
3 *
4 * Common V4L2 and V4L2 subdev definitions.
5 *
6 * Users are advised to #include this file either through videodev2.h
7 * (V4L2) or through v4l2-subdev.h (V4L2 subdev) rather than to refer
8 * to this file directly.
9 *
10 * Copyright (C) 2012 Nokia Corporation
11 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
12 *
Sakari Ailus80100fd2016-01-11 11:21:15 -020013 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
Sakari Ailus5689b282012-05-18 09:31:18 -030017 *
Sakari Ailus80100fd2016-01-11 11:21:15 -020018 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
Sakari Ailus5689b282012-05-18 09:31:18 -030022 *
Sakari Ailus80100fd2016-01-11 11:21:15 -020023 * Alternatively you can redistribute this file under the terms of the
24 * BSD license as stated below:
25 *
26 * Redistribution and use in source and binary forms, with or without
27 * modification, are permitted provided that the following conditions
28 * are met:
29 * 1. Redistributions of source code must retain the above copyright
30 * notice, this list of conditions and the following disclaimer.
31 * 2. Redistributions in binary form must reproduce the above copyright
32 * notice, this list of conditions and the following disclaimer in
33 * the documentation and/or other materials provided with the
34 * distribution.
35 * 3. The names of its contributors may not be used to endorse or promote
36 * products derived from this software without specific prior written
37 * permission.
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
40 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
41 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
42 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
43 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
45 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
46 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
47 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
48 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
49 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Sakari Ailus5689b282012-05-18 09:31:18 -030050 *
51 */
52
53#ifndef __V4L2_COMMON__
54#define __V4L2_COMMON__
55
Mauro Carvalho Chehab773bcf82014-04-06 10:48:31 -030056#include <linux/types.h>
57
Sakari Ailus563df3d2012-06-13 16:01:10 -030058/*
59 *
60 * Selection interface definitions
61 *
62 */
Sakari Ailus5689b282012-05-18 09:31:18 -030063
64/* Current cropping area */
65#define V4L2_SEL_TGT_CROP 0x0000
66/* Default cropping area */
67#define V4L2_SEL_TGT_CROP_DEFAULT 0x0001
68/* Cropping bounds */
69#define V4L2_SEL_TGT_CROP_BOUNDS 0x0002
Sakari Ailus0b4bc762014-10-15 13:38:15 -030070/* Native frame size */
71#define V4L2_SEL_TGT_NATIVE_SIZE 0x0003
Sakari Ailus5689b282012-05-18 09:31:18 -030072/* Current composing area */
73#define V4L2_SEL_TGT_COMPOSE 0x0100
74/* Default composing area */
75#define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101
76/* Composing bounds */
77#define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102
78/* Current composing area plus all padding pixels */
79#define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103
80
Sakari Ailus563df3d2012-06-13 16:01:10 -030081/* Backward compatibility target definitions --- to be removed. */
Sakari Ailus5689b282012-05-18 09:31:18 -030082#define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP
83#define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE
Sakari Ailus660e22c2012-07-30 05:08:47 -030084#define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP
85#define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE
86#define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS
87#define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS
Sakari Ailus5689b282012-05-18 09:31:18 -030088
Sakari Ailus563df3d2012-06-13 16:01:10 -030089/* Selection flags */
90#define V4L2_SEL_FLAG_GE (1 << 0)
91#define V4L2_SEL_FLAG_LE (1 << 1)
92#define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2)
93
94/* Backward compatibility flag definitions --- to be removed. */
95#define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE
96#define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE
97#define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG
98
Hans Verkuil254a4772014-03-04 07:46:47 -030099struct v4l2_edid {
100 __u32 pad;
101 __u32 start_block;
102 __u32 blocks;
103 __u32 reserved[5];
Hans Verkuil2dd477d2014-03-17 09:54:22 -0300104 __u8 *edid;
Hans Verkuil254a4772014-03-04 07:46:47 -0300105};
106
Sakari Ailus563df3d2012-06-13 16:01:10 -0300107#endif /* __V4L2_COMMON__ */