1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux << 2 /* 1 /* 3 * Copyright (C) 2013 - 2014 Texas Instruments 2 * Copyright (C) 2013 - 2014 Texas Instruments, Inc. 4 * 3 * 5 * Benoit Parrot <bparrot@ti.com> 4 * Benoit Parrot <bparrot@ti.com> 6 * Lad, Prabhakar <prabhakar.csengg@gmail.com> 5 * Lad, Prabhakar <prabhakar.csengg@gmail.com> 7 * 6 * 8 * This program is free software; you may redi 7 * This program is free software; you may redistribute it and/or modify 9 * it under the terms of the GNU General Publi 8 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; version 2 of 9 * the Free Software Foundation; version 2 of the License. 11 * 10 * 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT W 11 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 13 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMIT 12 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 14 * MERCHANTABILITY, FITNESS FOR A PARTICULAR P 13 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 15 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTH 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 16 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER L 15 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 17 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARIS 16 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 * CONNECTION WITH THE SOFTWARE OR THE USE OR 17 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 * SOFTWARE. 18 * SOFTWARE. 20 */ 19 */ 21 20 22 #ifndef AM437X_VPFE_USER_H 21 #ifndef AM437X_VPFE_USER_H 23 #define AM437X_VPFE_USER_H 22 #define AM437X_VPFE_USER_H 24 23 25 #include <linux/videodev2.h> 24 #include <linux/videodev2.h> 26 25 27 enum vpfe_ccdc_data_size { 26 enum vpfe_ccdc_data_size { 28 VPFE_CCDC_DATA_16BITS = 0, 27 VPFE_CCDC_DATA_16BITS = 0, 29 VPFE_CCDC_DATA_15BITS, 28 VPFE_CCDC_DATA_15BITS, 30 VPFE_CCDC_DATA_14BITS, 29 VPFE_CCDC_DATA_14BITS, 31 VPFE_CCDC_DATA_13BITS, 30 VPFE_CCDC_DATA_13BITS, 32 VPFE_CCDC_DATA_12BITS, 31 VPFE_CCDC_DATA_12BITS, 33 VPFE_CCDC_DATA_11BITS, 32 VPFE_CCDC_DATA_11BITS, 34 VPFE_CCDC_DATA_10BITS, 33 VPFE_CCDC_DATA_10BITS, 35 VPFE_CCDC_DATA_8BITS, 34 VPFE_CCDC_DATA_8BITS, 36 }; 35 }; 37 36 38 /* enum for No of pixel per line to be avg. in 37 /* enum for No of pixel per line to be avg. in Black Clamping*/ 39 enum vpfe_ccdc_sample_length { 38 enum vpfe_ccdc_sample_length { 40 VPFE_CCDC_SAMPLE_1PIXELS = 0, 39 VPFE_CCDC_SAMPLE_1PIXELS = 0, 41 VPFE_CCDC_SAMPLE_2PIXELS, 40 VPFE_CCDC_SAMPLE_2PIXELS, 42 VPFE_CCDC_SAMPLE_4PIXELS, 41 VPFE_CCDC_SAMPLE_4PIXELS, 43 VPFE_CCDC_SAMPLE_8PIXELS, 42 VPFE_CCDC_SAMPLE_8PIXELS, 44 VPFE_CCDC_SAMPLE_16PIXELS, 43 VPFE_CCDC_SAMPLE_16PIXELS, 45 }; 44 }; 46 45 47 /* enum for No of lines in Black Clamping */ 46 /* enum for No of lines in Black Clamping */ 48 enum vpfe_ccdc_sample_line { 47 enum vpfe_ccdc_sample_line { 49 VPFE_CCDC_SAMPLE_1LINES = 0, 48 VPFE_CCDC_SAMPLE_1LINES = 0, 50 VPFE_CCDC_SAMPLE_2LINES, 49 VPFE_CCDC_SAMPLE_2LINES, 51 VPFE_CCDC_SAMPLE_4LINES, 50 VPFE_CCDC_SAMPLE_4LINES, 52 VPFE_CCDC_SAMPLE_8LINES, 51 VPFE_CCDC_SAMPLE_8LINES, 53 VPFE_CCDC_SAMPLE_16LINES, 52 VPFE_CCDC_SAMPLE_16LINES, 54 }; 53 }; 55 54 56 /* enum for Alaw gamma width */ 55 /* enum for Alaw gamma width */ 57 enum vpfe_ccdc_gamma_width { 56 enum vpfe_ccdc_gamma_width { 58 VPFE_CCDC_GAMMA_BITS_15_6 = 0, /* use 57 VPFE_CCDC_GAMMA_BITS_15_6 = 0, /* use bits 15-6 for gamma */ 59 VPFE_CCDC_GAMMA_BITS_14_5, 58 VPFE_CCDC_GAMMA_BITS_14_5, 60 VPFE_CCDC_GAMMA_BITS_13_4, 59 VPFE_CCDC_GAMMA_BITS_13_4, 61 VPFE_CCDC_GAMMA_BITS_12_3, 60 VPFE_CCDC_GAMMA_BITS_12_3, 62 VPFE_CCDC_GAMMA_BITS_11_2, 61 VPFE_CCDC_GAMMA_BITS_11_2, 63 VPFE_CCDC_GAMMA_BITS_10_1, 62 VPFE_CCDC_GAMMA_BITS_10_1, 64 VPFE_CCDC_GAMMA_BITS_09_0, /* use 63 VPFE_CCDC_GAMMA_BITS_09_0, /* use bits 9-0 for gamma */ 65 }; 64 }; 66 65 67 /* structure for ALaw */ 66 /* structure for ALaw */ 68 struct vpfe_ccdc_a_law { 67 struct vpfe_ccdc_a_law { 69 /* Enable/disable A-Law */ 68 /* Enable/disable A-Law */ 70 unsigned char enable; 69 unsigned char enable; 71 /* Gamma Width Input */ 70 /* Gamma Width Input */ 72 enum vpfe_ccdc_gamma_width gamma_wd; 71 enum vpfe_ccdc_gamma_width gamma_wd; 73 }; 72 }; 74 73 75 /* structure for Black Clamping */ 74 /* structure for Black Clamping */ 76 struct vpfe_ccdc_black_clamp { 75 struct vpfe_ccdc_black_clamp { 77 unsigned char enable; 76 unsigned char enable; 78 /* only if bClampEnable is TRUE */ 77 /* only if bClampEnable is TRUE */ 79 enum vpfe_ccdc_sample_length sample_pi 78 enum vpfe_ccdc_sample_length sample_pixel; 80 /* only if bClampEnable is TRUE */ 79 /* only if bClampEnable is TRUE */ 81 enum vpfe_ccdc_sample_line sample_ln; 80 enum vpfe_ccdc_sample_line sample_ln; 82 /* only if bClampEnable is TRUE */ 81 /* only if bClampEnable is TRUE */ 83 unsigned short start_pixel; 82 unsigned short start_pixel; 84 /* only if bClampEnable is TRUE */ 83 /* only if bClampEnable is TRUE */ 85 unsigned short sgain; 84 unsigned short sgain; 86 /* only if bClampEnable is FALSE */ 85 /* only if bClampEnable is FALSE */ 87 unsigned short dc_sub; 86 unsigned short dc_sub; 88 }; 87 }; 89 88 90 /* structure for Black Level Compensation */ 89 /* structure for Black Level Compensation */ 91 struct vpfe_ccdc_black_compensation { 90 struct vpfe_ccdc_black_compensation { 92 /* Constant value to subtract from Red 91 /* Constant value to subtract from Red component */ 93 char r; 92 char r; 94 /* Constant value to subtract from Gr 93 /* Constant value to subtract from Gr component */ 95 char gr; 94 char gr; 96 /* Constant value to subtract from Blu 95 /* Constant value to subtract from Blue component */ 97 char b; 96 char b; 98 /* Constant value to subtract from Gb 97 /* Constant value to subtract from Gb component */ 99 char gb; 98 char gb; 100 }; 99 }; 101 100 102 /* Structure for CCDC configuration parameters 101 /* Structure for CCDC configuration parameters for raw capture mode passed 103 * by application 102 * by application 104 */ 103 */ 105 struct vpfe_ccdc_config_params_raw { 104 struct vpfe_ccdc_config_params_raw { 106 /* data size value from 8 to 16 bits * 105 /* data size value from 8 to 16 bits */ 107 enum vpfe_ccdc_data_size data_sz; 106 enum vpfe_ccdc_data_size data_sz; 108 /* Structure for Optional A-Law */ 107 /* Structure for Optional A-Law */ 109 struct vpfe_ccdc_a_law alaw; 108 struct vpfe_ccdc_a_law alaw; 110 /* Structure for Optical Black Clamp * 109 /* Structure for Optical Black Clamp */ 111 struct vpfe_ccdc_black_clamp blk_clamp 110 struct vpfe_ccdc_black_clamp blk_clamp; 112 /* Structure for Black Compensation */ 111 /* Structure for Black Compensation */ 113 struct vpfe_ccdc_black_compensation bl 112 struct vpfe_ccdc_black_compensation blk_comp; 114 }; 113 }; 115 114 116 /* 115 /* 117 * Private IOCTL 116 * Private IOCTL 118 * VIDIOC_AM437X_CCDC_CFG - Set CCDC configura 117 * VIDIOC_AM437X_CCDC_CFG - Set CCDC configuration for raw capture 119 * This is an experimental ioctl that will cha 118 * This is an experimental ioctl that will change in future kernels. So use 120 * this ioctl with care ! 119 * this ioctl with care ! 121 **/ 120 **/ 122 #define VIDIOC_AM437X_CCDC_CFG \ 121 #define VIDIOC_AM437X_CCDC_CFG \ 123 _IOW('V', BASE_VIDIOC_PRIVATE + 1, voi 122 _IOW('V', BASE_VIDIOC_PRIVATE + 1, void *) 124 123 125 #endif /* AM437X_VPFE_USER_H */ 124 #endif /* AM437X_VPFE_USER_H */ 126 125
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.