2 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2013 Intel Corporation. All Rights Reserved.
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.
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.
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
21 #ifndef __ATOMISP_DFS_TABLES_H__
22 #define __ATOMISP_DFS_TABLES_H__
24 #include <linux/kernel.h>
26 struct atomisp_freq_scaling_rule
{
30 unsigned int isp_freq
;
31 unsigned int run_mode
;
35 struct atomisp_dfs_config
{
36 unsigned int lowest_freq
;
37 unsigned int max_freq_at_vmin
;
38 unsigned int highest_freq
;
39 const struct atomisp_freq_scaling_rule
*dfs_table
;
40 unsigned int dfs_table_size
;
43 static const struct atomisp_freq_scaling_rule dfs_rules_merr
[] = {
45 .width
= ISP_FREQ_RULE_ANY
,
46 .height
= ISP_FREQ_RULE_ANY
,
47 .fps
= ISP_FREQ_RULE_ANY
,
48 .isp_freq
= ISP_FREQ_400MHZ
,
49 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
52 .width
= ISP_FREQ_RULE_ANY
,
53 .height
= ISP_FREQ_RULE_ANY
,
54 .fps
= ISP_FREQ_RULE_ANY
,
55 .isp_freq
= ISP_FREQ_400MHZ
,
56 .run_mode
= ATOMISP_RUN_MODE_STILL_CAPTURE
,
59 .width
= ISP_FREQ_RULE_ANY
,
60 .height
= ISP_FREQ_RULE_ANY
,
61 .fps
= ISP_FREQ_RULE_ANY
,
62 .isp_freq
= ISP_FREQ_400MHZ
,
63 .run_mode
= ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE
,
66 .width
= ISP_FREQ_RULE_ANY
,
67 .height
= ISP_FREQ_RULE_ANY
,
68 .fps
= ISP_FREQ_RULE_ANY
,
69 .isp_freq
= ISP_FREQ_400MHZ
,
70 .run_mode
= ATOMISP_RUN_MODE_PREVIEW
,
73 .width
= ISP_FREQ_RULE_ANY
,
74 .height
= ISP_FREQ_RULE_ANY
,
75 .fps
= ISP_FREQ_RULE_ANY
,
76 .isp_freq
= ISP_FREQ_457MHZ
,
77 .run_mode
= ATOMISP_RUN_MODE_SDV
,
81 /* Merrifield and Moorefield DFS rules */
82 static const struct atomisp_dfs_config dfs_config_merr
= {
83 .lowest_freq
= ISP_FREQ_200MHZ
,
84 .max_freq_at_vmin
= ISP_FREQ_400MHZ
,
85 .highest_freq
= ISP_FREQ_457MHZ
,
86 .dfs_table
= dfs_rules_merr
,
87 .dfs_table_size
= ARRAY_SIZE(dfs_rules_merr
),
90 static const struct atomisp_freq_scaling_rule dfs_rules_merr_1179
[] = {
92 .width
= ISP_FREQ_RULE_ANY
,
93 .height
= ISP_FREQ_RULE_ANY
,
94 .fps
= ISP_FREQ_RULE_ANY
,
95 .isp_freq
= ISP_FREQ_400MHZ
,
96 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
99 .width
= ISP_FREQ_RULE_ANY
,
100 .height
= ISP_FREQ_RULE_ANY
,
101 .fps
= ISP_FREQ_RULE_ANY
,
102 .isp_freq
= ISP_FREQ_400MHZ
,
103 .run_mode
= ATOMISP_RUN_MODE_STILL_CAPTURE
,
106 .width
= ISP_FREQ_RULE_ANY
,
107 .height
= ISP_FREQ_RULE_ANY
,
108 .fps
= ISP_FREQ_RULE_ANY
,
109 .isp_freq
= ISP_FREQ_400MHZ
,
110 .run_mode
= ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE
,
113 .width
= ISP_FREQ_RULE_ANY
,
114 .height
= ISP_FREQ_RULE_ANY
,
115 .fps
= ISP_FREQ_RULE_ANY
,
116 .isp_freq
= ISP_FREQ_400MHZ
,
117 .run_mode
= ATOMISP_RUN_MODE_PREVIEW
,
120 .width
= ISP_FREQ_RULE_ANY
,
121 .height
= ISP_FREQ_RULE_ANY
,
122 .fps
= ISP_FREQ_RULE_ANY
,
123 .isp_freq
= ISP_FREQ_400MHZ
,
124 .run_mode
= ATOMISP_RUN_MODE_SDV
,
128 static const struct atomisp_dfs_config dfs_config_merr_1179
= {
129 .lowest_freq
= ISP_FREQ_200MHZ
,
130 .max_freq_at_vmin
= ISP_FREQ_400MHZ
,
131 .highest_freq
= ISP_FREQ_400MHZ
,
132 .dfs_table
= dfs_rules_merr_1179
,
133 .dfs_table_size
= ARRAY_SIZE(dfs_rules_merr_1179
),
136 static const struct atomisp_freq_scaling_rule dfs_rules_merr_117a
[] = {
141 .isp_freq
= ISP_FREQ_266MHZ
,
142 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
149 .isp_freq
= ISP_FREQ_266MHZ
,
151 .isp_freq
= ISP_FREQ_400MHZ
,
153 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
159 .isp_freq
= ISP_FREQ_320MHZ
,
160 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
166 .isp_freq
= ISP_FREQ_320MHZ
,
167 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
170 .width
= ISP_FREQ_RULE_ANY
,
171 .height
= ISP_FREQ_RULE_ANY
,
173 .isp_freq
= ISP_FREQ_356MHZ
,
174 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
177 .width
= ISP_FREQ_RULE_ANY
,
178 .height
= ISP_FREQ_RULE_ANY
,
179 .fps
= ISP_FREQ_RULE_ANY
,
180 .isp_freq
= ISP_FREQ_200MHZ
,
181 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
184 .width
= ISP_FREQ_RULE_ANY
,
185 .height
= ISP_FREQ_RULE_ANY
,
186 .fps
= ISP_FREQ_RULE_ANY
,
187 .isp_freq
= ISP_FREQ_400MHZ
,
188 .run_mode
= ATOMISP_RUN_MODE_STILL_CAPTURE
,
191 .width
= ISP_FREQ_RULE_ANY
,
192 .height
= ISP_FREQ_RULE_ANY
,
193 .fps
= ISP_FREQ_RULE_ANY
,
194 .isp_freq
= ISP_FREQ_400MHZ
,
195 .run_mode
= ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE
,
198 .width
= ISP_FREQ_RULE_ANY
,
199 .height
= ISP_FREQ_RULE_ANY
,
200 .fps
= ISP_FREQ_RULE_ANY
,
201 .isp_freq
= ISP_FREQ_200MHZ
,
202 .run_mode
= ATOMISP_RUN_MODE_PREVIEW
,
205 .width
= ISP_FREQ_RULE_ANY
,
206 .height
= ISP_FREQ_RULE_ANY
,
207 .fps
= ISP_FREQ_RULE_ANY
,
208 .isp_freq
= ISP_FREQ_400MHZ
,
209 .run_mode
= ATOMISP_RUN_MODE_SDV
,
213 static const struct atomisp_dfs_config dfs_config_merr_117a
= {
214 .lowest_freq
= ISP_FREQ_200MHZ
,
215 .max_freq_at_vmin
= ISP_FREQ_200MHZ
,
216 .highest_freq
= ISP_FREQ_400MHZ
,
217 .dfs_table
= dfs_rules_merr_117a
,
218 .dfs_table_size
= ARRAY_SIZE(dfs_rules_merr_117a
),
221 static const struct atomisp_freq_scaling_rule dfs_rules_byt
[] = {
223 .width
= ISP_FREQ_RULE_ANY
,
224 .height
= ISP_FREQ_RULE_ANY
,
225 .fps
= ISP_FREQ_RULE_ANY
,
226 .isp_freq
= ISP_FREQ_400MHZ
,
227 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
230 .width
= ISP_FREQ_RULE_ANY
,
231 .height
= ISP_FREQ_RULE_ANY
,
232 .fps
= ISP_FREQ_RULE_ANY
,
233 .isp_freq
= ISP_FREQ_400MHZ
,
234 .run_mode
= ATOMISP_RUN_MODE_STILL_CAPTURE
,
237 .width
= ISP_FREQ_RULE_ANY
,
238 .height
= ISP_FREQ_RULE_ANY
,
239 .fps
= ISP_FREQ_RULE_ANY
,
240 .isp_freq
= ISP_FREQ_400MHZ
,
241 .run_mode
= ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE
,
244 .width
= ISP_FREQ_RULE_ANY
,
245 .height
= ISP_FREQ_RULE_ANY
,
246 .fps
= ISP_FREQ_RULE_ANY
,
247 .isp_freq
= ISP_FREQ_400MHZ
,
248 .run_mode
= ATOMISP_RUN_MODE_PREVIEW
,
251 .width
= ISP_FREQ_RULE_ANY
,
252 .height
= ISP_FREQ_RULE_ANY
,
253 .fps
= ISP_FREQ_RULE_ANY
,
254 .isp_freq
= ISP_FREQ_400MHZ
,
255 .run_mode
= ATOMISP_RUN_MODE_SDV
,
259 static const struct atomisp_dfs_config dfs_config_byt
= {
260 .lowest_freq
= ISP_FREQ_200MHZ
,
261 .max_freq_at_vmin
= ISP_FREQ_400MHZ
,
262 .highest_freq
= ISP_FREQ_400MHZ
,
263 .dfs_table
= dfs_rules_byt
,
264 .dfs_table_size
= ARRAY_SIZE(dfs_rules_byt
),
267 static const struct atomisp_freq_scaling_rule dfs_rules_byt_cr
[] = {
269 .width
= ISP_FREQ_RULE_ANY
,
270 .height
= ISP_FREQ_RULE_ANY
,
271 .fps
= ISP_FREQ_RULE_ANY
,
272 .isp_freq
= ISP_FREQ_320MHZ
,
273 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
276 .width
= ISP_FREQ_RULE_ANY
,
277 .height
= ISP_FREQ_RULE_ANY
,
278 .fps
= ISP_FREQ_RULE_ANY
,
279 .isp_freq
= ISP_FREQ_320MHZ
,
280 .run_mode
= ATOMISP_RUN_MODE_STILL_CAPTURE
,
283 .width
= ISP_FREQ_RULE_ANY
,
284 .height
= ISP_FREQ_RULE_ANY
,
285 .fps
= ISP_FREQ_RULE_ANY
,
286 .isp_freq
= ISP_FREQ_320MHZ
,
287 .run_mode
= ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE
,
290 .width
= ISP_FREQ_RULE_ANY
,
291 .height
= ISP_FREQ_RULE_ANY
,
292 .fps
= ISP_FREQ_RULE_ANY
,
293 .isp_freq
= ISP_FREQ_320MHZ
,
294 .run_mode
= ATOMISP_RUN_MODE_PREVIEW
,
297 .width
= ISP_FREQ_RULE_ANY
,
298 .height
= ISP_FREQ_RULE_ANY
,
299 .fps
= ISP_FREQ_RULE_ANY
,
300 .isp_freq
= ISP_FREQ_320MHZ
,
301 .run_mode
= ATOMISP_RUN_MODE_SDV
,
305 static const struct atomisp_dfs_config dfs_config_byt_cr
= {
306 .lowest_freq
= ISP_FREQ_200MHZ
,
307 .max_freq_at_vmin
= ISP_FREQ_320MHZ
,
308 .highest_freq
= ISP_FREQ_320MHZ
,
309 .dfs_table
= dfs_rules_byt_cr
,
310 .dfs_table_size
= ARRAY_SIZE(dfs_rules_byt_cr
),
313 static const struct atomisp_freq_scaling_rule dfs_rules_cht
[] = {
315 .width
= ISP_FREQ_RULE_ANY
,
316 .height
= ISP_FREQ_RULE_ANY
,
317 .fps
= ISP_FREQ_RULE_ANY
,
318 .isp_freq
= ISP_FREQ_320MHZ
,
319 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
322 .width
= ISP_FREQ_RULE_ANY
,
323 .height
= ISP_FREQ_RULE_ANY
,
324 .fps
= ISP_FREQ_RULE_ANY
,
325 .isp_freq
= ISP_FREQ_356MHZ
,
326 .run_mode
= ATOMISP_RUN_MODE_STILL_CAPTURE
,
329 .width
= ISP_FREQ_RULE_ANY
,
330 .height
= ISP_FREQ_RULE_ANY
,
331 .fps
= ISP_FREQ_RULE_ANY
,
332 .isp_freq
= ISP_FREQ_320MHZ
,
333 .run_mode
= ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE
,
336 .width
= ISP_FREQ_RULE_ANY
,
337 .height
= ISP_FREQ_RULE_ANY
,
338 .fps
= ISP_FREQ_RULE_ANY
,
339 .isp_freq
= ISP_FREQ_320MHZ
,
340 .run_mode
= ATOMISP_RUN_MODE_PREVIEW
,
345 .fps
= ISP_FREQ_RULE_ANY
,
346 .isp_freq
= ISP_FREQ_320MHZ
,
347 .run_mode
= ATOMISP_RUN_MODE_SDV
,
350 .width
= ISP_FREQ_RULE_ANY
,
351 .height
= ISP_FREQ_RULE_ANY
,
352 .fps
= ISP_FREQ_RULE_ANY
,
353 .isp_freq
= ISP_FREQ_356MHZ
,
354 .run_mode
= ATOMISP_RUN_MODE_SDV
,
358 static const struct atomisp_freq_scaling_rule dfs_rules_cht_soc
[] = {
360 .width
= ISP_FREQ_RULE_ANY
,
361 .height
= ISP_FREQ_RULE_ANY
,
362 .fps
= ISP_FREQ_RULE_ANY
,
363 .isp_freq
= ISP_FREQ_356MHZ
,
364 .run_mode
= ATOMISP_RUN_MODE_VIDEO
,
367 .width
= ISP_FREQ_RULE_ANY
,
368 .height
= ISP_FREQ_RULE_ANY
,
369 .fps
= ISP_FREQ_RULE_ANY
,
370 .isp_freq
= ISP_FREQ_356MHZ
,
371 .run_mode
= ATOMISP_RUN_MODE_STILL_CAPTURE
,
374 .width
= ISP_FREQ_RULE_ANY
,
375 .height
= ISP_FREQ_RULE_ANY
,
376 .fps
= ISP_FREQ_RULE_ANY
,
377 .isp_freq
= ISP_FREQ_320MHZ
,
378 .run_mode
= ATOMISP_RUN_MODE_CONTINUOUS_CAPTURE
,
381 .width
= ISP_FREQ_RULE_ANY
,
382 .height
= ISP_FREQ_RULE_ANY
,
383 .fps
= ISP_FREQ_RULE_ANY
,
384 .isp_freq
= ISP_FREQ_320MHZ
,
385 .run_mode
= ATOMISP_RUN_MODE_PREVIEW
,
388 .width
= ISP_FREQ_RULE_ANY
,
389 .height
= ISP_FREQ_RULE_ANY
,
390 .fps
= ISP_FREQ_RULE_ANY
,
391 .isp_freq
= ISP_FREQ_356MHZ
,
392 .run_mode
= ATOMISP_RUN_MODE_SDV
,
396 static const struct atomisp_dfs_config dfs_config_cht
= {
397 .lowest_freq
= ISP_FREQ_100MHZ
,
398 .max_freq_at_vmin
= ISP_FREQ_356MHZ
,
399 .highest_freq
= ISP_FREQ_356MHZ
,
400 .dfs_table
= dfs_rules_cht
,
401 .dfs_table_size
= ARRAY_SIZE(dfs_rules_cht
),
404 static const struct atomisp_dfs_config dfs_config_cht_soc
= {
405 .lowest_freq
= ISP_FREQ_100MHZ
,
406 .max_freq_at_vmin
= ISP_FREQ_356MHZ
,
407 .highest_freq
= ISP_FREQ_356MHZ
,
408 .dfs_table
= dfs_rules_cht_soc
,
409 .dfs_table_size
= ARRAY_SIZE(dfs_rules_cht_soc
),
412 #endif /* __ATOMISP_DFS_TABLES_H__ */