Changed sources for compiling
[platform/adaptation/ap_samsung/libomxil-e3250-v4l2.git] / exynos / kernel_header / v4l2-subdev.h
1 /*
2  * V4L2 subdev userspace API
3  *
4  * Copyright (C) 2010 Nokia Corporation
5  *
6  * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
7  *           Sakari Ailus <sakari.ailus@iki.fi>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef __LINUX_V4L2_SUBDEV_H
24 #define __LINUX_V4L2_SUBDEV_H
25
26 #include <linux/ioctl.h>
27 #include <linux/types.h>
28 #ifdef KERNEL_HEADER_MODIFICATION
29 #include "v4l2-mediabus.h"
30 #else
31 #include <linux/v4l2-mediabus.h>
32 #endif
33
34 /**
35  * enum v4l2_subdev_format_whence - Media bus format type
36  * @V4L2_SUBDEV_FORMAT_TRY: try format, for negotiation only
37  * @V4L2_SUBDEV_FORMAT_ACTIVE: active format, applied to the device
38  */
39 enum v4l2_subdev_format_whence {
40         V4L2_SUBDEV_FORMAT_TRY = 0,
41         V4L2_SUBDEV_FORMAT_ACTIVE = 1,
42 };
43
44 /**
45  * struct v4l2_subdev_format - Pad-level media bus format
46  * @which: format type (from enum v4l2_subdev_format_whence)
47  * @pad: pad number, as reported by the media API
48  * @format: media bus format (format code and frame size)
49  */
50 struct v4l2_subdev_format {
51         __u32 which;
52         __u32 pad;
53         struct v4l2_mbus_framefmt format;
54         __u32 reserved[8];
55 };
56
57 /**
58  * struct v4l2_subdev_crop - Pad-level crop settings
59  * @which: format type (from enum v4l2_subdev_format_whence)
60  * @pad: pad number, as reported by the media API
61  * @rect: pad crop rectangle boundaries
62  */
63 struct v4l2_subdev_crop {
64         __u32 which;
65         __u32 pad;
66         struct v4l2_rect rect;
67         __u32 reserved[8];
68 };
69
70 /**
71  * struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
72  * @pad: pad number, as reported by the media API
73  * @index: format index during enumeration
74  * @code: format code (from enum v4l2_mbus_pixelcode)
75  */
76 struct v4l2_subdev_mbus_code_enum {
77         __u32 pad;
78         __u32 index;
79         __u32 code;
80         __u32 reserved[9];
81 };
82
83 /**
84  * struct v4l2_subdev_frame_size_enum - Media bus format enumeration
85  * @pad: pad number, as reported by the media API
86  * @index: format index during enumeration
87  * @code: format code (from enum v4l2_mbus_pixelcode)
88  */
89 struct v4l2_subdev_frame_size_enum {
90         __u32 index;
91         __u32 pad;
92         __u32 code;
93         __u32 min_width;
94         __u32 max_width;
95         __u32 min_height;
96         __u32 max_height;
97         __u32 reserved[9];
98 };
99
100 /**
101  * struct v4l2_subdev_frame_interval - Pad-level frame rate
102  * @pad: pad number, as reported by the media API
103  * @interval: frame interval in seconds
104  */
105 struct v4l2_subdev_frame_interval {
106         __u32 pad;
107         struct v4l2_fract interval;
108         __u32 reserved[9];
109 };
110
111 /**
112  * struct v4l2_subdev_frame_interval_enum - Frame interval enumeration
113  * @pad: pad number, as reported by the media API
114  * @index: frame interval index during enumeration
115  * @code: format code (from enum v4l2_mbus_pixelcode)
116  * @width: frame width in pixels
117  * @height: frame height in pixels
118  * @interval: frame interval in seconds
119  */
120 struct v4l2_subdev_frame_interval_enum {
121         __u32 index;
122         __u32 pad;
123         __u32 code;
124         __u32 width;
125         __u32 height;
126         struct v4l2_fract interval;
127         __u32 reserved[9];
128 };
129
130 #define VIDIOC_SUBDEV_G_FMT     _IOWR('V',  4, struct v4l2_subdev_format)
131 #define VIDIOC_SUBDEV_S_FMT     _IOWR('V',  5, struct v4l2_subdev_format)
132 #define VIDIOC_SUBDEV_G_FRAME_INTERVAL \
133                         _IOWR('V', 21, struct v4l2_subdev_frame_interval)
134 #define VIDIOC_SUBDEV_S_FRAME_INTERVAL \
135                         _IOWR('V', 22, struct v4l2_subdev_frame_interval)
136 #define VIDIOC_SUBDEV_ENUM_MBUS_CODE \
137                         _IOWR('V',  2, struct v4l2_subdev_mbus_code_enum)
138 #define VIDIOC_SUBDEV_ENUM_FRAME_SIZE \
139                         _IOWR('V', 74, struct v4l2_subdev_frame_size_enum)
140 #define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \
141                         _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum)
142 #define VIDIOC_SUBDEV_G_CROP    _IOWR('V', 59, struct v4l2_subdev_crop)
143 #define VIDIOC_SUBDEV_S_CROP    _IOWR('V', 60, struct v4l2_subdev_crop)
144
145 #endif