Merge remote-tracking branch 'asoc/fix/intel' into asoc-linus
[sfrench/cifs-2.6.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / ia_css_stream.h
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms and conditions of the GNU General Public License,
7  * version 2, as published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 #ifndef _IA_CSS_STREAM_H_
16 #define _IA_CSS_STREAM_H_
17
18 #include <type_support.h>
19 #include <system_local.h>
20 #if !defined(HAS_NO_INPUT_SYSTEM) && !defined(USE_INPUT_SYSTEM_VERSION_2401)
21 #include <input_system.h>
22 #endif
23 #include "ia_css_types.h"
24 #include "ia_css_stream_public.h"
25
26 /**
27  * structure to hold all internal stream related information
28  */
29 struct ia_css_stream {
30         struct ia_css_stream_config    config;
31         struct ia_css_stream_info      info;
32 #if !defined(HAS_NO_INPUT_SYSTEM) && !defined(USE_INPUT_SYSTEM_VERSION_2401)
33         rx_cfg_t                       csi_rx_config;
34 #endif
35         bool                           reconfigure_css_rx;
36         struct ia_css_pipe            *last_pipe;
37         int                            num_pipes;
38         struct ia_css_pipe           **pipes;
39         struct ia_css_pipe            *continuous_pipe;
40         struct ia_css_isp_parameters  *isp_params_configs;
41         struct ia_css_isp_parameters  *per_frame_isp_params_configs;
42
43         bool                           cont_capt;
44         bool                           disable_cont_vf;
45 #ifndef ISP2401
46         bool                           stop_copy_preview;
47 #endif
48         bool                           started;
49 };
50
51 /* @brief Get a binary in the stream, which binary has the shading correction.
52  *
53  * @param[in] stream: The stream.
54  * @return      The binary which has the shading correction.
55  *
56  */
57 struct ia_css_binary *
58 ia_css_stream_get_shading_correction_binary(const struct ia_css_stream *stream);
59
60 struct ia_css_binary *
61 ia_css_stream_get_dvs_binary(const struct ia_css_stream *stream);
62
63 struct ia_css_binary *
64 ia_css_stream_get_3a_binary(const struct ia_css_stream *stream);
65
66 unsigned int
67 ia_css_stream_input_format_bits_per_pixel(struct ia_css_stream *stream);
68
69 bool
70 sh_css_params_set_binning_factor(struct ia_css_stream *stream, unsigned int sensor_binning);
71
72 void
73 sh_css_invalidate_params(struct ia_css_stream *stream);
74
75 /* The following functions are used for testing purposes only */
76 const struct ia_css_fpn_table *
77 ia_css_get_fpn_table(struct ia_css_stream *stream);
78
79 /* @brief Get a pointer to the shading table.
80  *
81  * @param[in] stream: The stream.
82  * @return      The pointer to the shading table.
83  *
84  */
85 struct ia_css_shading_table *
86 ia_css_get_shading_table(struct ia_css_stream *stream);
87
88 void
89 ia_css_get_isp_dis_coefficients(struct ia_css_stream *stream,
90                                 short *horizontal_coefficients,
91                                 short *vertical_coefficients);
92
93 void
94 ia_css_get_isp_dvs2_coefficients(struct ia_css_stream *stream,
95         short *hor_coefs_odd_real,
96         short *hor_coefs_odd_imag,
97         short *hor_coefs_even_real,
98         short *hor_coefs_even_imag,
99         short *ver_coefs_odd_real,
100         short *ver_coefs_odd_imag,
101         short *ver_coefs_even_real,
102         short *ver_coefs_even_imag);
103
104 enum ia_css_err
105 ia_css_stream_isp_parameters_init(struct ia_css_stream *stream);
106
107 void
108 ia_css_stream_isp_parameters_uninit(struct ia_css_stream *stream);
109
110 #endif /*_IA_CSS_STREAM_H_*/