File Index
Files and directories
Sign in
FILE

atomisp_compat.h

File preview with syntax highlighting.

linux-6.19.14/drivers/staging/media/atomisp/pci/atomisp_compat.h C
  1/* SPDX-License-Identifier: GPL-2.0 */
  2/*
  3 * Support for Clovertrail PNW Camera Imaging ISP subsystem.
  4 *
  5 * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
  6 */
  7
  8#ifndef __ATOMISP_COMPAT_H__
  9#define __ATOMISP_COMPAT_H__
 10
 11#include "atomisp_compat_css20.h"
 12
 13#include "../../include/linux/atomisp.h"
 14
 15struct atomisp_device;
 16struct atomisp_sub_device;
 17struct video_device;
 18enum atomisp_input_stream_id;
 19
 20struct atomisp_metadata_buf {
 21	struct ia_css_metadata *metadata;
 22	void *md_vptr;
 23	struct list_head list;
 24};
 25
 26void atomisp_css2_hw_store_32(hrt_address addr, uint32_t data);
 27void atomisp_load_uint32(hrt_address addr, uint32_t *data);
 28
 29int atomisp_css_init(struct atomisp_device *isp);
 30
 31void atomisp_css_uninit(struct atomisp_device *isp);
 32
 33void atomisp_css_init_struct(struct atomisp_sub_device *asd);
 34
 35int atomisp_css_irq_translate(struct atomisp_device *isp,
 36			      unsigned int *infos);
 37
 38void atomisp_css_rx_get_irq_info(enum mipi_port_id port,
 39				 unsigned int *infos);
 40
 41void atomisp_css_rx_clear_irq_info(enum mipi_port_id port,
 42				   unsigned int infos);
 43
 44int atomisp_css_irq_enable(struct atomisp_device *isp,
 45			   enum ia_css_irq_info info, bool enable);
 46
 47int atomisp_q_video_buffer_to_css(struct atomisp_sub_device *asd,
 48				  struct ia_css_frame *frame,
 49				  enum atomisp_input_stream_id stream_id,
 50				  enum ia_css_buffer_type css_buf_type,
 51				  enum ia_css_pipe_id css_pipe_id);
 52
 53int atomisp_q_s3a_buffer_to_css(struct atomisp_sub_device *asd,
 54				struct atomisp_s3a_buf *s3a_buf,
 55				enum atomisp_input_stream_id stream_id,
 56				enum ia_css_pipe_id css_pipe_id);
 57
 58int atomisp_q_metadata_buffer_to_css(struct atomisp_sub_device *asd,
 59				     struct atomisp_metadata_buf *metadata_buf,
 60				     enum atomisp_input_stream_id stream_id,
 61				     enum ia_css_pipe_id css_pipe_id);
 62
 63int atomisp_q_dis_buffer_to_css(struct atomisp_sub_device *asd,
 64				struct atomisp_dis_buf *dis_buf,
 65				enum atomisp_input_stream_id stream_id,
 66				enum ia_css_pipe_id css_pipe_id);
 67
 68void ia_css_mmu_invalidate_cache(void);
 69
 70int atomisp_css_start(struct atomisp_sub_device *asd);
 71
 72void atomisp_css_update_isp_params(struct atomisp_sub_device *asd);
 73void atomisp_css_update_isp_params_on_pipe(struct atomisp_sub_device *asd,
 74	struct ia_css_pipe *pipe);
 75
 76int atomisp_css_queue_buffer(struct atomisp_sub_device *asd,
 77			     enum atomisp_input_stream_id stream_id,
 78			     enum ia_css_pipe_id pipe_id,
 79			     enum ia_css_buffer_type buf_type,
 80			     struct atomisp_css_buffer *isp_css_buffer);
 81
 82int atomisp_css_dequeue_buffer(struct atomisp_sub_device *asd,
 83			       enum atomisp_input_stream_id stream_id,
 84			       enum ia_css_pipe_id pipe_id,
 85			       enum ia_css_buffer_type buf_type,
 86			       struct atomisp_css_buffer *isp_css_buffer);
 87
 88int atomisp_css_allocate_stat_buffers(struct atomisp_sub_device *asd,
 89				      u16 stream_id,
 90				      struct atomisp_s3a_buf *s3a_buf,
 91				      struct atomisp_dis_buf *dis_buf,
 92				      struct atomisp_metadata_buf *md_buf);
 93
 94void atomisp_css_free_stat_buffers(struct atomisp_sub_device *asd);
 95
 96void atomisp_css_free_3a_buffer(struct atomisp_s3a_buf *s3a_buf);
 97
 98void atomisp_css_free_dis_buffer(struct atomisp_dis_buf *dis_buf);
 99
100void atomisp_css_free_metadata_buffer(struct atomisp_metadata_buf
101				      *metadata_buf);
102
103int atomisp_css_get_grid_info(struct atomisp_sub_device *asd,
104			      enum ia_css_pipe_id pipe_id);
105
106int atomisp_alloc_3a_output_buf(struct atomisp_sub_device *asd);
107
108int atomisp_alloc_dis_coef_buf(struct atomisp_sub_device *asd);
109
110int atomisp_alloc_metadata_output_buf(struct atomisp_sub_device *asd);
111
112void atomisp_free_metadata_output_buf(struct atomisp_sub_device *asd);
113
114void atomisp_css_temp_pipe_to_pipe_id(struct atomisp_sub_device *asd,
115				      struct atomisp_css_event *current_event);
116
117int atomisp_css_isys_set_resolution(struct atomisp_sub_device *asd,
118				    enum atomisp_input_stream_id stream_id,
119				    struct v4l2_mbus_framefmt *ffmt,
120				    int isys_stream);
121
122void atomisp_css_isys_set_link(struct atomisp_sub_device *asd,
123			       enum atomisp_input_stream_id stream_id,
124			       int link,
125			       int isys_stream);
126
127void atomisp_css_isys_set_valid(struct atomisp_sub_device *asd,
128				enum atomisp_input_stream_id stream_id,
129				bool valid,
130				int isys_stream);
131
132void atomisp_css_isys_set_format(struct atomisp_sub_device *asd,
133				 enum atomisp_input_stream_id stream_id,
134				 enum atomisp_input_format format,
135				 int isys_stream);
136
137int atomisp_css_set_default_isys_config(struct atomisp_sub_device *asd,
138					enum atomisp_input_stream_id stream_id,
139					struct v4l2_mbus_framefmt *ffmt);
140
141void atomisp_css_isys_two_stream_cfg_update_stream1(
142    struct atomisp_sub_device *asd,
143    enum atomisp_input_stream_id stream_id,
144    enum atomisp_input_format input_format,
145    unsigned int width, unsigned int height);
146
147void atomisp_css_isys_two_stream_cfg_update_stream2(
148    struct atomisp_sub_device *asd,
149    enum atomisp_input_stream_id stream_id,
150    enum atomisp_input_format input_format,
151    unsigned int width, unsigned int height);
152
153int atomisp_css_input_set_resolution(struct atomisp_sub_device *asd,
154				     enum atomisp_input_stream_id stream_id,
155				     struct v4l2_mbus_framefmt *ffmt);
156
157void atomisp_css_input_set_binning_factor(struct atomisp_sub_device *asd,
158	enum atomisp_input_stream_id stream_id,
159	unsigned int bin_factor);
160
161void atomisp_css_input_set_bayer_order(struct atomisp_sub_device *asd,
162				       enum atomisp_input_stream_id stream_id,
163				       enum ia_css_bayer_order bayer_order);
164
165void atomisp_css_input_set_format(struct atomisp_sub_device *asd,
166				  enum atomisp_input_stream_id stream_id,
167				  enum atomisp_input_format format);
168
169int atomisp_css_input_set_effective_resolution(
170    struct atomisp_sub_device *asd,
171    enum atomisp_input_stream_id stream_id,
172    unsigned int width,
173    unsigned int height);
174
175void atomisp_css_video_set_dis_envelope(struct atomisp_sub_device *asd,
176					unsigned int dvs_w, unsigned int dvs_h);
177
178void atomisp_css_input_set_two_pixels_per_clock(
179    struct atomisp_sub_device *asd,
180    bool two_ppc);
181
182void atomisp_css_enable_dz(struct atomisp_sub_device *asd, bool enable);
183
184void atomisp_css_capture_set_mode(struct atomisp_sub_device *asd,
185				  enum ia_css_capture_mode mode);
186
187void atomisp_css_input_set_mode(struct atomisp_sub_device *asd,
188				enum ia_css_input_mode mode);
189
190void atomisp_css_capture_enable_online(struct atomisp_sub_device *asd,
191				       unsigned short stream_index, bool enable);
192
193void atomisp_css_preview_enable_online(struct atomisp_sub_device *asd,
194				       unsigned short stream_index, bool enable);
195
196int atomisp_css_input_configure_port(struct atomisp_sub_device *asd,
197				     enum mipi_port_id port,
198				     unsigned int num_lanes,
199				     unsigned int timeout,
200				     unsigned int mipi_freq,
201				     enum atomisp_input_format metadata_format,
202				     unsigned int metadata_width,
203				     unsigned int metadata_height);
204
205int atomisp_create_pipes_stream(struct atomisp_sub_device *asd);
206void atomisp_destroy_pipes_stream(struct atomisp_sub_device *asd);
207
208void atomisp_css_stop(struct atomisp_sub_device *asd, bool in_reset);
209
210void atomisp_css_continuous_set_num_raw_frames(
211     struct atomisp_sub_device *asd,
212     int num_frames);
213
214int atomisp_css_copy_configure_output(struct atomisp_sub_device *asd,
215				      unsigned int stream_index,
216				      unsigned int width, unsigned int height,
217				      unsigned int padded_width,
218				      enum ia_css_frame_format format);
219
220int atomisp_css_preview_configure_output(struct atomisp_sub_device *asd,
221	unsigned int width, unsigned int height,
222	unsigned int min_width,
223	enum ia_css_frame_format format);
224
225int atomisp_css_capture_configure_output(struct atomisp_sub_device *asd,
226	unsigned int width, unsigned int height,
227	unsigned int min_width,
228	enum ia_css_frame_format format);
229
230int atomisp_css_video_configure_output(struct atomisp_sub_device *asd,
231				       unsigned int width, unsigned int height,
232				       unsigned int min_width,
233				       enum ia_css_frame_format format);
234
235int atomisp_get_css_frame_info(struct atomisp_sub_device *asd,
236			       struct ia_css_frame_info *frame_info);
237
238int atomisp_css_video_configure_viewfinder(struct atomisp_sub_device *asd,
239	unsigned int width, unsigned int height,
240	unsigned int min_width,
241	enum ia_css_frame_format format);
242
243int atomisp_css_capture_configure_viewfinder(
244    struct atomisp_sub_device *asd,
245    unsigned int width, unsigned int height,
246    unsigned int min_width,
247    enum ia_css_frame_format format);
248
249int atomisp_css_video_get_viewfinder_frame_info(
250    struct atomisp_sub_device *asd,
251    struct ia_css_frame_info *info);
252
253int atomisp_css_capture_get_viewfinder_frame_info(
254    struct atomisp_sub_device *asd,
255    struct ia_css_frame_info *info);
256
257int atomisp_css_copy_get_output_frame_info(
258    struct atomisp_sub_device *asd,
259    unsigned int stream_index,
260    struct ia_css_frame_info *info);
261
262int atomisp_css_preview_get_output_frame_info(
263    struct atomisp_sub_device *asd,
264    struct ia_css_frame_info *info);
265
266int atomisp_css_capture_get_output_frame_info(
267    struct atomisp_sub_device *asd,
268    struct ia_css_frame_info *info);
269
270int atomisp_css_video_get_output_frame_info(
271    struct atomisp_sub_device *asd,
272    struct ia_css_frame_info *info);
273
274int atomisp_css_preview_configure_pp_input(
275    struct atomisp_sub_device *asd,
276    unsigned int width, unsigned int height);
277
278int atomisp_css_capture_configure_pp_input(
279    struct atomisp_sub_device *asd,
280    unsigned int width, unsigned int height);
281
282int atomisp_css_video_configure_pp_input(
283    struct atomisp_sub_device *asd,
284    unsigned int width, unsigned int height);
285
286int atomisp_css_offline_capture_configure(struct atomisp_sub_device *asd,
287	int num_captures, unsigned int skip, int offset);
288int atomisp_css_exp_id_capture(struct atomisp_sub_device *asd, int exp_id);
289int atomisp_css_exp_id_unlock(struct atomisp_sub_device *asd, int exp_id);
290
291int atomisp_css_capture_enable_xnr(struct atomisp_sub_device *asd,
292				   bool enable);
293
294void atomisp_css_set_ctc_table(struct atomisp_sub_device *asd,
295			       struct ia_css_ctc_table *ctc_table);
296
297void atomisp_css_video_set_dis_vector(struct atomisp_sub_device *asd,
298				      struct atomisp_dis_vector *vector);
299
300void atomisp_css_set_dvs2_coefs(struct atomisp_sub_device *asd,
301				struct ia_css_dvs2_coefficients *coefs);
302
303int atomisp_css_set_dis_coefs(struct atomisp_sub_device *asd,
304			      struct atomisp_dis_coefficients *coefs);
305
306void atomisp_css_set_zoom_factor(struct atomisp_sub_device *asd,
307				 unsigned int zoom);
308
309int atomisp_css_get_wb_config(struct atomisp_sub_device *asd,
310			      struct atomisp_wb_config *config);
311
312int atomisp_css_get_ob_config(struct atomisp_sub_device *asd,
313			      struct atomisp_ob_config *config);
314
315int atomisp_css_get_dp_config(struct atomisp_sub_device *asd,
316			      struct atomisp_dp_config *config);
317
318int atomisp_css_get_de_config(struct atomisp_sub_device *asd,
319			      struct atomisp_de_config *config);
320
321int atomisp_css_get_nr_config(struct atomisp_sub_device *asd,
322			      struct atomisp_nr_config *config);
323
324int atomisp_css_get_ee_config(struct atomisp_sub_device *asd,
325			      struct atomisp_ee_config *config);
326
327int atomisp_css_get_tnr_config(struct atomisp_sub_device *asd,
328			       struct atomisp_tnr_config *config);
329
330int atomisp_css_get_ctc_table(struct atomisp_sub_device *asd,
331			      struct atomisp_ctc_table *config);
332
333int atomisp_css_get_gamma_table(struct atomisp_sub_device *asd,
334				struct atomisp_gamma_table *config);
335
336int atomisp_css_get_gc_config(struct atomisp_sub_device *asd,
337			      struct atomisp_gc_config *config);
338
339int atomisp_css_get_3a_config(struct atomisp_sub_device *asd,
340			      struct atomisp_3a_config *config);
341
342int atomisp_css_get_formats_config(struct atomisp_sub_device *asd,
343				   struct atomisp_formats_config *formats_config);
344
345void atomisp_css_set_formats_config(struct atomisp_sub_device *asd,
346				    struct ia_css_formats_config *formats_config);
347
348int atomisp_css_get_zoom_factor(struct atomisp_sub_device *asd,
349				unsigned int *zoom);
350
351struct ia_css_shading_table *atomisp_css_shading_table_alloc(
352    unsigned int width, unsigned int height);
353
354void atomisp_css_set_shading_table(struct atomisp_sub_device *asd,
355				   struct ia_css_shading_table *table);
356
357void atomisp_css_shading_table_free(struct ia_css_shading_table *table);
358
359struct ia_css_morph_table *atomisp_css_morph_table_allocate(
360    unsigned int width, unsigned int height);
361
362void atomisp_css_set_morph_table(struct atomisp_sub_device *asd,
363				 struct ia_css_morph_table *table);
364
365void atomisp_css_get_morph_table(struct atomisp_sub_device *asd,
366				 struct ia_css_morph_table *table);
367
368void atomisp_css_morph_table_free(struct ia_css_morph_table *table);
369
370int atomisp_css_get_dis_stat(struct atomisp_sub_device *asd,
371			     struct atomisp_dis_statistics *stats);
372
373int atomisp_css_update_stream(struct atomisp_sub_device *asd);
374
375int atomisp_css_isr_thread(struct atomisp_device *isp);
376
377bool atomisp_css_valid_sof(struct atomisp_device *isp);
378
379void atomisp_en_dz_capt_pipe(struct atomisp_sub_device *asd, bool enable);
380
381#endif
~/ Read-only file preview.