2 * Samsung EXYNOS4x12 FIMC-IS (Imaging Subsystem) driver
4 * Copyright (C) 2011 - 2013 Samsung Electronics Co., Ltd.
6 * Authors: Younghwan Joo <yhwan.joo@samsung.com>
7 * Sylwester Nawrocki <s.nawrocki@samsung.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 #ifndef FIMC_IS_PARAM_H_
14 #define FIMC_IS_PARAM_H_
16 #include <linux/compiler.h>
18 #define FIMC_IS_CONFIG_TIMEOUT 3000 /* ms */
19 #define IS_DEFAULT_WIDTH 1280
20 #define IS_DEFAULT_HEIGHT 720
22 #define DEFAULT_PREVIEW_STILL_WIDTH IS_DEFAULT_WIDTH
23 #define DEFAULT_PREVIEW_STILL_HEIGHT IS_DEFAULT_HEIGHT
24 #define DEFAULT_CAPTURE_STILL_WIDTH IS_DEFAULT_WIDTH
25 #define DEFAULT_CAPTURE_STILL_HEIGHT IS_DEFAULT_HEIGHT
26 #define DEFAULT_PREVIEW_VIDEO_WIDTH IS_DEFAULT_WIDTH
27 #define DEFAULT_PREVIEW_VIDEO_HEIGHT IS_DEFAULT_HEIGHT
28 #define DEFAULT_CAPTURE_VIDEO_WIDTH IS_DEFAULT_WIDTH
29 #define DEFAULT_CAPTURE_VIDEO_HEIGHT IS_DEFAULT_HEIGHT
31 #define DEFAULT_PREVIEW_STILL_FRAMERATE 30
32 #define DEFAULT_CAPTURE_STILL_FRAMERATE 15
33 #define DEFAULT_PREVIEW_VIDEO_FRAMERATE 30
34 #define DEFAULT_CAPTURE_VIDEO_FRAMERATE 30
36 #define FIMC_IS_REGION_VER 124 /* IS REGION VERSION 1.24 */
37 #define FIMC_IS_PARAM_SIZE (FIMC_IS_REGION_SIZE + 1)
38 #define FIMC_IS_MAGIC_NUMBER 0x01020304
39 #define FIMC_IS_PARAM_MAX_SIZE 64 /* in bytes */
40 #define FIMC_IS_PARAM_MAX_ENTRIES (FIMC_IS_PARAM_MAX_SIZE / 4)
42 /* The parameter bitmask bit definitions. */
44 PARAM_GLOBAL_SHOTMODE
,
46 PARAM_SENSOR_OTF_OUTPUT
,
47 PARAM_SENSOR_FRAME_RATE
,
49 PARAM_BUFFER_OTF_INPUT
,
50 PARAM_BUFFER_OTF_OUTPUT
,
59 PARAM_ISP_IMAGE_EFFECT
,
66 PARAM_ISP_DMA1_OUTPUT
,
67 PARAM_ISP_DMA2_OUTPUT
,
72 PARAM_SCALERC_CONTROL
,
73 PARAM_SCALERC_OTF_INPUT
,
74 PARAM_SCALERC_IMAGE_EFFECT
,
75 PARAM_SCALERC_INPUT_CROP
,
77 PARAM_SCALERC_OUTPUT_CROP
,
78 PARAM_SCALERC_OTF_OUTPUT
,
79 PARAM_SCALERC_DMA_OUTPUT
,
90 PARAM_TDNR_OTF_OUTPUT
,
91 PARAM_TDNR_DMA_OUTPUT
,
92 PARAM_SCALERP_CONTROL
,
93 PARAM_SCALERP_OTF_INPUT
,
94 PARAM_SCALERP_IMAGE_EFFECT
,
95 PARAM_SCALERP_INPUT_CROP
,
96 PARAM_SCALERP_OUTPUT_CROP
,
97 PARAM_SCALERP_ROTATION
,
100 PARAM_SCALERP_OTF_OUTPUT
,
101 PARAM_SCALERP_DMA_OUTPUT
,
109 #define FIMC_IS_INT_GENERAL 0
110 #define FIMC_IS_INT_FRAME_DONE_ISP 1
114 #define CONTROL_COMMAND_STOP 0
115 #define CONTROL_COMMAND_START 1
117 #define CONTROL_BYPASS_DISABLE 0
118 #define CONTROL_BYPASS_ENABLE 1
120 #define CONTROL_ERROR_NONE 0
122 /* OTF (On-The-Fly) input interface commands */
123 #define OTF_INPUT_COMMAND_DISABLE 0
124 #define OTF_INPUT_COMMAND_ENABLE 1
126 /* OTF input interface color formats */
128 OTF_INPUT_FORMAT_BAYER
= 0, /* 1 channel */
129 OTF_INPUT_FORMAT_YUV444
= 1, /* 3 channels */
130 OTF_INPUT_FORMAT_YUV422
= 2, /* 3 channels */
131 OTF_INPUT_FORMAT_YUV420
= 3, /* 3 channels */
132 OTF_INPUT_FORMAT_STRGEN_COLORBAR_BAYER
= 10,
133 OTF_INPUT_FORMAT_BAYER_DMA
= 11,
136 #define OTF_INPUT_ORDER_BAYER_GR_BG 0
138 /* OTF input error codes */
139 #define OTF_INPUT_ERROR_NONE 0 /* Input setting is done */
141 /* DMA input commands */
142 #define DMA_INPUT_COMMAND_DISABLE 0
143 #define DMA_INPUT_COMMAND_ENABLE 1
145 /* DMA input color formats */
147 DMA_INPUT_FORMAT_BAYER
= 0,
148 DMA_INPUT_FORMAT_YUV444
= 1,
149 DMA_INPUT_FORMAT_YUV422
= 2,
150 DMA_INPUT_FORMAT_YUV420
= 3,
153 enum dma_input_order
{
154 /* (for DMA_INPUT_PLANE_3) */
155 DMA_INPUT_ORDER_NO
= 0,
156 /* (only valid at DMA_INPUT_PLANE_2) */
157 DMA_INPUT_ORDER_CBCR
= 1,
158 /* (only valid at DMA_INPUT_PLANE_2) */
159 DMA_INPUT_ORDER_CRCB
= 2,
160 /* (only valid at DMA_INPUT_PLANE_1 & DMA_INPUT_FORMAT_YUV444) */
161 DMA_INPUT_ORDER_YCBCR
= 3,
162 /* (only valid at DMA_INPUT_FORMAT_YUV422 & DMA_INPUT_PLANE_1) */
163 DMA_INPUT_ORDER_YYCBCR
= 4,
164 /* (only valid at DMA_INPUT_FORMAT_YUV422 & DMA_INPUT_PLANE_1) */
165 DMA_INPUT_ORDER_YCBYCR
= 5,
166 /* (only valid at DMA_INPUT_FORMAT_YUV422 & DMA_INPUT_PLANE_1) */
167 DMA_INPUT_ORDER_YCRYCB
= 6,
168 /* (only valid at DMA_INPUT_FORMAT_YUV422 & DMA_INPUT_PLANE_1) */
169 DMA_INPUT_ORDER_CBYCRY
= 7,
170 /* (only valid at DMA_INPUT_FORMAT_YUV422 & DMA_INPUT_PLANE_1) */
171 DMA_INPUT_ORDER_CRYCBY
= 8,
172 /* (only valid at DMA_INPUT_FORMAT_BAYER) */
173 DMA_INPUT_ORDER_GR_BG
= 9
176 #define DMA_INPUT_ERROR_NONE 0 /* DMA input setting
179 * Data output parameter definitions
181 #define OTF_OUTPUT_CROP_DISABLE 0
182 #define OTF_OUTPUT_CROP_ENABLE 1
184 #define OTF_OUTPUT_COMMAND_DISABLE 0
185 #define OTF_OUTPUT_COMMAND_ENABLE 1
187 enum otf_output_fmt
{
188 OTF_OUTPUT_FORMAT_YUV444
= 1,
189 OTF_OUTPUT_FORMAT_YUV422
= 2,
190 OTF_OUTPUT_FORMAT_YUV420
= 3,
191 OTF_OUTPUT_FORMAT_RGB
= 4,
194 #define OTF_OUTPUT_ORDER_BAYER_GR_BG 0
196 #define OTF_OUTPUT_ERROR_NONE 0 /* Output Setting is done */
198 #define DMA_OUTPUT_COMMAND_DISABLE 0
199 #define DMA_OUTPUT_COMMAND_ENABLE 1
201 enum dma_output_fmt
{
202 DMA_OUTPUT_FORMAT_BAYER
= 0,
203 DMA_OUTPUT_FORMAT_YUV444
= 1,
204 DMA_OUTPUT_FORMAT_YUV422
= 2,
205 DMA_OUTPUT_FORMAT_YUV420
= 3,
206 DMA_OUTPUT_FORMAT_RGB
= 4,
209 enum dma_output_order
{
210 DMA_OUTPUT_ORDER_NO
= 0,
211 /* for DMA_OUTPUT_PLANE_3 */
212 DMA_OUTPUT_ORDER_CBCR
= 1,
213 /* only valid at DMA_INPUT_PLANE_2) */
214 DMA_OUTPUT_ORDER_CRCB
= 2,
215 /* only valid at DMA_OUTPUT_PLANE_2) */
216 DMA_OUTPUT_ORDER_YYCBCR
= 3,
217 /* only valid at DMA_OUTPUT_FORMAT_YUV422 & DMA_OUTPUT_PLANE_1 */
218 DMA_OUTPUT_ORDER_YCBYCR
= 4,
219 /* only valid at DMA_OUTPUT_FORMAT_YUV422 & DMA_OUTPUT_PLANE_1 */
220 DMA_OUTPUT_ORDER_YCRYCB
= 5,
221 /* only valid at DMA_OUTPUT_FORMAT_YUV422 & DMA_OUTPUT_PLANE_1 */
222 DMA_OUTPUT_ORDER_CBYCRY
= 6,
223 /* only valid at DMA_OUTPUT_FORMAT_YUV422 & DMA_OUTPUT_PLANE_1 */
224 DMA_OUTPUT_ORDER_CRYCBY
= 7,
225 /* only valid at DMA_OUTPUT_FORMAT_YUV422 & DMA_OUTPUT_PLANE_1 */
226 DMA_OUTPUT_ORDER_YCBCR
= 8,
227 /* only valid at DMA_OUTPUT_FORMAT_YUV444 & DMA_OUPUT_PLANE_1 */
228 DMA_OUTPUT_ORDER_CRYCB
= 9,
229 /* only valid at DMA_OUTPUT_FORMAT_YUV444 & DMA_OUPUT_PLANE_1 */
230 DMA_OUTPUT_ORDER_CRCBY
= 10,
231 /* only valid at DMA_OUTPUT_FORMAT_YUV444 & DMA_OUPUT_PLANE_1 */
232 DMA_OUTPUT_ORDER_CBYCR
= 11,
233 /* only valid at DMA_OUTPUT_FORMAT_YUV444 & DMA_OUPUT_PLANE_1 */
234 DMA_OUTPUT_ORDER_YCRCB
= 12,
235 /* only valid at DMA_OUTPUT_FORMAT_YUV444 & DMA_OUPUT_PLANE_1 */
236 DMA_OUTPUT_ORDER_CBCRY
= 13,
237 /* only valid at DMA_OUTPUT_FORMAT_YUV444 & DMA_OUPUT_PLANE_1 */
238 DMA_OUTPUT_ORDER_BGR
= 14,
239 /* only valid at DMA_OUTPUT_FORMAT_RGB */
240 DMA_OUTPUT_ORDER_GB_BG
= 15
241 /* only valid at DMA_OUTPUT_FORMAT_BAYER */
244 /* enum dma_output_notify_dma_done */
245 #define DMA_OUTPUT_NOTIFY_DMA_DONE_DISABLE 0
246 #define DMA_OUTPUT_NOTIFY_DMA_DONE_ENABLE 1
248 /* DMA output error codes */
249 #define DMA_OUTPUT_ERROR_NONE 0 /* DMA output setting
252 /* ---------------------- Global ----------------------------------- */
253 #define GLOBAL_SHOTMODE_ERROR_NONE 0 /* shot-mode setting
255 /* 3A lock commands */
256 #define ISP_AA_COMMAND_START 0
257 #define ISP_AA_COMMAND_STOP 1
260 #define ISP_AA_TARGET_AF 1
261 #define ISP_AA_TARGET_AE 2
262 #define ISP_AA_TARGET_AWB 4
265 ISP_AF_MODE_MANUAL
= 0,
266 ISP_AF_MODE_SINGLE
= 1,
267 ISP_AF_MODE_CONTINUOUS
= 2,
268 ISP_AF_MODE_TOUCH
= 3,
269 ISP_AF_MODE_SLEEP
= 4,
270 ISP_AF_MODE_INIT
= 5,
271 ISP_AF_MODE_SET_CENTER_WINDOW
= 6,
272 ISP_AF_MODE_SET_TOUCH_WINDOW
= 7
275 /* Face AF commands */
276 #define ISP_AF_FACE_DISABLE 0
277 #define ISP_AF_FACE_ENABLE 1
280 #define ISP_AF_RANGE_NORMAL 0
281 #define ISP_AF_RANGE_MACRO 1
284 #define ISP_AF_SLEEP_OFF 0
285 #define ISP_AF_SLEEP_ON 1
287 /* Continuous AF commands */
288 #define ISP_AF_CONTINUOUS_DISABLE 0
289 #define ISP_AF_CONTINUOUS_ENABLE 1
291 /* ISP AF error codes */
292 #define ISP_AF_ERROR_NONE 0 /* AF mode change is done */
293 #define ISP_AF_ERROR_NONE_LOCK_DONE 1 /* AF lock is done */
296 #define ISP_FLASH_COMMAND_DISABLE 0
297 #define ISP_FLASH_COMMAND_MANUAL_ON 1 /* (forced flash) */
298 #define ISP_FLASH_COMMAND_AUTO 2
299 #define ISP_FLASH_COMMAND_TORCH 3 /* 3 sec */
301 /* Flash red-eye commads */
302 #define ISP_FLASH_REDEYE_DISABLE 0
303 #define ISP_FLASH_REDEYE_ENABLE 1
305 /* Flash error codes */
306 #define ISP_FLASH_ERROR_NONE 0 /* Flash setting is done */
308 /* -------------------------- AWB ------------------------------------ */
309 enum isp_awb_command
{
310 ISP_AWB_COMMAND_AUTO
= 0,
311 ISP_AWB_COMMAND_ILLUMINATION
= 1,
312 ISP_AWB_COMMAND_MANUAL
= 2
315 enum isp_awb_illumination
{
316 ISP_AWB_ILLUMINATION_DAYLIGHT
= 0,
317 ISP_AWB_ILLUMINATION_CLOUDY
= 1,
318 ISP_AWB_ILLUMINATION_TUNGSTEN
= 2,
319 ISP_AWB_ILLUMINATION_FLUORESCENT
= 3
322 /* ISP AWN error codes */
323 #define ISP_AWB_ERROR_NONE 0 /* AWB setting is done */
325 /* -------------------------- Effect ----------------------------------- */
326 enum isp_imageeffect_command
{
327 ISP_IMAGE_EFFECT_DISABLE
= 0,
328 ISP_IMAGE_EFFECT_MONOCHROME
= 1,
329 ISP_IMAGE_EFFECT_NEGATIVE_MONO
= 2,
330 ISP_IMAGE_EFFECT_NEGATIVE_COLOR
= 3,
331 ISP_IMAGE_EFFECT_SEPIA
= 4
334 /* Image effect error codes */
335 #define ISP_IMAGE_EFFECT_ERROR_NONE 0 /* Image effect setting
338 #define ISP_ISO_COMMAND_AUTO 0
339 #define ISP_ISO_COMMAND_MANUAL 1
341 /* ISO error codes */
342 #define ISP_ISO_ERROR_NONE 0 /* ISO setting is done */
344 /* ISP adjust commands */
345 #define ISP_ADJUST_COMMAND_AUTO (0 << 0)
346 #define ISP_ADJUST_COMMAND_MANUAL_CONTRAST (1 << 0)
347 #define ISP_ADJUST_COMMAND_MANUAL_SATURATION (1 << 1)
348 #define ISP_ADJUST_COMMAND_MANUAL_SHARPNESS (1 << 2)
349 #define ISP_ADJUST_COMMAND_MANUAL_EXPOSURE (1 << 3)
350 #define ISP_ADJUST_COMMAND_MANUAL_BRIGHTNESS (1 << 4)
351 #define ISP_ADJUST_COMMAND_MANUAL_HUE (1 << 5)
352 #define ISP_ADJUST_COMMAND_MANUAL_ALL 0x7f
354 /* ISP adjustment error codes */
355 #define ISP_ADJUST_ERROR_NONE 0 /* Adjust setting is done */
360 enum isp_metering_command
{
361 ISP_METERING_COMMAND_AVERAGE
= 0,
362 ISP_METERING_COMMAND_SPOT
= 1,
363 ISP_METERING_COMMAND_MATRIX
= 2,
364 ISP_METERING_COMMAND_CENTER
= 3
367 /* ISP metering error codes */
368 #define ISP_METERING_ERROR_NONE 0 /* Metering setting is done */
373 enum isp_afc_command
{
374 ISP_AFC_COMMAND_DISABLE
= 0,
375 ISP_AFC_COMMAND_AUTO
= 1,
376 ISP_AFC_COMMAND_MANUAL
= 2,
379 #define ISP_AFC_MANUAL_50HZ 50
380 #define ISP_AFC_MANUAL_60HZ 60
382 /* ------------------------ SCENE MODE--------------------------------- */
383 enum isp_scene_mode
{
385 ISP_SCENE_PORTRAIT
= 1,
386 ISP_SCENE_LANDSCAPE
= 2,
387 ISP_SCENE_SPORTS
= 3,
388 ISP_SCENE_PARTYINDOOR
= 4,
389 ISP_SCENE_BEACHSNOW
= 5,
390 ISP_SCENE_SUNSET
= 6,
394 ISP_SCENE_AGAINSTLIGHTWLIGHT
= 10,
395 ISP_SCENE_AGAINSTLIGHTWOLIGHT
= 11,
398 ISP_SCENE_CANDLE
= 14
401 /* AFC error codes */
402 #define ISP_AFC_ERROR_NONE 0 /* AFC setting is done */
404 /* ---------------------------- FD ------------------------------------- */
405 enum fd_config_command
{
406 FD_CONFIG_COMMAND_MAXIMUM_NUMBER
= 0x1,
407 FD_CONFIG_COMMAND_ROLL_ANGLE
= 0x2,
408 FD_CONFIG_COMMAND_YAW_ANGLE
= 0x4,
409 FD_CONFIG_COMMAND_SMILE_MODE
= 0x8,
410 FD_CONFIG_COMMAND_BLINK_MODE
= 0x10,
411 FD_CONFIG_COMMAND_EYES_DETECT
= 0x20,
412 FD_CONFIG_COMMAND_MOUTH_DETECT
= 0x40,
413 FD_CONFIG_COMMAND_ORIENTATION
= 0x80,
414 FD_CONFIG_COMMAND_ORIENTATION_VALUE
= 0x100
417 enum fd_config_roll_angle
{
418 FD_CONFIG_ROLL_ANGLE_BASIC
= 0,
419 FD_CONFIG_ROLL_ANGLE_PRECISE_BASIC
= 1,
420 FD_CONFIG_ROLL_ANGLE_SIDES
= 2,
421 FD_CONFIG_ROLL_ANGLE_PRECISE_SIDES
= 3,
422 FD_CONFIG_ROLL_ANGLE_FULL
= 4,
423 FD_CONFIG_ROLL_ANGLE_PRECISE_FULL
= 5,
426 enum fd_config_yaw_angle
{
427 FD_CONFIG_YAW_ANGLE_0
= 0,
428 FD_CONFIG_YAW_ANGLE_45
= 1,
429 FD_CONFIG_YAW_ANGLE_90
= 2,
430 FD_CONFIG_YAW_ANGLE_45_90
= 3,
433 /* Smile mode configuration */
434 #define FD_CONFIG_SMILE_MODE_DISABLE 0
435 #define FD_CONFIG_SMILE_MODE_ENABLE 1
437 /* Blink mode configuration */
438 #define FD_CONFIG_BLINK_MODE_DISABLE 0
439 #define FD_CONFIG_BLINK_MODE_ENABLE 1
441 /* Eyes detection configuration */
442 #define FD_CONFIG_EYES_DETECT_DISABLE 0
443 #define FD_CONFIG_EYES_DETECT_ENABLE 1
445 /* Mouth detection configuration */
446 #define FD_CONFIG_MOUTH_DETECT_DISABLE 0
447 #define FD_CONFIG_MOUTH_DETECT_ENABLE 1
449 #define FD_CONFIG_ORIENTATION_DISABLE 0
450 #define FD_CONFIG_ORIENTATION_ENABLE 1
452 struct param_control
{
457 u32 skip_frames
; /* only valid at ISP */
458 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 6];
462 struct param_otf_input
{
475 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 13];
479 struct param_dma_input
{
489 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 10];
493 struct param_otf_output
{
500 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 7];
504 struct param_dma_output
{
516 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 12];
520 struct param_global_shotmode
{
523 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 3];
527 struct param_sensor_framerate
{
529 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 2];
533 struct param_isp_aa
{
542 u32 manual_af_setting
;
543 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 10];
547 struct param_isp_flash
{
550 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 3];
554 struct param_isp_awb
{
557 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 3];
561 struct param_isp_imageeffect
{
563 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 2];
567 struct param_isp_iso
{
570 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 3];
574 struct param_isp_adjust
{
582 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 8];
586 struct param_isp_metering
{
592 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 6];
596 struct param_isp_afc
{
599 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 3];
603 struct param_scaler_imageeffect
{
607 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 4];
611 struct param_scaler_input_crop
{
621 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 10];
625 struct param_scaler_output_crop
{
632 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 7];
636 struct param_scaler_rotation
{
638 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 2];
642 struct param_scaler_flip
{
644 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 2];
648 struct param_3dnr_1stframe
{
650 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 2];
654 struct param_fd_config
{
664 u32 orientation_value
;
665 u32 reserved
[FIMC_IS_PARAM_MAX_ENTRIES
- 11];
669 struct global_param
{
670 struct param_global_shotmode shotmode
;
673 struct sensor_param
{
674 struct param_control control
;
675 struct param_otf_output otf_output
;
676 struct param_sensor_framerate frame_rate
;
679 struct buffer_param
{
680 struct param_control control
;
681 struct param_otf_input otf_input
;
682 struct param_otf_output otf_output
;
686 struct param_control control
;
687 struct param_otf_input otf_input
;
688 struct param_dma_input dma1_input
;
689 struct param_dma_input dma2_input
;
690 struct param_isp_aa aa
;
691 struct param_isp_flash flash
;
692 struct param_isp_awb awb
;
693 struct param_isp_imageeffect effect
;
694 struct param_isp_iso iso
;
695 struct param_isp_adjust adjust
;
696 struct param_isp_metering metering
;
697 struct param_isp_afc afc
;
698 struct param_otf_output otf_output
;
699 struct param_dma_output dma1_output
;
700 struct param_dma_output dma2_output
;
704 struct param_control control
;
705 struct param_otf_input otf_input
;
706 struct param_dma_input dma_input
;
707 struct param_otf_output otf_output
;
710 struct scalerc_param
{
711 struct param_control control
;
712 struct param_otf_input otf_input
;
713 struct param_scaler_imageeffect effect
;
714 struct param_scaler_input_crop input_crop
;
715 struct param_scaler_output_crop output_crop
;
716 struct param_otf_output otf_output
;
717 struct param_dma_output dma_output
;
721 struct param_control control
;
722 struct param_otf_input otf_input
;
723 struct param_otf_output otf_output
;
727 struct param_control control
;
728 struct param_otf_output otf_input
;
729 struct param_otf_output otf_output
;
733 struct param_control control
;
734 struct param_otf_input otf_input
;
735 struct param_3dnr_1stframe frame
;
736 struct param_otf_output otf_output
;
737 struct param_dma_output dma_output
;
740 struct scalerp_param
{
741 struct param_control control
;
742 struct param_otf_input otf_input
;
743 struct param_scaler_imageeffect effect
;
744 struct param_scaler_input_crop input_crop
;
745 struct param_scaler_output_crop output_crop
;
746 struct param_scaler_rotation rotation
;
747 struct param_scaler_flip flip
;
748 struct param_otf_output otf_output
;
749 struct param_dma_output dma_output
;
753 struct param_control control
;
754 struct param_otf_input otf_input
;
755 struct param_dma_input dma_input
;
756 struct param_fd_config config
;
759 struct is_param_region
{
760 struct global_param global
;
761 struct sensor_param sensor
;
762 struct buffer_param buf
;
763 struct isp_param isp
;
764 struct drc_param drc
;
765 struct scalerc_param scalerc
;
766 struct odc_param odc
;
767 struct dis_param dis
;
768 struct tdnr_param tdnr
;
769 struct scalerp_param scalerp
;
773 #define NUMBER_OF_GAMMA_CURVE_POINTS 32
775 struct is_tune_sensor
{
779 u32 actuator_position
;
782 struct is_tune_gammacurve
{
783 u32 num_pts_x
[NUMBER_OF_GAMMA_CURVE_POINTS
];
784 u32 num_pts_y_r
[NUMBER_OF_GAMMA_CURVE_POINTS
];
785 u32 num_pts_y_g
[NUMBER_OF_GAMMA_CURVE_POINTS
];
786 u32 num_pts_y_b
[NUMBER_OF_GAMMA_CURVE_POINTS
];
790 /* Brightness level: range 0...100, default 7. */
791 u32 brightness_level
;
792 /* Contrast level: range -127...127, default 0. */
794 /* Saturation level: range -127...127, default 0. */
795 s32 saturation_level
;
797 struct is_tune_gammacurve gamma_curve
[4];
798 /* Hue: range -127...127, default 0. */
800 /* Sharpness blur: range -127...127, default 0. */
802 /* Despeckle : range -127~127, default : 0 */
804 /* Edge color supression: range -127...127, default 0. */
805 s32 edge_color_supression
;
806 /* Noise reduction: range -127...127, default 0. */
808 /* (32 * 4 + 9) * 4 = 548 bytes */
811 struct is_tune_region
{
812 struct is_tune_sensor sensor
;
813 struct is_tune_isp isp
;
826 #define FLASH_FIRED_SHIFT 0
827 #define FLASH_NOT_FIRED 0
828 #define FLASH_FIRED 1
830 #define FLASH_STROBE_SHIFT 1
831 #define FLASH_STROBE_NO_DETECTION 0
832 #define FLASH_STROBE_RESERVED 1
833 #define FLASH_STROBE_RETURN_LIGHT_NOT_DETECTED 2
834 #define FLASH_STROBE_RETURN_LIGHT_DETECTED 3
836 #define FLASH_MODE_SHIFT 3
837 #define FLASH_MODE_UNKNOWN 0
838 #define FLASH_MODE_COMPULSORY_FLASH_FIRING 1
839 #define FLASH_MODE_COMPULSORY_FLASH_SUPPRESSION 2
840 #define FLASH_MODE_AUTO_MODE 3
842 #define FLASH_FUNCTION_SHIFT 5
843 #define FLASH_FUNCTION_PRESENT 0
844 #define FLASH_FUNCTION_NONE 1
846 #define FLASH_RED_EYE_SHIFT 6
847 #define FLASH_RED_EYE_DISABLED 0
848 #define FLASH_RED_EYE_SUPPORTED 1
850 enum apex_aperture_value
{
864 struct exif_attribute
{
865 struct rational exposure_time
;
866 struct srational shutter_speed
;
867 u32 iso_speed_rating
;
869 struct srational brightness
;
872 struct is_frame_header
{
877 struct exif_attribute exif
;
887 struct is_face_marker
{
889 struct is_fd_rect face
;
890 struct is_fd_rect left_eye
;
891 struct is_fd_rect right_eye
;
892 struct is_fd_rect mouth
;
900 #define MAX_FRAME_COUNT 8
901 #define MAX_FRAME_COUNT_PREVIEW 4
902 #define MAX_FRAME_COUNT_CAPTURE 1
903 #define MAX_FACE_COUNT 16
904 #define MAX_SHARED_COUNT 500
907 struct is_param_region parameter
;
908 struct is_tune_region tune
;
909 struct is_frame_header header
[MAX_FRAME_COUNT
];
910 struct is_face_marker face
[MAX_FACE_COUNT
];
911 u32 shared
[MAX_SHARED_COUNT
];
914 /* Offset to the ISP DMA2 output buffer address array. */
915 #define DMA2_OUTPUT_ADDR_ARRAY_OFFS \
916 (offsetof(struct is_region, shared) + 32 * sizeof(u32))
918 struct is_debug_frame_descriptor
{
919 u32 sensor_frame_time
;
920 u32 sensor_exposure_time
;
921 s32 sensor_analog_gain
;
925 u32 next_next_lei_exp
;
926 u32 next_next_lei_a_gain
;
927 u32 next_next_lei_d_gain
;
928 u32 next_next_lei_statlei
;
929 u32 next_next_lei_lei
;
934 #define MAX_FRAMEDESCRIPTOR_CONTEXT_NUM (30*20) /* 600 frames */
935 #define MAX_VERSION_DISPLAY_BUF 32
937 struct is_share_region
{
948 /* 0 : SIRC_ISP_CAMERA_AUTOFOCUSMESSAGE_NOMESSAGE */
949 /* 1 : SIRC_ISP_CAMERA_AUTOFOCUSMESSAGE_REACHED */
950 /* 2 : SIRC_ISP_CAMERA_AUTOFOCUSMESSAGE_UNABLETOREACH */
951 /* 3 : SIRC_ISP_CAMERA_AUTOFOCUSMESSAGE_LOST */
952 /* default : unknown */
955 u32 frame_descp_onoff_control
;
956 u32 frame_descp_update_done
;
958 u32 frame_descp_max_idx
;
959 struct is_debug_frame_descriptor
960 dbg_frame_descp_ctx
[MAX_FRAMEDESCRIPTOR_CONTEXT_NUM
];
964 u8 isp_fw_ver_no
[MAX_VERSION_DISPLAY_BUF
];
965 u8 isp_fw_ver_date
[MAX_VERSION_DISPLAY_BUF
];
966 u8 sirc_sdk_ver_no
[MAX_VERSION_DISPLAY_BUF
];
967 u8 sirc_sdk_rev_no
[MAX_VERSION_DISPLAY_BUF
];
968 u8 sirc_sdk_rev_date
[MAX_VERSION_DISPLAY_BUF
];
971 struct is_debug_control
{
972 u32 write_point
; /* 0~ 500KB boundary */
973 u32 assert_flag
; /* 0: Not invoked, 1: Invoked */
974 u32 pabort_flag
; /* 0: Not invoked, 1: Invoked */
975 u32 dabort_flag
; /* 0: Not invoked, 1: Invoked */
978 struct sensor_open_extended
{
983 /* Skip setfile loading when fast_open_sensor is not 0 */
984 u32 fast_open_sensor
;
985 /* Activating sensor self calibration mode (6A3) */
986 u32 self_calibration_mode
;
987 /* This field is to adjust I2c clock based on ACLK200 */
988 /* This value is varied in case of rev 0.2 */
994 int fimc_is_hw_get_sensor_max_framerate(struct fimc_is
*is
);
995 int __fimc_is_hw_update_param(struct fimc_is
*is
, u32 offset
);
996 void fimc_is_set_initial_params(struct fimc_is
*is
);
997 unsigned int __get_pending_param_count(struct fimc_is
*is
);
999 int __is_hw_update_params(struct fimc_is
*is
);
1000 void __is_get_frame_size(struct fimc_is
*is
, struct v4l2_mbus_framefmt
*mf
);
1001 void __is_set_frame_size(struct fimc_is
*is
, struct v4l2_mbus_framefmt
*mf
);
1002 void __is_set_sensor(struct fimc_is
*is
, int fps
);
1003 void __is_set_isp_aa_ae(struct fimc_is
*is
);
1004 void __is_set_isp_flash(struct fimc_is
*is
, u32 cmd
, u32 redeye
);
1005 void __is_set_isp_awb(struct fimc_is
*is
, u32 cmd
, u32 val
);
1006 void __is_set_isp_effect(struct fimc_is
*is
, u32 cmd
);
1007 void __is_set_isp_iso(struct fimc_is
*is
, u32 cmd
, u32 val
);
1008 void __is_set_isp_adjust(struct fimc_is
*is
, u32 cmd
, u32 val
);
1009 void __is_set_isp_metering(struct fimc_is
*is
, u32 id
, u32 val
);
1010 void __is_set_isp_afc(struct fimc_is
*is
, u32 cmd
, u32 val
);
1011 void __is_set_drc_control(struct fimc_is
*is
, u32 val
);
1012 void __is_set_fd_control(struct fimc_is
*is
, u32 val
);
1013 void __is_set_fd_config_maxface(struct fimc_is
*is
, u32 val
);
1014 void __is_set_fd_config_rollangle(struct fimc_is
*is
, u32 val
);
1015 void __is_set_fd_config_yawangle(struct fimc_is
*is
, u32 val
);
1016 void __is_set_fd_config_smilemode(struct fimc_is
*is
, u32 val
);
1017 void __is_set_fd_config_blinkmode(struct fimc_is
*is
, u32 val
);
1018 void __is_set_fd_config_eyedetect(struct fimc_is
*is
, u32 val
);
1019 void __is_set_fd_config_mouthdetect(struct fimc_is
*is
, u32 val
);
1020 void __is_set_fd_config_orientation(struct fimc_is
*is
, u32 val
);
1021 void __is_set_fd_config_orientation_val(struct fimc_is
*is
, u32 val
);
1022 void __is_set_isp_aa_af_mode(struct fimc_is
*is
, int cmd
);
1023 void __is_set_isp_aa_af_start_stop(struct fimc_is
*is
, int cmd
);