Nicholas Flintham | 1e3d311 | 2013-04-10 10:48:38 +0100 | [diff] [blame^] | 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 | #include <linux/v4l2-mediabus.h> |
| 29 | |
| 30 | enum v4l2_subdev_format_whence { |
| 31 | V4L2_SUBDEV_FORMAT_TRY = 0, |
| 32 | V4L2_SUBDEV_FORMAT_ACTIVE = 1, |
| 33 | }; |
| 34 | |
| 35 | struct v4l2_subdev_format { |
| 36 | __u32 which; |
| 37 | __u32 pad; |
| 38 | struct v4l2_mbus_framefmt format; |
| 39 | __u32 reserved[8]; |
| 40 | }; |
| 41 | |
| 42 | struct v4l2_subdev_crop { |
| 43 | __u32 which; |
| 44 | __u32 pad; |
| 45 | struct v4l2_rect rect; |
| 46 | __u32 reserved[8]; |
| 47 | }; |
| 48 | |
| 49 | struct v4l2_subdev_mbus_code_enum { |
| 50 | __u32 pad; |
| 51 | __u32 index; |
| 52 | __u32 code; |
| 53 | __u32 reserved[9]; |
| 54 | }; |
| 55 | |
| 56 | struct v4l2_subdev_frame_size_enum { |
| 57 | __u32 index; |
| 58 | __u32 pad; |
| 59 | __u32 code; |
| 60 | __u32 min_width; |
| 61 | __u32 max_width; |
| 62 | __u32 min_height; |
| 63 | __u32 max_height; |
| 64 | __u32 reserved[9]; |
| 65 | }; |
| 66 | |
| 67 | struct v4l2_subdev_frame_interval { |
| 68 | __u32 pad; |
| 69 | struct v4l2_fract interval; |
| 70 | __u32 reserved[9]; |
| 71 | }; |
| 72 | |
| 73 | struct v4l2_subdev_frame_interval_enum { |
| 74 | __u32 index; |
| 75 | __u32 pad; |
| 76 | __u32 code; |
| 77 | __u32 width; |
| 78 | __u32 height; |
| 79 | struct v4l2_fract interval; |
| 80 | __u32 reserved[9]; |
| 81 | }; |
| 82 | |
| 83 | #define VIDIOC_SUBDEV_G_FMT _IOWR('V', 4, struct v4l2_subdev_format) |
| 84 | #define VIDIOC_SUBDEV_S_FMT _IOWR('V', 5, struct v4l2_subdev_format) |
| 85 | #define VIDIOC_SUBDEV_G_FRAME_INTERVAL \ |
| 86 | _IOWR('V', 21, struct v4l2_subdev_frame_interval) |
| 87 | #define VIDIOC_SUBDEV_S_FRAME_INTERVAL \ |
| 88 | _IOWR('V', 22, struct v4l2_subdev_frame_interval) |
| 89 | #define VIDIOC_SUBDEV_ENUM_MBUS_CODE \ |
| 90 | _IOWR('V', 2, struct v4l2_subdev_mbus_code_enum) |
| 91 | #define VIDIOC_SUBDEV_ENUM_FRAME_SIZE \ |
| 92 | _IOWR('V', 74, struct v4l2_subdev_frame_size_enum) |
| 93 | #define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \ |
| 94 | _IOWR('V', 75, struct v4l2_subdev_frame_interval_enum) |
| 95 | #define VIDIOC_SUBDEV_G_CROP _IOWR('V', 59, struct v4l2_subdev_crop) |
| 96 | #define VIDIOC_SUBDEV_S_CROP _IOWR('V', 60, struct v4l2_subdev_crop) |
| 97 | |
| 98 | #endif |