1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 #ifndef OMAP3_ISP_USER_H
29 #define OMAP3_ISP_USER_H
30
31 #include <linux/types.h>
32 #include <linux/videodev2.h>
33
34
35
36
37
38
39
40
41
42
43
44
45
46 #define VIDIOC_OMAP3ISP_CCDC_CFG \
47 _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct omap3isp_ccdc_update_config)
48 #define VIDIOC_OMAP3ISP_PRV_CFG \
49 _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct omap3isp_prev_update_config)
50 #define VIDIOC_OMAP3ISP_AEWB_CFG \
51 _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct omap3isp_h3a_aewb_config)
52 #define VIDIOC_OMAP3ISP_HIST_CFG \
53 _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct omap3isp_hist_config)
54 #define VIDIOC_OMAP3ISP_AF_CFG \
55 _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct omap3isp_h3a_af_config)
56 #define VIDIOC_OMAP3ISP_STAT_REQ \
57 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data)
58 #define VIDIOC_OMAP3ISP_STAT_REQ_TIME32 \
59 _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct omap3isp_stat_data_time32)
60 #define VIDIOC_OMAP3ISP_STAT_EN \
61 _IOWR('V', BASE_VIDIOC_PRIVATE + 7, unsigned long)
62
63
64
65
66
67
68
69
70
71 #define V4L2_EVENT_OMAP3ISP_CLASS (V4L2_EVENT_PRIVATE_START | 0x100)
72 #define V4L2_EVENT_OMAP3ISP_AEWB (V4L2_EVENT_OMAP3ISP_CLASS | 0x1)
73 #define V4L2_EVENT_OMAP3ISP_AF (V4L2_EVENT_OMAP3ISP_CLASS | 0x2)
74 #define V4L2_EVENT_OMAP3ISP_HIST (V4L2_EVENT_OMAP3ISP_CLASS | 0x3)
75
76 struct omap3isp_stat_event_status {
77 __u32 frame_number;
78 __u16 config_counter;
79 __u8 buf_err;
80 };
81
82
83
84
85 #define OMAP3ISP_AEWB_MAX_SATURATION_LIM 1023
86 #define OMAP3ISP_AEWB_MIN_WIN_H 2
87 #define OMAP3ISP_AEWB_MAX_WIN_H 256
88 #define OMAP3ISP_AEWB_MIN_WIN_W 6
89 #define OMAP3ISP_AEWB_MAX_WIN_W 256
90 #define OMAP3ISP_AEWB_MIN_WINVC 1
91 #define OMAP3ISP_AEWB_MIN_WINHC 1
92 #define OMAP3ISP_AEWB_MAX_WINVC 128
93 #define OMAP3ISP_AEWB_MAX_WINHC 36
94 #define OMAP3ISP_AEWB_MAX_WINSTART 4095
95 #define OMAP3ISP_AEWB_MIN_SUB_INC 2
96 #define OMAP3ISP_AEWB_MAX_SUB_INC 32
97 #define OMAP3ISP_AEWB_MAX_BUF_SIZE 83600
98
99 #define OMAP3ISP_AF_IIRSH_MIN 0
100 #define OMAP3ISP_AF_IIRSH_MAX 4095
101 #define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MIN 1
102 #define OMAP3ISP_AF_PAXEL_HORIZONTAL_COUNT_MAX 36
103 #define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MIN 1
104 #define OMAP3ISP_AF_PAXEL_VERTICAL_COUNT_MAX 128
105 #define OMAP3ISP_AF_PAXEL_INCREMENT_MIN 2
106 #define OMAP3ISP_AF_PAXEL_INCREMENT_MAX 32
107 #define OMAP3ISP_AF_PAXEL_HEIGHT_MIN 2
108 #define OMAP3ISP_AF_PAXEL_HEIGHT_MAX 256
109 #define OMAP3ISP_AF_PAXEL_WIDTH_MIN 16
110 #define OMAP3ISP_AF_PAXEL_WIDTH_MAX 256
111 #define OMAP3ISP_AF_PAXEL_HZSTART_MIN 1
112 #define OMAP3ISP_AF_PAXEL_HZSTART_MAX 4095
113 #define OMAP3ISP_AF_PAXEL_VTSTART_MIN 0
114 #define OMAP3ISP_AF_PAXEL_VTSTART_MAX 4095
115 #define OMAP3ISP_AF_THRESHOLD_MAX 255
116 #define OMAP3ISP_AF_COEF_MAX 4095
117 #define OMAP3ISP_AF_PAXEL_SIZE 48
118 #define OMAP3ISP_AF_MAX_BUF_SIZE 221184
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137 struct omap3isp_h3a_aewb_config {
138
139
140
141
142
143 __u32 buf_size;
144 __u16 config_counter;
145
146
147 __u16 saturation_limit;
148 __u16 win_height;
149 __u16 win_width;
150 __u16 ver_win_count;
151 __u16 hor_win_count;
152 __u16 ver_win_start;
153 __u16 hor_win_start;
154 __u16 blk_ver_win_start;
155 __u16 blk_win_height;
156 __u16 subsample_ver_inc;
157 __u16 subsample_hor_inc;
158 __u8 alaw_enable;
159 };
160
161
162
163
164
165
166
167
168
169 struct omap3isp_stat_data {
170 #ifdef __KERNEL__
171 struct {
172 __s64 tv_sec;
173 __s64 tv_usec;
174 } ts;
175 #else
176 struct timeval ts;
177 #endif
178 void __user *buf;
179 __u32 buf_size;
180 __u16 frame_number;
181 __u16 cur_frame;
182 __u16 config_counter;
183 };
184
185 #ifdef __KERNEL__
186 struct omap3isp_stat_data_time32 {
187 struct {
188 __s32 tv_sec;
189 __s32 tv_usec;
190 } ts;
191 __u32 buf;
192 __u32 buf_size;
193 __u16 frame_number;
194 __u16 cur_frame;
195 __u16 config_counter;
196 };
197 #endif
198
199
200
201
202 #define OMAP3ISP_HIST_BINS_32 0
203 #define OMAP3ISP_HIST_BINS_64 1
204 #define OMAP3ISP_HIST_BINS_128 2
205 #define OMAP3ISP_HIST_BINS_256 3
206
207
208 #define OMAP3ISP_HIST_MEM_SIZE_BINS(n) ((1 << ((n)+5))*4*4)
209
210 #define OMAP3ISP_HIST_MEM_SIZE 1024
211 #define OMAP3ISP_HIST_MIN_REGIONS 1
212 #define OMAP3ISP_HIST_MAX_REGIONS 4
213 #define OMAP3ISP_HIST_MAX_WB_GAIN 255
214 #define OMAP3ISP_HIST_MIN_WB_GAIN 0
215 #define OMAP3ISP_HIST_MAX_BIT_WIDTH 14
216 #define OMAP3ISP_HIST_MIN_BIT_WIDTH 8
217 #define OMAP3ISP_HIST_MAX_WG 4
218 #define OMAP3ISP_HIST_MAX_BUF_SIZE 4096
219
220
221 #define OMAP3ISP_HIST_SOURCE_CCDC 0
222 #define OMAP3ISP_HIST_SOURCE_MEM 1
223
224
225 #define OMAP3ISP_HIST_CFA_BAYER 0
226 #define OMAP3ISP_HIST_CFA_FOVEONX3 1
227
228 struct omap3isp_hist_region {
229 __u16 h_start;
230 __u16 h_end;
231 __u16 v_start;
232 __u16 v_end;
233 };
234
235 struct omap3isp_hist_config {
236
237
238
239
240
241 __u32 buf_size;
242 __u16 config_counter;
243
244 __u8 num_acc_frames;
245
246 __u16 hist_bins;
247 __u8 cfa;
248 __u8 wg[OMAP3ISP_HIST_MAX_WG];
249 __u8 num_regions;
250 struct omap3isp_hist_region region[OMAP3ISP_HIST_MAX_REGIONS];
251 };
252
253
254
255 #define OMAP3ISP_AF_NUM_COEF 11
256
257 enum omap3isp_h3a_af_fvmode {
258 OMAP3ISP_AF_MODE_SUMMED = 0,
259 OMAP3ISP_AF_MODE_PEAK = 1
260 };
261
262
263 enum omap3isp_h3a_af_rgbpos {
264 OMAP3ISP_AF_GR_GB_BAYER = 0,
265 OMAP3ISP_AF_RG_GB_BAYER = 1,
266 OMAP3ISP_AF_GR_BG_BAYER = 2,
267 OMAP3ISP_AF_RG_BG_BAYER = 3,
268 OMAP3ISP_AF_GG_RB_CUSTOM = 4,
269 OMAP3ISP_AF_RB_GG_CUSTOM = 5
270 };
271
272
273 struct omap3isp_h3a_af_hmf {
274 __u8 enable;
275 __u8 threshold;
276 };
277
278
279 struct omap3isp_h3a_af_iir {
280 __u16 h_start;
281 __u16 coeff_set0[OMAP3ISP_AF_NUM_COEF];
282 __u16 coeff_set1[OMAP3ISP_AF_NUM_COEF];
283 };
284
285
286 struct omap3isp_h3a_af_paxel {
287 __u16 h_start;
288 __u16 v_start;
289 __u8 width;
290 __u8 height;
291 __u8 h_cnt;
292 __u8 v_cnt;
293 __u8 line_inc;
294 };
295
296
297 struct omap3isp_h3a_af_config {
298
299
300
301
302
303 __u32 buf_size;
304 __u16 config_counter;
305
306 struct omap3isp_h3a_af_hmf hmf;
307 struct omap3isp_h3a_af_iir iir;
308 struct omap3isp_h3a_af_paxel paxel;
309 enum omap3isp_h3a_af_rgbpos rgb_pos;
310 enum omap3isp_h3a_af_fvmode fvmode;
311 __u8 alaw_enable;
312 };
313
314
315
316
317 #define OMAP3ISP_CCDC_ALAW (1 << 0)
318 #define OMAP3ISP_CCDC_LPF (1 << 1)
319 #define OMAP3ISP_CCDC_BLCLAMP (1 << 2)
320 #define OMAP3ISP_CCDC_BCOMP (1 << 3)
321 #define OMAP3ISP_CCDC_FPC (1 << 4)
322 #define OMAP3ISP_CCDC_CULL (1 << 5)
323 #define OMAP3ISP_CCDC_CONFIG_LSC (1 << 7)
324 #define OMAP3ISP_CCDC_TBL_LSC (1 << 8)
325
326 #define OMAP3ISP_RGB_MAX 3
327
328
329 enum omap3isp_alaw_ipwidth {
330 OMAP3ISP_ALAW_BIT12_3 = 0x3,
331 OMAP3ISP_ALAW_BIT11_2 = 0x4,
332 OMAP3ISP_ALAW_BIT10_1 = 0x5,
333 OMAP3ISP_ALAW_BIT9_0 = 0x6
334 };
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353 struct omap3isp_ccdc_lsc_config {
354 __u16 offset;
355 __u8 gain_mode_n;
356 __u8 gain_mode_m;
357 __u8 gain_format;
358 __u16 fmtsph;
359 __u16 fmtlnh;
360 __u16 fmtslv;
361 __u16 fmtlnv;
362 __u8 initial_x;
363 __u8 initial_y;
364 __u32 size;
365 };
366
367
368
369
370
371
372
373
374
375 struct omap3isp_ccdc_bclamp {
376 __u8 obgain;
377 __u8 obstpixel;
378 __u8 oblines;
379 __u8 oblen;
380 __u16 dcsubval;
381 };
382
383
384
385
386
387
388 struct omap3isp_ccdc_fpc {
389 __u16 fpnum;
390 __u32 fpcaddr;
391 };
392
393
394
395
396
397
398
399
400 struct omap3isp_ccdc_blcomp {
401 __u8 b_mg;
402 __u8 gb_g;
403 __u8 gr_cy;
404 __u8 r_ye;
405 };
406
407
408
409
410
411
412
413 struct omap3isp_ccdc_culling {
414 __u8 v_pattern;
415 __u16 h_odd;
416 __u16 h_even;
417 };
418
419
420
421
422
423
424
425
426
427
428
429
430 struct omap3isp_ccdc_update_config {
431 __u16 update;
432 __u16 flag;
433 enum omap3isp_alaw_ipwidth alawip;
434 struct omap3isp_ccdc_bclamp __user *bclamp;
435 struct omap3isp_ccdc_blcomp __user *blcomp;
436 struct omap3isp_ccdc_fpc __user *fpc;
437 struct omap3isp_ccdc_lsc_config __user *lsc_cfg;
438 struct omap3isp_ccdc_culling __user *cull;
439 __u8 __user *lsc;
440 };
441
442
443 #define OMAP3ISP_PREV_LUMAENH (1 << 0)
444 #define OMAP3ISP_PREV_INVALAW (1 << 1)
445 #define OMAP3ISP_PREV_HRZ_MED (1 << 2)
446 #define OMAP3ISP_PREV_CFA (1 << 3)
447 #define OMAP3ISP_PREV_CHROMA_SUPP (1 << 4)
448 #define OMAP3ISP_PREV_WB (1 << 5)
449 #define OMAP3ISP_PREV_BLKADJ (1 << 6)
450 #define OMAP3ISP_PREV_RGB2RGB (1 << 7)
451 #define OMAP3ISP_PREV_COLOR_CONV (1 << 8)
452 #define OMAP3ISP_PREV_YC_LIMIT (1 << 9)
453 #define OMAP3ISP_PREV_DEFECT_COR (1 << 10)
454
455 #define OMAP3ISP_PREV_DRK_FRM_CAPTURE (1 << 12)
456 #define OMAP3ISP_PREV_DRK_FRM_SUBTRACT (1 << 13)
457 #define OMAP3ISP_PREV_LENS_SHADING (1 << 14)
458 #define OMAP3ISP_PREV_NF (1 << 15)
459 #define OMAP3ISP_PREV_GAMMA (1 << 16)
460
461 #define OMAP3ISP_PREV_NF_TBL_SIZE 64
462 #define OMAP3ISP_PREV_CFA_TBL_SIZE 576
463 #define OMAP3ISP_PREV_CFA_BLK_SIZE (OMAP3ISP_PREV_CFA_TBL_SIZE / 4)
464 #define OMAP3ISP_PREV_GAMMA_TBL_SIZE 1024
465 #define OMAP3ISP_PREV_YENH_TBL_SIZE 128
466
467 #define OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS 4
468
469
470
471
472
473
474
475
476 struct omap3isp_prev_hmed {
477 __u8 odddist;
478 __u8 evendist;
479 __u8 thres;
480 };
481
482
483
484
485 enum omap3isp_cfa_fmt {
486 OMAP3ISP_CFAFMT_BAYER,
487 OMAP3ISP_CFAFMT_SONYVGA,
488 OMAP3ISP_CFAFMT_RGBFOVEON,
489 OMAP3ISP_CFAFMT_DNSPL,
490 OMAP3ISP_CFAFMT_HONEYCOMB,
491 OMAP3ISP_CFAFMT_RRGGBBFOVEON
492 };
493
494
495
496
497
498
499
500
501 struct omap3isp_prev_cfa {
502 enum omap3isp_cfa_fmt format;
503 __u8 gradthrs_vert;
504 __u8 gradthrs_horz;
505 __u32 table[4][OMAP3ISP_PREV_CFA_BLK_SIZE];
506 };
507
508
509
510
511
512
513
514 struct omap3isp_prev_csup {
515 __u8 gain;
516 __u8 thres;
517 __u8 hypf_en;
518 };
519
520
521
522
523
524
525
526
527
528 struct omap3isp_prev_wbal {
529 __u16 dgain;
530 __u8 coef3;
531 __u8 coef2;
532 __u8 coef1;
533 __u8 coef0;
534 };
535
536
537
538
539
540
541
542 struct omap3isp_prev_blkadj {
543
544 __u8 red;
545
546 __u8 green;
547
548 __u8 blue;
549 };
550
551
552
553
554
555
556
557
558
559 struct omap3isp_prev_rgbtorgb {
560 __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX];
561 __u16 offset[OMAP3ISP_RGB_MAX];
562 };
563
564
565
566
567
568
569
570
571
572 struct omap3isp_prev_csc {
573 __u16 matrix[OMAP3ISP_RGB_MAX][OMAP3ISP_RGB_MAX];
574 __s16 offset[OMAP3ISP_RGB_MAX];
575 };
576
577
578
579
580
581
582
583
584 struct omap3isp_prev_yclimit {
585 __u8 minC;
586 __u8 maxC;
587 __u8 minY;
588 __u8 maxY;
589 };
590
591
592
593
594
595
596 struct omap3isp_prev_dcor {
597 __u8 couplet_mode_en;
598 __u32 detect_correct[OMAP3ISP_PREV_DETECT_CORRECT_CHANNELS];
599 };
600
601
602
603
604
605
606 struct omap3isp_prev_nf {
607 __u8 spread;
608 __u32 table[OMAP3ISP_PREV_NF_TBL_SIZE];
609 };
610
611
612
613
614
615
616
617 struct omap3isp_prev_gtables {
618 __u32 red[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
619 __u32 green[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
620 __u32 blue[OMAP3ISP_PREV_GAMMA_TBL_SIZE];
621 };
622
623
624
625
626
627 struct omap3isp_prev_luma {
628 __u32 table[OMAP3ISP_PREV_YENH_TBL_SIZE];
629 };
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651 struct omap3isp_prev_update_config {
652 __u32 update;
653 __u32 flag;
654 __u32 shading_shift;
655 struct omap3isp_prev_luma __user *luma;
656 struct omap3isp_prev_hmed __user *hmed;
657 struct omap3isp_prev_cfa __user *cfa;
658 struct omap3isp_prev_csup __user *csup;
659 struct omap3isp_prev_wbal __user *wbal;
660 struct omap3isp_prev_blkadj __user *blkadj;
661 struct omap3isp_prev_rgbtorgb __user *rgb2rgb;
662 struct omap3isp_prev_csc __user *csc;
663 struct omap3isp_prev_yclimit __user *yclimit;
664 struct omap3isp_prev_dcor __user *dcor;
665 struct omap3isp_prev_nf __user *nf;
666 struct omap3isp_prev_gtables __user *gamma;
667 };
668
669 #endif