This source file includes following definitions.
- ccdc_gamma_width_max_bit
- ccdc_data_size_max_bit
1
2
3
4
5 #ifndef _DM644X_CCDC_H
6 #define _DM644X_CCDC_H
7 #include <media/davinci/ccdc_types.h>
8 #include <media/davinci/vpfe_types.h>
9
10
11 enum ccdc_sample_length {
12 CCDC_SAMPLE_1PIXELS,
13 CCDC_SAMPLE_2PIXELS,
14 CCDC_SAMPLE_4PIXELS,
15 CCDC_SAMPLE_8PIXELS,
16 CCDC_SAMPLE_16PIXELS
17 };
18
19
20 enum ccdc_sample_line {
21 CCDC_SAMPLE_1LINES,
22 CCDC_SAMPLE_2LINES,
23 CCDC_SAMPLE_4LINES,
24 CCDC_SAMPLE_8LINES,
25 CCDC_SAMPLE_16LINES
26 };
27
28
29 enum ccdc_gamma_width {
30 CCDC_GAMMA_BITS_15_6,
31 CCDC_GAMMA_BITS_14_5,
32 CCDC_GAMMA_BITS_13_4,
33 CCDC_GAMMA_BITS_12_3,
34 CCDC_GAMMA_BITS_11_2,
35 CCDC_GAMMA_BITS_10_1,
36 CCDC_GAMMA_BITS_09_0
37 };
38
39
40 static inline u8 ccdc_gamma_width_max_bit(enum ccdc_gamma_width width)
41 {
42 return 15 - width;
43 }
44
45 enum ccdc_data_size {
46 CCDC_DATA_16BITS,
47 CCDC_DATA_15BITS,
48 CCDC_DATA_14BITS,
49 CCDC_DATA_13BITS,
50 CCDC_DATA_12BITS,
51 CCDC_DATA_11BITS,
52 CCDC_DATA_10BITS,
53 CCDC_DATA_8BITS
54 };
55
56
57 static inline u8 ccdc_data_size_max_bit(enum ccdc_data_size sz)
58 {
59 return sz == CCDC_DATA_8BITS ? 7 : 15 - sz;
60 }
61
62
63 struct ccdc_a_law {
64
65 unsigned char enable;
66
67 enum ccdc_gamma_width gamma_wd;
68 };
69
70
71 struct ccdc_black_clamp {
72 unsigned char enable;
73
74 enum ccdc_sample_length sample_pixel;
75
76 enum ccdc_sample_line sample_ln;
77
78 unsigned short start_pixel;
79
80 unsigned short sgain;
81
82 unsigned short dc_sub;
83 };
84
85
86 struct ccdc_black_compensation {
87
88 char r;
89
90 char gr;
91
92 char b;
93
94 char gb;
95 };
96
97
98
99
100 struct ccdc_config_params_raw {
101
102 enum ccdc_data_size data_sz;
103
104 struct ccdc_a_law alaw;
105
106 struct ccdc_black_clamp blk_clamp;
107
108 struct ccdc_black_compensation blk_comp;
109 };
110
111
112 #ifdef __KERNEL__
113 #include <linux/io.h>
114
115 #define FP_NUM_BYTES 4
116
117 #define NUM_EXTRAPIXELS 8
118 #define NUM_EXTRALINES 8
119
120
121 #define CCDC_WIN_PAL {0, 0, 720, 576}
122
123 #define CCDC_WIN_VGA {0, 0, (640 + NUM_EXTRAPIXELS), (480 + NUM_EXTRALINES)}
124
125
126 struct ccdc_params_raw {
127
128 enum ccdc_pixfmt pix_fmt;
129
130 enum ccdc_frmfmt frm_fmt;
131
132 struct v4l2_rect win;
133
134 enum vpfe_pin_pol fid_pol;
135
136 enum vpfe_pin_pol vd_pol;
137
138 enum vpfe_pin_pol hd_pol;
139
140 enum ccdc_buftype buf_type;
141
142
143
144
145 unsigned char image_invert_enable;
146
147 struct ccdc_config_params_raw config_params;
148 };
149
150 struct ccdc_params_ycbcr {
151
152 enum ccdc_pixfmt pix_fmt;
153
154 enum ccdc_frmfmt frm_fmt;
155
156 struct v4l2_rect win;
157
158 enum vpfe_pin_pol fid_pol;
159
160 enum vpfe_pin_pol vd_pol;
161
162 enum vpfe_pin_pol hd_pol;
163
164 int bt656_enable;
165
166 enum ccdc_pixorder pix_order;
167
168 enum ccdc_buftype buf_type;
169 };
170 #endif
171 #endif