media: staging: atomisp: stop duplicating input format types
[linux-2.6-block.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  *
16  */
17
18 #ifndef __ATOMISP_COMPAT_H__
19 #define __ATOMISP_COMPAT_H__
20
21 #include "atomisp_compat_css20.h"
22
23 #include "../../include/linux/atomisp.h"
24 #include <media/videobuf-vmalloc.h>
25
26 #define CSS_RX_IRQ_INFO_BUFFER_OVERRUN \
27         CSS_ID(CSS_RX_IRQ_INFO_BUFFER_OVERRUN)
28 #define CSS_RX_IRQ_INFO_ENTER_SLEEP_MODE \
29         CSS_ID(CSS_RX_IRQ_INFO_ENTER_SLEEP_MODE)
30 #define CSS_RX_IRQ_INFO_EXIT_SLEEP_MODE \
31         CSS_ID(CSS_RX_IRQ_INFO_EXIT_SLEEP_MODE)
32 #define CSS_RX_IRQ_INFO_ECC_CORRECTED \
33         CSS_ID(CSS_RX_IRQ_INFO_ECC_CORRECTED)
34 #define CSS_RX_IRQ_INFO_ERR_SOT \
35         CSS_ID(CSS_RX_IRQ_INFO_ERR_SOT)
36 #define CSS_RX_IRQ_INFO_ERR_SOT_SYNC \
37         CSS_ID(CSS_RX_IRQ_INFO_ERR_SOT_SYNC)
38 #define CSS_RX_IRQ_INFO_ERR_CONTROL \
39         CSS_ID(CSS_RX_IRQ_INFO_ERR_CONTROL)
40 #define CSS_RX_IRQ_INFO_ERR_ECC_DOUBLE \
41         CSS_ID(CSS_RX_IRQ_INFO_ERR_ECC_DOUBLE)
42 #define CSS_RX_IRQ_INFO_ERR_CRC \
43         CSS_ID(CSS_RX_IRQ_INFO_ERR_CRC)
44 #define CSS_RX_IRQ_INFO_ERR_UNKNOWN_ID \
45         CSS_ID(CSS_RX_IRQ_INFO_ERR_UNKNOWN_ID)
46 #define CSS_RX_IRQ_INFO_ERR_FRAME_SYNC \
47         CSS_ID(CSS_RX_IRQ_INFO_ERR_FRAME_SYNC)
48 #define CSS_RX_IRQ_INFO_ERR_FRAME_DATA \
49         CSS_ID(CSS_RX_IRQ_INFO_ERR_FRAME_DATA)
50 #define CSS_RX_IRQ_INFO_ERR_DATA_TIMEOUT \
51         CSS_ID(CSS_RX_IRQ_INFO_ERR_DATA_TIMEOUT)
52 #define CSS_RX_IRQ_INFO_ERR_UNKNOWN_ESC \
53         CSS_ID(CSS_RX_IRQ_INFO_ERR_UNKNOWN_ESC)
54 #define CSS_RX_IRQ_INFO_ERR_LINE_SYNC \
55         CSS_ID(CSS_RX_IRQ_INFO_ERR_LINE_SYNC)
56 #define CSS_RX_IRQ_INFO_INIT_TIMEOUT \
57         CSS_ID(CSS_RX_IRQ_INFO_INIT_TIMEOUT)
58
59 #define CSS_IRQ_INFO_CSS_RECEIVER_SOF   CSS_ID(CSS_IRQ_INFO_CSS_RECEIVER_SOF)
60 #define CSS_IRQ_INFO_CSS_RECEIVER_EOF   CSS_ID(CSS_IRQ_INFO_CSS_RECEIVER_EOF)
61 #define CSS_IRQ_INFO_CSS_RECEIVER_FIFO_OVERFLOW \
62         CSS_ID(CSS_IRQ_INFO_CSS_RECEIVER_FIFO_OVERFLOW)
63 #define CSS_EVENT_OUTPUT_FRAME_DONE     CSS_EVENT(OUTPUT_FRAME_DONE)
64 #define CSS_EVENT_SEC_OUTPUT_FRAME_DONE CSS_EVENT(SECOND_OUTPUT_FRAME_DONE)
65 #define CSS_EVENT_VF_OUTPUT_FRAME_DONE  CSS_EVENT(VF_OUTPUT_FRAME_DONE)
66 #define CSS_EVENT_SEC_VF_OUTPUT_FRAME_DONE      CSS_EVENT(SECOND_VF_OUTPUT_FRAME_DONE)
67 #define CSS_EVENT_3A_STATISTICS_DONE    CSS_EVENT(3A_STATISTICS_DONE)
68 #define CSS_EVENT_DIS_STATISTICS_DONE   CSS_EVENT(DIS_STATISTICS_DONE)
69 #define CSS_EVENT_PIPELINE_DONE         CSS_EVENT(PIPELINE_DONE)
70 #define CSS_EVENT_METADATA_DONE         CSS_EVENT(METADATA_DONE)
71 #define CSS_EVENT_ACC_STAGE_COMPLETE    CSS_EVENT(ACC_STAGE_COMPLETE)
72 #define CSS_EVENT_TIMER                 CSS_EVENT(TIMER)
73
74 #define CSS_BUFFER_TYPE_METADATA        CSS_ID(CSS_BUFFER_TYPE_METADATA)
75 #define CSS_BUFFER_TYPE_3A_STATISTICS   CSS_ID(CSS_BUFFER_TYPE_3A_STATISTICS)
76 #define CSS_BUFFER_TYPE_DIS_STATISTICS  CSS_ID(CSS_BUFFER_TYPE_DIS_STATISTICS)
77 #define CSS_BUFFER_TYPE_INPUT_FRAME     CSS_ID(CSS_BUFFER_TYPE_INPUT_FRAME)
78 #define CSS_BUFFER_TYPE_OUTPUT_FRAME    CSS_ID(CSS_BUFFER_TYPE_OUTPUT_FRAME)
79 #define CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME        CSS_ID(CSS_BUFFER_TYPE_SEC_OUTPUT_FRAME)
80 #define CSS_BUFFER_TYPE_VF_OUTPUT_FRAME CSS_ID(CSS_BUFFER_TYPE_VF_OUTPUT_FRAME)
81 #define CSS_BUFFER_TYPE_SEC_VF_OUTPUT_FRAME     CSS_ID(CSS_BUFFER_TYPE_SEC_VF_OUTPUT_FRAME)
82 #define CSS_BUFFER_TYPE_RAW_OUTPUT_FRAME \
83         CSS_ID(CSS_BUFFER_TYPE_RAW_OUTPUT_FRAME)
84
85 #define CSS_FORMAT_RAW_8        CSS_FORMAT(RAW_8)
86 #define CSS_FORMAT_RAW_10       CSS_FORMAT(RAW_10)
87 #define CSS_FORMAT_RAW_12       CSS_FORMAT(RAW_12)
88 #define CSS_FORMAT_RAW_16       CSS_FORMAT(RAW_16)
89
90 #define CSS_CAPTURE_MODE_RAW            CSS_ID(CSS_CAPTURE_MODE_RAW)
91 #define CSS_CAPTURE_MODE_BAYER          CSS_ID(CSS_CAPTURE_MODE_BAYER)
92 #define CSS_CAPTURE_MODE_PRIMARY        CSS_ID(CSS_CAPTURE_MODE_PRIMARY)
93 #define CSS_CAPTURE_MODE_ADVANCED       CSS_ID(CSS_CAPTURE_MODE_ADVANCED)
94 #define CSS_CAPTURE_MODE_LOW_LIGHT      CSS_ID(CSS_CAPTURE_MODE_LOW_LIGHT)
95
96 #define CSS_MORPH_TABLE_NUM_PLANES      CSS_ID(CSS_MORPH_TABLE_NUM_PLANES)
97
98 #define CSS_FRAME_FORMAT_NV11           CSS_ID(CSS_FRAME_FORMAT_NV11)
99 #define CSS_FRAME_FORMAT_NV12           CSS_ID(CSS_FRAME_FORMAT_NV12)
100 #define CSS_FRAME_FORMAT_NV16           CSS_ID(CSS_FRAME_FORMAT_NV16)
101 #define CSS_FRAME_FORMAT_NV21           CSS_ID(CSS_FRAME_FORMAT_NV21)
102 #define CSS_FRAME_FORMAT_NV61           CSS_ID(CSS_FRAME_FORMAT_NV61)
103 #define CSS_FRAME_FORMAT_YV12           CSS_ID(CSS_FRAME_FORMAT_YV12)
104 #define CSS_FRAME_FORMAT_YV16           CSS_ID(CSS_FRAME_FORMAT_YV16)
105 #define CSS_FRAME_FORMAT_YUV420         CSS_ID(CSS_FRAME_FORMAT_YUV420)
106 #define CSS_FRAME_FORMAT_YUV420_16      CSS_ID(CSS_FRAME_FORMAT_YUV420_16)
107 #define CSS_FRAME_FORMAT_YUV422         CSS_ID(CSS_FRAME_FORMAT_YUV422)
108 #define CSS_FRAME_FORMAT_YUV422_16      CSS_ID(CSS_FRAME_FORMAT_YUV422_16)
109 #define CSS_FRAME_FORMAT_UYVY           CSS_ID(CSS_FRAME_FORMAT_UYVY)
110 #define CSS_FRAME_FORMAT_YUYV           CSS_ID(CSS_FRAME_FORMAT_YUYV)
111 #define CSS_FRAME_FORMAT_YUV444         CSS_ID(CSS_FRAME_FORMAT_YUV444)
112 #define CSS_FRAME_FORMAT_YUV_LINE       CSS_ID(CSS_FRAME_FORMAT_YUV_LINE)
113 #define CSS_FRAME_FORMAT_RAW            CSS_ID(CSS_FRAME_FORMAT_RAW)
114 #define CSS_FRAME_FORMAT_RGB565         CSS_ID(CSS_FRAME_FORMAT_RGB565)
115 #define CSS_FRAME_FORMAT_PLANAR_RGB888  CSS_ID(CSS_FRAME_FORMAT_PLANAR_RGB888)
116 #define CSS_FRAME_FORMAT_RGBA888        CSS_ID(CSS_FRAME_FORMAT_RGBA888)
117 #define CSS_FRAME_FORMAT_QPLANE6        CSS_ID(CSS_FRAME_FORMAT_QPLANE6)
118 #define CSS_FRAME_FORMAT_BINARY_8       CSS_ID(CSS_FRAME_FORMAT_BINARY_8)
119
120 struct atomisp_device;
121 struct atomisp_sub_device;
122 struct video_device;
123 enum atomisp_input_stream_id;
124
125 struct atomisp_metadata_buf {
126         struct ia_css_metadata *metadata;
127         void *md_vptr;
128         struct list_head list;
129 };
130
131 void atomisp_css_debug_dump_sp_sw_debug_info(void);
132 void atomisp_css_debug_dump_debug_info(const char *context);
133 void atomisp_css_debug_set_dtrace_level(const unsigned int trace_level);
134
135 void atomisp_store_uint32(hrt_address addr, uint32_t data);
136 void atomisp_load_uint32(hrt_address addr, uint32_t *data);
137
138 int atomisp_css_init(struct atomisp_device *isp);
139
140 void atomisp_css_uninit(struct atomisp_device *isp);
141
142 void atomisp_css_suspend(struct atomisp_device *isp);
143
144 int atomisp_css_resume(struct atomisp_device *isp);
145
146 void atomisp_css_init_struct(struct atomisp_sub_device *asd);
147
148 int atomisp_css_irq_translate(struct atomisp_device *isp,
149                               unsigned int *infos);
150
151 void atomisp_css_rx_get_irq_info(enum mipi_port_id port,
152                                         unsigned int *infos);
153
154 void atomisp_css_rx_clear_irq_info(enum mipi_port_id port,
155                                         unsigned int infos);
156
157 int atomisp_css_irq_enable(struct atomisp_device *isp,
158                            enum atomisp_css_irq_info info, bool enable);
159
160 int atomisp_q_video_buffer_to_css(struct atomisp_sub_device *asd,
161                         struct videobuf_vmalloc_memory *vm_mem,
162                         enum atomisp_input_stream_id stream_id,
163                         enum atomisp_css_buffer_type css_buf_type,
164                         enum atomisp_css_pipe_id css_pipe_id);
165
166 int atomisp_q_s3a_buffer_to_css(struct atomisp_sub_device *asd,
167                         struct atomisp_s3a_buf *s3a_buf,
168                         enum atomisp_input_stream_id stream_id,
169                         enum atomisp_css_pipe_id css_pipe_id);
170
171 int atomisp_q_metadata_buffer_to_css(struct atomisp_sub_device *asd,
172                         struct atomisp_metadata_buf *metadata_buf,
173                         enum atomisp_input_stream_id stream_id,
174                         enum atomisp_css_pipe_id css_pipe_id);
175
176 int atomisp_q_dis_buffer_to_css(struct atomisp_sub_device *asd,
177                         struct atomisp_dis_buf *dis_buf,
178                         enum atomisp_input_stream_id stream_id,
179                         enum atomisp_css_pipe_id css_pipe_id);
180
181 void atomisp_css_mmu_invalidate_cache(void);
182
183 void atomisp_css_mmu_invalidate_tlb(void);
184
185 int atomisp_css_start(struct atomisp_sub_device *asd,
186                       enum atomisp_css_pipe_id pipe_id, bool in_reset);
187
188 void atomisp_css_update_isp_params(struct atomisp_sub_device *asd);
189 void atomisp_css_update_isp_params_on_pipe(struct atomisp_sub_device *asd,
190                                         struct ia_css_pipe *pipe);
191
192 int atomisp_css_queue_buffer(struct atomisp_sub_device *asd,
193                              enum atomisp_input_stream_id stream_id,
194                              enum atomisp_css_pipe_id pipe_id,
195                              enum atomisp_css_buffer_type buf_type,
196                              struct atomisp_css_buffer *isp_css_buffer);
197
198 int atomisp_css_dequeue_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_allocate_stat_buffers(struct atomisp_sub_device *asd,
205                                       uint16_t stream_id,
206                                       struct atomisp_s3a_buf *s3a_buf,
207                                       struct atomisp_dis_buf *dis_buf,
208                                       struct atomisp_metadata_buf *md_buf);
209
210 void atomisp_css_free_stat_buffers(struct atomisp_sub_device *asd);
211
212 void atomisp_css_free_3a_buffer(struct atomisp_s3a_buf *s3a_buf);
213
214 void atomisp_css_free_dis_buffer(struct atomisp_dis_buf *dis_buf);
215
216 void atomisp_css_free_metadata_buffer(struct atomisp_metadata_buf *metadata_buf);
217
218 int atomisp_css_get_grid_info(struct atomisp_sub_device *asd,
219                                 enum atomisp_css_pipe_id pipe_id,
220                                 int source_pad);
221
222 int atomisp_alloc_3a_output_buf(struct atomisp_sub_device *asd);
223
224 int atomisp_alloc_dis_coef_buf(struct atomisp_sub_device *asd);
225
226 int atomisp_alloc_metadata_output_buf(struct atomisp_sub_device *asd);
227
228 void atomisp_free_metadata_output_buf(struct atomisp_sub_device *asd);
229
230 void atomisp_css_get_dis_statistics(struct atomisp_sub_device *asd,
231                                     struct atomisp_css_buffer *isp_css_buffer,
232                                     struct ia_css_isp_dvs_statistics_map *dvs_map);
233
234 int atomisp_css_dequeue_event(struct atomisp_css_event *current_event);
235
236 void atomisp_css_temp_pipe_to_pipe_id(struct atomisp_sub_device *asd,
237                                       struct atomisp_css_event *current_event);
238
239 int atomisp_css_isys_set_resolution(struct atomisp_sub_device *asd,
240                                     enum atomisp_input_stream_id stream_id,
241                                     struct v4l2_mbus_framefmt *ffmt,
242                                     int isys_stream);
243
244 void atomisp_css_isys_set_link(struct atomisp_sub_device *asd,
245                                enum atomisp_input_stream_id stream_id,
246                                int link,
247                                int isys_stream);
248
249 void atomisp_css_isys_set_valid(struct atomisp_sub_device *asd,
250                                 enum atomisp_input_stream_id stream_id,
251                                 bool valid,
252                                 int isys_stream);
253
254 void atomisp_css_isys_set_format(struct atomisp_sub_device *asd,
255                                  enum atomisp_input_stream_id stream_id,
256                                  enum atomisp_input_format format,
257                                  int isys_stream);
258
259 int atomisp_css_set_default_isys_config(struct atomisp_sub_device *asd,
260                                         enum atomisp_input_stream_id stream_id,
261                                         struct v4l2_mbus_framefmt *ffmt);
262
263 int atomisp_css_isys_two_stream_cfg(struct atomisp_sub_device *asd,
264                                     enum atomisp_input_stream_id stream_id,
265                                     enum atomisp_input_format input_format);
266
267 void atomisp_css_isys_two_stream_cfg_update_stream1(
268                                     struct atomisp_sub_device *asd,
269                                     enum atomisp_input_stream_id stream_id,
270                                     enum atomisp_input_format input_format,
271                                     unsigned int width, unsigned int height);
272
273 void atomisp_css_isys_two_stream_cfg_update_stream2(
274                                     struct atomisp_sub_device *asd,
275                                     enum atomisp_input_stream_id stream_id,
276                                     enum atomisp_input_format input_format,
277                                     unsigned int width, unsigned int height);
278
279 int atomisp_css_input_set_resolution(struct atomisp_sub_device *asd,
280                                         enum atomisp_input_stream_id stream_id,
281                                         struct v4l2_mbus_framefmt *ffmt);
282
283 void atomisp_css_input_set_binning_factor(struct atomisp_sub_device *asd,
284                                         enum atomisp_input_stream_id stream_id,
285                                         unsigned int bin_factor);
286
287 void atomisp_css_input_set_bayer_order(struct atomisp_sub_device *asd,
288                                 enum atomisp_input_stream_id stream_id,
289                                 enum atomisp_css_bayer_order bayer_order);
290
291 void atomisp_css_input_set_format(struct atomisp_sub_device *asd,
292                                 enum atomisp_input_stream_id stream_id,
293                                 enum atomisp_input_format format);
294
295 int atomisp_css_input_set_effective_resolution(
296                                         struct atomisp_sub_device *asd,
297                                         enum atomisp_input_stream_id stream_id,
298                                         unsigned int width,
299                                         unsigned int height);
300
301 void atomisp_css_video_set_dis_envelope(struct atomisp_sub_device *asd,
302                                         unsigned int dvs_w, unsigned int dvs_h);
303
304 void atomisp_css_input_set_two_pixels_per_clock(
305                                         struct atomisp_sub_device *asd,
306                                         bool two_ppc);
307
308 void atomisp_css_enable_raw_binning(struct atomisp_sub_device *asd,
309                                         bool enable);
310
311 void atomisp_css_enable_dz(struct atomisp_sub_device *asd, bool enable);
312
313 void atomisp_css_capture_set_mode(struct atomisp_sub_device *asd,
314                                 enum atomisp_css_capture_mode mode);
315
316 void atomisp_css_input_set_mode(struct atomisp_sub_device *asd,
317                                 enum atomisp_css_input_mode mode);
318
319 void atomisp_css_capture_enable_online(struct atomisp_sub_device *asd,
320                                 unsigned short stream_index, bool enable);
321
322 void atomisp_css_preview_enable_online(struct atomisp_sub_device *asd,
323                                 unsigned short stream_index, bool enable);
324
325 void atomisp_css_video_enable_online(struct atomisp_sub_device *asd,
326                                                         bool enable);
327
328 void atomisp_css_enable_continuous(struct atomisp_sub_device *asd,
329                                                         bool enable);
330
331 void atomisp_css_enable_cvf(struct atomisp_sub_device *asd,
332                                                         bool enable);
333
334 int atomisp_css_input_configure_port(struct atomisp_sub_device *asd,
335                                 enum mipi_port_id port,
336                                 unsigned int num_lanes,
337                                 unsigned int timeout,
338                                 unsigned int mipi_freq,
339                                 enum atomisp_input_format metadata_format,
340                                 unsigned int metadata_width,
341                                 unsigned int metadata_height);
342
343 int atomisp_css_frame_allocate(struct atomisp_css_frame **frame,
344                                 unsigned int width, unsigned int height,
345                                 enum atomisp_css_frame_format format,
346                                 unsigned int padded_width,
347                                 unsigned int raw_bit_depth);
348
349 int atomisp_css_frame_allocate_from_info(struct atomisp_css_frame **frame,
350                                 const struct atomisp_css_frame_info *info);
351
352 void atomisp_css_frame_free(struct atomisp_css_frame *frame);
353
354 int atomisp_css_frame_map(struct atomisp_css_frame **frame,
355                                 const struct atomisp_css_frame_info *info,
356                                 const void *data, uint16_t attribute,
357                                 void *context);
358
359 int atomisp_css_set_black_frame(struct atomisp_sub_device *asd,
360                         const struct atomisp_css_frame *raw_black_frame);
361
362 int atomisp_css_allocate_continuous_frames(bool init_time,
363                         struct atomisp_sub_device *asd);
364
365 void atomisp_css_update_continuous_frames(struct atomisp_sub_device *asd);
366
367 void atomisp_create_pipes_stream(struct atomisp_sub_device *asd);
368 void atomisp_destroy_pipes_stream_force(struct atomisp_sub_device *asd);
369
370 int atomisp_css_stop(struct atomisp_sub_device *asd,
371                         enum atomisp_css_pipe_id pipe_id, bool in_reset);
372
373 int atomisp_css_continuous_set_num_raw_frames(
374                                         struct atomisp_sub_device *asd,
375                                         int num_frames);
376
377 void atomisp_css_disable_vf_pp(struct atomisp_sub_device *asd,
378                                bool disable);
379
380 int atomisp_css_copy_configure_output(struct atomisp_sub_device *asd,
381                                 unsigned int stream_index,
382                                 unsigned int width, unsigned int height,
383                                 unsigned int padded_width,
384                                 enum atomisp_css_frame_format format);
385
386 int atomisp_css_yuvpp_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_viewfinder(
393                                 struct atomisp_sub_device *asd,
394                                 unsigned int stream_index,
395                                 unsigned int width, unsigned int height,
396                                 unsigned int min_width,
397                                 enum atomisp_css_frame_format format);
398
399 int atomisp_css_yuvpp_get_output_frame_info(
400                                         struct atomisp_sub_device *asd,
401                                         unsigned int stream_index,
402                                         struct atomisp_css_frame_info *info);
403
404 int atomisp_css_yuvpp_get_viewfinder_frame_info(
405                                         struct atomisp_sub_device *asd,
406                                         unsigned int stream_index,
407                                         struct atomisp_css_frame_info *info);
408
409 int atomisp_css_preview_configure_output(struct atomisp_sub_device *asd,
410                                 unsigned int width, unsigned int height,
411                                 unsigned int min_width,
412                                 enum atomisp_css_frame_format format);
413
414 int atomisp_css_capture_configure_output(struct atomisp_sub_device *asd,
415                                 unsigned int width, unsigned int height,
416                                 unsigned int min_width,
417                                 enum atomisp_css_frame_format format);
418
419 int atomisp_css_video_configure_output(struct atomisp_sub_device *asd,
420                                 unsigned int width, unsigned int height,
421                                 unsigned int min_width,
422                                 enum atomisp_css_frame_format format);
423
424 int atomisp_get_css_frame_info(struct atomisp_sub_device *asd,
425                                 uint16_t source_pad,
426                                 struct atomisp_css_frame_info *frame_info);
427
428 int atomisp_css_video_configure_viewfinder(struct atomisp_sub_device *asd,
429                                         unsigned int width, unsigned int height,
430                                         unsigned int min_width,
431                                         enum atomisp_css_frame_format format);
432
433 int atomisp_css_capture_configure_viewfinder(
434                                         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_video_get_viewfinder_frame_info(
440                                         struct atomisp_sub_device *asd,
441                                         struct atomisp_css_frame_info *info);
442
443 int atomisp_css_capture_get_viewfinder_frame_info(
444                                         struct atomisp_sub_device *asd,
445                                         struct atomisp_css_frame_info *info);
446
447 int atomisp_css_copy_get_output_frame_info(
448                                         struct atomisp_sub_device *asd,
449                                         unsigned int stream_index,
450                                         struct atomisp_css_frame_info *info);
451
452 int atomisp_css_capture_get_output_raw_frame_info(
453                                         struct atomisp_sub_device *asd,
454                                         struct atomisp_css_frame_info *info);
455
456 int atomisp_css_preview_get_output_frame_info(
457                                         struct atomisp_sub_device *asd,
458                                         struct atomisp_css_frame_info *info);
459
460 int atomisp_css_capture_get_output_frame_info(
461                                         struct atomisp_sub_device *asd,
462                                         struct atomisp_css_frame_info *info);
463
464 int atomisp_css_video_get_output_frame_info(
465                                         struct atomisp_sub_device *asd,
466                                         struct atomisp_css_frame_info *info);
467
468 int atomisp_css_preview_configure_pp_input(
469                                 struct atomisp_sub_device *asd,
470                                 unsigned int width, unsigned int height);
471
472 int atomisp_css_capture_configure_pp_input(
473                                 struct atomisp_sub_device *asd,
474                                 unsigned int width, unsigned int height);
475
476 int atomisp_css_video_configure_pp_input(
477                                 struct atomisp_sub_device *asd,
478                                 unsigned int width, unsigned int height);
479
480 int atomisp_css_offline_capture_configure(struct atomisp_sub_device *asd,
481                         int num_captures, unsigned int skip, int offset);
482 int atomisp_css_exp_id_capture(struct atomisp_sub_device *asd, int exp_id);
483 int atomisp_css_exp_id_unlock(struct atomisp_sub_device *asd, int exp_id);
484
485 int atomisp_css_capture_enable_xnr(struct atomisp_sub_device *asd,
486                                    bool enable);
487
488 void atomisp_css_send_input_frame(struct atomisp_sub_device *asd,
489                                   unsigned short *data, unsigned int width,
490                                   unsigned int height);
491
492 bool atomisp_css_isp_has_started(void);
493
494 void atomisp_css_request_flash(struct atomisp_sub_device *asd);
495
496 void atomisp_css_set_wb_config(struct atomisp_sub_device *asd,
497                         struct atomisp_css_wb_config *wb_config);
498
499 void atomisp_css_set_ob_config(struct atomisp_sub_device *asd,
500                         struct atomisp_css_ob_config *ob_config);
501
502 void atomisp_css_set_dp_config(struct atomisp_sub_device *asd,
503                         struct atomisp_css_dp_config *dp_config);
504
505 void atomisp_css_set_de_config(struct atomisp_sub_device *asd,
506                         struct atomisp_css_de_config *de_config);
507
508 void atomisp_css_set_dz_config(struct atomisp_sub_device *asd,
509                         struct atomisp_css_dz_config *dz_config);
510
511 void atomisp_css_set_default_de_config(struct atomisp_sub_device *asd);
512
513 void atomisp_css_set_ce_config(struct atomisp_sub_device *asd,
514                         struct atomisp_css_ce_config *ce_config);
515
516 void atomisp_css_set_nr_config(struct atomisp_sub_device *asd,
517                         struct atomisp_css_nr_config *nr_config);
518
519 void atomisp_css_set_ee_config(struct atomisp_sub_device *asd,
520                         struct atomisp_css_ee_config *ee_config);
521
522 void atomisp_css_set_tnr_config(struct atomisp_sub_device *asd,
523                         struct atomisp_css_tnr_config *tnr_config);
524
525 void atomisp_css_set_cc_config(struct atomisp_sub_device *asd,
526                         struct atomisp_css_cc_config *cc_config);
527
528 void atomisp_css_set_macc_table(struct atomisp_sub_device *asd,
529                         struct atomisp_css_macc_table *macc_table);
530
531 void atomisp_css_set_gamma_table(struct atomisp_sub_device *asd,
532                         struct atomisp_css_gamma_table *gamma_table);
533
534 void atomisp_css_set_ctc_table(struct atomisp_sub_device *asd,
535                         struct atomisp_css_ctc_table *ctc_table);
536
537 void atomisp_css_set_gc_config(struct atomisp_sub_device *asd,
538                         struct atomisp_css_gc_config *gc_config);
539
540 void atomisp_css_set_3a_config(struct atomisp_sub_device *asd,
541                         struct atomisp_css_3a_config *s3a_config);
542
543 void atomisp_css_video_set_dis_vector(struct atomisp_sub_device *asd,
544                                 struct atomisp_dis_vector *vector);
545
546 void atomisp_css_set_dvs2_coefs(struct atomisp_sub_device *asd,
547                                 struct ia_css_dvs2_coefficients *coefs);
548
549 int atomisp_css_set_dis_coefs(struct atomisp_sub_device *asd,
550                           struct atomisp_dis_coefficients *coefs);
551
552 void atomisp_css_set_zoom_factor(struct atomisp_sub_device *asd,
553                                         unsigned int zoom);
554
555 int atomisp_css_get_wb_config(struct atomisp_sub_device *asd,
556                         struct atomisp_wb_config *config);
557
558 int atomisp_css_get_ob_config(struct atomisp_sub_device *asd,
559                         struct atomisp_ob_config *config);
560
561 int atomisp_css_get_dp_config(struct atomisp_sub_device *asd,
562                         struct atomisp_dp_config *config);
563
564 int atomisp_css_get_de_config(struct atomisp_sub_device *asd,
565                         struct atomisp_de_config *config);
566
567 int atomisp_css_get_nr_config(struct atomisp_sub_device *asd,
568                         struct atomisp_nr_config *config);
569
570 int atomisp_css_get_ee_config(struct atomisp_sub_device *asd,
571                         struct atomisp_ee_config *config);
572
573 int atomisp_css_get_tnr_config(struct atomisp_sub_device *asd,
574                         struct atomisp_tnr_config *config);
575
576 int atomisp_css_get_ctc_table(struct atomisp_sub_device *asd,
577                         struct atomisp_ctc_table *config);
578
579 int atomisp_css_get_gamma_table(struct atomisp_sub_device *asd,
580                         struct atomisp_gamma_table *config);
581
582 int atomisp_css_get_gc_config(struct atomisp_sub_device *asd,
583                         struct atomisp_gc_config *config);
584
585 int atomisp_css_get_3a_config(struct atomisp_sub_device *asd,
586                         struct atomisp_3a_config *config);
587
588 int atomisp_css_get_formats_config(struct atomisp_sub_device *asd,
589                         struct atomisp_formats_config *formats_config);
590
591 void atomisp_css_set_formats_config(struct atomisp_sub_device *asd,
592                         struct atomisp_css_formats_config *formats_config);
593
594 int atomisp_css_get_zoom_factor(struct atomisp_sub_device *asd,
595                                         unsigned int *zoom);
596
597 struct atomisp_css_shading_table *atomisp_css_shading_table_alloc(
598                                 unsigned int width, unsigned int height);
599
600 void atomisp_css_set_shading_table(struct atomisp_sub_device *asd,
601                                 struct atomisp_css_shading_table *table);
602
603 void atomisp_css_shading_table_free(struct atomisp_css_shading_table *table);
604
605 struct atomisp_css_morph_table *atomisp_css_morph_table_allocate(
606                                 unsigned int width, unsigned int height);
607
608 void atomisp_css_set_morph_table(struct atomisp_sub_device *asd,
609                                 struct atomisp_css_morph_table *table);
610
611 void atomisp_css_get_morph_table(struct atomisp_sub_device *asd,
612                                 struct atomisp_css_morph_table *table);
613
614 void atomisp_css_morph_table_free(struct atomisp_css_morph_table *table);
615
616 void atomisp_css_set_cont_prev_start_time(struct atomisp_device *isp,
617                                         unsigned int overlap);
618
619 int atomisp_css_get_dis_stat(struct atomisp_sub_device *asd,
620                          struct atomisp_dis_statistics *stats);
621
622 int atomisp_css_update_stream(struct atomisp_sub_device *asd);
623
624 int atomisp_css_create_acc_pipe(struct atomisp_sub_device *asd);
625
626 int atomisp_css_start_acc_pipe(struct atomisp_sub_device *asd);
627
628 int atomisp_css_stop_acc_pipe(struct atomisp_sub_device *asd);
629
630 void atomisp_css_destroy_acc_pipe(struct atomisp_sub_device *asd);
631
632 int atomisp_css_load_acc_extension(struct atomisp_sub_device *asd,
633                                         struct atomisp_css_fw_info *fw,
634                                         enum atomisp_css_pipe_id pipe_id,
635                                         unsigned int type);
636
637 void atomisp_css_unload_acc_extension(struct atomisp_sub_device *asd,
638                                         struct atomisp_css_fw_info *fw,
639                                         enum atomisp_css_pipe_id pipe_id);
640
641 int atomisp_css_wait_acc_finish(struct atomisp_sub_device *asd);
642
643 void atomisp_css_acc_done(struct atomisp_sub_device *asd);
644
645 int atomisp_css_load_acc_binary(struct atomisp_sub_device *asd,
646                                         struct atomisp_css_fw_info *fw,
647                                         unsigned int index);
648
649 void atomisp_css_unload_acc_binary(struct atomisp_sub_device *asd);
650
651 struct atomisp_acc_fw;
652 int atomisp_css_set_acc_parameters(struct atomisp_acc_fw *acc_fw);
653
654 int atomisp_css_isr_thread(struct atomisp_device *isp,
655                            bool *frame_done_found,
656                            bool *css_pipe_done);
657
658 bool atomisp_css_valid_sof(struct atomisp_device *isp);
659
660 void atomisp_en_dz_capt_pipe(struct atomisp_sub_device *asd, bool enable);
661
662 #endif