2
* Copyright (C) 2006-2009 Texas Instruments Inc
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
#ifndef _DM644X_CCDC_H
19
#define _DM644X_CCDC_H
20
#include <media/davinci/ccdc_types.h>
21
#include <media/davinci/vpfe_types.h>
23
/* enum for No of pixel per line to be avg. in Black Clamping*/
24
enum ccdc_sample_length {
32
/* enum for No of lines in Black Clamping */
33
enum ccdc_sample_line {
41
/* enum for Alaw gama width */
42
enum ccdc_gama_width {
63
/* structure for ALaw */
65
/* Enable/disable A-Law */
67
/* Gama Width Input */
68
enum ccdc_gama_width gama_wd;
71
/* structure for Black Clamping */
72
struct ccdc_black_clamp {
74
/* only if bClampEnable is TRUE */
75
enum ccdc_sample_length sample_pixel;
76
/* only if bClampEnable is TRUE */
77
enum ccdc_sample_line sample_ln;
78
/* only if bClampEnable is TRUE */
79
unsigned short start_pixel;
80
/* only if bClampEnable is TRUE */
82
/* only if bClampEnable is FALSE */
83
unsigned short dc_sub;
86
/* structure for Black Level Compensation */
87
struct ccdc_black_compensation {
88
/* Constant value to subtract from Red component */
90
/* Constant value to subtract from Gr component */
92
/* Constant value to subtract from Blue component */
94
/* Constant value to subtract from Gb component */
98
/* structure for fault pixel correction */
99
struct ccdc_fault_pixel {
100
/* Enable or Disable fault pixel correction */
101
unsigned char enable;
102
/* Number of fault pixel */
103
unsigned short fp_num;
104
/* Address of fault pixel table */
105
unsigned int fpc_table_addr;
108
/* Structure for CCDC configuration parameters for raw capture mode passed
111
struct ccdc_config_params_raw {
112
/* data size value from 8 to 16 bits */
113
enum ccdc_data_size data_sz;
114
/* Structure for Optional A-Law */
115
struct ccdc_a_law alaw;
116
/* Structure for Optical Black Clamp */
117
struct ccdc_black_clamp blk_clamp;
118
/* Structure for Black Compensation */
119
struct ccdc_black_compensation blk_comp;
120
/* Structure for Fault Pixel Module Configuration */
121
struct ccdc_fault_pixel fault_pxl;
126
#include <linux/io.h>
127
/* Define to enable/disable video port */
128
#define FP_NUM_BYTES 4
129
/* Define for extra pixel/line and extra lines/frame */
130
#define NUM_EXTRAPIXELS 8
131
#define NUM_EXTRALINES 8
133
/* settings for commonly used video formats */
134
#define CCDC_WIN_PAL {0, 0, 720, 576}
135
/* ntsc square pixel */
136
#define CCDC_WIN_VGA {0, 0, (640 + NUM_EXTRAPIXELS), (480 + NUM_EXTRALINES)}
138
/* Structure for CCDC configuration parameters for raw capture mode */
139
struct ccdc_params_raw {
141
enum ccdc_pixfmt pix_fmt;
142
/* progressive or interlaced frame */
143
enum ccdc_frmfmt frm_fmt;
145
struct v4l2_rect win;
146
/* field id polarity */
147
enum vpfe_pin_pol fid_pol;
148
/* vertical sync polarity */
149
enum vpfe_pin_pol vd_pol;
150
/* horizontal sync polarity */
151
enum vpfe_pin_pol hd_pol;
152
/* interleaved or separated fields */
153
enum ccdc_buftype buf_type;
155
* enable to store the image in inverse
156
* order in memory(bottom to top)
158
unsigned char image_invert_enable;
159
/* configurable paramaters */
160
struct ccdc_config_params_raw config_params;
163
struct ccdc_params_ycbcr {
165
enum ccdc_pixfmt pix_fmt;
166
/* progressive or interlaced frame */
167
enum ccdc_frmfmt frm_fmt;
169
struct v4l2_rect win;
170
/* field id polarity */
171
enum vpfe_pin_pol fid_pol;
172
/* vertical sync polarity */
173
enum vpfe_pin_pol vd_pol;
174
/* horizontal sync polarity */
175
enum vpfe_pin_pol hd_pol;
176
/* enable BT.656 embedded sync mode */
178
/* cb:y:cr:y or y:cb:y:cr in memory */
179
enum ccdc_pixorder pix_order;
180
/* interleaved or separated fields */
181
enum ccdc_buftype buf_type;
184
#endif /* _DM644X_CCDC_H */