]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h
fb8b8fab4e928272bdf8a8be2ea7e3191c9d674c
[mirror_ubuntu-bionic-kernel.git] / drivers / staging / media / atomisp / pci / atomisp2 / atomisp_compat.h
1 /*
2 * Support for Clovertrail PNW Camera Imaging ISP subsystem.
3 *
4 * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
5 *
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.
9 *
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.
14 *
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
18 * 02110-1301, USA.
19 *
20 */
21
22 #ifndef __ATOMISP_COMPAT_H__
23 #define __ATOMISP_COMPAT_H__
24
25 #include "atomisp_compat_css20.h"
26
27 #include "../../include/linux/atomisp.h"
28 #include <media/videobuf-vmalloc.h>
29
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)
62
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)
77
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)
88
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)
93
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)
99
100 #define CSS_MORPH_TABLE_NUM_PLANES CSS_ID(CSS_MORPH_TABLE_NUM_PLANES)
101
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)
123
124 struct atomisp_device;
125 struct atomisp_sub_device;
126 struct video_device;
127 enum atomisp_input_stream_id;
128
129 struct atomisp_metadata_buf {
130 struct ia_css_metadata *metadata;
131 void *md_vptr;
132 struct list_head list;
133 };
134
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);
138
139 void atomisp_store_uint32(hrt_address addr, uint32_t data);
140 void atomisp_load_uint32(hrt_address addr, uint32_t *data);
141
142 int atomisp_css_init(struct atomisp_device *isp);
143
144 void atomisp_css_uninit(struct atomisp_device *isp);
145
146 void atomisp_css_suspend(struct atomisp_device *isp);
147
148 int atomisp_css_resume(struct atomisp_device *isp);
149
150 void atomisp_css_init_struct(struct atomisp_sub_device *asd);
151
152 int atomisp_css_irq_translate(struct atomisp_device *isp,
153 unsigned int *infos);
154
155 void atomisp_css_rx_get_irq_info(enum ia_css_csi2_port port,
156 unsigned int *infos);
157
158 void atomisp_css_rx_clear_irq_info(enum ia_css_csi2_port port,
159 unsigned int infos);
160
161 int atomisp_css_irq_enable(struct atomisp_device *isp,
162 enum atomisp_css_irq_info info, bool enable);
163
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);
169
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);
174
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);
179
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);
184
185 void atomisp_css_mmu_invalidate_cache(void);
186
187 void atomisp_css_mmu_invalidate_tlb(void);
188
189 void atomisp_css_mmu_set_page_table_base_index(unsigned long base_index);
190
191 int atomisp_css_start(struct atomisp_sub_device *asd,
192 enum atomisp_css_pipe_id pipe_id, bool in_reset);
193
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);
197
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);
203
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);
209
210 int atomisp_css_allocate_stat_buffers(struct atomisp_sub_device *asd,
211 uint16_t stream_id,
212 struct atomisp_s3a_buf *s3a_buf,
213 struct atomisp_dis_buf *dis_buf,
214 struct atomisp_metadata_buf *md_buf);
215
216 void atomisp_css_free_stat_buffers(struct atomisp_sub_device *asd);
217
218 void atomisp_css_free_3a_buffer(struct atomisp_s3a_buf *s3a_buf);
219
220 void atomisp_css_free_dis_buffer(struct atomisp_dis_buf *dis_buf);
221
222 void atomisp_css_free_metadata_buffer(struct atomisp_metadata_buf *metadata_buf);
223
224 int atomisp_css_get_grid_info(struct atomisp_sub_device *asd,
225 enum atomisp_css_pipe_id pipe_id,
226 int source_pad);
227
228 int atomisp_alloc_3a_output_buf(struct atomisp_sub_device *asd);
229
230 int atomisp_alloc_dis_coef_buf(struct atomisp_sub_device *asd);
231
232 int atomisp_alloc_metadata_output_buf(struct atomisp_sub_device *asd);
233
234 void atomisp_free_metadata_output_buf(struct atomisp_sub_device *asd);
235
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);
239
240 int atomisp_css_dequeue_event(struct atomisp_css_event *current_event);
241
242 void atomisp_css_temp_pipe_to_pipe_id(struct atomisp_sub_device *asd,
243 struct atomisp_css_event *current_event);
244
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,
248 int isys_stream);
249
250 void atomisp_css_isys_set_link(struct atomisp_sub_device *asd,
251 enum atomisp_input_stream_id stream_id,
252 int link,
253 int isys_stream);
254
255 void atomisp_css_isys_set_valid(struct atomisp_sub_device *asd,
256 enum atomisp_input_stream_id stream_id,
257 bool valid,
258 int isys_stream);
259
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,
263 int isys_stream);
264
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);
268
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);
272
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);
278
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);
284
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);
288
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);
292
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);
296
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);
300
301 int atomisp_css_input_set_effective_resolution(
302 struct atomisp_sub_device *asd,
303 enum atomisp_input_stream_id stream_id,
304 unsigned int width,
305 unsigned int height);
306
307 void atomisp_css_video_set_dis_envelope(struct atomisp_sub_device *asd,
308 unsigned int dvs_w, unsigned int dvs_h);
309
310 void atomisp_css_input_set_two_pixels_per_clock(
311 struct atomisp_sub_device *asd,
312 bool two_ppc);
313
314 void atomisp_css_enable_raw_binning(struct atomisp_sub_device *asd,
315 bool enable);
316
317 void atomisp_css_enable_dz(struct atomisp_sub_device *asd, bool enable);
318
319 void atomisp_css_capture_set_mode(struct atomisp_sub_device *asd,
320 enum atomisp_css_capture_mode mode);
321
322 void atomisp_css_input_set_mode(struct atomisp_sub_device *asd,
323 enum atomisp_css_input_mode mode);
324
325 void atomisp_css_capture_enable_online(struct atomisp_sub_device *asd,
326 unsigned short stream_index, bool enable);
327
328 void atomisp_css_preview_enable_online(struct atomisp_sub_device *asd,
329 unsigned short stream_index, bool enable);
330
331 void atomisp_css_video_enable_online(struct atomisp_sub_device *asd,
332 bool enable);
333
334 void atomisp_css_enable_continuous(struct atomisp_sub_device *asd,
335 bool enable);
336
337 void atomisp_css_enable_cvf(struct atomisp_sub_device *asd,
338 bool enable);
339
340 int atomisp_css_input_configure_port(struct atomisp_sub_device *asd,
341 mipi_port_ID_t port,
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);
348
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);
354
355 int atomisp_css_frame_allocate_from_info(struct atomisp_css_frame **frame,
356 const struct atomisp_css_frame_info *info);
357
358 void atomisp_css_frame_free(struct atomisp_css_frame *frame);
359
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,
363 void *context);
364
365 int atomisp_css_set_black_frame(struct atomisp_sub_device *asd,
366 const struct atomisp_css_frame *raw_black_frame);
367
368 int atomisp_css_allocate_continuous_frames(bool init_time,
369 struct atomisp_sub_device *asd);
370
371 void atomisp_css_update_continuous_frames(struct atomisp_sub_device *asd);
372
373 void atomisp_create_pipes_stream(struct atomisp_sub_device *asd);
374 void atomisp_destroy_pipes_stream_force(struct atomisp_sub_device *asd);
375
376 int atomisp_css_stop(struct atomisp_sub_device *asd,
377 enum atomisp_css_pipe_id pipe_id, bool in_reset);
378
379 int atomisp_css_continuous_set_num_raw_frames(
380 struct atomisp_sub_device *asd,
381 int num_frames);
382
383 void atomisp_css_disable_vf_pp(struct atomisp_sub_device *asd,
384 bool disable);
385
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);
391
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);
397
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);
404
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);
409
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);
414
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);
419
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);
424
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);
429
430 int atomisp_get_css_frame_info(struct atomisp_sub_device *asd,
431 uint16_t source_pad,
432 struct atomisp_css_frame_info *frame_info);
433
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);
438
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);
444
445 int atomisp_css_video_get_viewfinder_frame_info(
446 struct atomisp_sub_device *asd,
447 struct atomisp_css_frame_info *info);
448
449 int atomisp_css_capture_get_viewfinder_frame_info(
450 struct atomisp_sub_device *asd,
451 struct atomisp_css_frame_info *info);
452
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);
457
458 int atomisp_css_capture_get_output_raw_frame_info(
459 struct atomisp_sub_device *asd,
460 struct atomisp_css_frame_info *info);
461
462 int atomisp_css_preview_get_output_frame_info(
463 struct atomisp_sub_device *asd,
464 struct atomisp_css_frame_info *info);
465
466 int atomisp_css_capture_get_output_frame_info(
467 struct atomisp_sub_device *asd,
468 struct atomisp_css_frame_info *info);
469
470 int atomisp_css_video_get_output_frame_info(
471 struct atomisp_sub_device *asd,
472 struct atomisp_css_frame_info *info);
473
474 int atomisp_css_preview_configure_pp_input(
475 struct atomisp_sub_device *asd,
476 unsigned int width, unsigned int height);
477
478 int atomisp_css_capture_configure_pp_input(
479 struct atomisp_sub_device *asd,
480 unsigned int width, unsigned int height);
481
482 int atomisp_css_video_configure_pp_input(
483 struct atomisp_sub_device *asd,
484 unsigned int width, unsigned int height);
485
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);
490
491 int atomisp_css_capture_enable_xnr(struct atomisp_sub_device *asd,
492 bool enable);
493
494 void atomisp_css_send_input_frame(struct atomisp_sub_device *asd,
495 unsigned short *data, unsigned int width,
496 unsigned int height);
497
498 bool atomisp_css_isp_has_started(void);
499
500 void atomisp_css_request_flash(struct atomisp_sub_device *asd);
501
502 void atomisp_css_set_wb_config(struct atomisp_sub_device *asd,
503 struct atomisp_css_wb_config *wb_config);
504
505 void atomisp_css_set_ob_config(struct atomisp_sub_device *asd,
506 struct atomisp_css_ob_config *ob_config);
507
508 void atomisp_css_set_dp_config(struct atomisp_sub_device *asd,
509 struct atomisp_css_dp_config *dp_config);
510
511 void atomisp_css_set_de_config(struct atomisp_sub_device *asd,
512 struct atomisp_css_de_config *de_config);
513
514 void atomisp_css_set_dz_config(struct atomisp_sub_device *asd,
515 struct atomisp_css_dz_config *dz_config);
516
517 void atomisp_css_set_default_de_config(struct atomisp_sub_device *asd);
518
519 void atomisp_css_set_ce_config(struct atomisp_sub_device *asd,
520 struct atomisp_css_ce_config *ce_config);
521
522 void atomisp_css_set_nr_config(struct atomisp_sub_device *asd,
523 struct atomisp_css_nr_config *nr_config);
524
525 void atomisp_css_set_ee_config(struct atomisp_sub_device *asd,
526 struct atomisp_css_ee_config *ee_config);
527
528 void atomisp_css_set_tnr_config(struct atomisp_sub_device *asd,
529 struct atomisp_css_tnr_config *tnr_config);
530
531 void atomisp_css_set_cc_config(struct atomisp_sub_device *asd,
532 struct atomisp_css_cc_config *cc_config);
533
534 void atomisp_css_set_macc_table(struct atomisp_sub_device *asd,
535 struct atomisp_css_macc_table *macc_table);
536
537 void atomisp_css_set_gamma_table(struct atomisp_sub_device *asd,
538 struct atomisp_css_gamma_table *gamma_table);
539
540 void atomisp_css_set_ctc_table(struct atomisp_sub_device *asd,
541 struct atomisp_css_ctc_table *ctc_table);
542
543 void atomisp_css_set_gc_config(struct atomisp_sub_device *asd,
544 struct atomisp_css_gc_config *gc_config);
545
546 void atomisp_css_set_3a_config(struct atomisp_sub_device *asd,
547 struct atomisp_css_3a_config *s3a_config);
548
549 void atomisp_css_video_set_dis_vector(struct atomisp_sub_device *asd,
550 struct atomisp_dis_vector *vector);
551
552 void atomisp_css_set_dvs2_coefs(struct atomisp_sub_device *asd,
553 struct ia_css_dvs2_coefficients *coefs);
554
555 int atomisp_css_set_dis_coefs(struct atomisp_sub_device *asd,
556 struct atomisp_dis_coefficients *coefs);
557
558 void atomisp_css_set_zoom_factor(struct atomisp_sub_device *asd,
559 unsigned int zoom);
560
561 int atomisp_css_get_wb_config(struct atomisp_sub_device *asd,
562 struct atomisp_wb_config *config);
563
564 int atomisp_css_get_ob_config(struct atomisp_sub_device *asd,
565 struct atomisp_ob_config *config);
566
567 int atomisp_css_get_dp_config(struct atomisp_sub_device *asd,
568 struct atomisp_dp_config *config);
569
570 int atomisp_css_get_de_config(struct atomisp_sub_device *asd,
571 struct atomisp_de_config *config);
572
573 int atomisp_css_get_nr_config(struct atomisp_sub_device *asd,
574 struct atomisp_nr_config *config);
575
576 int atomisp_css_get_ee_config(struct atomisp_sub_device *asd,
577 struct atomisp_ee_config *config);
578
579 int atomisp_css_get_tnr_config(struct atomisp_sub_device *asd,
580 struct atomisp_tnr_config *config);
581
582 int atomisp_css_get_ctc_table(struct atomisp_sub_device *asd,
583 struct atomisp_ctc_table *config);
584
585 int atomisp_css_get_gamma_table(struct atomisp_sub_device *asd,
586 struct atomisp_gamma_table *config);
587
588 int atomisp_css_get_gc_config(struct atomisp_sub_device *asd,
589 struct atomisp_gc_config *config);
590
591 int atomisp_css_get_3a_config(struct atomisp_sub_device *asd,
592 struct atomisp_3a_config *config);
593
594 int atomisp_css_get_formats_config(struct atomisp_sub_device *asd,
595 struct atomisp_formats_config *formats_config);
596
597 void atomisp_css_set_formats_config(struct atomisp_sub_device *asd,
598 struct atomisp_css_formats_config *formats_config);
599
600 int atomisp_css_get_zoom_factor(struct atomisp_sub_device *asd,
601 unsigned int *zoom);
602
603 struct atomisp_css_shading_table *atomisp_css_shading_table_alloc(
604 unsigned int width, unsigned int height);
605
606 void atomisp_css_set_shading_table(struct atomisp_sub_device *asd,
607 struct atomisp_css_shading_table *table);
608
609 void atomisp_css_shading_table_free(struct atomisp_css_shading_table *table);
610
611 struct atomisp_css_morph_table *atomisp_css_morph_table_allocate(
612 unsigned int width, unsigned int height);
613
614 void atomisp_css_set_morph_table(struct atomisp_sub_device *asd,
615 struct atomisp_css_morph_table *table);
616
617 void atomisp_css_get_morph_table(struct atomisp_sub_device *asd,
618 struct atomisp_css_morph_table *table);
619
620 void atomisp_css_morph_table_free(struct atomisp_css_morph_table *table);
621
622 void atomisp_css_set_cont_prev_start_time(struct atomisp_device *isp,
623 unsigned int overlap);
624
625 int atomisp_css_get_dis_stat(struct atomisp_sub_device *asd,
626 struct atomisp_dis_statistics *stats);
627
628 int atomisp_css_update_stream(struct atomisp_sub_device *asd);
629
630 int atomisp_css_create_acc_pipe(struct atomisp_sub_device *asd);
631
632 int atomisp_css_start_acc_pipe(struct atomisp_sub_device *asd);
633
634 int atomisp_css_stop_acc_pipe(struct atomisp_sub_device *asd);
635
636 void atomisp_css_destroy_acc_pipe(struct atomisp_sub_device *asd);
637
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,
641 unsigned int type);
642
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);
646
647 int atomisp_css_wait_acc_finish(struct atomisp_sub_device *asd);
648
649 void atomisp_css_acc_done(struct atomisp_sub_device *asd);
650
651 int atomisp_css_load_acc_binary(struct atomisp_sub_device *asd,
652 struct atomisp_css_fw_info *fw,
653 unsigned int index);
654
655 void atomisp_css_unload_acc_binary(struct atomisp_sub_device *asd);
656
657 struct atomisp_acc_fw;
658 int atomisp_css_set_acc_parameters(struct atomisp_acc_fw *acc_fw);
659
660 int atomisp_css_isr_thread(struct atomisp_device *isp,
661 bool *frame_done_found,
662 bool *css_pipe_done);
663
664 bool atomisp_css_valid_sof(struct atomisp_device *isp);
665
666 void atomisp_en_dz_capt_pipe(struct atomisp_sub_device *asd, bool enable);
667
668 #endif