0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #ifndef OMAP3_ISP_USER_H
0029 #define OMAP3_ISP_USER_H
0030
0031 #include <linux/types.h>
0032 #include <linux/videodev2.h>
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 #define VIDIOC_OMAP3ISP_CCDC_CFG \
0047 _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct omap3isp_ccdc_update_config)
0048 #define VIDIOC_OMAP3ISP_PRV_CFG \
0049 _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct omap3isp_prev_update_config)
0050 #define VIDIOC_OMAP3ISP_AEWB_CFG \
0051 _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct omap3isp_h3a_aewb_config)
0052 #define VIDIOC_OMAP3ISP_HIST_CFG \
0053 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct omap3isp_hist_config)
0054 #define VIDIOC_OMAP3ISP_AF_CFG \
0055 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct omap3isp_h3a_af_config)
0056 #define VIDIOC_OMAP3ISP_STAT_REQ \
0057 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data)
0058 #define VIDIOC_OMAP3ISP_STAT_REQ_TIME32 \
0059 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data_time32)
0060 #define VIDIOC_OMAP3ISP_STAT_EN \
0061 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long)
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071 #define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100)
0072 #define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1)
0073 #define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2)
0074 #define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3)
0075
0076 struct omap3isp_stat_event_status {
0077 __u32 frame_number;
0078 __u16 config_counter;
0079 __u8 buf_err;
0080 };
0081
0082
0083
0084
0085 #define OMAP3ISP_AEWB_MAX_SATURATION_LIM 1023
0086 #define OMAP3ISP_AEWB_MIN_WIN_H 2
0087 #define OMAP3ISP_AEWB_MAX_WIN_H 256
0088 #define OMAP3ISP_AEWB_MIN_WIN_W 6
0089 #define OMAP3ISP_AEWB_MAX_WIN_W 256
0090 #define OMAP3ISP_AEWB_MIN_WINVC 1
0091 #define OMAP3ISP_AEWB_MIN_WINHC 1
0092 #define OMAP3ISP_AEWB_MAX_WINVC 128
0093 #define OMAP3ISP_AEWB_MAX_WINHC 36
0094 #define OMAP3ISP_AEWB_MAX_WINSTART 4095
0095 #define OMAP3ISP_AEWB_MIN_SUB_INC 2
0096 #define OMAP3ISP_AEWB_MAX_SUB_INC 32
0097 #define OMAP3ISP_AEWB_MAX_BUF_SIZE 83600
0098
0099 #define OMAP3ISP_AF_IIRSH_MIN 0
0100 #define OMAP3ISP_AF_IIRSH_MAX 4095
0101 #define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MIN 1
0102 #define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MAX 36
0103 #define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MIN 1
0104 #define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MAX 128
0105 #define OMAP3ISP_AF_PAXEL_INCREMENT_MIN 2
0106 #define OMAP3ISP_AF_PAXEL_INCREMENT_MAX 32
0107 #define OMAP3ISP_AF_PAXEL_HEIGHT_MIN 2
0108 #define OMAP3ISP_AF_PAXEL_HEIGHT_MAX 256
0109 #define OMAP3ISP_AF_PAXEL_WIDTH_MIN 16
0110 #define OMAP3ISP_AF_PAXEL_WIDTH_MAX 256
0111 #define OMAP3ISP_AF_PAXEL_HZSTART_MIN 1
0112 #define OMAP3ISP_AF_PAXEL_HZSTART_MAX 4095
0113 #define OMAP3ISP_AF_PAXEL_VTSTART_MIN 0
0114 #define OMAP3ISP_AF_PAXEL_VTSTART_MAX 4095
0115 #define OMAP3ISP_AF_THRESHOLD_MAX 255
0116 #define OMAP3ISP_AF_COEF_MAX 4095
0117 #define OMAP3ISP_AF_PAXEL_SIZE 48
0118 #define OMAP3ISP_AF_MAX_BUF_SIZE 221184
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137 struct omap3isp_h3a_aewb_config {
0138
0139
0140
0141
0142
0143 __u32 buf_size;
0144 __u16 config_counter;
0145
0146
0147 __u16 saturation_limit;
0148 __u16 win_height;
0149 __u16 win_width;
0150 __u16 ver_win_count;
0151 __u16 hor_win_count;
0152 __u16 ver_win_start;
0153 __u16 hor_win_start;
0154 __u16 blk_ver_win_start;
0155 __u16 blk_win_height;
0156 __u16 subsample_ver_inc;
0157 __u16 subsample_hor_inc;
0158 __u8 alaw_enable;
0159 };
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170 struct omap3isp_stat_data {
0171 #ifdef __KERNEL__
0172 struct {
0173 __s64 tv_sec;
0174 __s64 tv_usec;
0175 } ts;
0176 #else
0177 struct timeval ts;
0178 #endif
0179 void __user *buf;
0180 __struct_group(, frame, ,
0181 __u32 buf_size;
0182 __u16 frame_number;
0183 __u16 cur_frame;
0184 __u16 config_counter;
0185 );
0186 };
0187
0188 #ifdef __KERNEL__
0189 struct omap3isp_stat_data_time32 {
0190 struct {
0191 __s32 tv_sec;
0192 __s32 tv_usec;
0193 } ts;
0194 __u32 buf;
0195 __struct_group(, frame, ,
0196 __u32 buf_size;
0197 __u16 frame_number;
0198 __u16 cur_frame;
0199 __u16 config_counter;
0200 );
0201 };
0202 #endif
0203
0204
0205
0206
0207 #define OMAP3ISP_HIST_BINS_32 0
0208 #define OMAP3ISP_HIST_BINS_64 1
0209 #define OMAP3ISP_HIST_BINS_128 2
0210 #define OMAP3ISP_HIST_BINS_256 3
0211
0212
0213 #define OMAP3ISP_HIST_MEM_SIZE_BINS(n) ((1 << ((n)+5))*4*4)
0214
0215 #define OMAP3ISP_HIST_MEM_SIZE 1024
0216 #define OMAP3ISP_HIST_MIN_REGIONS 1
0217 #define OMAP3ISP_HIST_MAX_REGIONS 4
0218 #define OMAP3ISP_HIST_MAX_WB_GAIN 255
0219 #define OMAP3ISP_HIST_MIN_WB_GAIN 0
0220 #define OMAP3ISP_HIST_MAX_BIT_WIDTH 14
0221 #define OMAP3ISP_HIST_MIN_BIT_WIDTH 8
0222 #define OMAP3ISP_HIST_MAX_WG 4
0223 #define OMAP3ISP_HIST_MAX_BUF_SIZE 4096
0224
0225
0226 #define OMAP3ISP_HIST_SOURCE_CCDC 0
0227 #define OMAP3ISP_HIST_SOURCE_MEM 1
0228
0229
0230 #define OMAP3ISP_HIST_CFA_BAYER 0
0231 #define OMAP3ISP_HIST_CFA_FOVEONX3 1
0232
0233 struct omap3isp_hist_region {
0234 __u16 h_start;
0235 __u16 h_end;
0236 __u16 v_start;
0237 __u16 v_end;
0238 };
0239
0240 struct omap3isp_hist_config {
0241
0242
0243
0244
0245
0246 __u32 buf_size;
0247 __u16 config_counter;
0248
0249 __u8 num_acc_frames;
0250
0251 __u16 hist_bins;
0252 __u8 cfa;
0253 __u8 wg[OMAP3ISP_HIST_MAX_WG];
0254 __u8 num_regions;
0255 struct omap3isp_hist_region region[OMAP3ISP_HIST_MAX_REGIONS];
0256 };
0257
0258
0259
0260 #define OMAP3ISP_AF_NUM_COEF 11
0261
0262 enum omap3isp_h3a_af_fvmode {
0263 OMAP3ISP_AF_MODE_SUMMED = 0,
0264 OMAP3ISP_AF_MODE_PEAK = 1
0265 };
0266
0267
0268 enum omap3isp_h3a_af_rgbpos {
0269 OMAP3ISP_AF_GR_GB_BAYER = 0,
0270 OMAP3ISP_AF_RG_GB_BAYER = 1,
0271 OMAP3ISP_AF_GR_BG_BAYER = 2,
0272 OMAP3ISP_AF_RG_BG_BAYER = 3,
0273 OMAP3ISP_AF_GG_RB_CUSTOM = 4,
0274 OMAP3ISP_AF_RB_GG_CUSTOM = 5
0275 };
0276
0277
0278 struct omap3isp_h3a_af_hmf {
0279 __u8 enable;
0280 __u8 threshold;
0281 };
0282
0283
0284 struct omap3isp_h3a_af_iir {
0285 __u16 h_start;
0286 __u16 coeff_set0[OMAP3ISP_AF_NUM_COEF];
0287 __u16 coeff_set1[OMAP3ISP_AF_NUM_COEF];
0288 };
0289
0290
0291 struct omap3isp_h3a_af_paxel {
0292 __u16 h_start;
0293 __u16 v_start;
0294 __u8 width;
0295 __u8 height;
0296 __u8 h_cnt;
0297 __u8 v_cnt;
0298 __u8 line_inc;
0299 };
0300
0301
0302 struct omap3isp_h3a_af_config {
0303
0304
0305
0306
0307
0308 __u32 buf_size;
0309 __u16 config_counter;
0310
0311 struct omap3isp_h3a_af_hmf hmf;
0312 struct omap3isp_h3a_af_iir iir;
0313 struct omap3isp_h3a_af_paxel paxel;
0314 enum omap3isp_h3a_af_rgbpos rgb_pos;
0315 enum omap3isp_h3a_af_fvmode fvmode;
0316 __u8 alaw_enable;
0317 };
0318
0319
0320
0321
0322 #define OMAP3ISP_CCDC_ALAW (1 << 0)
0323 #define OMAP3ISP_CCDC_LPF (1 << 1)
0324 #define OMAP3ISP_CCDC_BLCLAMP (1 << 2)
0325 #define OMAP3ISP_CCDC_BCOMP (1 << 3)
0326 #define OMAP3ISP_CCDC_FPC (1 << 4)
0327 #define OMAP3ISP_CCDC_CULL (1 << 5)
0328 #define OMAP3ISP_CCDC_CONFIG_LSC (1 << 7)
0329 #define OMAP3ISP_CCDC_TBL_LSC (1 << 8)
0330
0331 #define OMAP3ISP_RGB_MAX 3
0332
0333
0334 enum omap3isp_alaw_ipwidth {
0335 OMAP3ISP_ALAW_BIT12_3 = 0x3,
0336 OMAP3ISP_ALAW_BIT11_2 = 0x4,
0337 OMAP3ISP_ALAW_BIT10_1 = 0x5,
0338 OMAP3ISP_ALAW_BIT9_0 = 0x6
0339 };
0340
0341
0342
0343
0344
0345
0346
0347
0348
0349
0350
0351
0352
0353
0354
0355
0356
0357
0358 struct omap3isp_ccdc_lsc_config {
0359 __u16 offset;
0360 __u8 gain_mode_n;
0361 __u8 gain_mode_m;
0362 __u8 gain_format;
0363 __u16 fmtsph;
0364 __u16 fmtlnh;
0365 __u16 fmtslv;
0366 __u16 fmtlnv;
0367 __u8 initial_x;
0368 __u8 initial_y;
0369 __u32 size;
0370 };
0371
0372
0373
0374
0375
0376
0377
0378
0379
0380 struct omap3isp_ccdc_bclamp {
0381 __u8 obgain;
0382 __u8 obstpixel;
0383 __u8 oblines;
0384 __u8 oblen;
0385 __u16 dcsubval;
0386 };
0387
0388
0389
0390
0391
0392
0393 struct omap3isp_ccdc_fpc {
0394 __u16 fpnum;
0395 __u32 fpcaddr;
0396 };
0397
0398
0399
0400
0401
0402
0403
0404
0405 struct omap3isp_ccdc_blcomp {
0406 __u8 b_mg;
0407 __u8 gb_g;
0408 __u8 gr_cy;
0409 __u8 r_ye;
0410 };
0411
0412
0413
0414
0415
0416
0417
0418 struct omap3isp_ccdc_culling {
0419 __u8 v_pattern;
0420 __u16 h_odd;
0421 __u16 h_even;
0422 };
0423
0424
0425
0426
0427
0428
0429
0430
0431
0432
0433
0434
0435 struct omap3isp_ccdc_update_config {
0436 __u16 update;
0437 __u16 flag;
0438 enum omap3isp_alaw_ipwidth alawip;
0439 struct omap3isp_ccdc_bclamp __user *bclamp;
0440 struct omap3isp_ccdc_blcomp __user *blcomp;
0441 struct omap3isp_ccdc_fpc __user *fpc;
0442 struct omap3isp_ccdc_lsc_config __user *lsc_cfg;
0443 struct omap3isp_ccdc_culling __user *cull;
0444 __u8 __user *lsc;
0445 };
0446
0447
0448 #define OMAP3ISP_PREV_LUMAENH (1 << 0)
0449 #define OMAP3ISP_PREV_INVALAW (1 << 1)
0450 #define OMAP3ISP_PREV_HRZ_MED (1 << 2)
0451 #define OMAP3ISP_PREV_CFA (1 << 3)
0452 #define OMAP3ISP_PREV_CHROMA_SUPP (1 << 4)
0453 #define OMAP3ISP_PREV_WB (1 << 5)
0454 #define OMAP3ISP_PREV_BLKADJ (1 << 6)
0455 #define OMAP3ISP_PREV_RGB2RGB (1 << 7)
0456 #define OMAP3ISP_PREV_COLOR_CONV (1 << 8)
0457 #define OMAP3ISP_PREV_YC_LIMIT (1 << 9)
0458 #define OMAP3ISP_PREV_DEFECT_COR (1 << 10)
0459
0460 #define OMAP3ISP_PREV_DRK_FRM_CAPTURE (1 << 12)
0461 #define OMAP3ISP_PREV_DRK_FRM_SUBTRACT (1 << 13)
0462 #define OMAP3ISP_PREV_LENS_SHADING (1 << 14)
0463 #define OMAP3ISP_PREV_NF (1 << 15)
0464 #define OMAP3ISP_PREV_GAMMA (1 << 16)
0465
0466 #define OMAP3ISP_PREV_NF_TBL_SIZE 64
0467 #define OMAP3ISP_PREV_CFA_TBL_SIZE 576
0468 #define OMAP3ISP_PREV_CFA_BLK_SIZE (OMAP3ISP_PREV_CFA_TBL_SIZE / 4)
0469 #define OMAP3ISP_PREV_GAMMA_TBL_SIZE 1024
0470 #define OMAP3ISP_PREV_YENH_TBL_SIZE 128
0471
0472 #define OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS 4
0473
0474
0475
0476
0477
0478
0479
0480
0481 struct omap3isp_prev_hmed {
0482 __u8 odddist;
0483 __u8 evendist;
0484 __u8 thres;
0485 };
0486
0487
0488
0489
0490 enum omap3isp_cfa_fmt {
0491 OMAP3ISP_CFAFMT_BAYER,
0492 OMAP3ISP_CFAFMT_SONYVGA,
0493 OMAP3ISP_CFAFMT_RGBFOVEON,
0494 OMAP3ISP_CFAFMT_DNSPL,
0495 OMAP3ISP_CFAFMT_HONEYCOMB,
0496 OMAP3ISP_CFAFMT_RRGGBBFOVEON
0497 };
0498
0499
0500
0501
0502
0503
0504
0505
0506 struct omap3isp_prev_cfa {
0507 enum omap3isp_cfa_fmt format;
0508 __u8 gradthrs_vert;
0509 __u8 gradthrs_horz;
0510 __u32 table[4][OMAP3ISP_PREV_CFA_BLK_SIZE];
0511 };
0512
0513
0514
0515
0516
0517
0518
0519 struct omap3isp_prev_csup {
0520 __u8 gain;
0521 __u8 thres;
0522 __u8 hypf_en;
0523 };
0524
0525
0526
0527
0528
0529
0530
0531
0532
0533 struct omap3isp_prev_wbal {
0534 __u16 dgain;
0535 __u8 coef3;
0536 __u8 coef2;
0537 __u8 coef1;
0538 __u8 coef0;
0539 };
0540
0541
0542
0543
0544
0545
0546
0547 struct omap3isp_prev_blkadj {
0548
0549 __u8 red;
0550
0551 __u8 green;
0552
0553 __u8 blue;
0554 };
0555
0556
0557
0558
0559
0560
0561
0562
0563
0564 struct omap3isp_prev_rgbtorgb {
0565 __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX];
0566 __u16 offset[OMAP3ISP_RGB_MAX];
0567 };
0568
0569
0570
0571
0572
0573
0574
0575
0576
0577 struct omap3isp_prev_csc {
0578 __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX];
0579 __s16 offset[OMAP3ISP_RGB_MAX];
0580 };
0581
0582
0583
0584
0585
0586
0587
0588
0589 struct omap3isp_prev_yclimit {
0590 __u8 minC;
0591 __u8 maxC;
0592 __u8 minY;
0593 __u8 maxY;
0594 };
0595
0596
0597
0598
0599
0600
0601 struct omap3isp_prev_dcor {
0602 __u8 couplet_mode_en;
0603 __u32 detect_correct[OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS];
0604 };
0605
0606
0607
0608
0609
0610
0611 struct omap3isp_prev_nf {
0612 __u8 spread;
0613 __u32 table[OMAP3ISP_PREV_NF_TBL_SIZE];
0614 };
0615
0616
0617
0618
0619
0620
0621
0622 struct omap3isp_prev_gtables {
0623 __u32 red[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
0624 __u32 green[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
0625 __u32 blue[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
0626 };
0627
0628
0629
0630
0631
0632 struct omap3isp_prev_luma {
0633 __u32 table[OMAP3ISP_PREV_YENH_TBL_SIZE];
0634 };
0635
0636
0637
0638
0639
0640
0641
0642
0643
0644
0645
0646
0647
0648
0649
0650
0651
0652
0653
0654
0655
0656 struct omap3isp_prev_update_config {
0657 __u32 update;
0658 __u32 flag;
0659 __u32 shading_shift;
0660 struct omap3isp_prev_luma __user *luma;
0661 struct omap3isp_prev_hmed __user *hmed;
0662 struct omap3isp_prev_cfa __user *cfa;
0663 struct omap3isp_prev_csup __user *csup;
0664 struct omap3isp_prev_wbal __user *wbal;
0665 struct omap3isp_prev_blkadj __user *blkadj;
0666 struct omap3isp_prev_rgbtorgb __user *rgb2rgb;
0667 struct omap3isp_prev_csc __user *csc;
0668 struct omap3isp_prev_yclimit __user *yclimit;
0669 struct omap3isp_prev_dcor __user *dcor;
0670 struct omap3isp_prev_nf __user *nf;
0671 struct omap3isp_prev_gtables __user *gamma;
0672 };
0673
0674 #endif