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_PP _IOW(MSM_CAM_IOCTL_MAGIC, 19, uint8_t *) 58 59 #define MSM_CAM_IOCTL_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 MSM_CAM_IOCTL_ENABLE_OUTPUT_IND _IOW(MSM_CAM_IOCTL_MAGIC, 25, uint32_t *) 74 75 #define MSM_CAM_IOCTL_AF_CTRL _IOR(MSM_CAM_IOCTL_MAGIC, 26, struct msm_ctrl_cmt_t *) 76 #define MSM_CAM_IOCTL_AF_CTRL_DONE _IOW(MSM_CAM_IOCTL_MAGIC, 27, struct msm_ctrl_cmt_t *) 77 78 #define MAX_SENSOR_NUM 3 79 #define MAX_SENSOR_NAME 32 80 81 #define PP_SNAP 1 82 #define PP_RAW_SNAP (1<<1) 83 #define PP_PREV (1<<2) 84 #define PP_MASK (PP_SNAP|PP_RAW_SNAP|PP_PREV) 85 86 #define MSM_CAM_CTRL_CMD_DONE 0 87 #define MSM_CAM_SENSOR_VFE_CMD 1 88 89 struct msm_ctrl_cmd { 90 uint16_t type; 91 uint16_t length; 92 void *value; 93 uint16_t status; 94 uint32_t timeout_ms; 95 int resp_fd; 96 }; 97 98 struct msm_vfe_evt_msg { 99 unsigned short type; 100 unsigned short msg_id; 101 unsigned int len; 102 void *data; 103 }; 104 105 #define MSM_CAM_RESP_CTRL 0 106 #define MSM_CAM_RESP_STAT_EVT_MSG 1 107 #define MSM_CAM_RESP_V4L2 2 108 #define MSM_CAM_RESP_MAX 3 109 110 struct msm_stats_event_ctrl { 111 112 int resptype; 113 int timeout_ms; 114 struct msm_ctrl_cmd ctrl_cmd; 115 116 struct msm_vfe_evt_msg stats_event; 117 }; 118 119 struct msm_camera_cfg_cmd { 120 121 uint16_t cfg_type; 122 123 uint16_t cmd_type; 124 uint16_t queue; 125 uint16_t length; 126 void *value; 127 }; 128 129 #define CMD_GENERAL 0 130 #define CMD_AXI_CFG_OUT1 1 131 #define CMD_AXI_CFG_SNAP_O1_AND_O2 2 132 #define CMD_AXI_CFG_OUT2 3 133 #define CMD_PICT_T_AXI_CFG 4 134 #define CMD_PICT_M_AXI_CFG 5 135 #define CMD_RAW_PICT_AXI_CFG 6 136 #define CMD_STATS_AXI_CFG 7 137 #define CMD_STATS_AF_AXI_CFG 8 138 #define CMD_FRAME_BUF_RELEASE 9 139 #define CMD_PREV_BUF_CFG 10 140 #define CMD_SNAP_BUF_RELEASE 11 141 #define CMD_SNAP_BUF_CFG 12 142 #define CMD_STATS_DISABLE 13 143 #define CMD_STATS_AEC_AWB_ENABLE 14 144 #define CMD_STATS_AF_ENABLE 15 145 #define CMD_STATS_BUF_RELEASE 16 146 #define CMD_STATS_AF_BUF_RELEASE 17 147 #define CMD_STATS_ENABLE 18 148 #define UPDATE_STATS_INVALID 19 149 150 #define CMD_STATS_AEC_ENABLE 20 151 #define CMD_STATS_AWB_ENABLE 21 152 #define CMD_STATS_AEC_AXI_CFG 22 153 #define CMD_STATS_AWB_AXI_CFG 23 154 #define CMD_STATS_RS_AXI_CFG 24 155 #define CMD_STATS_CS_AXI_CFG 25 156 #define CMD_STATS_IHIST_AXI_CFG 26 157 #define CMD_STATS_SKIN_AXI_CFG 27 158 #define CMD_STATS_AEC_BUF_RELEASE 28 159 #define CMD_STATS_AWB_BUF_RELEASE 29 160 #define CMD_STATS_RS_BUF_RELEASE 30 161 #define CMD_STATS_CS_BUF_RELEASE 31 162 #define CMD_STATS_IHIST_BUF_RELEASE 32 163 #define CMD_STATS_SKIN_BUF_RELEASE 33 164 165 #define CMD_AXI_CFG_SNAP_GEMINI 34 166 #define CMD_AXI_CFG_SNAP 35 167 #define CMD_AXI_CFG_PREVIEW 36 168 #define CMD_AXI_CFG_VIDEO 37 169 170 #define CMD_STATS_IHIST_ENABLE 38 171 #define CMD_STATS_RS_ENABLE 39 172 #define CMD_STATS_CS_ENABLE 40 173 #define CMD_AXI_CFG_O1_AND_O2 41 174 175 struct msm_vfe_cfg_cmd { 176 int cmd_type; 177 uint16_t length; 178 void *value; 179 }; 180 181 #define MAX_CAMERA_ENABLE_NAME_LEN 32 182 struct camera_enable_cmd { 183 char name[MAX_CAMERA_ENABLE_NAME_LEN]; 184 }; 185 186 #define MSM_PMEM_OUTPUT1 0 187 #define MSM_PMEM_OUTPUT2 1 188 #define MSM_PMEM_OUTPUT1_OUTPUT2 2 189 #define MSM_PMEM_THUMBNAIL 3 190 #define MSM_PMEM_MAINIMG 4 191 #define MSM_PMEM_RAW_MAINIMG 5 192 #define MSM_PMEM_AEC_AWB 6 193 #define MSM_PMEM_AF 7 194 #define MSM_PMEM_AEC 8 195 #define MSM_PMEM_AWB 9 196 #define MSM_PMEM_RS 10 197 #define MSM_PMEM_CS 11 198 #define MSM_PMEM_IHIST 12 199 #define MSM_PMEM_SKIN 13 200 #define MSM_PMEM_VIDEO 14 201 #define MSM_PMEM_PREVIEW 15 202 #define MSM_PMEM_MAX 16 203 204 #define FRAME_PREVIEW_OUTPUT1 0 205 #define FRAME_PREVIEW_OUTPUT2 1 206 #define FRAME_SNAPSHOT 2 207 #define FRAME_THUMBNAIL 3 208 #define FRAME_RAW_SNAPSHOT 4 209 #define FRAME_MAX 5 210 211 struct msm_pmem_info { 212 int type; 213 int fd; 214 void *vaddr; 215 uint32_t offset; 216 uint32_t len; 217 uint32_t y_off; 218 uint32_t cbcr_off; 219 uint8_t vfe_can_write; 220 }; 221 222 struct outputCfg { 223 uint32_t height; 224 uint32_t width; 225 226 uint32_t window_height_firstline; 227 uint32_t window_height_lastline; 228 }; 229 230 #define OUTPUT_1 0 231 #define OUTPUT_2 1 232 #define OUTPUT_1_AND_2 2 233 #define CAMIF_TO_AXI_VIA_OUTPUT_2 3 234 #define OUTPUT_1_AND_CAMIF_TO_AXI_VIA_OUTPUT_2 4 235 #define OUTPUT_2_AND_CAMIF_TO_AXI_VIA_OUTPUT_1 5 236 #define OUTPUT_1_AND_3 6 237 #define LAST_AXI_OUTPUT_MODE_ENUM = OUTPUT_1_AND_3 7 238 239 #define MSM_FRAME_PREV_1 0 240 #define MSM_FRAME_PREV_2 1 241 #define MSM_FRAME_ENC 2 242 243 #define OUTPUT_TYPE_P 1 244 #define OUTPUT_TYPE_T 2 245 #define OUTPUT_TYPE_S 3 246 #define OUTPUT_TYPE_V 4 247 248 struct msm_frame { 249 int path; 250 unsigned long buffer; 251 uint32_t y_off; 252 uint32_t cbcr_off; 253 int fd; 254 255 void *cropinfo; 256 int croplen; 257 }; 258 259 #define STAT_AEAW 0 260 #define STAT_AF 1 261 #define STAT_AEC 2 262 #define STAT_AWB 3 263 #define STAT_RS 4 264 #define STAT_CS 5 265 #define STAT_IHIST 6 266 #define STAT_SKIN 7 267 #define STAT_MAX 8 268 269 struct msm_stats_buf { 270 int type; 271 unsigned long buffer; 272 int fd; 273 }; 274 275 #define MSM_V4L2_VID_CAP_TYPE 0 276 #define MSM_V4L2_STREAM_ON 1 277 #define MSM_V4L2_STREAM_OFF 2 278 #define MSM_V4L2_SNAPSHOT 3 279 #define MSM_V4L2_QUERY_CTRL 4 280 #define MSM_V4L2_GET_CTRL 5 281 #define MSM_V4L2_SET_CTRL 6 282 #define MSM_V4L2_QUERY 7 283 #define MSM_V4L2_MAX 8 284 285 struct crop_info { 286 void *info; 287 int len; 288 }; 289 290 struct msm_postproc { 291 int ftnum; 292 struct msm_frame fthumnail; 293 int fmnum; 294 struct msm_frame fmain; 295 }; 296 297 struct msm_snapshot_pp_status { 298 void *status; 299 }; 300 301 #define CFG_SET_MODE 0 302 #define CFG_SET_EFFECT 1 303 #define CFG_START 2 304 #define CFG_PWR_UP 3 305 #define CFG_PWR_DOWN 4 306 #define CFG_WRITE_EXPOSURE_GAIN 5 307 #define CFG_SET_DEFAULT_FOCUS 6 308 #define CFG_MOVE_FOCUS 7 309 #define CFG_REGISTER_TO_REAL_GAIN 8 310 #define CFG_REAL_TO_REGISTER_GAIN 9 311 #define CFG_SET_FPS 10 312 #define CFG_SET_PICT_FPS 11 313 #define CFG_SET_BRIGHTNESS 12 314 #define CFG_SET_CONTRAST 13 315 #define CFG_SET_ZOOM 14 316 #define CFG_SET_EXPOSURE_MODE 15 317 #define CFG_SET_WB 16 318 #define CFG_SET_ANTIBANDING 17 319 #define CFG_SET_EXP_GAIN 18 320 #define CFG_SET_PICT_EXP_GAIN 19 321 #define CFG_SET_LENS_SHADING 20 322 #define CFG_GET_PICT_FPS 21 323 #define CFG_GET_PREV_L_PF 22 324 #define CFG_GET_PREV_P_PL 23 325 #define CFG_GET_PICT_L_PF 24 326 #define CFG_GET_PICT_P_PL 25 327 #define CFG_GET_AF_MAX_STEPS 26 328 #define CFG_GET_PICT_MAX_EXP_LC 27 329 #define CFG_MAX 28 330 331 #define MOVE_NEAR 0 332 #define MOVE_FAR 1 333 334 #define SENSOR_PREVIEW_MODE 0 335 #define SENSOR_SNAPSHOT_MODE 1 336 #define SENSOR_RAW_SNAPSHOT_MODE 2 337 338 #define SENSOR_QTR_SIZE 0 339 #define SENSOR_FULL_SIZE 1 340 #define SENSOR_INVALID_SIZE 2 341 342 #define CAMERA_EFFECT_OFF 0 343 #define CAMERA_EFFECT_MONO 1 344 #define CAMERA_EFFECT_NEGATIVE 2 345 #define CAMERA_EFFECT_SOLARIZE 3 346 #define CAMERA_EFFECT_PASTEL 4 347 #define CAMERA_EFFECT_MOSAIC 5 348 #define CAMERA_EFFECT_RESIZE 6 349 #define CAMERA_EFFECT_SEPIA 7 350 #define CAMERA_EFFECT_POSTERIZE 8 351 #define CAMERA_EFFECT_WHITEBOARD 9 352 #define CAMERA_EFFECT_BLACKBOARD 10 353 #define CAMERA_EFFECT_AQUA 11 354 #define CAMERA_EFFECT_MAX 12 355 356 struct sensor_pict_fps { 357 uint16_t prevfps; 358 uint16_t pictfps; 359 }; 360 361 struct exp_gain_cfg { 362 uint16_t gain; 363 uint32_t line; 364 }; 365 366 struct focus_cfg { 367 int32_t steps; 368 int dir; 369 }; 370 371 struct fps_cfg { 372 uint16_t f_mult; 373 uint16_t fps_div; 374 uint32_t pict_fps_div; 375 }; 376 377 struct sensor_cfg_data { 378 int cfgtype; 379 int mode; 380 int rs; 381 uint8_t max_steps; 382 383 union { 384 int8_t effect; 385 uint8_t lens_shading; 386 uint16_t prevl_pf; 387 uint16_t prevp_pl; 388 uint16_t pictl_pf; 389 uint16_t pictp_pl; 390 uint32_t pict_max_exp_lc; 391 uint16_t p_fps; 392 struct sensor_pict_fps gfps; 393 struct exp_gain_cfg exp_gain; 394 struct focus_cfg focus; 395 struct fps_cfg fps; 396 } cfg; 397 }; 398 399 #define GET_NAME 0 400 #define GET_PREVIEW_LINE_PER_FRAME 1 401 #define GET_PREVIEW_PIXELS_PER_LINE 2 402 #define GET_SNAPSHOT_LINE_PER_FRAME 3 403 #define GET_SNAPSHOT_PIXELS_PER_LINE 4 404 #define GET_SNAPSHOT_FPS 5 405 #define GET_SNAPSHOT_MAX_EP_LINE_CNT 6 406 407 struct msm_camsensor_info { 408 char name[MAX_SENSOR_NAME]; 409 uint8_t flash_enabled; 410 }; 411 #endif 412 413