2 * Support for Clovertrail PNW Camera Imaging ISP subsystem.
4 * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 #ifndef __ATOMISP_COMPAT_H__
23 #define __ATOMISP_COMPAT_H__
25 #include "atomisp_compat_css20.h"
27 #include "../../include/linux/atomisp.h"
28 #include <media/videobuf-vmalloc.h>
30 #define CSS_RX_IRQ_INFO_BUFFER_OVERRUN \
31 CSS_ID(CSS_RX_IRQ_INFO_BUFFER_OVERRUN)
32 #define CSS_RX_IRQ_INFO_ENTER_SLEEP_MODE \
33 CSS_ID(CSS_RX_IRQ_INFO_ENTER_SLEEP_MODE)
34 #define CSS_RX_IRQ_INFO_EXIT_SLEEP_MODE \
35 CSS_ID(CSS_RX_IRQ_INFO_EXIT_SLEEP_MODE)
36 #define CSS_RX_IRQ_INFO_ECC_CORRECTED \
37 CSS_ID(CSS_RX_IRQ_INFO_ECC_CORRECTED)
38 #define CSS_RX_IRQ_INFO_ERR_SOT \
39 CSS_ID(CSS_RX_IRQ_INFO_ERR_SOT)
40 #define CSS_RX_IRQ_INFO_ERR_SOT_SYNC \
41 CSS_ID(CSS_RX_IRQ_INFO_ERR_SOT_SYNC)
42 #define CSS_RX_IRQ_INFO_ERR_CONTROL \
43 CSS_ID(CSS_RX_IRQ_INFO_ERR_CONTROL)
44 #define CSS_RX_IRQ_INFO_ERR_ECC_DOUBLE \
45 CSS_ID(CSS_RX_IRQ_INFO_ERR_ECC_DOUBLE)
46 #define CSS_RX_IRQ_INFO_ERR_CRC \
47 CSS_ID(CSS_RX_IRQ_INFO_ERR_CRC)
48 #define CSS_RX_IRQ_INFO_ERR_UNKNOWN_ID \
49 CSS_ID(CSS_RX_IRQ_INFO_ERR_UNKNOWN_ID)
50 #define CSS_RX_IRQ_INFO_ERR_FRAME_SYNC \
51 CSS_ID(CSS_RX_IRQ_INFO_ERR_FRAME_SYNC)
52 #define CSS_RX_IRQ_INFO_ERR_FRAME_DATA \
53 CSS_ID(CSS_RX_IRQ_INFO_ERR_FRAME_DATA)
54 #define CSS_RX_IRQ_INFO_ERR_DATA_TIMEOUT \
55 CSS_ID(CSS_RX_IRQ_INFO_ERR_DATA_TIMEOUT)
56 #define CSS_RX_IRQ_INFO_ERR_UNKNOWN_ESC \
57 CSS_ID(CSS_RX_IRQ_INFO_ERR_UNKNOWN_ESC)
58 #define CSS_RX_IRQ_INFO_ERR_LINE_SYNC \
59 CSS_ID(CSS_RX_IRQ_INFO_ERR_LINE_SYNC)
60 #define CSS_RX_IRQ_INFO_INIT_TIMEOUT \
61 CSS_ID(CSS_RX_IRQ_INFO_INIT_TIMEOUT)
63 #define CSS_IRQ_INFO_CSS_RECEIVER_SOF CSS_ID(CSS_IRQ_INFO_CSS_RECEIVER_SOF)
64 #define CSS_IRQ_INFO_CSS_RECEIVER_EOF CSS_ID(CSS_IRQ_INFO_CSS_RECEIVER_EOF)
65 #define CSS_IRQ_INFO_CSS_RECEIVER_FIFO_OVERFLOW \
66 CSS_ID(CSS_IRQ_INFO_CSS_RECEIVER_FIFO_OVERFLOW)
67 #define CSS_EVENT_OUTPUT_FRAME_DONE CSS_EVENT(OUTPUT_FRAME_DONE)
68 #define CSS_EVENT_SEC_OUTPUT_FRAME_DONE CSS_EVENT(SECOND_OUTPUT_FRAME_DONE)
69 #define CSS_EVENT_VF_OUTPUT_FRAME_DONE CSS_EVENT(VF_OUTPUT_FRAME_DONE)
70 #define CSS_EVENT_SEC_VF_OUTPUT_FRAME_DONE CSS_EVENT(SECOND_VF_OUTPUT_FRAME_DONE)
71 #define CSS_EVENT_3A_STATISTICS_DONE CSS_EVENT(3A_STATISTICS_DONE)
72 #define CSS_EVENT_DIS_STATISTICS_DONE CSS_EVENT(DIS_STATISTICS_DONE)
73 #define CSS_EVENT_PIPELINE_DONE CSS_EVENT(PIPELINE_DONE)
74 #define CSS_EVENT_METADATA_DONE CSS_EVENT(METADATA_DONE)
75 #define CSS_EVENT_ACC_STAGE_COMPLETE CSS_EVENT(ACC_STAGE_COMPLETE)
76 #define CSS_EVENT_TIMER CSS_EVENT(TIMER)
78 #define CSS_BUFFER_TYPE_METADATA CSS_ID(CSS_BUFFER_TYPE_METADATA)
79 #define CSS_BUFFER_TYPE_3A_STATISTICS CSS_ID(CSS_BUFFER_TYPE_3A_STATISTICS)
80 #define CSS_BUFFER_TYPE_DIS_STATISTICS CSS_ID(CSS_BUFFER_TYPE_DIS_STATISTICS)
81 #define CSS_BUFFER_TYPE_INPUT_FRAME CSS_ID(CSS_BUFFER_TYPE_INPUT_FRAME)
82 #define CSS_BUFFER_TYPE_OUTPUT_FRAME CSS_ID(CSS_BUFFER_TYPE_OUTPUT_FRAME)
83 #define CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME CSS_ID(CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME)
84 #define CSS_BUFFER_TYPE_VF_OUTPUT_FRAME CSS_ID(CSS_BUFFER_TYPE_VF_OUTPUT_FRAME)
85 #define CSS_BUFFER_TYPE_SEC_VF_OUTPUT_FRAME CSS_ID(CSS_BUFFER_TYPE_SEC_VF_OUTPUT_FRAME)
86 #define CSS_BUFFER_TYPE_RAW_OUTPUT_FRAME \
87 CSS_ID(CSS_BUFFER_TYPE_RAW_OUTPUT_FRAME)
89 #define CSS_FORMAT_RAW_8 CSS_FORMAT(RAW_8)
90 #define CSS_FORMAT_RAW_10 CSS_FORMAT(RAW_10)
91 #define CSS_FORMAT_RAW_12 CSS_FORMAT(RAW_12)
92 #define CSS_FORMAT_RAW_16 CSS_FORMAT(RAW_16)
94 #define CSS_CAPTURE_MODE_RAW CSS_ID(CSS_CAPTURE_MODE_RAW)
95 #define CSS_CAPTURE_MODE_BAYER CSS_ID(CSS_CAPTURE_MODE_BAYER)
96 #define CSS_CAPTURE_MODE_PRIMARY CSS_ID(CSS_CAPTURE_MODE_PRIMARY)
97 #define CSS_CAPTURE_MODE_ADVANCED CSS_ID(CSS_CAPTURE_MODE_ADVANCED)
98 #define CSS_CAPTURE_MODE_LOW_LIGHT CSS_ID(CSS_CAPTURE_MODE_LOW_LIGHT)
100 #define CSS_MORPH_TABLE_NUM_PLANES CSS_ID(CSS_MORPH_TABLE_NUM_PLANES)
102 #define CSS_FRAME_FORMAT_NV11 CSS_ID(CSS_FRAME_FORMAT_NV11)
103 #define CSS_FRAME_FORMAT_NV12 CSS_ID(CSS_FRAME_FORMAT_NV12)
104 #define CSS_FRAME_FORMAT_NV16 CSS_ID(CSS_FRAME_FORMAT_NV16)
105 #define CSS_FRAME_FORMAT_NV21 CSS_ID(CSS_FRAME_FORMAT_NV21)
106 #define CSS_FRAME_FORMAT_NV61 CSS_ID(CSS_FRAME_FORMAT_NV61)
107 #define CSS_FRAME_FORMAT_YV12 CSS_ID(CSS_FRAME_FORMAT_YV12)
108 #define CSS_FRAME_FORMAT_YV16 CSS_ID(CSS_FRAME_FORMAT_YV16)
109 #define CSS_FRAME_FORMAT_YUV420 CSS_ID(CSS_FRAME_FORMAT_YUV420)
110 #define CSS_FRAME_FORMAT_YUV420_16 CSS_ID(CSS_FRAME_FORMAT_YUV420_16)
111 #define CSS_FRAME_FORMAT_YUV422 CSS_ID(CSS_FRAME_FORMAT_YUV422)
112 #define CSS_FRAME_FORMAT_YUV422_16 CSS_ID(CSS_FRAME_FORMAT_YUV422_16)
113 #define CSS_FRAME_FORMAT_UYVY CSS_ID(CSS_FRAME_FORMAT_UYVY)
114 #define CSS_FRAME_FORMAT_YUYV CSS_ID(CSS_FRAME_FORMAT_YUYV)
115 #define CSS_FRAME_FORMAT_YUV444 CSS_ID(CSS_FRAME_FORMAT_YUV444)
116 #define CSS_FRAME_FORMAT_YUV_LINE CSS_ID(CSS_FRAME_FORMAT_YUV_LINE)
117 #define CSS_FRAME_FORMAT_RAW CSS_ID(CSS_FRAME_FORMAT_RAW)
118 #define CSS_FRAME_FORMAT_RGB565 CSS_ID(CSS_FRAME_FORMAT_RGB565)
119 #define CSS_FRAME_FORMAT_PLANAR_RGB888 CSS_ID(CSS_FRAME_FORMAT_PLANAR_RGB888)
120 #define CSS_FRAME_FORMAT_RGBA888 CSS_ID(CSS_FRAME_FORMAT_RGBA888)
121 #define CSS_FRAME_FORMAT_QPLANE6 CSS_ID(CSS_FRAME_FORMAT_QPLANE6)
122 #define CSS_FRAME_FORMAT_BINARY_8 CSS_ID(CSS_FRAME_FORMAT_BINARY_8)
124 struct atomisp_device
;
125 struct atomisp_sub_device
;
127 enum atomisp_input_stream_id
;
129 struct atomisp_metadata_buf
{
130 struct ia_css_metadata
*metadata
;
132 struct list_head list
;
135 void atomisp_css_debug_dump_sp_sw_debug_info(void);
136 void atomisp_css_debug_dump_debug_info(const char *context
);
137 void atomisp_css_debug_set_dtrace_level(const unsigned int trace_level
);
139 void atomisp_store_uint32(hrt_address addr
, uint32_t data
);
140 void atomisp_load_uint32(hrt_address addr
, uint32_t *data
);
142 int atomisp_css_init(struct atomisp_device
*isp
);
144 void atomisp_css_uninit(struct atomisp_device
*isp
);
146 void atomisp_css_suspend(struct atomisp_device
*isp
);
148 int atomisp_css_resume(struct atomisp_device
*isp
);
150 void atomisp_css_init_struct(struct atomisp_sub_device
*asd
);
152 int atomisp_css_irq_translate(struct atomisp_device
*isp
,
153 unsigned int *infos
);
155 void atomisp_css_rx_get_irq_info(enum ia_css_csi2_port port
,
156 unsigned int *infos
);
158 void atomisp_css_rx_clear_irq_info(enum ia_css_csi2_port port
,
161 int atomisp_css_irq_enable(struct atomisp_device
*isp
,
162 enum atomisp_css_irq_info info
, bool enable
);
164 int atomisp_q_video_buffer_to_css(struct atomisp_sub_device
*asd
,
165 struct videobuf_vmalloc_memory
*vm_mem
,
166 enum atomisp_input_stream_id stream_id
,
167 enum atomisp_css_buffer_type css_buf_type
,
168 enum atomisp_css_pipe_id css_pipe_id
);
170 int atomisp_q_s3a_buffer_to_css(struct atomisp_sub_device
*asd
,
171 struct atomisp_s3a_buf
*s3a_buf
,
172 enum atomisp_input_stream_id stream_id
,
173 enum atomisp_css_pipe_id css_pipe_id
);
175 int atomisp_q_metadata_buffer_to_css(struct atomisp_sub_device
*asd
,
176 struct atomisp_metadata_buf
*metadata_buf
,
177 enum atomisp_input_stream_id stream_id
,
178 enum atomisp_css_pipe_id css_pipe_id
);
180 int atomisp_q_dis_buffer_to_css(struct atomisp_sub_device
*asd
,
181 struct atomisp_dis_buf
*dis_buf
,
182 enum atomisp_input_stream_id stream_id
,
183 enum atomisp_css_pipe_id css_pipe_id
);
185 void atomisp_css_mmu_invalidate_cache(void);
187 void atomisp_css_mmu_invalidate_tlb(void);
189 void atomisp_css_mmu_set_page_table_base_index(unsigned long base_index
);
191 int atomisp_css_start(struct atomisp_sub_device
*asd
,
192 enum atomisp_css_pipe_id pipe_id
, bool in_reset
);
194 void atomisp_css_update_isp_params(struct atomisp_sub_device
*asd
);
195 void atomisp_css_update_isp_params_on_pipe(struct atomisp_sub_device
*asd
,
196 struct ia_css_pipe
*pipe
);
198 int atomisp_css_queue_buffer(struct atomisp_sub_device
*asd
,
199 enum atomisp_input_stream_id stream_id
,
200 enum atomisp_css_pipe_id pipe_id
,
201 enum atomisp_css_buffer_type buf_type
,
202 struct atomisp_css_buffer
*isp_css_buffer
);
204 int atomisp_css_dequeue_buffer(struct atomisp_sub_device
*asd
,
205 enum atomisp_input_stream_id stream_id
,
206 enum atomisp_css_pipe_id pipe_id
,
207 enum atomisp_css_buffer_type buf_type
,
208 struct atomisp_css_buffer
*isp_css_buffer
);
210 int atomisp_css_allocate_stat_buffers(struct atomisp_sub_device
*asd
,
212 struct atomisp_s3a_buf
*s3a_buf
,
213 struct atomisp_dis_buf
*dis_buf
,
214 struct atomisp_metadata_buf
*md_buf
);
216 void atomisp_css_free_stat_buffers(struct atomisp_sub_device
*asd
);
218 void atomisp_css_free_3a_buffer(struct atomisp_s3a_buf
*s3a_buf
);
220 void atomisp_css_free_dis_buffer(struct atomisp_dis_buf
*dis_buf
);
222 void atomisp_css_free_metadata_buffer(struct atomisp_metadata_buf
*metadata_buf
);
224 int atomisp_css_get_grid_info(struct atomisp_sub_device
*asd
,
225 enum atomisp_css_pipe_id pipe_id
,
228 int atomisp_alloc_3a_output_buf(struct atomisp_sub_device
*asd
);
230 int atomisp_alloc_dis_coef_buf(struct atomisp_sub_device
*asd
);
232 int atomisp_alloc_metadata_output_buf(struct atomisp_sub_device
*asd
);
234 void atomisp_free_metadata_output_buf(struct atomisp_sub_device
*asd
);
236 void atomisp_css_get_dis_statistics(struct atomisp_sub_device
*asd
,
237 struct atomisp_css_buffer
*isp_css_buffer
,
238 struct ia_css_isp_dvs_statistics_map
*dvs_map
);
240 int atomisp_css_dequeue_event(struct atomisp_css_event
*current_event
);
242 void atomisp_css_temp_pipe_to_pipe_id(struct atomisp_sub_device
*asd
,
243 struct atomisp_css_event
*current_event
);
245 int atomisp_css_isys_set_resolution(struct atomisp_sub_device
*asd
,
246 enum atomisp_input_stream_id stream_id
,
247 struct v4l2_mbus_framefmt
*ffmt
,
250 void atomisp_css_isys_set_link(struct atomisp_sub_device
*asd
,
251 enum atomisp_input_stream_id stream_id
,
255 void atomisp_css_isys_set_valid(struct atomisp_sub_device
*asd
,
256 enum atomisp_input_stream_id stream_id
,
260 void atomisp_css_isys_set_format(struct atomisp_sub_device
*asd
,
261 enum atomisp_input_stream_id stream_id
,
262 enum atomisp_css_stream_format format
,
265 int atomisp_css_set_default_isys_config(struct atomisp_sub_device
*asd
,
266 enum atomisp_input_stream_id stream_id
,
267 struct v4l2_mbus_framefmt
*ffmt
);
269 int atomisp_css_isys_two_stream_cfg(struct atomisp_sub_device
*asd
,
270 enum atomisp_input_stream_id stream_id
,
271 enum atomisp_css_stream_format input_format
);
273 void atomisp_css_isys_two_stream_cfg_update_stream1(
274 struct atomisp_sub_device
*asd
,
275 enum atomisp_input_stream_id stream_id
,
276 enum atomisp_css_stream_format input_format
,
277 unsigned int width
, unsigned int height
);
279 void atomisp_css_isys_two_stream_cfg_update_stream2(
280 struct atomisp_sub_device
*asd
,
281 enum atomisp_input_stream_id stream_id
,
282 enum atomisp_css_stream_format input_format
,
283 unsigned int width
, unsigned int height
);
285 int atomisp_css_input_set_resolution(struct atomisp_sub_device
*asd
,
286 enum atomisp_input_stream_id stream_id
,
287 struct v4l2_mbus_framefmt
*ffmt
);
289 void atomisp_css_input_set_binning_factor(struct atomisp_sub_device
*asd
,
290 enum atomisp_input_stream_id stream_id
,
291 unsigned int bin_factor
);
293 void atomisp_css_input_set_bayer_order(struct atomisp_sub_device
*asd
,
294 enum atomisp_input_stream_id stream_id
,
295 enum atomisp_css_bayer_order bayer_order
);
297 void atomisp_css_input_set_format(struct atomisp_sub_device
*asd
,
298 enum atomisp_input_stream_id stream_id
,
299 enum atomisp_css_stream_format format
);
301 int atomisp_css_input_set_effective_resolution(
302 struct atomisp_sub_device
*asd
,
303 enum atomisp_input_stream_id stream_id
,
305 unsigned int height
);
307 void atomisp_css_video_set_dis_envelope(struct atomisp_sub_device
*asd
,
308 unsigned int dvs_w
, unsigned int dvs_h
);
310 void atomisp_css_input_set_two_pixels_per_clock(
311 struct atomisp_sub_device
*asd
,
314 void atomisp_css_enable_raw_binning(struct atomisp_sub_device
*asd
,
317 void atomisp_css_enable_dz(struct atomisp_sub_device
*asd
, bool enable
);
319 void atomisp_css_capture_set_mode(struct atomisp_sub_device
*asd
,
320 enum atomisp_css_capture_mode mode
);
322 void atomisp_css_input_set_mode(struct atomisp_sub_device
*asd
,
323 enum atomisp_css_input_mode mode
);
325 void atomisp_css_capture_enable_online(struct atomisp_sub_device
*asd
,
326 unsigned short stream_index
, bool enable
);
328 void atomisp_css_preview_enable_online(struct atomisp_sub_device
*asd
,
329 unsigned short stream_index
, bool enable
);
331 void atomisp_css_video_enable_online(struct atomisp_sub_device
*asd
,
334 void atomisp_css_enable_continuous(struct atomisp_sub_device
*asd
,
337 void atomisp_css_enable_cvf(struct atomisp_sub_device
*asd
,
340 int atomisp_css_input_configure_port(struct atomisp_sub_device
*asd
,
342 unsigned int num_lanes
,
343 unsigned int timeout
,
344 unsigned int mipi_freq
,
345 enum atomisp_css_stream_format metadata_format
,
346 unsigned int metadata_width
,
347 unsigned int metadata_height
);
349 int atomisp_css_frame_allocate(struct atomisp_css_frame
**frame
,
350 unsigned int width
, unsigned int height
,
351 enum atomisp_css_frame_format format
,
352 unsigned int padded_width
,
353 unsigned int raw_bit_depth
);
355 int atomisp_css_frame_allocate_from_info(struct atomisp_css_frame
**frame
,
356 const struct atomisp_css_frame_info
*info
);
358 void atomisp_css_frame_free(struct atomisp_css_frame
*frame
);
360 int atomisp_css_frame_map(struct atomisp_css_frame
**frame
,
361 const struct atomisp_css_frame_info
*info
,
362 const void *data
, uint16_t attribute
,
365 int atomisp_css_set_black_frame(struct atomisp_sub_device
*asd
,
366 const struct atomisp_css_frame
*raw_black_frame
);
368 int atomisp_css_allocate_continuous_frames(bool init_time
,
369 struct atomisp_sub_device
*asd
);
371 void atomisp_css_update_continuous_frames(struct atomisp_sub_device
*asd
);
373 void atomisp_create_pipes_stream(struct atomisp_sub_device
*asd
);
374 void atomisp_destroy_pipes_stream_force(struct atomisp_sub_device
*asd
);
376 int atomisp_css_stop(struct atomisp_sub_device
*asd
,
377 enum atomisp_css_pipe_id pipe_id
, bool in_reset
);
379 int atomisp_css_continuous_set_num_raw_frames(
380 struct atomisp_sub_device
*asd
,
383 void atomisp_css_disable_vf_pp(struct atomisp_sub_device
*asd
,
386 int atomisp_css_copy_configure_output(struct atomisp_sub_device
*asd
,
387 unsigned int stream_index
,
388 unsigned int width
, unsigned int height
,
389 unsigned int padded_width
,
390 enum atomisp_css_frame_format format
);
392 int atomisp_css_yuvpp_configure_output(struct atomisp_sub_device
*asd
,
393 unsigned int stream_index
,
394 unsigned int width
, unsigned int height
,
395 unsigned int padded_width
,
396 enum atomisp_css_frame_format format
);
398 int atomisp_css_yuvpp_configure_viewfinder(
399 struct atomisp_sub_device
*asd
,
400 unsigned int stream_index
,
401 unsigned int width
, unsigned int height
,
402 unsigned int min_width
,
403 enum atomisp_css_frame_format format
);
405 int atomisp_css_yuvpp_get_output_frame_info(
406 struct atomisp_sub_device
*asd
,
407 unsigned int stream_index
,
408 struct atomisp_css_frame_info
*info
);
410 int atomisp_css_yuvpp_get_viewfinder_frame_info(
411 struct atomisp_sub_device
*asd
,
412 unsigned int stream_index
,
413 struct atomisp_css_frame_info
*info
);
415 int atomisp_css_preview_configure_output(struct atomisp_sub_device
*asd
,
416 unsigned int width
, unsigned int height
,
417 unsigned int min_width
,
418 enum atomisp_css_frame_format format
);
420 int atomisp_css_capture_configure_output(struct atomisp_sub_device
*asd
,
421 unsigned int width
, unsigned int height
,
422 unsigned int min_width
,
423 enum atomisp_css_frame_format format
);
425 int atomisp_css_video_configure_output(struct atomisp_sub_device
*asd
,
426 unsigned int width
, unsigned int height
,
427 unsigned int min_width
,
428 enum atomisp_css_frame_format format
);
430 int atomisp_get_css_frame_info(struct atomisp_sub_device
*asd
,
432 struct atomisp_css_frame_info
*frame_info
);
434 int atomisp_css_video_configure_viewfinder(struct atomisp_sub_device
*asd
,
435 unsigned int width
, unsigned int height
,
436 unsigned int min_width
,
437 enum atomisp_css_frame_format format
);
439 int atomisp_css_capture_configure_viewfinder(
440 struct atomisp_sub_device
*asd
,
441 unsigned int width
, unsigned int height
,
442 unsigned int min_width
,
443 enum atomisp_css_frame_format format
);
445 int atomisp_css_video_get_viewfinder_frame_info(
446 struct atomisp_sub_device
*asd
,
447 struct atomisp_css_frame_info
*info
);
449 int atomisp_css_capture_get_viewfinder_frame_info(
450 struct atomisp_sub_device
*asd
,
451 struct atomisp_css_frame_info
*info
);
453 int atomisp_css_copy_get_output_frame_info(
454 struct atomisp_sub_device
*asd
,
455 unsigned int stream_index
,
456 struct atomisp_css_frame_info
*info
);
458 int atomisp_css_capture_get_output_raw_frame_info(
459 struct atomisp_sub_device
*asd
,
460 struct atomisp_css_frame_info
*info
);
462 int atomisp_css_preview_get_output_frame_info(
463 struct atomisp_sub_device
*asd
,
464 struct atomisp_css_frame_info
*info
);
466 int atomisp_css_capture_get_output_frame_info(
467 struct atomisp_sub_device
*asd
,
468 struct atomisp_css_frame_info
*info
);
470 int atomisp_css_video_get_output_frame_info(
471 struct atomisp_sub_device
*asd
,
472 struct atomisp_css_frame_info
*info
);
474 int atomisp_css_preview_configure_pp_input(
475 struct atomisp_sub_device
*asd
,
476 unsigned int width
, unsigned int height
);
478 int atomisp_css_capture_configure_pp_input(
479 struct atomisp_sub_device
*asd
,
480 unsigned int width
, unsigned int height
);
482 int atomisp_css_video_configure_pp_input(
483 struct atomisp_sub_device
*asd
,
484 unsigned int width
, unsigned int height
);
486 int atomisp_css_offline_capture_configure(struct atomisp_sub_device
*asd
,
487 int num_captures
, unsigned int skip
, int offset
);
488 int atomisp_css_exp_id_capture(struct atomisp_sub_device
*asd
, int exp_id
);
489 int atomisp_css_exp_id_unlock(struct atomisp_sub_device
*asd
, int exp_id
);
491 int atomisp_css_capture_enable_xnr(struct atomisp_sub_device
*asd
,
494 void atomisp_css_send_input_frame(struct atomisp_sub_device
*asd
,
495 unsigned short *data
, unsigned int width
,
496 unsigned int height
);
498 bool atomisp_css_isp_has_started(void);
500 void atomisp_css_request_flash(struct atomisp_sub_device
*asd
);
502 void atomisp_css_set_wb_config(struct atomisp_sub_device
*asd
,
503 struct atomisp_css_wb_config
*wb_config
);
505 void atomisp_css_set_ob_config(struct atomisp_sub_device
*asd
,
506 struct atomisp_css_ob_config
*ob_config
);
508 void atomisp_css_set_dp_config(struct atomisp_sub_device
*asd
,
509 struct atomisp_css_dp_config
*dp_config
);
511 void atomisp_css_set_de_config(struct atomisp_sub_device
*asd
,
512 struct atomisp_css_de_config
*de_config
);
514 void atomisp_css_set_dz_config(struct atomisp_sub_device
*asd
,
515 struct atomisp_css_dz_config
*dz_config
);
517 void atomisp_css_set_default_de_config(struct atomisp_sub_device
*asd
);
519 void atomisp_css_set_ce_config(struct atomisp_sub_device
*asd
,
520 struct atomisp_css_ce_config
*ce_config
);
522 void atomisp_css_set_nr_config(struct atomisp_sub_device
*asd
,
523 struct atomisp_css_nr_config
*nr_config
);
525 void atomisp_css_set_ee_config(struct atomisp_sub_device
*asd
,
526 struct atomisp_css_ee_config
*ee_config
);
528 void atomisp_css_set_tnr_config(struct atomisp_sub_device
*asd
,
529 struct atomisp_css_tnr_config
*tnr_config
);
531 void atomisp_css_set_cc_config(struct atomisp_sub_device
*asd
,
532 struct atomisp_css_cc_config
*cc_config
);
534 void atomisp_css_set_macc_table(struct atomisp_sub_device
*asd
,
535 struct atomisp_css_macc_table
*macc_table
);
537 void atomisp_css_set_gamma_table(struct atomisp_sub_device
*asd
,
538 struct atomisp_css_gamma_table
*gamma_table
);
540 void atomisp_css_set_ctc_table(struct atomisp_sub_device
*asd
,
541 struct atomisp_css_ctc_table
*ctc_table
);
543 void atomisp_css_set_gc_config(struct atomisp_sub_device
*asd
,
544 struct atomisp_css_gc_config
*gc_config
);
546 void atomisp_css_set_3a_config(struct atomisp_sub_device
*asd
,
547 struct atomisp_css_3a_config
*s3a_config
);
549 void atomisp_css_video_set_dis_vector(struct atomisp_sub_device
*asd
,
550 struct atomisp_dis_vector
*vector
);
552 void atomisp_css_set_dvs2_coefs(struct atomisp_sub_device
*asd
,
553 struct ia_css_dvs2_coefficients
*coefs
);
555 int atomisp_css_set_dis_coefs(struct atomisp_sub_device
*asd
,
556 struct atomisp_dis_coefficients
*coefs
);
558 void atomisp_css_set_zoom_factor(struct atomisp_sub_device
*asd
,
561 int atomisp_css_get_wb_config(struct atomisp_sub_device
*asd
,
562 struct atomisp_wb_config
*config
);
564 int atomisp_css_get_ob_config(struct atomisp_sub_device
*asd
,
565 struct atomisp_ob_config
*config
);
567 int atomisp_css_get_dp_config(struct atomisp_sub_device
*asd
,
568 struct atomisp_dp_config
*config
);
570 int atomisp_css_get_de_config(struct atomisp_sub_device
*asd
,
571 struct atomisp_de_config
*config
);
573 int atomisp_css_get_nr_config(struct atomisp_sub_device
*asd
,
574 struct atomisp_nr_config
*config
);
576 int atomisp_css_get_ee_config(struct atomisp_sub_device
*asd
,
577 struct atomisp_ee_config
*config
);
579 int atomisp_css_get_tnr_config(struct atomisp_sub_device
*asd
,
580 struct atomisp_tnr_config
*config
);
582 int atomisp_css_get_ctc_table(struct atomisp_sub_device
*asd
,
583 struct atomisp_ctc_table
*config
);
585 int atomisp_css_get_gamma_table(struct atomisp_sub_device
*asd
,
586 struct atomisp_gamma_table
*config
);
588 int atomisp_css_get_gc_config(struct atomisp_sub_device
*asd
,
589 struct atomisp_gc_config
*config
);
591 int atomisp_css_get_3a_config(struct atomisp_sub_device
*asd
,
592 struct atomisp_3a_config
*config
);
594 int atomisp_css_get_formats_config(struct atomisp_sub_device
*asd
,
595 struct atomisp_formats_config
*formats_config
);
597 void atomisp_css_set_formats_config(struct atomisp_sub_device
*asd
,
598 struct atomisp_css_formats_config
*formats_config
);
600 int atomisp_css_get_zoom_factor(struct atomisp_sub_device
*asd
,
603 struct atomisp_css_shading_table
*atomisp_css_shading_table_alloc(
604 unsigned int width
, unsigned int height
);
606 void atomisp_css_set_shading_table(struct atomisp_sub_device
*asd
,
607 struct atomisp_css_shading_table
*table
);
609 void atomisp_css_shading_table_free(struct atomisp_css_shading_table
*table
);
611 struct atomisp_css_morph_table
*atomisp_css_morph_table_allocate(
612 unsigned int width
, unsigned int height
);
614 void atomisp_css_set_morph_table(struct atomisp_sub_device
*asd
,
615 struct atomisp_css_morph_table
*table
);
617 void atomisp_css_get_morph_table(struct atomisp_sub_device
*asd
,
618 struct atomisp_css_morph_table
*table
);
620 void atomisp_css_morph_table_free(struct atomisp_css_morph_table
*table
);
622 void atomisp_css_set_cont_prev_start_time(struct atomisp_device
*isp
,
623 unsigned int overlap
);
625 int atomisp_css_get_dis_stat(struct atomisp_sub_device
*asd
,
626 struct atomisp_dis_statistics
*stats
);
628 int atomisp_css_update_stream(struct atomisp_sub_device
*asd
);
630 int atomisp_css_create_acc_pipe(struct atomisp_sub_device
*asd
);
632 int atomisp_css_start_acc_pipe(struct atomisp_sub_device
*asd
);
634 int atomisp_css_stop_acc_pipe(struct atomisp_sub_device
*asd
);
636 void atomisp_css_destroy_acc_pipe(struct atomisp_sub_device
*asd
);
638 int atomisp_css_load_acc_extension(struct atomisp_sub_device
*asd
,
639 struct atomisp_css_fw_info
*fw
,
640 enum atomisp_css_pipe_id pipe_id
,
643 void atomisp_css_unload_acc_extension(struct atomisp_sub_device
*asd
,
644 struct atomisp_css_fw_info
*fw
,
645 enum atomisp_css_pipe_id pipe_id
);
647 int atomisp_css_wait_acc_finish(struct atomisp_sub_device
*asd
);
649 void atomisp_css_acc_done(struct atomisp_sub_device
*asd
);
651 int atomisp_css_load_acc_binary(struct atomisp_sub_device
*asd
,
652 struct atomisp_css_fw_info
*fw
,
655 void atomisp_css_unload_acc_binary(struct atomisp_sub_device
*asd
);
657 struct atomisp_acc_fw
;
658 int atomisp_css_set_acc_parameters(struct atomisp_acc_fw
*acc_fw
);
660 int atomisp_css_isr_thread(struct atomisp_device
*isp
,
661 bool *frame_done_found
,
662 bool *css_pipe_done
);
664 bool atomisp_css_valid_sof(struct atomisp_device
*isp
);
666 void atomisp_en_dz_capt_pipe(struct atomisp_sub_device
*asd
, bool enable
);