• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ****************************************************************************
11  ****************************************************************************/
12 #ifndef __LINUX_MSM_CAMERA_H
13 #define __LINUX_MSM_CAMERA_H
14 
15 #include <linux/types.h>
16 #include <asm/sizes.h>
17 #include <linux/ioctl.h>
18 
19 #define MSM_CAM_IOCTL_MAGIC 'm'
20 
21 #define MSM_CAM_IOCTL_GET_SENSOR_INFO   _IOR(MSM_CAM_IOCTL_MAGIC, 1, struct msm_camsensor_info *)
22 
23 #define MSM_CAM_IOCTL_REGISTER_PMEM   _IOW(MSM_CAM_IOCTL_MAGIC, 2, struct msm_pmem_info *)
24 
25 #define MSM_CAM_IOCTL_UNREGISTER_PMEM   _IOW(MSM_CAM_IOCTL_MAGIC, 3, unsigned)
26 
27 #define MSM_CAM_IOCTL_CTRL_COMMAND   _IOW(MSM_CAM_IOCTL_MAGIC, 4, struct msm_ctrl_cmd *)
28 
29 #define MSM_CAM_IOCTL_CONFIG_VFE   _IOW(MSM_CAM_IOCTL_MAGIC, 5, struct msm_camera_vfe_cfg_cmd *)
30 
31 #define MSM_CAM_IOCTL_GET_STATS   _IOR(MSM_CAM_IOCTL_MAGIC, 6, struct msm_camera_stats_event_ctrl *)
32 
33 #define MSM_CAM_IOCTL_GETFRAME   _IOR(MSM_CAM_IOCTL_MAGIC, 7, struct msm_camera_get_frame *)
34 
35 #define MSM_CAM_IOCTL_ENABLE_VFE   _IOW(MSM_CAM_IOCTL_MAGIC, 8, struct camera_enable_cmd *)
36 
37 #define MSM_CAM_IOCTL_CTRL_CMD_DONE   _IOW(MSM_CAM_IOCTL_MAGIC, 9, struct camera_cmd *)
38 
39 #define MSM_CAM_IOCTL_CONFIG_CMD   _IOW(MSM_CAM_IOCTL_MAGIC, 10, struct camera_cmd *)
40 
41 #define MSM_CAM_IOCTL_DISABLE_VFE   _IOW(MSM_CAM_IOCTL_MAGIC, 11, struct camera_enable_cmd *)
42 
43 #define MSM_CAM_IOCTL_PAD_REG_RESET2   _IOW(MSM_CAM_IOCTL_MAGIC, 12, struct camera_enable_cmd *)
44 
45 #define MSM_CAM_IOCTL_VFE_APPS_RESET   _IOW(MSM_CAM_IOCTL_MAGIC, 13, struct camera_enable_cmd *)
46 
47 #define MSM_CAM_IOCTL_RELEASE_FRAME_BUFFER   _IOW(MSM_CAM_IOCTL_MAGIC, 14, struct camera_enable_cmd *)
48 
49 #define MSM_CAM_IOCTL_RELEASE_STATS_BUFFER   _IOW(MSM_CAM_IOCTL_MAGIC, 15, struct msm_stats_buf *)
50 
51 #define MSM_CAM_IOCTL_AXI_CONFIG   _IOW(MSM_CAM_IOCTL_MAGIC, 16, struct msm_camera_vfe_cfg_cmd *)
52 
53 #define MSM_CAM_IOCTL_GET_PICTURE   _IOW(MSM_CAM_IOCTL_MAGIC, 17, struct msm_camera_ctrl_cmd *)
54 
55 #define MSM_CAM_IOCTL_SET_CROP   _IOW(MSM_CAM_IOCTL_MAGIC, 18, struct crop_info *)
56 
57 #define MSM_CAM_IOCTL_PICT_PP   _IOW(MSM_CAM_IOCTL_MAGIC, 19, uint8_t *)
58 
59 #define MSM_CAM_IOCTL_PICT_PP_DONE   _IOW(MSM_CAM_IOCTL_MAGIC, 20, struct msm_snapshot_pp_status *)
60 
61 #define MSM_CAM_IOCTL_SENSOR_IO_CFG   _IOW(MSM_CAM_IOCTL_MAGIC, 21, struct sensor_cfg_data *)
62 
63 #define MSM_CAMERA_LED_OFF 0
64 #define MSM_CAMERA_LED_LOW 1
65 #define MSM_CAMERA_LED_HIGH 2
66 
67 #define MSM_CAM_IOCTL_FLASH_LED_CFG   _IOW(MSM_CAM_IOCTL_MAGIC, 22, unsigned *)
68 
69 #define MSM_CAM_IOCTL_UNBLOCK_POLL_FRAME   _IO(MSM_CAM_IOCTL_MAGIC, 23)
70 
71 #define MSM_CAM_IOCTL_CTRL_COMMAND_2   _IOW(MSM_CAM_IOCTL_MAGIC, 24, struct msm_ctrl_cmd *)
72 
73 #define MAX_SENSOR_NUM 3
74 #define MAX_SENSOR_NAME 32
75 
76 #define MSM_CAM_CTRL_CMD_DONE 0
77 #define MSM_CAM_SENSOR_VFE_CMD 1
78 
79 struct msm_ctrl_cmd {
80  uint16_t type;
81  uint16_t length;
82  void *value;
83  uint16_t status;
84  uint32_t timeout_ms;
85  int resp_fd;
86 };
87 
88 struct msm_vfe_evt_msg {
89  unsigned short type;
90  unsigned short msg_id;
91  unsigned int len;
92  void *data;
93 };
94 
95 #define MSM_CAM_RESP_CTRL 0
96 #define MSM_CAM_RESP_STAT_EVT_MSG 1
97 #define MSM_CAM_RESP_V4L2 2
98 #define MSM_CAM_RESP_MAX 3
99 
100 struct msm_stats_event_ctrl {
101 
102  int resptype;
103  int timeout_ms;
104  struct msm_ctrl_cmd ctrl_cmd;
105 
106  struct msm_vfe_evt_msg stats_event;
107 };
108 
109 struct msm_camera_cfg_cmd {
110 
111  uint16_t cfg_type;
112 
113  uint16_t cmd_type;
114  uint16_t queue;
115  uint16_t length;
116  void *value;
117 };
118 
119 #define CMD_GENERAL 0
120 #define CMD_AXI_CFG_OUT1 1
121 #define CMD_AXI_CFG_SNAP_O1_AND_O2 2
122 #define CMD_AXI_CFG_OUT2 3
123 #define CMD_PICT_T_AXI_CFG 4
124 #define CMD_PICT_M_AXI_CFG 5
125 #define CMD_RAW_PICT_AXI_CFG 6
126 #define CMD_STATS_AXI_CFG 7
127 #define CMD_STATS_AF_AXI_CFG 8
128 #define CMD_FRAME_BUF_RELEASE 9
129 #define CMD_PREV_BUF_CFG 10
130 #define CMD_SNAP_BUF_RELEASE 11
131 #define CMD_SNAP_BUF_CFG 12
132 #define CMD_STATS_DISABLE 13
133 #define CMD_STATS_ENABLE 14
134 #define CMD_STATS_AF_ENABLE 15
135 #define CMD_STATS_BUF_RELEASE 16
136 #define CMD_STATS_AF_BUF_RELEASE 17
137 #define UPDATE_STATS_INVALID 18
138 
139 struct msm_vfe_cfg_cmd {
140  int cmd_type;
141  uint16_t length;
142  void *value;
143 };
144 
145 #define MAX_CAMERA_ENABLE_NAME_LEN 32
146 struct camera_enable_cmd {
147  char name[MAX_CAMERA_ENABLE_NAME_LEN];
148 };
149 
150 #define MSM_PMEM_OUTPUT1 0
151 #define MSM_PMEM_OUTPUT2 1
152 #define MSM_PMEM_OUTPUT1_OUTPUT2 2
153 #define MSM_PMEM_THUMBAIL 3
154 #define MSM_PMEM_MAINIMG 4
155 #define MSM_PMEM_RAW_MAINIMG 5
156 #define MSM_PMEM_AEC_AWB 6
157 #define MSM_PMEM_AF 7
158 #define MSM_PMEM_MAX 8
159 
160 #define FRAME_PREVIEW_OUTPUT1 0
161 #define FRAME_PREVIEW_OUTPUT2 1
162 #define FRAME_SNAPSHOT 2
163 #define FRAME_THUMBAIL 3
164 #define FRAME_RAW_SNAPSHOT 4
165 #define FRAME_MAX 5
166 
167 struct msm_pmem_info {
168  int type;
169  int fd;
170  void *vaddr;
171  uint32_t offset;
172  uint32_t len;
173  uint32_t y_off;
174  uint32_t cbcr_off;
175  uint8_t active;
176 };
177 
178 struct outputCfg {
179  uint32_t height;
180  uint32_t width;
181 
182  uint32_t window_height_firstline;
183  uint32_t window_height_lastline;
184 };
185 
186 #define OUTPUT_1 0
187 #define OUTPUT_2 1
188 #define OUTPUT_1_AND_2 2
189 #define CAMIF_TO_AXI_VIA_OUTPUT_2 3
190 #define OUTPUT_1_AND_CAMIF_TO_AXI_VIA_OUTPUT_2 4
191 #define OUTPUT_2_AND_CAMIF_TO_AXI_VIA_OUTPUT_1 5
192 #define LAST_AXI_OUTPUT_MODE_ENUM = OUTPUT_2_AND_CAMIF_TO_AXI_VIA_OUTPUT_1 6
193 
194 #define MSM_FRAME_PREV_1 0
195 #define MSM_FRAME_PREV_2 1
196 #define MSM_FRAME_ENC 2
197 
198 struct msm_frame {
199  int path;
200  unsigned long buffer;
201  uint32_t y_off;
202  uint32_t cbcr_off;
203  int fd;
204 
205  void *cropinfo;
206  int croplen;
207 };
208 
209 #define STAT_AEAW 0
210 #define STAT_AF 1
211 #define STAT_MAX 2
212 
213 struct msm_stats_buf {
214  int type;
215  unsigned long buffer;
216  int fd;
217 };
218 
219 #define MSM_V4L2_VID_CAP_TYPE 0
220 #define MSM_V4L2_STREAM_ON 1
221 #define MSM_V4L2_STREAM_OFF 2
222 #define MSM_V4L2_SNAPSHOT 3
223 #define MSM_V4L2_QUERY_CTRL 4
224 #define MSM_V4L2_GET_CTRL 5
225 #define MSM_V4L2_SET_CTRL 6
226 #define MSM_V4L2_QUERY 7
227 #define MSM_V4L2_MAX 8
228 
229 struct crop_info {
230  void *info;
231  int len;
232 };
233 
234 struct msm_postproc {
235  int ftnum;
236  struct msm_frame fthumnail;
237  int fmnum;
238  struct msm_frame fmain;
239 };
240 
241 struct msm_snapshot_pp_status {
242  void *status;
243 };
244 
245 #define CFG_SET_MODE 0
246 #define CFG_SET_EFFECT 1
247 #define CFG_START 2
248 #define CFG_PWR_UP 3
249 #define CFG_PWR_DOWN 4
250 #define CFG_WRITE_EXPOSURE_GAIN 5
251 #define CFG_SET_DEFAULT_FOCUS 6
252 #define CFG_MOVE_FOCUS 7
253 #define CFG_REGISTER_TO_REAL_GAIN 8
254 #define CFG_REAL_TO_REGISTER_GAIN 9
255 #define CFG_SET_FPS 10
256 #define CFG_SET_PICT_FPS 11
257 #define CFG_SET_BRIGHTNESS 12
258 #define CFG_SET_CONTRAST 13
259 #define CFG_SET_ZOOM 14
260 #define CFG_SET_EXPOSURE_MODE 15
261 #define CFG_SET_WB 16
262 #define CFG_SET_ANTIBANDING 17
263 #define CFG_SET_EXP_GAIN 18
264 #define CFG_SET_PICT_EXP_GAIN 19
265 #define CFG_SET_LENS_SHADING 20
266 #define CFG_GET_PICT_FPS 21
267 #define CFG_GET_PREV_L_PF 22
268 #define CFG_GET_PREV_P_PL 23
269 #define CFG_GET_PICT_L_PF 24
270 #define CFG_GET_PICT_P_PL 25
271 #define CFG_GET_AF_MAX_STEPS 26
272 #define CFG_GET_PICT_MAX_EXP_LC 27
273 #define CFG_MAX 28
274 
275 #define MOVE_NEAR 0
276 #define MOVE_FAR 1
277 
278 #define SENSOR_PREVIEW_MODE 0
279 #define SENSOR_SNAPSHOT_MODE 1
280 #define SENSOR_RAW_SNAPSHOT_MODE 2
281 
282 #define SENSOR_QTR_SIZE 0
283 #define SENSOR_FULL_SIZE 1
284 #define SENSOR_INVALID_SIZE 2
285 
286 #define CAMERA_EFFECT_OFF 0
287 #define CAMERA_EFFECT_MONO 1
288 #define CAMERA_EFFECT_NEGATIVE 2
289 #define CAMERA_EFFECT_SOLARIZE 3
290 #define CAMERA_EFFECT_PASTEL 4
291 #define CAMERA_EFFECT_MOSAIC 5
292 #define CAMERA_EFFECT_RESIZE 6
293 #define CAMERA_EFFECT_SEPIA 7
294 #define CAMERA_EFFECT_POSTERIZE 8
295 #define CAMERA_EFFECT_WHITEBOARD 9
296 #define CAMERA_EFFECT_BLACKBOARD 10
297 #define CAMERA_EFFECT_AQUA 11
298 #define CAMERA_EFFECT_MAX 12
299 
300 struct sensor_pict_fps {
301  uint16_t prevfps;
302  uint16_t pictfps;
303 };
304 
305 struct exp_gain_cfg {
306  uint16_t gain;
307  uint32_t line;
308 };
309 
310 struct focus_cfg {
311  int32_t steps;
312  int dir;
313 };
314 
315 struct fps_cfg {
316  uint16_t f_mult;
317  uint16_t fps_div;
318  uint32_t pict_fps_div;
319 };
320 
321 struct sensor_cfg_data {
322  int cfgtype;
323  int mode;
324  int rs;
325  uint8_t max_steps;
326 
327  union {
328  int8_t effect;
329  uint8_t lens_shading;
330  uint16_t prevl_pf;
331  uint16_t prevp_pl;
332  uint16_t pictl_pf;
333  uint16_t pictp_pl;
334  uint32_t pict_max_exp_lc;
335  uint16_t p_fps;
336  struct sensor_pict_fps gfps;
337  struct exp_gain_cfg exp_gain;
338  struct focus_cfg focus;
339  struct fps_cfg fps;
340  } cfg;
341 };
342 
343 #define GET_NAME 0
344 #define GET_PREVIEW_LINE_PER_FRAME 1
345 #define GET_PREVIEW_PIXELS_PER_LINE 2
346 #define GET_SNAPSHOT_LINE_PER_FRAME 3
347 #define GET_SNAPSHOT_PIXELS_PER_LINE 4
348 #define GET_SNAPSHOT_FPS 5
349 #define GET_SNAPSHOT_MAX_EP_LINE_CNT 6
350 
351 struct msm_camsensor_info {
352  char name[MAX_SENSOR_NAME];
353  uint8_t flash_enabled;
354 };
355 #endif
356 
357