xref: /linux/drivers/media/i2c/ccs/ccs-limits.h (revision 0d3b051adbb72ed81956447d0d1e54d5943ee6f5)
1 /* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */
2 /* Copyright (C) 2019--2020 Intel Corporation */
3 
4 #ifndef __CCS_LIMITS_H__
5 #define __CCS_LIMITS_H__
6 
7 #include <linux/bits.h>
8 #include <linux/types.h>
9 
10 struct ccs_limit {
11 	u32 reg;
12 	u16 size;
13 	u16 flags;
14 	const char *name;
15 };
16 
17 #define CCS_L_FL_SAME_REG	BIT(0)
18 
19 extern const struct ccs_limit ccs_limits[];
20 
21 #define CCS_L_FRAME_FORMAT_MODEL_TYPE				0
22 #define CCS_L_FRAME_FORMAT_MODEL_SUBTYPE			1
23 #define CCS_L_FRAME_FORMAT_DESCRIPTOR				2
24 #define CCS_L_FRAME_FORMAT_DESCRIPTOR_OFFSET(n)			((n) * 2)
25 #define CCS_L_FRAME_FORMAT_DESCRIPTOR_4				3
26 #define CCS_L_FRAME_FORMAT_DESCRIPTOR_4_OFFSET(n)		((n) * 4)
27 #define CCS_L_ANALOG_GAIN_CAPABILITY				4
28 #define CCS_L_ANALOG_GAIN_CODE_MIN				5
29 #define CCS_L_ANALOG_GAIN_CODE_MAX				6
30 #define CCS_L_ANALOG_GAIN_CODE_STEP				7
31 #define CCS_L_ANALOG_GAIN_TYPE					8
32 #define CCS_L_ANALOG_GAIN_M0					9
33 #define CCS_L_ANALOG_GAIN_C0					10
34 #define CCS_L_ANALOG_GAIN_M1					11
35 #define CCS_L_ANALOG_GAIN_C1					12
36 #define CCS_L_ANALOG_LINEAR_GAIN_MIN				13
37 #define CCS_L_ANALOG_LINEAR_GAIN_MAX				14
38 #define CCS_L_ANALOG_LINEAR_GAIN_STEP_SIZE			15
39 #define CCS_L_ANALOG_EXPONENTIAL_GAIN_MIN			16
40 #define CCS_L_ANALOG_EXPONENTIAL_GAIN_MAX			17
41 #define CCS_L_ANALOG_EXPONENTIAL_GAIN_STEP_SIZE			18
42 #define CCS_L_DATA_FORMAT_MODEL_TYPE				19
43 #define CCS_L_DATA_FORMAT_MODEL_SUBTYPE				20
44 #define CCS_L_DATA_FORMAT_DESCRIPTOR				21
45 #define CCS_L_DATA_FORMAT_DESCRIPTOR_OFFSET(n)			((n) * 2)
46 #define CCS_L_INTEGRATION_TIME_CAPABILITY			22
47 #define CCS_L_COARSE_INTEGRATION_TIME_MIN			23
48 #define CCS_L_COARSE_INTEGRATION_TIME_MAX_MARGIN		24
49 #define CCS_L_FINE_INTEGRATION_TIME_MIN				25
50 #define CCS_L_FINE_INTEGRATION_TIME_MAX_MARGIN			26
51 #define CCS_L_DIGITAL_GAIN_CAPABILITY				27
52 #define CCS_L_DIGITAL_GAIN_MIN					28
53 #define CCS_L_DIGITAL_GAIN_MAX					29
54 #define CCS_L_DIGITAL_GAIN_STEP_SIZE				30
55 #define CCS_L_PEDESTAL_CAPABILITY				31
56 #define CCS_L_ADC_CAPABILITY					32
57 #define CCS_L_ADC_BIT_DEPTH_CAPABILITY				33
58 #define CCS_L_MIN_EXT_CLK_FREQ_MHZ				34
59 #define CCS_L_MAX_EXT_CLK_FREQ_MHZ				35
60 #define CCS_L_MIN_PRE_PLL_CLK_DIV				36
61 #define CCS_L_MAX_PRE_PLL_CLK_DIV				37
62 #define CCS_L_MIN_PLL_IP_CLK_FREQ_MHZ				38
63 #define CCS_L_MAX_PLL_IP_CLK_FREQ_MHZ				39
64 #define CCS_L_MIN_PLL_MULTIPLIER				40
65 #define CCS_L_MAX_PLL_MULTIPLIER				41
66 #define CCS_L_MIN_PLL_OP_CLK_FREQ_MHZ				42
67 #define CCS_L_MAX_PLL_OP_CLK_FREQ_MHZ				43
68 #define CCS_L_MIN_VT_SYS_CLK_DIV				44
69 #define CCS_L_MAX_VT_SYS_CLK_DIV				45
70 #define CCS_L_MIN_VT_SYS_CLK_FREQ_MHZ				46
71 #define CCS_L_MAX_VT_SYS_CLK_FREQ_MHZ				47
72 #define CCS_L_MIN_VT_PIX_CLK_FREQ_MHZ				48
73 #define CCS_L_MAX_VT_PIX_CLK_FREQ_MHZ				49
74 #define CCS_L_MIN_VT_PIX_CLK_DIV				50
75 #define CCS_L_MAX_VT_PIX_CLK_DIV				51
76 #define CCS_L_CLOCK_CALCULATION					52
77 #define CCS_L_NUM_OF_VT_LANES					53
78 #define CCS_L_NUM_OF_OP_LANES					54
79 #define CCS_L_OP_BITS_PER_LANE					55
80 #define CCS_L_MIN_FRAME_LENGTH_LINES				56
81 #define CCS_L_MAX_FRAME_LENGTH_LINES				57
82 #define CCS_L_MIN_LINE_LENGTH_PCK				58
83 #define CCS_L_MAX_LINE_LENGTH_PCK				59
84 #define CCS_L_MIN_LINE_BLANKING_PCK				60
85 #define CCS_L_MIN_FRAME_BLANKING_LINES				61
86 #define CCS_L_MIN_LINE_LENGTH_PCK_STEP_SIZE			62
87 #define CCS_L_TIMING_MODE_CAPABILITY				63
88 #define CCS_L_FRAME_MARGIN_MAX_VALUE				64
89 #define CCS_L_FRAME_MARGIN_MIN_VALUE				65
90 #define CCS_L_GAIN_DELAY_TYPE					66
91 #define CCS_L_MIN_OP_SYS_CLK_DIV				67
92 #define CCS_L_MAX_OP_SYS_CLK_DIV				68
93 #define CCS_L_MIN_OP_SYS_CLK_FREQ_MHZ				69
94 #define CCS_L_MAX_OP_SYS_CLK_FREQ_MHZ				70
95 #define CCS_L_MIN_OP_PIX_CLK_DIV				71
96 #define CCS_L_MAX_OP_PIX_CLK_DIV				72
97 #define CCS_L_MIN_OP_PIX_CLK_FREQ_MHZ				73
98 #define CCS_L_MAX_OP_PIX_CLK_FREQ_MHZ				74
99 #define CCS_L_X_ADDR_MIN					75
100 #define CCS_L_Y_ADDR_MIN					76
101 #define CCS_L_X_ADDR_MAX					77
102 #define CCS_L_Y_ADDR_MAX					78
103 #define CCS_L_MIN_X_OUTPUT_SIZE					79
104 #define CCS_L_MIN_Y_OUTPUT_SIZE					80
105 #define CCS_L_MAX_X_OUTPUT_SIZE					81
106 #define CCS_L_MAX_Y_OUTPUT_SIZE					82
107 #define CCS_L_X_ADDR_START_DIV_CONSTANT				83
108 #define CCS_L_Y_ADDR_START_DIV_CONSTANT				84
109 #define CCS_L_X_ADDR_END_DIV_CONSTANT				85
110 #define CCS_L_Y_ADDR_END_DIV_CONSTANT				86
111 #define CCS_L_X_SIZE_DIV					87
112 #define CCS_L_Y_SIZE_DIV					88
113 #define CCS_L_X_OUTPUT_DIV					89
114 #define CCS_L_Y_OUTPUT_DIV					90
115 #define CCS_L_NON_FLEXIBLE_RESOLUTION_SUPPORT			91
116 #define CCS_L_MIN_OP_PRE_PLL_CLK_DIV				92
117 #define CCS_L_MAX_OP_PRE_PLL_CLK_DIV				93
118 #define CCS_L_MIN_OP_PLL_IP_CLK_FREQ_MHZ			94
119 #define CCS_L_MAX_OP_PLL_IP_CLK_FREQ_MHZ			95
120 #define CCS_L_MIN_OP_PLL_MULTIPLIER				96
121 #define CCS_L_MAX_OP_PLL_MULTIPLIER				97
122 #define CCS_L_MIN_OP_PLL_OP_CLK_FREQ_MHZ			98
123 #define CCS_L_MAX_OP_PLL_OP_CLK_FREQ_MHZ			99
124 #define CCS_L_CLOCK_TREE_PLL_CAPABILITY				100
125 #define CCS_L_CLOCK_CAPA_TYPE_CAPABILITY			101
126 #define CCS_L_MIN_EVEN_INC					102
127 #define CCS_L_MIN_ODD_INC					103
128 #define CCS_L_MAX_EVEN_INC					104
129 #define CCS_L_MAX_ODD_INC					105
130 #define CCS_L_AUX_SUBSAMP_CAPABILITY				106
131 #define CCS_L_AUX_SUBSAMP_MONO_CAPABILITY			107
132 #define CCS_L_MONOCHROME_CAPABILITY				108
133 #define CCS_L_PIXEL_READOUT_CAPABILITY				109
134 #define CCS_L_MIN_EVEN_INC_MONO					110
135 #define CCS_L_MAX_EVEN_INC_MONO					111
136 #define CCS_L_MIN_ODD_INC_MONO					112
137 #define CCS_L_MAX_ODD_INC_MONO					113
138 #define CCS_L_MIN_EVEN_INC_BC2					114
139 #define CCS_L_MAX_EVEN_INC_BC2					115
140 #define CCS_L_MIN_ODD_INC_BC2					116
141 #define CCS_L_MAX_ODD_INC_BC2					117
142 #define CCS_L_MIN_EVEN_INC_MONO_BC2				118
143 #define CCS_L_MAX_EVEN_INC_MONO_BC2				119
144 #define CCS_L_MIN_ODD_INC_MONO_BC2				120
145 #define CCS_L_MAX_ODD_INC_MONO_BC2				121
146 #define CCS_L_SCALING_CAPABILITY				122
147 #define CCS_L_SCALER_M_MIN					123
148 #define CCS_L_SCALER_M_MAX					124
149 #define CCS_L_SCALER_N_MIN					125
150 #define CCS_L_SCALER_N_MAX					126
151 #define CCS_L_DIGITAL_CROP_CAPABILITY				127
152 #define CCS_L_HDR_CAPABILITY_1					128
153 #define CCS_L_MIN_HDR_BIT_DEPTH					129
154 #define CCS_L_HDR_RESOLUTION_SUB_TYPES				130
155 #define CCS_L_HDR_RESOLUTION_SUB_TYPE				131
156 #define CCS_L_HDR_RESOLUTION_SUB_TYPE_OFFSET(n)			(n)
157 #define CCS_L_HDR_CAPABILITY_2					132
158 #define CCS_L_MAX_HDR_BIT_DEPTH					133
159 #define CCS_L_USL_SUPPORT_CAPABILITY				134
160 #define CCS_L_USL_CLOCK_MODE_D_CAPABILITY			135
161 #define CCS_L_MIN_OP_SYS_CLK_DIV_REV				136
162 #define CCS_L_MAX_OP_SYS_CLK_DIV_REV				137
163 #define CCS_L_MIN_OP_PIX_CLK_DIV_REV				138
164 #define CCS_L_MAX_OP_PIX_CLK_DIV_REV				139
165 #define CCS_L_MIN_OP_SYS_CLK_FREQ_REV_MHZ			140
166 #define CCS_L_MAX_OP_SYS_CLK_FREQ_REV_MHZ			141
167 #define CCS_L_MIN_OP_PIX_CLK_FREQ_REV_MHZ			142
168 #define CCS_L_MAX_OP_PIX_CLK_FREQ_REV_MHZ			143
169 #define CCS_L_MAX_BITRATE_REV_D_MODE_MBPS			144
170 #define CCS_L_MAX_SYMRATE_REV_C_MODE_MSPS			145
171 #define CCS_L_COMPRESSION_CAPABILITY				146
172 #define CCS_L_TEST_MODE_CAPABILITY				147
173 #define CCS_L_PN9_DATA_FORMAT1					148
174 #define CCS_L_PN9_DATA_FORMAT2					149
175 #define CCS_L_PN9_DATA_FORMAT3					150
176 #define CCS_L_PN9_DATA_FORMAT4					151
177 #define CCS_L_PN9_MISC_CAPABILITY				152
178 #define CCS_L_TEST_PATTERN_CAPABILITY				153
179 #define CCS_L_PATTERN_SIZE_DIV_M1				154
180 #define CCS_L_FIFO_SUPPORT_CAPABILITY				155
181 #define CCS_L_PHY_CTRL_CAPABILITY				156
182 #define CCS_L_CSI_DPHY_LANE_MODE_CAPABILITY			157
183 #define CCS_L_CSI_SIGNALING_MODE_CAPABILITY			158
184 #define CCS_L_FAST_STANDBY_CAPABILITY				159
185 #define CCS_L_CSI_ADDRESS_CONTROL_CAPABILITY			160
186 #define CCS_L_DATA_TYPE_CAPABILITY				161
187 #define CCS_L_CSI_CPHY_LANE_MODE_CAPABILITY			162
188 #define CCS_L_EMB_DATA_CAPABILITY				163
189 #define CCS_L_MAX_PER_LANE_BITRATE_LANE_D_MODE_MBPS		164
190 #define CCS_L_MAX_PER_LANE_BITRATE_LANE_D_MODE_MBPS_OFFSET(n)	((n) * 4)
191 #define CCS_L_TEMP_SENSOR_CAPABILITY				165
192 #define CCS_L_MAX_PER_LANE_BITRATE_LANE_C_MODE_MBPS		166
193 #define CCS_L_MAX_PER_LANE_BITRATE_LANE_C_MODE_MBPS_OFFSET(n)	((n) * 4)
194 #define CCS_L_DPHY_EQUALIZATION_CAPABILITY			167
195 #define CCS_L_CPHY_EQUALIZATION_CAPABILITY			168
196 #define CCS_L_DPHY_PREAMBLE_CAPABILITY				169
197 #define CCS_L_DPHY_SSC_CAPABILITY				170
198 #define CCS_L_CPHY_CALIBRATION_CAPABILITY			171
199 #define CCS_L_DPHY_CALIBRATION_CAPABILITY			172
200 #define CCS_L_PHY_CTRL_CAPABILITY_2				173
201 #define CCS_L_LRTE_CPHY_CAPABILITY				174
202 #define CCS_L_LRTE_DPHY_CAPABILITY				175
203 #define CCS_L_ALPS_CAPABILITY_DPHY				176
204 #define CCS_L_ALPS_CAPABILITY_CPHY				177
205 #define CCS_L_SCRAMBLING_CAPABILITY				178
206 #define CCS_L_DPHY_MANUAL_CONSTANT				179
207 #define CCS_L_CPHY_MANUAL_CONSTANT				180
208 #define CCS_L_CSI2_INTERFACE_CAPABILITY_MISC			181
209 #define CCS_L_PHY_CTRL_CAPABILITY_3				182
210 #define CCS_L_DPHY_SF						183
211 #define CCS_L_CPHY_SF						184
212 #define CCS_L_DPHY_LIMITS_1					185
213 #define CCS_L_DPHY_LIMITS_2					186
214 #define CCS_L_DPHY_LIMITS_3					187
215 #define CCS_L_DPHY_LIMITS_4					188
216 #define CCS_L_DPHY_LIMITS_5					189
217 #define CCS_L_DPHY_LIMITS_6					190
218 #define CCS_L_CPHY_LIMITS_1					191
219 #define CCS_L_CPHY_LIMITS_2					192
220 #define CCS_L_CPHY_LIMITS_3					193
221 #define CCS_L_MIN_FRAME_LENGTH_LINES_BIN			194
222 #define CCS_L_MAX_FRAME_LENGTH_LINES_BIN			195
223 #define CCS_L_MIN_LINE_LENGTH_PCK_BIN				196
224 #define CCS_L_MAX_LINE_LENGTH_PCK_BIN				197
225 #define CCS_L_MIN_LINE_BLANKING_PCK_BIN				198
226 #define CCS_L_FINE_INTEGRATION_TIME_MIN_BIN			199
227 #define CCS_L_FINE_INTEGRATION_TIME_MAX_MARGIN_BIN		200
228 #define CCS_L_BINNING_CAPABILITY				201
229 #define CCS_L_BINNING_WEIGHTING_CAPABILITY			202
230 #define CCS_L_BINNING_SUB_TYPES					203
231 #define CCS_L_BINNING_SUB_TYPE					204
232 #define CCS_L_BINNING_SUB_TYPE_OFFSET(n)			(n)
233 #define CCS_L_BINNING_WEIGHTING_MONO_CAPABILITY			205
234 #define CCS_L_BINNING_SUB_TYPES_MONO				206
235 #define CCS_L_BINNING_SUB_TYPE_MONO				207
236 #define CCS_L_BINNING_SUB_TYPE_MONO_OFFSET(n)			(n)
237 #define CCS_L_DATA_TRANSFER_IF_CAPABILITY			208
238 #define CCS_L_SHADING_CORRECTION_CAPABILITY			209
239 #define CCS_L_GREEN_IMBALANCE_CAPABILITY			210
240 #define CCS_L_MODULE_SPECIFIC_CORRECTION_CAPABILITY		211
241 #define CCS_L_DEFECT_CORRECTION_CAPABILITY			212
242 #define CCS_L_DEFECT_CORRECTION_CAPABILITY_2			213
243 #define CCS_L_NF_CAPABILITY					214
244 #define CCS_L_OB_READOUT_CAPABILITY				215
245 #define CCS_L_COLOR_FEEDBACK_CAPABILITY				216
246 #define CCS_L_CFA_PATTERN_CAPABILITY				217
247 #define CCS_L_CFA_PATTERN_CONVERSION_CAPABILITY			218
248 #define CCS_L_FLASH_MODE_CAPABILITY				219
249 #define CCS_L_SA_STROBE_MODE_CAPABILITY				220
250 #define CCS_L_RESET_MAX_DELAY					221
251 #define CCS_L_RESET_MIN_TIME					222
252 #define CCS_L_PDAF_CAPABILITY_1					223
253 #define CCS_L_PDAF_CAPABILITY_2					224
254 #define CCS_L_BRACKETING_LUT_CAPABILITY_1			225
255 #define CCS_L_BRACKETING_LUT_CAPABILITY_2			226
256 #define CCS_L_BRACKETING_LUT_SIZE				227
257 #define CCS_L_LAST						228
258 
259 #endif /* __CCS_LIMITS_H__ */
260