1*e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) */ 2607ca46eSDavid Howells /* 3607ca46eSDavid Howells * include/linux/v4l2-common.h 4607ca46eSDavid Howells * 5607ca46eSDavid Howells * Common V4L2 and V4L2 subdev definitions. 6607ca46eSDavid Howells * 7607ca46eSDavid Howells * Users are advised to #include this file either through videodev2.h 8607ca46eSDavid Howells * (V4L2) or through v4l2-subdev.h (V4L2 subdev) rather than to refer 9607ca46eSDavid Howells * to this file directly. 10607ca46eSDavid Howells * 11607ca46eSDavid Howells * Copyright (C) 2012 Nokia Corporation 12607ca46eSDavid Howells * Contact: Sakari Ailus <sakari.ailus@iki.fi> 13607ca46eSDavid Howells * 1480100fd9SSakari Ailus * This program is free software; you can redistribute it and/or modify 1580100fd9SSakari Ailus * it under the terms of the GNU General Public License as published by 1680100fd9SSakari Ailus * the Free Software Foundation; either version 2 of the License, or 1780100fd9SSakari Ailus * (at your option) any later version. 18607ca46eSDavid Howells * 1980100fd9SSakari Ailus * This program is distributed in the hope that it will be useful, 2080100fd9SSakari Ailus * but WITHOUT ANY WARRANTY; without even the implied warranty of 2180100fd9SSakari Ailus * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2280100fd9SSakari Ailus * GNU General Public License for more details. 23607ca46eSDavid Howells * 2480100fd9SSakari Ailus * Alternatively you can redistribute this file under the terms of the 2580100fd9SSakari Ailus * BSD license as stated below: 2680100fd9SSakari Ailus * 2780100fd9SSakari Ailus * Redistribution and use in source and binary forms, with or without 2880100fd9SSakari Ailus * modification, are permitted provided that the following conditions 2980100fd9SSakari Ailus * are met: 3080100fd9SSakari Ailus * 1. Redistributions of source code must retain the above copyright 3180100fd9SSakari Ailus * notice, this list of conditions and the following disclaimer. 3280100fd9SSakari Ailus * 2. Redistributions in binary form must reproduce the above copyright 3380100fd9SSakari Ailus * notice, this list of conditions and the following disclaimer in 3480100fd9SSakari Ailus * the documentation and/or other materials provided with the 3580100fd9SSakari Ailus * distribution. 3680100fd9SSakari Ailus * 3. The names of its contributors may not be used to endorse or promote 3780100fd9SSakari Ailus * products derived from this software without specific prior written 3880100fd9SSakari Ailus * permission. 3980100fd9SSakari Ailus * 4080100fd9SSakari Ailus * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 4180100fd9SSakari Ailus * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 4280100fd9SSakari Ailus * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 4380100fd9SSakari Ailus * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 4480100fd9SSakari Ailus * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 4580100fd9SSakari Ailus * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 4680100fd9SSakari Ailus * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 4780100fd9SSakari Ailus * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 4880100fd9SSakari Ailus * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 4980100fd9SSakari Ailus * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 5080100fd9SSakari Ailus * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51607ca46eSDavid Howells * 52607ca46eSDavid Howells */ 53607ca46eSDavid Howells 54607ca46eSDavid Howells #ifndef __V4L2_COMMON__ 55607ca46eSDavid Howells #define __V4L2_COMMON__ 56607ca46eSDavid Howells 57773bcf8cSMauro Carvalho Chehab #include <linux/types.h> 58773bcf8cSMauro Carvalho Chehab 59607ca46eSDavid Howells /* 60607ca46eSDavid Howells * 61607ca46eSDavid Howells * Selection interface definitions 62607ca46eSDavid Howells * 63607ca46eSDavid Howells */ 64607ca46eSDavid Howells 65607ca46eSDavid Howells /* Current cropping area */ 66607ca46eSDavid Howells #define V4L2_SEL_TGT_CROP 0x0000 67607ca46eSDavid Howells /* Default cropping area */ 68607ca46eSDavid Howells #define V4L2_SEL_TGT_CROP_DEFAULT 0x0001 69607ca46eSDavid Howells /* Cropping bounds */ 70607ca46eSDavid Howells #define V4L2_SEL_TGT_CROP_BOUNDS 0x0002 710b4bc768SSakari Ailus /* Native frame size */ 720b4bc768SSakari Ailus #define V4L2_SEL_TGT_NATIVE_SIZE 0x0003 73607ca46eSDavid Howells /* Current composing area */ 74607ca46eSDavid Howells #define V4L2_SEL_TGT_COMPOSE 0x0100 75607ca46eSDavid Howells /* Default composing area */ 76607ca46eSDavid Howells #define V4L2_SEL_TGT_COMPOSE_DEFAULT 0x0101 77607ca46eSDavid Howells /* Composing bounds */ 78607ca46eSDavid Howells #define V4L2_SEL_TGT_COMPOSE_BOUNDS 0x0102 79607ca46eSDavid Howells /* Current composing area plus all padding pixels */ 80607ca46eSDavid Howells #define V4L2_SEL_TGT_COMPOSE_PADDED 0x0103 81607ca46eSDavid Howells 82607ca46eSDavid Howells /* Backward compatibility target definitions --- to be removed. */ 83607ca46eSDavid Howells #define V4L2_SEL_TGT_CROP_ACTIVE V4L2_SEL_TGT_CROP 84607ca46eSDavid Howells #define V4L2_SEL_TGT_COMPOSE_ACTIVE V4L2_SEL_TGT_COMPOSE 85607ca46eSDavid Howells #define V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL V4L2_SEL_TGT_CROP 86607ca46eSDavid Howells #define V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL V4L2_SEL_TGT_COMPOSE 87607ca46eSDavid Howells #define V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS V4L2_SEL_TGT_CROP_BOUNDS 88607ca46eSDavid Howells #define V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS V4L2_SEL_TGT_COMPOSE_BOUNDS 89607ca46eSDavid Howells 90607ca46eSDavid Howells /* Selection flags */ 91607ca46eSDavid Howells #define V4L2_SEL_FLAG_GE (1 << 0) 92607ca46eSDavid Howells #define V4L2_SEL_FLAG_LE (1 << 1) 93607ca46eSDavid Howells #define V4L2_SEL_FLAG_KEEP_CONFIG (1 << 2) 94607ca46eSDavid Howells 95607ca46eSDavid Howells /* Backward compatibility flag definitions --- to be removed. */ 96607ca46eSDavid Howells #define V4L2_SUBDEV_SEL_FLAG_SIZE_GE V4L2_SEL_FLAG_GE 97607ca46eSDavid Howells #define V4L2_SUBDEV_SEL_FLAG_SIZE_LE V4L2_SEL_FLAG_LE 98607ca46eSDavid Howells #define V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG V4L2_SEL_FLAG_KEEP_CONFIG 99607ca46eSDavid Howells 100254a4777SHans Verkuil struct v4l2_edid { 101254a4777SHans Verkuil __u32 pad; 102254a4777SHans Verkuil __u32 start_block; 103254a4777SHans Verkuil __u32 blocks; 104254a4777SHans Verkuil __u32 reserved[5]; 1052dd477dbSHans Verkuil __u8 *edid; 106254a4777SHans Verkuil }; 107254a4777SHans Verkuil 108607ca46eSDavid Howells #endif /* __V4L2_COMMON__ */ 109