]> bbs.cooldavid.org Git - net-next-2.6.git/blame - drivers/staging/dream/camera/msm_vfe7x.h
semaphore: Remove mutex emulation
[net-next-2.6.git] / drivers / staging / dream / camera / msm_vfe7x.h
CommitLineData
eb7b797b
BS
1/*
2 * Copyright (C) 2008-2009 QUALCOMM Incorporated.
3 */
4#ifndef __MSM_VFE7X_H__
5#define __MSM_VFE7X_H__
6#include <media/msm_camera.h>
7#include <mach/camera.h>
8
9struct vfe_frame_extra {
10 uint32_t bl_evencol;
11 uint32_t bl_oddcol;
12 uint16_t g_def_p_cnt;
13 uint16_t r_b_def_p_cnt;
14};
15
16struct vfe_endframe {
17 uint32_t y_address;
18 uint32_t cbcr_address;
19
20 unsigned int blacklevelevencolumn:23;
21 uint16_t reserved1:9;
22 unsigned int blackleveloddcolumn:23;
23 uint16_t reserved2:9;
24
25 uint16_t greendefectpixelcount:8;
26 uint16_t reserved3:8;
27 uint16_t redbluedefectpixelcount:8;
28 uint16_t reserved4:8;
29} __attribute__((packed, aligned(4)));
30
31struct vfe_outputack {
32 uint32_t header;
33 void *output2newybufferaddress;
34 void *output2newcbcrbufferaddress;
35} __attribute__((packed, aligned(4)));
36
37struct vfe_stats_ack {
38 uint32_t header;
39 /* MUST BE 64 bit ALIGNED */
40 void *bufaddr;
41} __attribute__((packed, aligned(4)));
42
43/* AXI Output Config Command sent to DSP */
44struct axiout {
45 uint32_t cmdheader:32;
46 int outputmode:3;
47 uint8_t format:2;
48 uint32_t /* reserved */ : 27;
49
50 /* AXI Output 1 Y Configuration, Part 1 */
51 uint32_t out1yimageheight:12;
52 uint32_t /* reserved */ : 4;
53 uint32_t out1yimagewidthin64bitwords:10;
54 uint32_t /* reserved */ : 6;
55
56 /* AXI Output 1 Y Configuration, Part 2 */
57 uint8_t out1yburstlen:2;
58 uint32_t out1ynumrows:12;
59 uint32_t out1yrowincin64bitincs:12;
60 uint32_t /* reserved */ : 6;
61
62 /* AXI Output 1 CbCr Configuration, Part 1 */
63 uint32_t out1cbcrimageheight:12;
64 uint32_t /* reserved */ : 4;
65 uint32_t out1cbcrimagewidthin64bitwords:10;
66 uint32_t /* reserved */ : 6;
67
68 /* AXI Output 1 CbCr Configuration, Part 2 */
69 uint8_t out1cbcrburstlen:2;
70 uint32_t out1cbcrnumrows:12;
71 uint32_t out1cbcrrowincin64bitincs:12;
72 uint32_t /* reserved */ : 6;
73
74 /* AXI Output 2 Y Configuration, Part 1 */
75 uint32_t out2yimageheight:12;
76 uint32_t /* reserved */ : 4;
77 uint32_t out2yimagewidthin64bitwords:10;
78 uint32_t /* reserved */ : 6;
79
80 /* AXI Output 2 Y Configuration, Part 2 */
81 uint8_t out2yburstlen:2;
82 uint32_t out2ynumrows:12;
83 uint32_t out2yrowincin64bitincs:12;
84 uint32_t /* reserved */ : 6;
85
86 /* AXI Output 2 CbCr Configuration, Part 1 */
87 uint32_t out2cbcrimageheight:12;
88 uint32_t /* reserved */ : 4;
89 uint32_t out2cbcrimagewidtein64bitwords:10;
90 uint32_t /* reserved */ : 6;
91
92 /* AXI Output 2 CbCr Configuration, Part 2 */
93 uint8_t out2cbcrburstlen:2;
94 uint32_t out2cbcrnumrows:12;
95 uint32_t out2cbcrrowincin64bitincs:12;
96 uint32_t /* reserved */ : 6;
97
98 /* Address configuration:
99 * output1 phisycal address */
100 unsigned long output1buffer1_y_phy;
101 unsigned long output1buffer1_cbcr_phy;
102 unsigned long output1buffer2_y_phy;
103 unsigned long output1buffer2_cbcr_phy;
104 unsigned long output1buffer3_y_phy;
105 unsigned long output1buffer3_cbcr_phy;
106 unsigned long output1buffer4_y_phy;
107 unsigned long output1buffer4_cbcr_phy;
108 unsigned long output1buffer5_y_phy;
109 unsigned long output1buffer5_cbcr_phy;
110 unsigned long output1buffer6_y_phy;
111 unsigned long output1buffer6_cbcr_phy;
112 unsigned long output1buffer7_y_phy;
113 unsigned long output1buffer7_cbcr_phy;
114 unsigned long output1buffer8_y_phy;
115 unsigned long output1buffer8_cbcr_phy;
116
117 /* output2 phisycal address */
118 unsigned long output2buffer1_y_phy;
119 unsigned long output2buffer1_cbcr_phy;
120 unsigned long output2buffer2_y_phy;
121 unsigned long output2buffer2_cbcr_phy;
122 unsigned long output2buffer3_y_phy;
123 unsigned long output2buffer3_cbcr_phy;
124 unsigned long output2buffer4_y_phy;
125 unsigned long output2buffer4_cbcr_phy;
126 unsigned long output2buffer5_y_phy;
127 unsigned long output2buffer5_cbcr_phy;
128 unsigned long output2buffer6_y_phy;
129 unsigned long output2buffer6_cbcr_phy;
130 unsigned long output2buffer7_y_phy;
131 unsigned long output2buffer7_cbcr_phy;
132 unsigned long output2buffer8_y_phy;
133 unsigned long output2buffer8_cbcr_phy;
134} __attribute__((packed, aligned(4)));
135
136struct vfe_stats_we_cfg {
137 uint32_t header;
138
139 /* White Balance/Exposure Statistic Selection */
140 uint8_t wb_expstatsenable:1;
141 uint8_t wb_expstatbuspriorityselection:1;
142 unsigned int wb_expstatbuspriorityvalue:4;
143 unsigned int /* reserved */ : 26;
144
145 /* White Balance/Exposure Statistic Configuration, Part 1 */
146 uint8_t exposurestatregions:1;
147 uint8_t exposurestatsubregions:1;
148 unsigned int /* reserved */ : 14;
149
150 unsigned int whitebalanceminimumy:8;
151 unsigned int whitebalancemaximumy:8;
152
153 /* White Balance/Exposure Statistic Configuration, Part 2 */
154 uint8_t wb_expstatslopeofneutralregionline[
155 NUM_WB_EXP_NEUTRAL_REGION_LINES];
156
157 /* White Balance/Exposure Statistic Configuration, Part 3 */
158 unsigned int wb_expstatcrinterceptofneutralregionline2:12;
159 unsigned int /* reserved */ : 4;
160 unsigned int wb_expstatcbinterceptofneutralreginnline1:12;
161 unsigned int /* reserved */ : 4;
162
163 /* White Balance/Exposure Statistic Configuration, Part 4 */
164 unsigned int wb_expstatcrinterceptofneutralregionline4:12;
165 unsigned int /* reserved */ : 4;
166 unsigned int wb_expstatcbinterceptofneutralregionline3:12;
167 unsigned int /* reserved */ : 4;
168
169 /* White Balance/Exposure Statistic Output Buffer Header */
170 unsigned int wb_expmetricheaderpattern:8;
171 unsigned int /* reserved */ : 24;
172
173 /* White Balance/Exposure Statistic Output Buffers-MUST
174 * BE 64 bit ALIGNED */
175 void *wb_expstatoutputbuffer[NUM_WB_EXP_STAT_OUTPUT_BUFFERS];
176} __attribute__((packed, aligned(4)));
177
178struct vfe_stats_af_cfg {
179 uint32_t header;
180
181 /* Autofocus Statistic Selection */
182 uint8_t af_enable:1;
183 uint8_t af_busprioritysel:1;
184 unsigned int af_buspriorityval:4;
185 unsigned int /* reserved */ : 26;
186
187 /* Autofocus Statistic Configuration, Part 1 */
188 unsigned int af_singlewinvoffset:12;
189 unsigned int /* reserved */ : 4;
190 unsigned int af_singlewinhoffset:12;
191 unsigned int /* reserved */ : 3;
192 uint8_t af_winmode:1;
193
194 /* Autofocus Statistic Configuration, Part 2 */
195 unsigned int af_singglewinvh:11;
196 unsigned int /* reserved */ : 5;
197 unsigned int af_singlewinhw:11;
198 unsigned int /* reserved */ : 5;
199
200 /* Autofocus Statistic Configuration, Parts 3-6 */
201 uint8_t af_multiwingrid[NUM_AUTOFOCUS_MULTI_WINDOW_GRIDS];
202
203 /* Autofocus Statistic Configuration, Part 7 */
204 signed int af_metrichpfcoefa00:5;
205 signed int af_metrichpfcoefa04:5;
206 unsigned int af_metricmaxval:11;
207 uint8_t af_metricsel:1;
208 unsigned int /* reserved */ : 10;
209
210 /* Autofocus Statistic Configuration, Part 8 */
211 signed int af_metrichpfcoefa20:5;
212 signed int af_metrichpfcoefa21:5;
213 signed int af_metrichpfcoefa22:5;
214 signed int af_metrichpfcoefa23:5;
215 signed int af_metrichpfcoefa24:5;
216 unsigned int /* reserved */ : 7;
217
218 /* Autofocus Statistic Output Buffer Header */
219 unsigned int af_metrichp:8;
220 unsigned int /* reserved */ : 24;
221
222 /* Autofocus Statistic Output Buffers - MUST BE 64 bit ALIGNED!!! */
223 void *af_outbuf[NUM_AF_STAT_OUTPUT_BUFFERS];
224} __attribute__((packed, aligned(4))); /* VFE_StatsAutofocusConfigCmdType */
225
226struct msm_camera_frame_msg {
227 unsigned long output_y_address;
228 unsigned long output_cbcr_address;
229
230 unsigned int blacklevelevenColumn:23;
231 uint16_t reserved1:9;
232 unsigned int blackleveloddColumn:23;
233 uint16_t reserved2:9;
234
235 uint16_t greendefectpixelcount:8;
236 uint16_t reserved3:8;
237 uint16_t redbluedefectpixelcount:8;
238 uint16_t reserved4:8;
239} __attribute__((packed, aligned(4)));
240
241/* New one for 7k */
242struct msm_vfe_command_7k {
243 uint16_t queue;
244 uint16_t length;
245 void *value;
246};
247
248struct stop_event {
249 wait_queue_head_t wait;
250 int state;
251 int timeout;
252};
253
254
255#endif /* __MSM_VFE7X_H__ */