summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/linux/linux-omap-2.6.29/isp/omap3camera/0003-omap3isp-Add-userspace-header.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/linux/linux-omap-2.6.29/isp/omap3camera/0003-omap3isp-Add-userspace-header.patch')
-rw-r--r--meta/recipes-kernel/linux/linux-omap-2.6.29/isp/omap3camera/0003-omap3isp-Add-userspace-header.patch696
1 files changed, 696 insertions, 0 deletions
diff --git a/meta/recipes-kernel/linux/linux-omap-2.6.29/isp/omap3camera/0003-omap3isp-Add-userspace-header.patch b/meta/recipes-kernel/linux/linux-omap-2.6.29/isp/omap3camera/0003-omap3isp-Add-userspace-header.patch
new file mode 100644
index 0000000000..66c171f544
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-omap-2.6.29/isp/omap3camera/0003-omap3isp-Add-userspace-header.patch
@@ -0,0 +1,696 @@
1From 98ca1ef8c6e2561989aeef981131cf5077eab1d1 Mon Sep 17 00:00:00 2001
2From: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
3Date: Tue, 10 Mar 2009 10:49:02 +0200
4Subject: [PATCH] omap3isp: Add userspace header
5
6Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
7---
8 arch/arm/plat-omap/include/mach/isp_user.h | 676 ++++++++++++++++++++++++++++
9 1 files changed, 676 insertions(+), 0 deletions(-)
10 create mode 100644 arch/arm/plat-omap/include/mach/isp_user.h
11
12diff --git a/arch/arm/plat-omap/include/mach/isp_user.h b/arch/arm/plat-omap/include/mach/isp_user.h
13new file mode 100644
14index 0000000..b819e26
15--- /dev/null
16+++ b/arch/arm/plat-omap/include/mach/isp_user.h
17@@ -0,0 +1,676 @@
18+/*
19+ * isp_user.h
20+ *
21+ * Include file for OMAP ISP module in TI's OMAP3.
22+ *
23+ * Copyright (C) 2009 Texas Instruments, Inc.
24+ *
25+ * Contributors:
26+ * Mohit Jalori <mjalori@ti.com>
27+ * Sergio Aguirre <saaguirre@ti.com>
28+ *
29+ * This package is free software; you can redistribute it and/or modify
30+ * it under the terms of the GNU General Public License version 2 as
31+ * published by the Free Software Foundation.
32+ *
33+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
34+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
35+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
36+ */
37+
38+#ifndef OMAP_ISP_USER_H
39+#define OMAP_ISP_USER_H
40+
41+/* ISP Private IOCTLs */
42+#define VIDIOC_PRIVATE_ISP_CCDC_CFG \
43+ _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct ispccdc_update_config)
44+#define VIDIOC_PRIVATE_ISP_PRV_CFG \
45+ _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct ispprv_update_config)
46+#define VIDIOC_PRIVATE_ISP_AEWB_CFG \
47+ _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct isph3a_aewb_config)
48+#define VIDIOC_PRIVATE_ISP_AEWB_REQ \
49+ _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct isph3a_aewb_data)
50+#define VIDIOC_PRIVATE_ISP_HIST_CFG \
51+ _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct isp_hist_config)
52+#define VIDIOC_PRIVATE_ISP_HIST_REQ \
53+ _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct isp_hist_data)
54+#define VIDIOC_PRIVATE_ISP_AF_CFG \
55+ _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct af_configuration)
56+#define VIDIOC_PRIVATE_ISP_AF_REQ \
57+ _IOWR('V', BASE_VIDIOC_PRIVATE + 9, struct isp_af_data)
58+
59+/* AE/AWB related structures and flags*/
60+
61+/* Flags for update field */
62+#define REQUEST_STATISTICS (1 << 0)
63+#define SET_COLOR_GAINS (1 << 1)
64+#define SET_DIGITAL_GAIN (1 << 2)
65+#define SET_EXPOSURE (1 << 3)
66+#define SET_ANALOG_GAIN (1 << 4)
67+
68+#define MAX_FRAME_COUNT 0x0FFF
69+#define MAX_FUTURE_FRAMES 10
70+
71+#define MAX_SATURATION_LIM 1023
72+#define MIN_WIN_H 2
73+#define MAX_WIN_H 256
74+#define MIN_WIN_W 6
75+#define MAX_WIN_W 256
76+#define MAX_WINVC 128
77+#define MAX_WINHC 36
78+#define MAX_WINSTART 4095
79+#define MIN_SUB_INC 2
80+#define MAX_SUB_INC 32
81+
82+/* Range Constants */
83+#define AF_IIRSH_MIN 0
84+#define AF_IIRSH_MAX 4094
85+#define AF_PAXEL_HORIZONTAL_COUNT_MIN 0
86+#define AF_PAXEL_HORIZONTAL_COUNT_MAX 35
87+#define AF_PAXEL_VERTICAL_COUNT_MIN 0
88+#define AF_PAXEL_VERTICAL_COUNT_MAX 127
89+#define AF_PAXEL_INCREMENT_MIN 0
90+#define AF_PAXEL_INCREMENT_MAX 14
91+#define AF_PAXEL_HEIGHT_MIN 0
92+#define AF_PAXEL_HEIGHT_MAX 127
93+#define AF_PAXEL_WIDTH_MIN 0
94+#define AF_PAXEL_WIDTH_MAX 127
95+#define AF_PAXEL_HZSTART_MIN 2
96+#define AF_PAXEL_HZSTART_MAX 4094
97+
98+#define AF_PAXEL_VTSTART_MIN 0
99+#define AF_PAXEL_VTSTART_MAX 4095
100+#define AF_THRESHOLD_MAX 255
101+#define AF_COEF_MAX 4095
102+#define AF_PAXEL_SIZE 48
103+
104+/**
105+ * struct isph3a_aewb_config - AE AWB configuration reset values.
106+ * saturation_limit: Saturation limit.
107+ * @win_height: Window Height. Range 2 - 256, even values only.
108+ * @win_width: Window Width. Range 6 - 256, even values only.
109+ * @ver_win_count: Vertical Window Count. Range 1 - 128.
110+ * @hor_win_count: Horizontal Window Count. Range 1 - 36.
111+ * @ver_win_start: Vertical Window Start. Range 0 - 4095.
112+ * @hor_win_start: Horizontal Window Start. Range 0 - 4095.
113+ * @blk_ver_win_start: Black Vertical Windows Start. Range 0 - 4095.
114+ * @blk_win_height: Black Window Height. Range 2 - 256, even values only.
115+ * @subsample_ver_inc: Subsample Vertical points increment Range 2 - 32, even
116+ * values only.
117+ * @subsample_hor_inc: Subsample Horizontal points increment Range 2 - 32, even
118+ * values only.
119+ * @alaw_enable: AEW ALAW EN flag.
120+ * @aewb_enable: AE AWB stats generation EN flag.
121+ */
122+struct isph3a_aewb_config {
123+ __u16 saturation_limit;
124+ __u16 win_height;
125+ __u16 win_width;
126+ __u16 ver_win_count;
127+ __u16 hor_win_count;
128+ __u16 ver_win_start;
129+ __u16 hor_win_start;
130+ __u16 blk_ver_win_start;
131+ __u16 blk_win_height;
132+ __u16 subsample_ver_inc;
133+ __u16 subsample_hor_inc;
134+ __u8 alaw_enable;
135+ __u8 aewb_enable;
136+};
137+
138+/**
139+ * struct isph3a_aewb_data - Structure of data sent to or received from user
140+ * @h3a_aewb_statistics_buf: Pointer to pass to user.
141+ * @shutter: Shutter speed.
142+ * @gain: Sensor analog Gain.
143+ * @shutter_cap: Shutter speed for capture.
144+ * @gain_cap: Sensor Gain for capture.
145+ * @dgain: White balance digital gain.
146+ * @wb_gain_b: White balance color gain blue.
147+ * @wb_gain_r: White balance color gain red.
148+ * @wb_gain_gb: White balance color gain green blue.
149+ * @wb_gain_gr: White balance color gain green red.
150+ * @frame_number: Frame number of requested stats.
151+ * @curr_frame: Current frame number being processed.
152+ * @update: Bitwise flags to update parameters.
153+ * @ts: Timestamp of returned framestats.
154+ * @field_count: Sequence number of returned framestats.
155+ */
156+struct isph3a_aewb_data {
157+ void *h3a_aewb_statistics_buf;
158+ __u32 shutter;
159+ __u16 gain;
160+ __u32 shutter_cap;
161+ __u16 gain_cap;
162+ __u16 dgain;
163+ __u16 wb_gain_b;
164+ __u16 wb_gain_r;
165+ __u16 wb_gain_gb;
166+ __u16 wb_gain_gr;
167+ __u16 frame_number;
168+ __u16 curr_frame;
169+ __u8 update;
170+ struct timeval ts;
171+ __u32 config_counter;
172+ unsigned long field_count;
173+};
174+
175+
176+/* Histogram related structs */
177+/* Flags for number of bins */
178+#define BINS_32 0x0
179+#define BINS_64 0x1
180+#define BINS_128 0x2
181+#define BINS_256 0x3
182+
183+struct isp_hist_config {
184+ __u8 hist_source; /* CCDC or Memory */
185+ __u8 input_bit_width; /* Needed o know the size per pixel */
186+ __u8 hist_frames; /* Num of frames to be processed and
187+ * accumulated
188+ */
189+ __u8 hist_h_v_info; /* frame-input width and height if source is
190+ * memory
191+ */
192+ __u16 hist_radd; /* frame-input address in memory */
193+ __u16 hist_radd_off; /* line-offset for frame-input */
194+ __u16 hist_bins; /* number of bins: 32, 64, 128, or 256 */
195+ __u16 wb_gain_R; /* White Balance Field-to-Pattern Assignments */
196+ __u16 wb_gain_RG; /* White Balance Field-to-Pattern Assignments */
197+ __u16 wb_gain_B; /* White Balance Field-to-Pattern Assignments */
198+ __u16 wb_gain_BG; /* White Balance Field-to-Pattern Assignments */
199+ __u8 num_regions; /* number of regions to be configured */
200+ __u16 reg0_hor; /* Region 0 size and position */
201+ __u16 reg0_ver; /* Region 0 size and position */
202+ __u16 reg1_hor; /* Region 1 size and position */
203+ __u16 reg1_ver; /* Region 1 size and position */
204+ __u16 reg2_hor; /* Region 2 size and position */
205+ __u16 reg2_ver; /* Region 2 size and position */
206+ __u16 reg3_hor; /* Region 3 size and position */
207+ __u16 reg3_ver; /* Region 3 size and position */
208+};
209+
210+struct isp_hist_data {
211+ __u32 *hist_statistics_buf; /* Pointer to pass to user */
212+};
213+
214+/* Auto Focus related structs */
215+
216+#define AF_NUMBER_OF_COEF 11
217+
218+/* Flags for update field */
219+#define REQUEST_STATISTICS (1 << 0)
220+#define LENS_DESIRED_POSITION (1 << 1)
221+#define LENS_CURRENT_POSITION (1 << 2)
222+
223+/**
224+ * struct isp_af_xtrastats - Extra statistics related to AF generated stats.
225+ * @ts: Timestamp when the frame gets delivered to the user.
226+ * @field_count: Field count of the frame delivered to the user.
227+ * @lens_position: Lens position when the stats are being generated.
228+ */
229+struct isp_af_xtrastats {
230+ struct timeval ts;
231+ unsigned long field_count;
232+ __u16 lens_position; /* deprecated */
233+};
234+
235+/**
236+ * struct isp_af_data - AF statistics data to transfer between driver and user.
237+ * @af_statistics_buf: Pointer to pass to user.
238+ * @lens_current_position: Read value of lens absolute position.
239+ * @desired_lens_direction: Lens desired location.
240+ * @update: Bitwise flags to update parameters.
241+ * @frame_number: Data for which frame is desired/given.
242+ * @curr_frame: Current frame number being processed by AF module.
243+ * @xtrastats: Extra statistics structure.
244+ */
245+struct isp_af_data {
246+ void *af_statistics_buf;
247+ __u16 lens_current_position; /* deprecated */
248+ __u16 desired_lens_direction; /* deprecated */
249+ __u16 update;
250+ __u16 frame_number;
251+ __u16 curr_frame;
252+ __u32 config_counter;
253+ struct isp_af_xtrastats xtrastats;
254+};
255+
256+/* enum used for status of specific feature */
257+enum af_alaw_enable {
258+ H3A_AF_ALAW_DISABLE = 0,
259+ H3A_AF_ALAW_ENABLE = 1
260+};
261+
262+enum af_hmf_enable {
263+ H3A_AF_HMF_DISABLE = 0,
264+ H3A_AF_HMF_ENABLE = 1
265+};
266+
267+enum af_config_flag {
268+ H3A_AF_CFG_DISABLE = 0,
269+ H3A_AF_CFG_ENABLE = 1
270+};
271+
272+enum af_mode {
273+ ACCUMULATOR_SUMMED = 0,
274+ ACCUMULATOR_PEAK = 1
275+};
276+
277+/* Red, Green, and blue pixel location in the AF windows */
278+enum rgbpos {
279+ GR_GB_BAYER = 0, /* GR and GB as Bayer pattern */
280+ RG_GB_BAYER = 1, /* RG and GB as Bayer pattern */
281+ GR_BG_BAYER = 2, /* GR and BG as Bayer pattern */
282+ RG_BG_BAYER = 3, /* RG and BG as Bayer pattern */
283+ GG_RB_CUSTOM = 4, /* GG and RB as custom pattern */
284+ RB_GG_CUSTOM = 5 /* RB and GG as custom pattern */
285+};
286+
287+/* Contains the information regarding the Horizontal Median Filter */
288+struct af_hmf {
289+ enum af_hmf_enable enable; /* Status of Horizontal Median Filter */
290+ unsigned int threshold; /* Threshhold Value for Horizontal Median
291+ * Filter
292+ */
293+};
294+
295+/* Contains the information regarding the IIR Filters */
296+struct af_iir {
297+ unsigned int hz_start_pos; /* IIR Start Register Value */
298+ int coeff_set0[AF_NUMBER_OF_COEF]; /*
299+ * IIR Filter Coefficient for
300+ * Set 0
301+ */
302+ int coeff_set1[AF_NUMBER_OF_COEF]; /*
303+ * IIR Filter Coefficient for
304+ * Set 1
305+ */
306+};
307+
308+/* Contains the information regarding the Paxels Structure in AF Engine */
309+struct af_paxel {
310+ unsigned int width; /* Width of the Paxel */
311+ unsigned int height; /* Height of the Paxel */
312+ unsigned int hz_start; /* Horizontal Start Position */
313+ unsigned int vt_start; /* Vertical Start Position */
314+ unsigned int hz_cnt; /* Horizontal Count */
315+ unsigned int vt_cnt; /* vertical Count */
316+ unsigned int line_incr; /* Line Increment */
317+};
318+/* Contains the parameters required for hardware set up of AF Engine */
319+struct af_configuration {
320+ enum af_alaw_enable alaw_enable; /*ALWAW status */
321+ struct af_hmf hmf_config; /*HMF configurations */
322+ enum rgbpos rgb_pos; /*RGB Positions */
323+ struct af_iir iir_config; /*IIR filter configurations */
324+ struct af_paxel paxel_config; /*Paxel parameters */
325+ enum af_mode mode; /*Accumulator mode */
326+ enum af_config_flag af_config; /*Flag indicates Engine is configured */
327+};
328+
329+/* ISP CCDC structs */
330+
331+/* Abstraction layer CCDC configurations */
332+#define ISP_ABS_CCDC_ALAW (1 << 0)
333+#define ISP_ABS_CCDC_LPF (1 << 1)
334+#define ISP_ABS_CCDC_BLCLAMP (1 << 2)
335+#define ISP_ABS_CCDC_BCOMP (1 << 3)
336+#define ISP_ABS_CCDC_FPC (1 << 4)
337+#define ISP_ABS_CCDC_CULL (1 << 5)
338+#define ISP_ABS_CCDC_COLPTN (1 << 6)
339+#define ISP_ABS_CCDC_CONFIG_LSC (1 << 7)
340+#define ISP_ABS_TBL_LSC (1 << 8)
341+
342+#define RGB_MAX 3
343+
344+/* Enumeration constants for Alaw input width */
345+enum alaw_ipwidth {
346+ ALAW_BIT12_3 = 0x3,
347+ ALAW_BIT11_2 = 0x4,
348+ ALAW_BIT10_1 = 0x5,
349+ ALAW_BIT9_0 = 0x6
350+};
351+
352+/* Enumeration constants for Video Port */
353+enum vpin {
354+ BIT12_3 = 3,
355+ BIT11_2 = 4,
356+ BIT10_1 = 5,
357+ BIT9_0 = 6
358+};
359+
360+enum vpif_freq {
361+ PIXCLKBY2,
362+ PIXCLKBY3_5,
363+ PIXCLKBY4_5,
364+ PIXCLKBY5_5,
365+ PIXCLKBY6_5
366+};
367+
368+/**
369+ * struct ispccdc_lsc_config - Structure for LSC configuration.
370+ * @offset: Table Offset of the gain table.
371+ * @gain_mode_n: Vertical dimension of a paxel in LSC configuration.
372+ * @gain_mode_m: Horizontal dimension of a paxel in LSC configuration.
373+ * @gain_format: Gain table format.
374+ * @fmtsph: Start pixel horizontal from start of the HS sync pulse.
375+ * @fmtlnh: Number of pixels in horizontal direction to use for the data
376+ * reformatter.
377+ * @fmtslv: Start line from start of VS sync pulse for the data reformatter.
378+ * @fmtlnv: Number of lines in vertical direction for the data reformatter.
379+ * @initial_x: X position, in pixels, of the first active pixel in reference
380+ * to the first active paxel. Must be an even number.
381+ * @initial_y: Y position, in pixels, of the first active pixel in reference
382+ * to the first active paxel. Must be an even number.
383+ * @size: Size of LSC gain table. Filled when loaded from userspace.
384+ */
385+struct ispccdc_lsc_config {
386+ __u16 offset;
387+ __u8 gain_mode_n;
388+ __u8 gain_mode_m;
389+ __u8 gain_format;
390+ __u16 fmtsph;
391+ __u16 fmtlnh;
392+ __u16 fmtslv;
393+ __u16 fmtlnv;
394+ __u8 initial_x;
395+ __u8 initial_y;
396+ __u32 size;
397+};
398+
399+/**
400+ * struct ispccdc_bclamp - Structure for Optical & Digital black clamp subtract
401+ * @obgain: Optical black average gain.
402+ * @obstpixel: Start Pixel w.r.t. HS pulse in Optical black sample.
403+ * @oblines: Optical Black Sample lines.
404+ * @oblen: Optical Black Sample Length.
405+ * @dcsubval: Digital Black Clamp subtract value.
406+ */
407+struct ispccdc_bclamp {
408+ __u8 obgain;
409+ __u8 obstpixel;
410+ __u8 oblines;
411+ __u8 oblen;
412+ __u16 dcsubval;
413+};
414+
415+/**
416+ * ispccdc_fpc - Structure for FPC
417+ * @fpnum: Number of faulty pixels to be corrected in the frame.
418+ * @fpcaddr: Memory address of the FPC Table
419+ */
420+struct ispccdc_fpc {
421+ __u16 fpnum;
422+ __u32 fpcaddr;
423+};
424+
425+/**
426+ * ispccdc_blcomp - Structure for Black Level Compensation parameters.
427+ * @b_mg: B/Mg pixels. 2's complement. -128 to +127.
428+ * @gb_g: Gb/G pixels. 2's complement. -128 to +127.
429+ * @gr_cy: Gr/Cy pixels. 2's complement. -128 to +127.
430+ * @r_ye: R/Ye pixels. 2's complement. -128 to +127.
431+ */
432+struct ispccdc_blcomp {
433+ __u8 b_mg;
434+ __u8 gb_g;
435+ __u8 gr_cy;
436+ __u8 r_ye;
437+};
438+
439+/**
440+ * struct ispccdc_vp - Structure for Video Port parameters
441+ * @bitshift_sel: Video port input select. 3 - bits 12-3, 4 - bits 11-2,
442+ * 5 - bits 10-1, 6 - bits 9-0.
443+ * @freq_sel: Video port data ready frequency. 1 - 1/3.5, 2 - 1/4.5,
444+ * 3 - 1/5.5, 4 - 1/6.5.
445+ */
446+struct ispccdc_vp {
447+ enum vpin bitshift_sel;
448+ enum vpif_freq freq_sel;
449+};
450+
451+/**
452+ * ispccdc_culling - Structure for Culling parameters.
453+ * @v_pattern: Vertical culling pattern.
454+ * @h_odd: Horizontal Culling pattern for odd lines.
455+ * @h_even: Horizontal Culling pattern for even lines.
456+ */
457+struct ispccdc_culling {
458+ __u8 v_pattern;
459+ __u16 h_odd;
460+ __u16 h_even;
461+};
462+
463+/**
464+ * ispccdc_update_config - Structure for CCDC configuration.
465+ * @update: Specifies which CCDC registers should be updated.
466+ * @flag: Specifies which CCDC functions should be enabled.
467+ * @alawip: Enable/Disable A-Law compression.
468+ * @bclamp: Black clamp control register.
469+ * @blcomp: Black level compensation value for RGrGbB Pixels. 2's complement.
470+ * @fpc: Number of faulty pixels corrected in the frame, address of FPC table.
471+ * @cull: Cull control register.
472+ * @colptn: Color pattern of the sensor.
473+ * @lsc: Pointer to LSC gain table.
474+ */
475+struct ispccdc_update_config {
476+ __u16 update;
477+ __u16 flag;
478+ enum alaw_ipwidth alawip;
479+ struct ispccdc_bclamp *bclamp;
480+ struct ispccdc_blcomp *blcomp;
481+ struct ispccdc_fpc *fpc;
482+ struct ispccdc_lsc_config *lsc_cfg;
483+ struct ispccdc_culling *cull;
484+ __u32 colptn;
485+ __u8 *lsc;
486+};
487+
488+/* Preview configuration */
489+
490+/*Abstraction layer preview configurations*/
491+#define ISP_ABS_PREV_LUMAENH (1 << 0)
492+#define ISP_ABS_PREV_INVALAW (1 << 1)
493+#define ISP_ABS_PREV_HRZ_MED (1 << 2)
494+#define ISP_ABS_PREV_CFA (1 << 3)
495+#define ISP_ABS_PREV_CHROMA_SUPP (1 << 4)
496+#define ISP_ABS_PREV_WB (1 << 5)
497+#define ISP_ABS_PREV_BLKADJ (1 << 6)
498+#define ISP_ABS_PREV_RGB2RGB (1 << 7)
499+#define ISP_ABS_PREV_COLOR_CONV (1 << 8)
500+#define ISP_ABS_PREV_YC_LIMIT (1 << 9)
501+#define ISP_ABS_PREV_DEFECT_COR (1 << 10)
502+#define ISP_ABS_PREV_GAMMABYPASS (1 << 11)
503+#define ISP_ABS_TBL_NF (1 << 12)
504+#define ISP_ABS_TBL_REDGAMMA (1 << 13)
505+#define ISP_ABS_TBL_GREENGAMMA (1 << 14)
506+#define ISP_ABS_TBL_BLUEGAMMA (1 << 15)
507+
508+#define ISPPRV_NF_TBL_SIZE 64
509+#define ISPPRV_CFA_TBL_SIZE 576
510+#define ISPPRV_GAMMA_TBL_SIZE 1024
511+#define ISPPRV_YENH_TBL_SIZE 128
512+
513+/**
514+ * struct ispprev_hmed - Structure for Horizontal Median Filter.
515+ * @odddist: Distance between consecutive pixels of same color in the odd line.
516+ * @evendist: Distance between consecutive pixels of same color in the even
517+ * line.
518+ * @thres: Horizontal median filter threshold.
519+ */
520+struct ispprev_hmed {
521+ __u8 odddist;
522+ __u8 evendist;
523+ __u8 thres;
524+};
525+
526+/*
527+ * Enumeration for CFA Formats supported by preview
528+ */
529+enum cfa_fmt {
530+ CFAFMT_BAYER, CFAFMT_SONYVGA, CFAFMT_RGBFOVEON,
531+ CFAFMT_DNSPL, CFAFMT_HONEYCOMB, CFAFMT_RRGGBBFOVEON
532+};
533+
534+/**
535+ * struct ispprev_cfa - Structure for CFA Inpterpolation.
536+ * @cfafmt: CFA Format Enum value supported by preview.
537+ * @cfa_gradthrs_vert: CFA Gradient Threshold - Vertical.
538+ * @cfa_gradthrs_horz: CFA Gradient Threshold - Horizontal.
539+ * @cfa_table: Pointer to the CFA table.
540+ */
541+struct ispprev_cfa {
542+ enum cfa_fmt cfafmt;
543+ __u8 cfa_gradthrs_vert;
544+ __u8 cfa_gradthrs_horz;
545+ __u32 *cfa_table;
546+};
547+
548+/**
549+ * struct ispprev_csup - Structure for Chrominance Suppression.
550+ * @gain: Gain.
551+ * @thres: Threshold.
552+ * @hypf_en: Flag to enable/disable the High Pass Filter.
553+ */
554+struct ispprev_csup {
555+ __u8 gain;
556+ __u8 thres;
557+ __u8 hypf_en;
558+};
559+
560+/**
561+ * struct ispprev_wbal - Structure for White Balance.
562+ * @dgain: Digital gain (U10Q8).
563+ * @coef3: White balance gain - COEF 3 (U8Q5).
564+ * @coef2: White balance gain - COEF 2 (U8Q5).
565+ * @coef1: White balance gain - COEF 1 (U8Q5).
566+ * @coef0: White balance gain - COEF 0 (U8Q5).
567+ */
568+struct ispprev_wbal {
569+ __u16 dgain;
570+ __u8 coef3;
571+ __u8 coef2;
572+ __u8 coef1;
573+ __u8 coef0;
574+};
575+
576+/**
577+ * struct ispprev_blkadj - Structure for Black Adjustment.
578+ * @red: Black level offset adjustment for Red in 2's complement format
579+ * @green: Black level offset adjustment for Green in 2's complement format
580+ * @blue: Black level offset adjustment for Blue in 2's complement format
581+ */
582+struct ispprev_blkadj {
583+ /*Black level offset adjustment for Red in 2's complement format */
584+ __u8 red;
585+ /*Black level offset adjustment for Green in 2's complement format */
586+ __u8 green;
587+ /* Black level offset adjustment for Blue in 2's complement format */
588+ __u8 blue;
589+};
590+
591+/**
592+ * struct ispprev_rgbtorgb - Structure for RGB to RGB Blending.
593+ * @matrix: Blending values(S12Q8 format)
594+ * [RR] [GR] [BR]
595+ * [RG] [GG] [BG]
596+ * [RB] [GB] [BB]
597+ * @offset: Blending offset value for R,G,B in 2's complement integer format.
598+ */
599+struct ispprev_rgbtorgb {
600+ __u16 matrix[3][3];
601+ __u16 offset[3];
602+};
603+
604+/**
605+ * struct ispprev_csc - Structure for Color Space Conversion from RGB-YCbYCr
606+ * @matrix: Color space conversion coefficients(S10Q8)
607+ * [CSCRY] [CSCGY] [CSCBY]
608+ * [CSCRCB] [CSCGCB] [CSCBCB]
609+ * [CSCRCR] [CSCGCR] [CSCBCR]
610+ * @offset: CSC offset values for Y offset, CB offset and CR offset respectively
611+ */
612+struct ispprev_csc {
613+ __u16 matrix[RGB_MAX][RGB_MAX];
614+ __s16 offset[RGB_MAX];
615+};
616+
617+/**
618+ * struct ispprev_yclimit - Structure for Y, C Value Limit.
619+ * @minC: Minimum C value
620+ * @maxC: Maximum C value
621+ * @minY: Minimum Y value
622+ * @maxY: Maximum Y value
623+ */
624+struct ispprev_yclimit {
625+ __u8 minC;
626+ __u8 maxC;
627+ __u8 minY;
628+ __u8 maxY;
629+};
630+
631+/**
632+ * struct ispprev_dcor - Structure for Defect correction.
633+ * @couplet_mode_en: Flag to enable or disable the couplet dc Correction in NF
634+ * @detect_correct: Thresholds for correction bit 0:10 detect 16:25 correct
635+ */
636+struct ispprev_dcor {
637+ __u8 couplet_mode_en;
638+ __u32 detect_correct[4];
639+};
640+
641+/**
642+ * struct ispprev_nf - Structure for Noise Filter
643+ * @spread: Spread value to be used in Noise Filter
644+ * @table: Pointer to the Noise Filter table
645+ */
646+struct ispprev_nf {
647+ __u8 spread;
648+ __u32 table[ISPPRV_NF_TBL_SIZE];
649+};
650+
651+/**
652+ * struct ispprv_update_config - Structure for Preview Configuration (user).
653+ * @update: Specifies which ISP Preview registers should be updated.
654+ * @flag: Specifies which ISP Preview functions should be enabled.
655+ * @yen: Pointer to luma enhancement table.
656+ * @shading_shift: 3bit value of shift used in shading compensation.
657+ * @prev_hmed: Pointer to structure containing the odd and even distance.
658+ * between the pixels in the image along with the filter threshold.
659+ * @prev_cfa: Pointer to structure containing the CFA interpolation table, CFA.
660+ * format in the image, vertical and horizontal gradient threshold.
661+ * @csup: Pointer to Structure for Chrominance Suppression coefficients.
662+ * @prev_wbal: Pointer to structure for White Balance.
663+ * @prev_blkadj: Pointer to structure for Black Adjustment.
664+ * @rgb2rgb: Pointer to structure for RGB to RGB Blending.
665+ * @prev_csc: Pointer to structure for Color Space Conversion from RGB-YCbYCr.
666+ * @yclimit: Pointer to structure for Y, C Value Limit.
667+ * @prev_dcor: Pointer to structure for defect correction.
668+ * @prev_nf: Pointer to structure for Noise Filter
669+ * @red_gamma: Pointer to red gamma correction table.
670+ * @green_gamma: Pointer to green gamma correction table.
671+ * @blue_gamma: Pointer to blue gamma correction table.
672+ */
673+struct ispprv_update_config {
674+ __u16 update;
675+ __u16 flag;
676+ void *yen;
677+ __u32 shading_shift;
678+ struct ispprev_hmed *prev_hmed;
679+ struct ispprev_cfa *prev_cfa;
680+ struct ispprev_csup *csup;
681+ struct ispprev_wbal *prev_wbal;
682+ struct ispprev_blkadj *prev_blkadj;
683+ struct ispprev_rgbtorgb *rgb2rgb;
684+ struct ispprev_csc *prev_csc;
685+ struct ispprev_yclimit *yclimit;
686+ struct ispprev_dcor *prev_dcor;
687+ struct ispprev_nf *prev_nf;
688+ __u32 *red_gamma;
689+ __u32 *green_gamma;
690+ __u32 *blue_gamma;
691+};
692+
693+#endif /* OMAP_ISP_USER_H */
694--
6951.5.6.5
696