]> bbs.cooldavid.org Git - net-next-2.6.git/blob - drivers/staging/dream/include/mach/qdsp5/qdsp5vfecmdi.h
55e8fc2269f7b6a7267d48c9e6e8778694b746d1
[net-next-2.6.git] / drivers / staging / dream / include / mach / qdsp5 / qdsp5vfecmdi.h
1 #ifndef QDSP5VFECMDI_H
2 #define QDSP5VFECMDI_H
3
4 /*====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*
5
6     V F E   I N T E R N A L   C O M M A N D S
7
8 GENERAL DESCRIPTION
9   This file contains defintions of format blocks of commands
10   that are accepted by VFE Task
11
12 REFERENCES
13   None
14
15 EXTERNALIZED FUNCTIONS
16   None
17
18 Copyright(c) 1992 - 2008 by QUALCOMM, Incorporated.
19
20 This software is licensed under the terms of the GNU General Public
21 License version 2, as published by the Free Software Foundation, and
22 may be copied, distributed, and modified under those terms.
23
24 This program is distributed in the hope that it will be useful,
25 but WITHOUT ANY WARRANTY; without even the implied warranty of
26 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
27 GNU General Public License for more details.
28
29 *====*====*====*====*====*====*====*====*====*====*====*====*====*====*====*/
30 /*===========================================================================
31
32                       EDIT HISTORY FOR FILE
33
34 This section contains comments describing changes made to this file.
35 Notice that changes are listed in reverse chronological order.
36
37 $Header: //source/qcom/qct/multimedia2/AdspSvc/7XXX/qdsp5cmd/video/qdsp5vfecmdi.h#2 $ $DateTime: 2008/07/30 10:50:23 $ $Author: pavanr $
38 Revision History:
39
40 when       who     what, where, why
41 --------   ---     ----------------------------------------------------------
42 06/12/08   sv      initial version
43 ===========================================================================*/
44
45 /******************************************************************************
46  * Commands through vfeCommandScaleQueue
47  *****************************************************************************/
48
49 /*
50  * Command to program scaler for op1 . max op of scaler is VGA
51  */
52
53
54 #define VFE_CMD_SCALE_OP1_CFG           0x0000
55 #define VFE_CMD_SCALE_OP1_CFG_LEN       \
56         sizeof(vfe_cmd_scale_op1_cfg)
57
58 #define VFE_CMD_SCALE_OP1_SEL_IP_SEL_Y_STANDARD 0x0000
59 #define VFE_CMD_SCALE_OP1_SEL_IP_SEL_Y_CASCADED 0x0001
60 #define VFE_CMD_SCALE_OP1_SEL_H_Y_SCALER_DIS    0x0000
61 #define VFE_CMD_SCALE_OP1_SEL_H_Y_SCALER_ENA    0x0002
62 #define VFE_CMD_SCALE_OP1_SEL_H_PP_Y_SCALER_DIS 0x0000
63 #define VFE_CMD_SCALE_OP1_SEL_H_PP_Y_SCALER_ENA 0x0004
64 #define VFE_CMD_SCALE_OP1_SEL_V_Y_SCALER_DIS    0x0000
65 #define VFE_CMD_SCALE_OP1_SEL_V_Y_SCALER_ENA    0x0008
66 #define VFE_CMD_SCALE_OP1_SEL_V_PP_Y_SCALER_DIS 0x0000
67 #define VFE_CMD_SCALE_OP1_SEL_V_PP_Y_SCALER_ENA 0x0010
68 #define VFE_CMD_SCALE_OP1_SEL_IP_SEL_CBCR_STANDARD      0x0000
69 #define VFE_CMD_SCALE_OP1_SEL_IP_SEL_CBCR_CASCADED      0x0020
70 #define VFE_CMD_SCALE_OP1_SEL_H_CBCR_SCALER_DIS         0x0000
71 #define VFE_CMD_SCALE_OP1_SEL_H_CBCR_SCALER_ENA         0x0040
72 #define VFE_CMD_SCALE_OP1_SEL_V_CBCR_SCALER_DIS         0x0000
73 #define VFE_CMD_SCALE_OP1_SEL_V_CBCR_SCALER_ENA         0x0080
74
75 #define VFE_CMD_OP1_PP_Y_SCALER_CFG_PART1_DONT_LOAD_COEFFS      0x80000000
76 #define VFE_CMD_OP1_PP_Y_SCALER_CFG_PART1_LOAD_COEFFS   0x80000000
77
78 typedef struct {
79         unsigned int    cmd_id;
80         unsigned int    scale_op1_sel;
81         unsigned int    y_scaler_cfg_part1;
82         unsigned int    y_scaler_cfg_part2;
83         unsigned int    cbcr_scaler_cfg_part1;
84         unsigned int    cbcr_scaler_cfg_part2;
85         unsigned int    cbcr_scaler_cfg_part3;
86         unsigned int    pp_y_scaler_cfg_part1;
87         unsigned int    pp_y_scaler_cfg_part2;
88         unsigned int    y_scaler_v_coeff_bank_part1[16];
89         unsigned int    y_scaler_v_coeff_bank_part2[16];
90         unsigned int    y_scaler_h_coeff_bank_part1[16];
91         unsigned int    y_scaler_h_coeff_bank_part2[16];
92 } __attribute__((packed)) vfe_cmd_scale_op1_cfg;
93
94
95 /*
96  * Command to program scaler for op2
97  */
98
99 #define VFE_CMD_SCALE_OP2_CFG           0x0001
100 #define VFE_CMD_SCALE_OP2_CFG_LEN       \
101         sizeof(vfe_cmd_scale_op2_cfg)
102
103 #define VFE_CMD_SCALE_OP2_SEL_IP_SEL_Y_STANDARD 0x0000
104 #define VFE_CMD_SCALE_OP2_SEL_IP_SEL_Y_CASCADED 0x0001
105 #define VFE_CMD_SCALE_OP2_SEL_H_Y_SCALER_DIS    0x0000
106 #define VFE_CMD_SCALE_OP2_SEL_H_Y_SCALER_ENA    0x0002
107 #define VFE_CMD_SCALE_OP2_SEL_H_PP_Y_SCALER_DIS 0x0000
108 #define VFE_CMD_SCALE_OP2_SEL_H_PP_Y_SCALER_ENA 0x0004
109 #define VFE_CMD_SCALE_OP2_SEL_V_Y_SCALER_DIS    0x0000
110 #define VFE_CMD_SCALE_OP2_SEL_V_Y_SCALER_ENA    0x0008
111 #define VFE_CMD_SCALE_OP2_SEL_V_PP_Y_SCALER_DIS 0x0000
112 #define VFE_CMD_SCALE_OP2_SEL_V_PP_Y_SCALER_ENA 0x0010
113 #define VFE_CMD_SCALE_OP2_SEL_IP_SEL_CBCR_STANDARD      0x0000
114 #define VFE_CMD_SCALE_OP2_SEL_IP_SEL_CBCR_CASCADED      0x0020
115 #define VFE_CMD_SCALE_OP2_SEL_H_CBCR_SCALER_DIS         0x0000
116 #define VFE_CMD_SCALE_OP2_SEL_H_CBCR_SCALER_ENA         0x0040
117 #define VFE_CMD_SCALE_OP2_SEL_V_CBCR_SCALER_DIS         0x0000
118 #define VFE_CMD_SCALE_OP2_SEL_V_CBCR_SCALER_ENA         0x0080
119
120 #define VFE_CMD_OP2_PP_Y_SCALER_CFG_PART1_DONT_LOAD_COEFFS      0x80000000
121 #define VFE_CMD_OP2_PP_Y_SCALER_CFG_PART1_LOAD_COEFFS           0x80000000
122
123 typedef struct {
124         unsigned int    cmd_id;
125         unsigned int    scale_op2_sel;
126         unsigned int    y_scaler_cfg_part1;
127         unsigned int    y_scaler_cfg_part2;
128         unsigned int    cbcr_scaler_cfg_part1;
129         unsigned int    cbcr_scaler_cfg_part2;
130         unsigned int    cbcr_scaler_cfg_part3;
131         unsigned int    pp_y_scaler_cfg_part1;
132         unsigned int    pp_y_scaler_cfg_part2;
133         unsigned int    y_scaler_v_coeff_bank_part1[16];
134         unsigned int    y_scaler_v_coeff_bank_part2[16];
135         unsigned int    y_scaler_h_coeff_bank_part1[16];
136         unsigned int    y_scaler_h_coeff_bank_part2[16];
137 } __attribute__((packed)) vfe_cmd_scale_op2_cfg;
138
139
140 /******************************************************************************
141  * Commands through vfeCommandTableQueue
142  *****************************************************************************/
143
144 /*
145  * Command to program the AXI ip paths
146  */
147
148 #define VFE_CMD_AXI_IP_CFG              0x0000
149 #define VFE_CMD_AXI_IP_CFG_LEN          sizeof(vfe_cmd_axi_ip_cfg)
150
151 #define VFE_CMD_IP_SEL_IP_FORMAT_8      0x0000
152 #define VFE_CMD_IP_SEL_IP_FORMAT_10     0x0001
153 #define VFE_CMD_IP_SEL_IP_FORMAT_12     0x0002
154
155 typedef struct {
156         unsigned int    cmd_id;
157         unsigned int    ip_sel;
158         unsigned int    ip_cfg_part1;
159         unsigned int    ip_cfg_part2;
160         unsigned int    ip_unpack_cfg_part[6];
161         unsigned int    ip_buf_addr[8];
162 } __attribute__ ((packed)) vfe_cmd_axi_ip_cfg;
163
164
165 /*
166  * Command to program axi op paths
167  */
168
169 #define VFE_CMD_AXI_OP_CFG      0x0001
170 #define VFE_CMD_AXI_OP_CFG_LEN  sizeof(vfe_cmd_axi_op_cfg)
171
172 #define VFE_CMD_OP_SEL_OP1              0x0000
173 #define VFE_CMD_OP_SEL_OP2              0x0001
174 #define VFE_CMD_OP_SEL_OP1_OP2          0x0002
175 #define VFE_CMD_OP_SEL_CTOA             0x0003
176 #define VFE_CMD_OP_SEL_CTOA_OP1         0x0004
177 #define VFE_CMD_OP_SEL_CTOA_OP2         0x0005
178 #define VFE_CMD_OP_SEL_OP_FORMAT_8      0x0000
179 #define VFE_CMD_OP_SEL_OP_FORMAT_10     0x0008
180 #define VFE_CMD_OP_SEL_OP_FORMAT_12     0x0010
181
182
183 typedef struct {
184         unsigned int    cmd_id;
185         unsigned int    op_sel;
186         unsigned int    op1_y_cfg_part1;
187         unsigned int    op1_y_cfg_part2;
188         unsigned int    op1_cbcr_cfg_part1;
189         unsigned int    op1_cbcr_cfg_part2;
190         unsigned int    op2_y_cfg_part1;
191         unsigned int    op2_y_cfg_part2;
192         unsigned int    op2_cbcr_cfg_part1;
193         unsigned int    op2_cbcr_cfg_part2;
194         unsigned int    op1_buf1_addr[16];
195         unsigned int    op2_buf1_addr[16];
196 } __attribute__((packed)) vfe_cmd_axi_op_cfg;
197
198
199
200
201 /*
202  * Command to program the roll off correction module
203  */
204
205 #define VFE_CMD_ROLLOFF_CFG     0x0002
206 #define VFE_CMD_ROLLOFF_CFG_LEN \
207         sizeof(vfe_cmd_rolloff_cfg)
208
209
210 typedef struct {
211         unsigned int    cmd_id;
212         unsigned int    correction_opt_center_pos;
213         unsigned int    radius_square_entry[32];
214         unsigned int    red_table_entry[32];
215         unsigned int    green_table_entry[32];
216         unsigned int    blue_table_entry[32];
217 } __attribute__((packed)) vfe_cmd_rolloff_cfg;
218
219 /*
220  * Command to program RGB gamma table
221  */
222
223 #define VFE_CMD_RGB_GAMMA_CFG           0x0003
224 #define VFE_CMD_RGB_GAMMA_CFG_LEN       \
225         sizeof(vfe_cmd_rgb_gamma_cfg)
226
227 #define VFE_CMD_RGB_GAMMA_SEL_LINEAR            0x0000
228 #define VFE_CMD_RGB_GAMMA_SEL_PW_LINEAR         0x0001
229 typedef struct {
230         unsigned int    cmd_id;
231         unsigned int    rgb_gamma_sel;
232         unsigned int    rgb_gamma_entry[256];
233 } __attribute__((packed)) vfe_cmd_rgb_gamma_cfg;
234
235
236 /*
237  * Command to program luma gamma table for the noise reduction path
238  */
239
240 #define VFE_CMD_Y_GAMMA_CFG             0x0004
241 #define VFE_CMD_Y_GAMMA_CFG_LEN         \
242         sizeof(vfe_cmd_y_gamma_cfg)
243
244 #define VFE_CMD_Y_GAMMA_SEL_LINEAR      0x0000
245 #define VFE_CMD_Y_GAMMA_SEL_PW_LINEAR   0x0001
246
247 typedef struct {
248         unsigned int    cmd_id;
249         unsigned int    y_gamma_sel;
250         unsigned int    y_gamma_entry[256];
251 } __attribute__((packed)) vfe_cmd_y_gamma_cfg;
252
253
254
255 /******************************************************************************
256  * Commands through vfeCommandQueue
257  *****************************************************************************/
258
259 /*
260  * Command to reset the VFE to a known good state.All previously programmed
261  * Params will be lost
262  */
263
264
265 #define VFE_CMD_RESET           0x0000
266 #define VFE_CMD_RESET_LEN       sizeof(vfe_cmd_reset)
267
268
269 typedef struct {
270         unsigned short  cmd_id;
271 } __attribute__((packed)) vfe_cmd_reset;
272
273
274 /*
275  * Command to start VFE processing based on the config params
276  */
277
278
279 #define VFE_CMD_START           0x0001
280 #define VFE_CMD_START_LEN       sizeof(vfe_cmd_start)
281
282 #define VFE_CMD_STARTUP_PARAMS_SRC_CAMIF        0x0000
283 #define VFE_CMD_STARTUP_PARAMS_SRC_AXI          0x0001
284 #define VFE_CMD_STARTUP_PARAMS_MODE_CONTINUOUS  0x0000
285 #define VFE_CMD_STARTUP_PARAMS_MODE_SNAPSHOT    0x0002
286
287 #define VFE_CMD_IMAGE_PL_BLACK_LVL_CORR_DIS     0x0000
288 #define VFE_CMD_IMAGE_PL_BLACK_LVL_CORR_ENA     0x0001
289 #define VFE_CMD_IMAGE_PL_ROLLOFF_CORR_DIS       0x0000
290 #define VFE_CMD_IMAGE_PL_ROLLOFF_CORR_ENA       0x0002
291 #define VFE_CMD_IMAGE_PL_WHITE_BAL_DIS          0x0000
292 #define VFE_CMD_IMAGE_PL_WHITE_BAL_ENA          0x0004
293 #define VFE_CMD_IMAGE_PL_RGB_GAMMA_DIS          0x0000
294 #define VFE_CMD_IMAGE_PL_RGB_GAMMA_ENA          0x0008
295 #define VFE_CMD_IMAGE_PL_LUMA_NOISE_RED_PATH_DIS        0x0000
296 #define VFE_CMD_IMAGE_PL_LUMA_NOISE_RED_PATH_ENA        0x0010
297 #define VFE_CMD_IMAGE_PL_ADP_FILTER_DIS         0x0000
298 #define VFE_CMD_IMAGE_PL_ADP_FILTER_ENA         0x0020
299 #define VFE_CMD_IMAGE_PL_CHROMA_SAMP_DIS        0x0000
300 #define VFE_CMD_IMAGE_PL_CHROMA_SAMP_ENA        0x0040
301
302
303 typedef struct {
304         unsigned int    cmd_id;
305         unsigned int    startup_params;
306         unsigned int    image_pipeline;
307         unsigned int    frame_dimension;
308 } __attribute__((packed)) vfe_cmd_start;
309
310
311 /*
312  * Command to halt all processing
313  */
314
315 #define VFE_CMD_STOP            0x0002
316 #define VFE_CMD_STOP_LEN        sizeof(vfe_cmd_stop)
317
318 typedef struct {
319         unsigned short  cmd_id;
320 } __attribute__((packed)) vfe_cmd_stop;
321
322
323 /*
324  * Command to commit the params that have been programmed to take
325  * effect on the next frame
326  */
327
328 #define VFE_CMD_UPDATE          0x0003
329 #define VFE_CMD_UPDATE_LEN      sizeof(vfe_cmd_update)
330
331
332 typedef struct {
333         unsigned short  cmd_id;
334 } __attribute__((packed)) vfe_cmd_update;
335
336
337 /*
338  * Command to program CAMIF module
339  */
340
341 #define VFE_CMD_CAMIF_CFG       0x0004
342 #define VFE_CMD_CAMIF_CFG_LEN   sizeof(vfe_cmd_camif_cfg)
343
344 #define VFE_CMD_CFG_VSYNC_SYNC_EDGE_HIGH        0x0000
345 #define VFE_CMD_CFG_VSYNC_SYNC_EDGE_LOW         0x0002
346 #define VFE_CMD_CFG_HSYNC_SYNC_EDGE_HIGH        0x0000
347 #define VFE_CMD_CFG_HSYNC_SYNC_EDGE_LOW         0x0004
348 #define VFE_CMD_CFG_SYNC_MODE_APS               0x0000
349 #define VFE_CMD_CFG_SYNC_MODE_EFS               0X0008
350 #define VFE_CMD_CFG_SYNC_MODE_ELS               0x0010
351 #define VFE_CMD_CFG_SYNC_MODE_RVD               0x0018
352 #define VFE_CMD_CFG_VFE_SUBSAMP_EN_DIS          0x0000
353 #define VFE_CMD_CFG_VFE_SUBSAMP_EN_ENA          0x0020
354 #define VFE_CMD_CFG_BUS_SUBSAMP_EN_DIS          0x0000
355 #define VFE_CMD_CFG_BUS_SUBSAMP_EN_ENA          0x0080
356 #define VFE_CMD_CFG_IRQ_SUBSAMP_EN_DIS          0x0000
357 #define VFE_CMD_CFG_IRQ_SUBSAMP_EN_ENA          0x0800
358
359 #define VFE_CMD_SUBSAMP2_CFG_PIXEL_SKIP_16      0x0000
360 #define VFE_CMD_SUBSAMP2_CFG_PIXEL_SKIP_12      0x0010
361
362 #define VFE_CMD_EPOCH_IRQ_1_DIS                 0x0000
363 #define VFE_CMD_EPOCH_IRQ_1_ENA                 0x4000
364 #define VFE_CMD_EPOCH_IRQ_2_DIS                 0x0000
365 #define VFE_CMD_EPOCH_IRQ_2_ENA                 0x8000
366
367 typedef struct {
368         unsigned int    cmd_id;
369         unsigned int    cfg;
370         unsigned int    efs_cfg;
371         unsigned int    frame_cfg;
372         unsigned int    window_width_cfg;
373         unsigned int    window_height_cfg;
374         unsigned int    subsamp1_cfg;
375         unsigned int    subsamp2_cfg;
376         unsigned int    epoch_irq;
377 } __attribute__((packed)) vfe_cmd_camif_cfg;
378
379
380
381 /*
382  * Command to program the black level module
383  */
384
385 #define VFE_CMD_BLACK_LVL_CFG           0x0005
386 #define VFE_CMD_BLACK_LVL_CFG_LEN       sizeof(vfe_cmd_black_lvl_cfg)
387
388 #define VFE_CMD_BL_SEL_MANUAL           0x0000
389 #define VFE_CMD_BL_SEL_AUTO             0x0001
390
391 typedef struct {
392         unsigned int    cmd_id;
393         unsigned int    black_lvl_sel;
394         unsigned int    cfg_part[3];
395 } __attribute__((packed)) vfe_cmd_black_lvl_cfg;
396
397
398 /*
399  * Command to program the active region by cropping the region of interest
400  */
401
402 #define VFE_CMD_ACTIVE_REGION_CFG       0x0006
403 #define VFE_CMD_ACTIVE_REGION_CFG_LEN   \
404         sizeof(vfe_cmd_active_region_cfg)
405
406
407 typedef struct {
408         unsigned int    cmd_id;
409         unsigned int    cfg_part1;
410         unsigned int    cfg_part2;
411 } __attribute__((packed)) vfe_cmd_active_region_cfg;
412
413
414
415 /*
416  * Command to program the defective pixel correction(DPC) ,
417  * adaptive bayer filter (ABF) and demosaic modules
418  */
419
420 #define VFE_CMD_DEMOSAIC_CFG            0x0007
421 #define VFE_CMD_DEMOSAIC_CFG_LEN        sizeof(vfe_cmd_demosaic_cfg)
422
423 #define VFE_CMD_DEMOSAIC_PART1_ABF_EN_DIS       0x0000
424 #define VFE_CMD_DEMOSAIC_PART1_ABF_EN_ENA       0x0001
425 #define VFE_CMD_DEMOSAIC_PART1_DPC_EN_DIS       0x0000
426 #define VFE_CMD_DEMOSAIC_PART1_DPC_EN_ENA       0x0002
427 #define VFE_CMD_DEMOSAIC_PART1_FORCE_ABF_OFF    0x0000
428 #define VFE_CMD_DEMOSAIC_PART1_FORCE_ABF_ON     0x0004
429 #define VFE_CMD_DEMOSAIC_PART1_SLOPE_SHIFT_1    0x00000000
430 #define VFE_CMD_DEMOSAIC_PART1_SLOPE_SHIFT_2    0x10000000
431 #define VFE_CMD_DEMOSAIC_PART1_SLOPE_SHIFT_4    0x20000000
432 #define VFE_CMD_DEMOSAIC_PART1_SLOPE_SHIFT_8    0x30000000
433 #define VFE_CMD_DEMOSAIC_PART1_SLOPE_SHIFT_1_2  0x50000000
434 #define VFE_CMD_DEMOSAIC_PART1_SLOPE_SHIFT_1_4  0x60000000
435 #define VFE_CMD_DEMOSAIC_PART1_SLOPE_SHIFT_1_8  0x70000000
436
437 typedef struct {
438         unsigned int    cmd_id;
439         unsigned int    demosaic_part1;
440         unsigned int    demosaic_part2;
441         unsigned int    demosaic_part3;
442         unsigned int    demosaic_part4;
443         unsigned int    demosaic_part5;
444 } __attribute__((packed)) vfe_cmd_demosaic_cfg;
445
446
447 /*
448  * Command to program the ip format
449  */
450
451 #define VFE_CMD_IP_FORMAT_CFG           0x0008
452 #define VFE_CMD_IP_FORMAT_CFG_LEN       \
453         sizeof(vfe_cmd_ip_format_cfg)
454
455 #define VFE_CMD_IP_FORMAT_SEL_RGRG      0x0000
456 #define VFE_CMD_IP_FORMAT_SEL_GRGR      0x0001
457 #define VFE_CMD_IP_FORMAT_SEL_BGBG      0x0002
458 #define VFE_CMD_IP_FORMAT_SEL_GBGB      0x0003
459 #define VFE_CMD_IP_FORMAT_SEL_YCBYCR    0x0004
460 #define VFE_CMD_IP_FORMAT_SEL_YCRYCB    0x0005
461 #define VFE_CMD_IP_FORMAT_SEL_CBYCRY    0x0006
462 #define VFE_CMD_IP_FORMAT_SEL_CRYCBY    0x0007
463 #define VFE_CMD_IP_FORMAT_SEL_NO_CHROMA 0x0000
464 #define VFE_CMD_IP_FORMAT_SEL_CHROMA    0x0008
465
466
467 typedef struct {
468         unsigned int    cmd_id;
469         unsigned int    ip_format_sel;
470         unsigned int    balance_gains_part1;
471         unsigned int    balance_gains_part2;
472 } __attribute__((packed)) vfe_cmd_ip_format_cfg;
473
474
475
476 /*
477  * Command to program max and min allowed op values
478  */
479
480 #define VFE_CMD_OP_CLAMP_CFG            0x0009
481 #define VFE_CMD_OP_CLAMP_CFG_LEN        \
482         sizeof(vfe_cmd_op_clamp_cfg)
483
484 typedef struct {
485         unsigned int    cmd_id;
486         unsigned int    op_clamp_max;
487         unsigned int    op_clamp_min;
488 } __attribute__((packed)) vfe_cmd_op_clamp_cfg;
489
490
491 /*
492  * Command to program chroma sub sample module
493  */
494
495 #define VFE_CMD_CHROMA_SUBSAMPLE_CFG            0x000A
496 #define VFE_CMD_CHROMA_SUBSAMPLE_CFG_LEN        \
497         sizeof(vfe_cmd_chroma_subsample_cfg)
498
499 #define VFE_CMD_CHROMA_SUBSAMP_SEL_H_INTERESTIAL_SAMPS  0x0000
500 #define VFE_CMD_CHROMA_SUBSAMP_SEL_H_COSITED_SAMPS      0x0001
501 #define VFE_CMD_CHROMA_SUBSAMP_SEL_V_INTERESTIAL_SAMPS  0x0000
502 #define VFE_CMD_CHROMA_SUBSAMP_SEL_V_COSITED_SAMPS      0x0002
503 #define VFE_CMD_CHROMA_SUBSAMP_SEL_H_SUBSAMP_DIS        0x0000
504 #define VFE_CMD_CHROMA_SUBSAMP_SEL_H_SUBSAMP_ENA        0x0004
505 #define VFE_CMD_CHROMA_SUBSAMP_SEL_V_SUBSAMP_DIS        0x0000
506 #define VFE_CMD_CHROMA_SUBSAMP_SEL_V_SUBSAMP_ENA        0x0008
507
508 typedef struct {
509         unsigned int    cmd_id;
510         unsigned int    chroma_subsamp_sel;
511 } __attribute__((packed)) vfe_cmd_chroma_subsample_cfg;
512
513
514 /*
515  * Command to program the white balance module
516  */
517
518 #define VFE_CMD_WHITE_BALANCE_CFG       0x000B
519 #define VFE_CMD_WHITE_BALANCE_CFG_LEN   \
520         sizeof(vfe_cmd_white_balance_cfg)
521
522 typedef struct {
523         unsigned int    cmd_id;
524         unsigned int    white_balance_gains;
525 } __attribute__((packed)) vfe_cmd_white_balance_cfg;
526
527
528 /*
529  * Command to program the color processing module
530  */
531
532 #define VFE_CMD_COLOR_PROCESS_CFG       0x000C
533 #define VFE_CMD_COLOR_PROCESS_CFG_LEN   \
534         sizeof(vfe_cmd_color_process_cfg)
535
536 #define VFE_CMD_COLOR_CORRE_PART7_Q7_FACTORS    0x0000
537 #define VFE_CMD_COLOR_CORRE_PART7_Q8_FACTORS    0x0001
538 #define VFE_CMD_COLOR_CORRE_PART7_Q9_FACTORS    0x0002
539 #define VFE_CMD_COLOR_CORRE_PART7_Q10_FACTORS   0x0003
540
541 typedef struct {
542         unsigned int    cmd_id;
543         unsigned int    color_correction_part1;
544         unsigned int    color_correction_part2;
545         unsigned int    color_correction_part3;
546         unsigned int    color_correction_part4;
547         unsigned int    color_correction_part5;
548         unsigned int    color_correction_part6;
549         unsigned int    color_correction_part7;
550         unsigned int    chroma_enhance_part1;
551         unsigned int    chroma_enhance_part2;
552         unsigned int    chroma_enhance_part3;
553         unsigned int    chroma_enhance_part4;
554         unsigned int    chroma_enhance_part5;
555         unsigned int    luma_calc_part1;
556         unsigned int    luma_calc_part2;
557 } __attribute__((packed)) vfe_cmd_color_process_cfg;
558
559
560 /*
561  * Command to program adaptive filter module
562  */
563
564 #define VFE_CMD_ADP_FILTER_CFG          0x000D
565 #define VFE_CMD_ADP_FILTER_CFG_LEN      \
566         sizeof(vfe_cmd_adp_filter_cfg)
567
568 #define VFE_CMD_ASF_CFG_PART_SMOOTH_FILTER_DIS          0x0000
569 #define VFE_CMD_ASF_CFG_PART_SMOOTH_FILTER_ENA          0x0001
570 #define VFE_CMD_ASF_CFG_PART_NO_SHARP_MODE              0x0000
571 #define VFE_CMD_ASF_CFG_PART_SINGLE_FILTER              0x0002
572 #define VFE_CMD_ASF_CFG_PART_DUAL_FILTER                0x0004
573 #define VFE_CMD_ASF_CFG_PART_SHARP_MODE                 0x0007
574
575 typedef struct {
576         unsigned int    cmd_id;
577         unsigned int    asf_cfg_part[7];
578 } __attribute__((packed)) vfe_cmd_adp_filter_cfg;
579
580
581 /*
582  * Command to program for frame skip pattern for op1 and op2
583  */
584
585 #define VFE_CMD_FRAME_SKIP_CFG          0x000E
586 #define VFE_CMD_FRAME_SKIP_CFG_LEN      \
587         sizeof(vfe_cmd_frame_skip_cfg)
588
589 typedef struct {
590         unsigned int    cmd_id;
591         unsigned int    frame_skip_pattern_op1;
592         unsigned int    frame_skip_pattern_op2;
593 } __attribute__((packed)) vfe_cmd_frame_skip_cfg;
594
595
596 /*
597  * Command to program field-of-view crop for digital zoom
598  */
599
600 #define VFE_CMD_FOV_CROP        0x000F
601 #define VFE_CMD_FOV_CROP_LEN    sizeof(vfe_cmd_fov_crop)
602
603 typedef struct {
604         unsigned int    cmd_id;
605         unsigned int    fov_crop_part1;
606         unsigned int    fov_crop_part2;
607 } __attribute__((packed)) vfe_cmd_fov_crop;
608
609
610
611 /*
612  * Command to program auto focus(AF) statistics module
613  */
614
615 #define VFE_CMD_STATS_AUTOFOCUS_CFG     0x0010
616 #define VFE_CMD_STATS_AUTOFOCUS_CFG_LEN \
617         sizeof(vfe_cmd_stats_autofocus_cfg)
618
619 #define VFE_CMD_AF_STATS_SEL_STATS_DIS  0x0000
620 #define VFE_CMD_AF_STATS_SEL_STATS_ENA  0x0001
621 #define VFE_CMD_AF_STATS_SEL_PRI_FIXED  0x0000
622 #define VFE_CMD_AF_STATS_SEL_PRI_VAR    0x0002
623 #define VFE_CMD_AF_STATS_CFG_PART_METRIC_SUM    0x00000000
624 #define VFE_CMD_AF_STATS_CFG_PART_METRIC_MAX    0x00200000
625
626 typedef struct {
627         unsigned int    cmd_id;
628         unsigned int    af_stats_sel;
629         unsigned int    af_stats_cfg_part[8];
630         unsigned int    af_stats_op_buf_hdr;
631         unsigned int    af_stats_op_buf[3];
632 } __attribute__((packed)) vfe_cmd_stats_autofocus_cfg;
633
634
635 /*
636  * Command to program White balance(wb) and exposure (exp)
637  * statistics module
638  */
639
640 #define VFE_CMD_STATS_WB_EXP_CFG        0x0011
641 #define VFE_CMD_STATS_WB_EXP_CFG_LEN    \
642         sizeof(vfe_cmd_stats_wb_exp_cfg)
643
644 #define VFE_CMD_WB_EXP_STATS_SEL_STATS_DIS      0x0000
645 #define VFE_CMD_WB_EXP_STATS_SEL_STATS_ENA      0x0001
646 #define VFE_CMD_WB_EXP_STATS_SEL_PRI_FIXED      0x0000
647 #define VFE_CMD_WB_EXP_STATS_SEL_PRI_VAR        0x0002
648
649 #define VFE_CMD_WB_EXP_STATS_CFG_PART1_EXP_REG_8_8      0x0000
650 #define VFE_CMD_WB_EXP_STATS_CFG_PART1_EXP_REG_16_16    0x0001
651 #define VFE_CMD_WB_EXP_STATS_CFG_PART1_EXP_SREG_8_8     0x0000
652 #define VFE_CMD_WB_EXP_STATS_CFG_PART1_EXP_SREG_4_4     0x0002
653
654 typedef struct {
655         unsigned int    cmd_id;
656         unsigned int    wb_exp_stats_sel;
657         unsigned int    wb_exp_stats_cfg_part1;
658         unsigned int    wb_exp_stats_cfg_part2;
659         unsigned int    wb_exp_stats_cfg_part3;
660         unsigned int    wb_exp_stats_cfg_part4;
661         unsigned int    wb_exp_stats_op_buf_hdr;
662         unsigned int    wb_exp_stats_op_buf[3];
663 } __attribute__((packed)) vfe_cmd_stats_wb_exp_cfg;
664
665
666 /*
667  * Command to program histogram(hg) stats module
668  */
669
670 #define VFE_CMD_STATS_HG_CFG            0x0012
671 #define VFE_CMD_STATS_HG_CFG_LEN        \
672         sizeof(vfe_cmd_stats_hg_cfg)
673
674 #define VFE_CMD_HG_STATS_SEL_PRI_FIXED  0x0000
675 #define VFE_CMD_HG_STATS_SEL_PRI_VAR    0x0002
676
677 typedef struct {
678         unsigned int    cmd_id;
679         unsigned int    hg_stats_sel;
680         unsigned int    hg_stats_cfg_part1;
681         unsigned int    hg_stats_cfg_part2;
682         unsigned int    hg_stats_op_buf_hdr;
683         unsigned int    hg_stats_op_buf;
684 } __attribute__((packed)) vfe_cmd_stats_hg_cfg;
685
686
687 /*
688  * Command to acknowledge last MSG_VFE_OP1 message
689  */
690
691 #define VFE_CMD_OP1_ACK         0x0013
692 #define VFE_CMD_OP1_ACK_LEN     sizeof(vfe_cmd_op1_ack)
693
694 typedef struct {
695         unsigned int    cmd_id;
696         unsigned int    op1_buf_y_addr;
697         unsigned int    op1_buf_cbcr_addr;
698 } __attribute__((packed)) vfe_cmd_op1_ack;
699
700
701
702 /*
703  * Command to acknowledge last MSG_VFE_OP2 message
704  */
705
706 #define VFE_CMD_OP2_ACK         0x0014
707 #define VFE_CMD_OP2_ACK_LEN     sizeof(vfe_cmd_op2_ack)
708
709 typedef struct {
710         unsigned int    cmd_id;
711         unsigned int    op2_buf_y_addr;
712         unsigned int    op2_buf_cbcr_addr;
713 } __attribute__((packed)) vfe_cmd_op2_ack;
714
715
716
717 /*
718  * Command to acknowledge MSG_VFE_STATS_AUTOFOCUS msg
719  */
720
721 #define VFE_CMD_STATS_AF_ACK            0x0015
722 #define VFE_CMD_STATS_AF_ACK_LEN        sizeof(vfe_cmd_stats_af_ack)
723
724
725 typedef struct {
726         unsigned int    cmd_id;
727         unsigned int    af_stats_op_buf;
728 } __attribute__((packed)) vfe_cmd_stats_af_ack;
729
730
731 /*
732  * Command to acknowledge MSG_VFE_STATS_WB_EXP msg
733  */
734
735 #define VFE_CMD_STATS_WB_EXP_ACK        0x0016
736 #define VFE_CMD_STATS_WB_EXP_ACK_LEN    sizeof(vfe_cmd_stats_wb_exp_ack)
737
738 typedef struct {
739         unsigned int    cmd_id;
740         unsigned int    wb_exp_stats_op_buf;
741 } __attribute__((packed)) vfe_cmd_stats_wb_exp_ack;
742
743
744 /*
745  * Command to acknowledge MSG_VFE_EPOCH1 message
746  */
747
748 #define VFE_CMD_EPOCH1_ACK      0x0017
749 #define VFE_CMD_EPOCH1_ACK_LEN  sizeof(vfe_cmd_epoch1_ack)
750
751 typedef struct {
752         unsigned short cmd_id;
753 } __attribute__((packed)) vfe_cmd_epoch1_ack;
754
755
756 /*
757  * Command to acknowledge MSG_VFE_EPOCH2 message
758  */
759
760 #define VFE_CMD_EPOCH2_ACK      0x0018
761 #define VFE_CMD_EPOCH2_ACK_LEN  sizeof(vfe_cmd_epoch2_ack)
762
763 typedef struct {
764         unsigned short cmd_id;
765 } __attribute__((packed)) vfe_cmd_epoch2_ack;
766
767
768
769 /*
770  * Command to configure, enable or disable synchronous timer1
771  */
772
773 #define VFE_CMD_SYNC_TIMER1_CFG         0x0019
774 #define VFE_CMD_SYNC_TIMER1_CFG_LEN     \
775         sizeof(vfe_cmd_sync_timer1_cfg)
776
777 #define VFE_CMD_SYNC_T1_CFG_PART1_TIMER_DIS     0x0000
778 #define VFE_CMD_SYNC_T1_CFG_PART1_TIMER_ENA     0x0001
779 #define VFE_CMD_SYNC_T1_CFG_PART1_POL_HIGH      0x0000
780 #define VFE_CMD_SYNC_T1_CFG_PART1_POL_LOW       0x0002
781
782 typedef struct {
783         unsigned int    cmd_id;
784         unsigned int    sync_t1_cfg_part1;
785         unsigned int    sync_t1_h_sync_countdown;
786         unsigned int    sync_t1_pclk_countdown;
787         unsigned int    sync_t1_duration;
788 } __attribute__((packed)) vfe_cmd_sync_timer1_cfg;
789
790
791 /*
792  * Command to configure, enable or disable synchronous timer1
793  */
794
795 #define VFE_CMD_SYNC_TIMER2_CFG         0x001A
796 #define VFE_CMD_SYNC_TIMER2_CFG_LEN     \
797         sizeof(vfe_cmd_sync_timer2_cfg)
798
799 #define VFE_CMD_SYNC_T2_CFG_PART1_TIMER_DIS     0x0000
800 #define VFE_CMD_SYNC_T2_CFG_PART1_TIMER_ENA     0x0001
801 #define VFE_CMD_SYNC_T2_CFG_PART1_POL_HIGH      0x0000
802 #define VFE_CMD_SYNC_T2_CFG_PART1_POL_LOW       0x0002
803
804 typedef struct {
805         unsigned int    cmd_id;
806         unsigned int    sync_t2_cfg_part1;
807         unsigned int    sync_t2_h_sync_countdown;
808         unsigned int    sync_t2_pclk_countdown;
809         unsigned int    sync_t2_duration;
810 } __attribute__((packed)) vfe_cmd_sync_timer2_cfg;
811
812
813 /*
814  * Command to configure and start asynchronous timer1
815  */
816
817 #define VFE_CMD_ASYNC_TIMER1_START      0x001B
818 #define VFE_CMD_ASYNC_TIMER1_START_LEN  \
819         sizeof(vfe_cmd_async_timer1_start)
820
821 #define VFE_CMD_ASYNC_T1_POLARITY_A_HIGH        0x0000
822 #define VFE_CMD_ASYNC_T1_POLARITY_A_LOW         0x0001
823 #define VFE_CMD_ASYNC_T1_POLARITY_B_HIGH        0x0000
824 #define VFE_CMD_ASYNC_T1_POLARITY_B_LOW         0x0002
825
826 typedef struct {
827         unsigned int    cmd_id;
828         unsigned int    async_t1a_cfg;
829         unsigned int    async_t1b_cfg;
830         unsigned int    async_t1_polarity;
831 } __attribute__((packed)) vfe_cmd_async_timer1_start;
832
833
834 /*
835  * Command to configure and start asynchronous timer2
836  */
837
838 #define VFE_CMD_ASYNC_TIMER2_START      0x001C
839 #define VFE_CMD_ASYNC_TIMER2_START_LEN  \
840         sizeof(vfe_cmd_async_timer2_start)
841
842 #define VFE_CMD_ASYNC_T2_POLARITY_A_HIGH        0x0000
843 #define VFE_CMD_ASYNC_T2_POLARITY_A_LOW         0x0001
844 #define VFE_CMD_ASYNC_T2_POLARITY_B_HIGH        0x0000
845 #define VFE_CMD_ASYNC_T2_POLARITY_B_LOW         0x0002
846
847 typedef struct {
848         unsigned int    cmd_id;
849         unsigned int    async_t2a_cfg;
850         unsigned int    async_t2b_cfg;
851         unsigned int    async_t2_polarity;
852 } __attribute__((packed)) vfe_cmd_async_timer2_start;
853
854
855 /*
856  * Command to program partial configurations of auto focus(af)
857  */
858
859 #define VFE_CMD_STATS_AF_UPDATE         0x001D
860 #define VFE_CMD_STATS_AF_UPDATE_LEN     \
861         sizeof(vfe_cmd_stats_af_update)
862
863 #define VFE_CMD_AF_UPDATE_PART1_WINDOW_ONE      0x00000000
864 #define VFE_CMD_AF_UPDATE_PART1_WINDOW_MULTI    0x80000000
865
866 typedef struct {
867         unsigned int    cmd_id;
868         unsigned int    af_update_part1;
869         unsigned int    af_update_part2;
870 } __attribute__((packed)) vfe_cmd_stats_af_update;
871
872
873 /*
874  * Command to program partial cfg of wb and exp
875  */
876
877 #define VFE_CMD_STATS_WB_EXP_UPDATE     0x001E
878 #define VFE_CMD_STATS_WB_EXP_UPDATE_LEN \
879         sizeof(vfe_cmd_stats_wb_exp_update)
880
881 #define VFE_CMD_WB_EXP_UPDATE_PART1_REGIONS_8_8         0x0000
882 #define VFE_CMD_WB_EXP_UPDATE_PART1_REGIONS_16_16       0x0001
883 #define VFE_CMD_WB_EXP_UPDATE_PART1_SREGIONS_8_8        0x0000
884 #define VFE_CMD_WB_EXP_UPDATE_PART1_SREGIONS_4_4        0x0002
885
886 typedef struct {
887         unsigned int    cmd_id;
888         unsigned int    wb_exp_update_part1;
889         unsigned int    wb_exp_update_part2;
890         unsigned int    wb_exp_update_part3;
891         unsigned int    wb_exp_update_part4;
892 } __attribute__((packed)) vfe_cmd_stats_wb_exp_update;
893
894
895
896 /*
897  * Command to re program the CAMIF FRAME CONFIG settings
898  */
899
900 #define VFE_CMD_UPDATE_CAMIF_FRAME_CFG          0x001F
901 #define VFE_CMD_UPDATE_CAMIF_FRAME_CFG_LEN      \
902         sizeof(vfe_cmd_update_camif_frame_cfg)
903
904 typedef struct {
905         unsigned int    cmd_id;
906         unsigned int    camif_frame_cfg;
907 } __attribute__((packed)) vfe_cmd_update_camif_frame_cfg;
908
909
910 #endif