1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef OMAP3_ISP_USER_H 7 #define OMAP3_ISP_USER_H 8 #include <linux/types.h> 9 #include <linux/videodev2.h> 10 #define VIDIOC_OMAP3ISP_CCDC_CFG \ 11 _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct omap3isp_ccdc_update_config) 12 #define VIDIOC_OMAP3ISP_PRV_CFG \ 13 _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct omap3isp_prev_update_config) 14 #define VIDIOC_OMAP3ISP_AEWB_CFG \ 15 _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct omap3isp_h3a_aewb_config) 16 #define VIDIOC_OMAP3ISP_HIST_CFG \ 17 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct omap3isp_hist_config) 18 #define VIDIOC_OMAP3ISP_AF_CFG \ 19 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct omap3isp_h3a_af_config) 20 #define VIDIOC_OMAP3ISP_STAT_REQ \ 21 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data) 22 #define VIDIOC_OMAP3ISP_STAT_REQ_TIME32 \ 23 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data_time32) 24 #define VIDIOC_OMAP3ISP_STAT_EN \ 25 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long) 26 #define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100) 27 #define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1) 28 #define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2) 29 #define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3) 30 struct omap3isp_stat_event_status { 31 __u32 frame_number; 32 __u16 config_counter; 33 __u8 buf_err; 34 }; 35 #define OMAP3ISP_AEWB_MAX_SATURATION_LIM 1023 36 #define OMAP3ISP_AEWB_MIN_WIN_H 2 37 #define OMAP3ISP_AEWB_MAX_WIN_H 256 38 #define OMAP3ISP_AEWB_MIN_WIN_W 6 39 #define OMAP3ISP_AEWB_MAX_WIN_W 256 40 #define OMAP3ISP_AEWB_MIN_WINVC 1 41 #define OMAP3ISP_AEWB_MIN_WINHC 1 42 #define OMAP3ISP_AEWB_MAX_WINVC 128 43 #define OMAP3ISP_AEWB_MAX_WINHC 36 44 #define OMAP3ISP_AEWB_MAX_WINSTART 4095 45 #define OMAP3ISP_AEWB_MIN_SUB_INC 2 46 #define OMAP3ISP_AEWB_MAX_SUB_INC 32 47 #define OMAP3ISP_AEWB_MAX_BUF_SIZE 83600 48 #define OMAP3ISP_AF_IIRSH_MIN 0 49 #define OMAP3ISP_AF_IIRSH_MAX 4095 50 #define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MIN 1 51 #define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MAX 36 52 #define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MIN 1 53 #define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MAX 128 54 #define OMAP3ISP_AF_PAXEL_INCREMENT_MIN 2 55 #define OMAP3ISP_AF_PAXEL_INCREMENT_MAX 32 56 #define OMAP3ISP_AF_PAXEL_HEIGHT_MIN 2 57 #define OMAP3ISP_AF_PAXEL_HEIGHT_MAX 256 58 #define OMAP3ISP_AF_PAXEL_WIDTH_MIN 16 59 #define OMAP3ISP_AF_PAXEL_WIDTH_MAX 256 60 #define OMAP3ISP_AF_PAXEL_HZSTART_MIN 1 61 #define OMAP3ISP_AF_PAXEL_HZSTART_MAX 4095 62 #define OMAP3ISP_AF_PAXEL_VTSTART_MIN 0 63 #define OMAP3ISP_AF_PAXEL_VTSTART_MAX 4095 64 #define OMAP3ISP_AF_THRESHOLD_MAX 255 65 #define OMAP3ISP_AF_COEF_MAX 4095 66 #define OMAP3ISP_AF_PAXEL_SIZE 48 67 #define OMAP3ISP_AF_MAX_BUF_SIZE 221184 68 struct omap3isp_h3a_aewb_config { 69 70 __u32 buf_size; 71 __u16 config_counter; 72 73 __u16 saturation_limit; 74 __u16 win_height; 75 __u16 win_width; 76 __u16 ver_win_count; 77 __u16 hor_win_count; 78 __u16 ver_win_start; 79 __u16 hor_win_start; 80 __u16 blk_ver_win_start; 81 __u16 blk_win_height; 82 __u16 subsample_ver_inc; 83 __u16 subsample_hor_inc; 84 __u8 alaw_enable; 85 }; 86 struct omap3isp_stat_data { 87 #ifdef __KERNEL__ 88 struct { 89 __s64 tv_sec; 90 __s64 tv_usec; 91 } ts; 92 #else 93 struct timeval ts; 94 #endif 95 void __user *buf; 96 __u32 buf_size; 97 __u16 frame_number; 98 __u16 cur_frame; 99 __u16 config_counter; 100 }; 101 #ifdef __KERNEL__ 102 struct omap3isp_stat_data_time32 { 103 struct { 104 __s32 tv_sec; 105 __s32 tv_usec; 106 } ts; 107 __u32 buf; 108 __u32 buf_size; 109 __u16 frame_number; 110 __u16 cur_frame; 111 __u16 config_counter; 112 }; 113 #endif 114 #define OMAP3ISP_HIST_BINS_32 0 115 #define OMAP3ISP_HIST_BINS_64 1 116 #define OMAP3ISP_HIST_BINS_128 2 117 #define OMAP3ISP_HIST_BINS_256 3 118 #define OMAP3ISP_HIST_MEM_SIZE_BINS(n) ((1 << ((n)+5))*4*4) 119 #define OMAP3ISP_HIST_MEM_SIZE 1024 120 #define OMAP3ISP_HIST_MIN_REGIONS 1 121 #define OMAP3ISP_HIST_MAX_REGIONS 4 122 #define OMAP3ISP_HIST_MAX_WB_GAIN 255 123 #define OMAP3ISP_HIST_MIN_WB_GAIN 0 124 #define OMAP3ISP_HIST_MAX_BIT_WIDTH 14 125 #define OMAP3ISP_HIST_MIN_BIT_WIDTH 8 126 #define OMAP3ISP_HIST_MAX_WG 4 127 #define OMAP3ISP_HIST_MAX_BUF_SIZE 4096 128 #define OMAP3ISP_HIST_SOURCE_CCDC 0 129 #define OMAP3ISP_HIST_SOURCE_MEM 1 130 #define OMAP3ISP_HIST_CFA_BAYER 0 131 #define OMAP3ISP_HIST_CFA_FOVEONX3 1 132 struct omap3isp_hist_region { 133 __u16 h_start; 134 __u16 h_end; 135 __u16 v_start; 136 __u16 v_end; 137 }; 138 struct omap3isp_hist_config { 139 140 __u32 buf_size; 141 __u16 config_counter; 142 __u8 num_acc_frames; 143 __u16 hist_bins; 144 __u8 cfa; 145 __u8 wg[OMAP3ISP_HIST_MAX_WG]; 146 __u8 num_regions; 147 struct omap3isp_hist_region region[OMAP3ISP_HIST_MAX_REGIONS]; 148 }; 149 #define OMAP3ISP_AF_NUM_COEF 11 150 enum omap3isp_h3a_af_fvmode { 151 OMAP3ISP_AF_MODE_SUMMED = 0, 152 OMAP3ISP_AF_MODE_PEAK = 1 153 }; 154 enum omap3isp_h3a_af_rgbpos { 155 OMAP3ISP_AF_GR_GB_BAYER = 0, 156 OMAP3ISP_AF_RG_GB_BAYER = 1, 157 OMAP3ISP_AF_GR_BG_BAYER = 2, 158 OMAP3ISP_AF_RG_BG_BAYER = 3, 159 OMAP3ISP_AF_GG_RB_CUSTOM = 4, 160 OMAP3ISP_AF_RB_GG_CUSTOM = 5 161 }; 162 struct omap3isp_h3a_af_hmf { 163 __u8 enable; 164 __u8 threshold; 165 }; 166 struct omap3isp_h3a_af_iir { 167 __u16 h_start; 168 __u16 coeff_set0[OMAP3ISP_AF_NUM_COEF]; 169 __u16 coeff_set1[OMAP3ISP_AF_NUM_COEF]; 170 }; 171 struct omap3isp_h3a_af_paxel { 172 __u16 h_start; 173 __u16 v_start; 174 __u8 width; 175 __u8 height; 176 __u8 h_cnt; 177 __u8 v_cnt; 178 __u8 line_inc; 179 }; 180 struct omap3isp_h3a_af_config { 181 182 __u32 buf_size; 183 __u16 config_counter; 184 struct omap3isp_h3a_af_hmf hmf; 185 struct omap3isp_h3a_af_iir iir; 186 struct omap3isp_h3a_af_paxel paxel; 187 enum omap3isp_h3a_af_rgbpos rgb_pos; 188 enum omap3isp_h3a_af_fvmode fvmode; 189 __u8 alaw_enable; 190 }; 191 #define OMAP3ISP_CCDC_ALAW (1 << 0) 192 #define OMAP3ISP_CCDC_LPF (1 << 1) 193 #define OMAP3ISP_CCDC_BLCLAMP (1 << 2) 194 #define OMAP3ISP_CCDC_BCOMP (1 << 3) 195 #define OMAP3ISP_CCDC_FPC (1 << 4) 196 #define OMAP3ISP_CCDC_CULL (1 << 5) 197 #define OMAP3ISP_CCDC_CONFIG_LSC (1 << 7) 198 #define OMAP3ISP_CCDC_TBL_LSC (1 << 8) 199 #define OMAP3ISP_RGB_MAX 3 200 enum omap3isp_alaw_ipwidth { 201 OMAP3ISP_ALAW_BIT12_3 = 0x3, 202 OMAP3ISP_ALAW_BIT11_2 = 0x4, 203 OMAP3ISP_ALAW_BIT10_1 = 0x5, 204 OMAP3ISP_ALAW_BIT9_0 = 0x6 205 }; 206 struct omap3isp_ccdc_lsc_config { 207 __u16 offset; 208 __u8 gain_mode_n; 209 __u8 gain_mode_m; 210 __u8 gain_format; 211 __u16 fmtsph; 212 __u16 fmtlnh; 213 __u16 fmtslv; 214 __u16 fmtlnv; 215 __u8 initial_x; 216 __u8 initial_y; 217 __u32 size; 218 }; 219 struct omap3isp_ccdc_bclamp { 220 __u8 obgain; 221 __u8 obstpixel; 222 __u8 oblines; 223 __u8 oblen; 224 __u16 dcsubval; 225 }; 226 struct omap3isp_ccdc_fpc { 227 __u16 fpnum; 228 __u32 fpcaddr; 229 }; 230 struct omap3isp_ccdc_blcomp { 231 __u8 b_mg; 232 __u8 gb_g; 233 __u8 gr_cy; 234 __u8 r_ye; 235 }; 236 struct omap3isp_ccdc_culling { 237 __u8 v_pattern; 238 __u16 h_odd; 239 __u16 h_even; 240 }; 241 struct omap3isp_ccdc_update_config { 242 __u16 update; 243 __u16 flag; 244 enum omap3isp_alaw_ipwidth alawip; 245 struct omap3isp_ccdc_bclamp __user *bclamp; 246 struct omap3isp_ccdc_blcomp __user *blcomp; 247 struct omap3isp_ccdc_fpc __user *fpc; 248 struct omap3isp_ccdc_lsc_config __user *lsc_cfg; 249 struct omap3isp_ccdc_culling __user *cull; 250 __u8 __user *lsc; 251 }; 252 #define OMAP3ISP_PREV_LUMAENH (1 << 0) 253 #define OMAP3ISP_PREV_INVALAW (1 << 1) 254 #define OMAP3ISP_PREV_HRZ_MED (1 << 2) 255 #define OMAP3ISP_PREV_CFA (1 << 3) 256 #define OMAP3ISP_PREV_CHROMA_SUPP (1 << 4) 257 #define OMAP3ISP_PREV_WB (1 << 5) 258 #define OMAP3ISP_PREV_BLKADJ (1 << 6) 259 #define OMAP3ISP_PREV_RGB2RGB (1 << 7) 260 #define OMAP3ISP_PREV_COLOR_CONV (1 << 8) 261 #define OMAP3ISP_PREV_YC_LIMIT (1 << 9) 262 #define OMAP3ISP_PREV_DEFECT_COR (1 << 10) 263 #define OMAP3ISP_PREV_DRK_FRM_CAPTURE (1 << 12) 264 #define OMAP3ISP_PREV_DRK_FRM_SUBTRACT (1 << 13) 265 #define OMAP3ISP_PREV_LENS_SHADING (1 << 14) 266 #define OMAP3ISP_PREV_NF (1 << 15) 267 #define OMAP3ISP_PREV_GAMMA (1 << 16) 268 #define OMAP3ISP_PREV_NF_TBL_SIZE 64 269 #define OMAP3ISP_PREV_CFA_TBL_SIZE 576 270 #define OMAP3ISP_PREV_CFA_BLK_SIZE (OMAP3ISP_PREV_CFA_TBL_SIZE / 4) 271 #define OMAP3ISP_PREV_GAMMA_TBL_SIZE 1024 272 #define OMAP3ISP_PREV_YENH_TBL_SIZE 128 273 #define OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS 4 274 struct omap3isp_prev_hmed { 275 __u8 odddist; 276 __u8 evendist; 277 __u8 thres; 278 }; 279 enum omap3isp_cfa_fmt { 280 OMAP3ISP_CFAFMT_BAYER, 281 OMAP3ISP_CFAFMT_SONYVGA, 282 OMAP3ISP_CFAFMT_RGBFOVEON, 283 OMAP3ISP_CFAFMT_DNSPL, 284 OMAP3ISP_CFAFMT_HONEYCOMB, 285 OMAP3ISP_CFAFMT_RRGGBBFOVEON 286 }; 287 struct omap3isp_prev_cfa { 288 enum omap3isp_cfa_fmt format; 289 __u8 gradthrs_vert; 290 __u8 gradthrs_horz; 291 __u32 table[4][OMAP3ISP_PREV_CFA_BLK_SIZE]; 292 }; 293 struct omap3isp_prev_csup { 294 __u8 gain; 295 __u8 thres; 296 __u8 hypf_en; 297 }; 298 struct omap3isp_prev_wbal { 299 __u16 dgain; 300 __u8 coef3; 301 __u8 coef2; 302 __u8 coef1; 303 __u8 coef0; 304 }; 305 struct omap3isp_prev_blkadj { 306 307 __u8 red; 308 309 __u8 green; 310 311 __u8 blue; 312 }; 313 struct omap3isp_prev_rgbtorgb { 314 __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX]; 315 __u16 offset[OMAP3ISP_RGB_MAX]; 316 }; 317 struct omap3isp_prev_csc { 318 __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX]; 319 __s16 offset[OMAP3ISP_RGB_MAX]; 320 }; 321 struct omap3isp_prev_yclimit { 322 __u8 minC; 323 __u8 maxC; 324 __u8 minY; 325 __u8 maxY; 326 }; 327 struct omap3isp_prev_dcor { 328 __u8 couplet_mode_en; 329 __u32 detect_correct[OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS]; 330 }; 331 struct omap3isp_prev_nf { 332 __u8 spread; 333 __u32 table[OMAP3ISP_PREV_NF_TBL_SIZE]; 334 }; 335 struct omap3isp_prev_gtables { 336 __u32 red[OMAP3ISP_PREV_GAMMA_TBL_SIZE]; 337 __u32 green[OMAP3ISP_PREV_GAMMA_TBL_SIZE]; 338 __u32 blue[OMAP3ISP_PREV_GAMMA_TBL_SIZE]; 339 }; 340 struct omap3isp_prev_luma { 341 __u32 table[OMAP3ISP_PREV_YENH_TBL_SIZE]; 342 }; 343 struct omap3isp_prev_update_config { 344 __u32 update; 345 __u32 flag; 346 __u32 shading_shift; 347 struct omap3isp_prev_luma __user *luma; 348 struct omap3isp_prev_hmed __user *hmed; 349 struct omap3isp_prev_cfa __user *cfa; 350 struct omap3isp_prev_csup __user *csup; 351 struct omap3isp_prev_wbal __user *wbal; 352 struct omap3isp_prev_blkadj __user *blkadj; 353 struct omap3isp_prev_rgbtorgb __user *rgb2rgb; 354 struct omap3isp_prev_csc __user *csc; 355 struct omap3isp_prev_yclimit __user *yclimit; 356 struct omap3isp_prev_dcor __user *dcor; 357 struct omap3isp_prev_nf __user *nf; 358 struct omap3isp_prev_gtables __user *gamma; 359 }; 360 #endif 361