Iliyan Malchev | 94a144e | 2009-04-30 12:29:52 -0700 | [diff] [blame^] | 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_t *) |
| 22 | |
| 23 | #define MSM_CAM_IOCTL_REGISTER_PMEM _IOW(MSM_CAM_IOCTL_MAGIC, 2, struct msm_pmem_info_t *) |
| 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_t *) |
| 28 | |
| 29 | #define MSM_CAM_IOCTL_CONFIG_VFE _IOW(MSM_CAM_IOCTL_MAGIC, 5, struct msm_camera_vfe_cfg_cmd_t *) |
| 30 | |
| 31 | #define MSM_CAM_IOCTL_GET_STATS _IOR(MSM_CAM_IOCTL_MAGIC, 6, struct msm_camera_stats_event_ctrl_t *) |
| 32 | |
| 33 | #define MSM_CAM_IOCTL_GETFRAME _IOR(MSM_CAM_IOCTL_MAGIC, 7, struct msm_camera_get_frame_t *) |
| 34 | |
| 35 | #define MSM_CAM_IOCTL_ENABLE_VFE _IOW(MSM_CAM_IOCTL_MAGIC, 8, struct camera_enable_cmd_t *) |
| 36 | |
| 37 | #define MSM_CAM_IOCTL_CTRL_CMD_DONE _IOW(MSM_CAM_IOCTL_MAGIC, 9, struct camera_cmd_t *) |
| 38 | |
| 39 | #define MSM_CAM_IOCTL_CONFIG_CMD _IOW(MSM_CAM_IOCTL_MAGIC, 10, struct camera_cmd_t *) |
| 40 | |
| 41 | #define MSM_CAM_IOCTL_DISABLE_VFE _IOW(MSM_CAM_IOCTL_MAGIC, 11, struct camera_enable_cmd_t *) |
| 42 | |
| 43 | #define MSM_CAM_IOCTL_PAD_REG_RESET2 _IOW(MSM_CAM_IOCTL_MAGIC, 12, struct camera_enable_cmd_t *) |
| 44 | |
| 45 | #define MSM_CAM_IOCTL_VFE_APPS_RESET _IOW(MSM_CAM_IOCTL_MAGIC, 13, struct camera_enable_cmd_t *) |
| 46 | |
| 47 | #define MSM_CAM_IOCTL_RELEASE_FRAME_BUFFER _IOW(MSM_CAM_IOCTL_MAGIC, 14, struct camera_enable_cmd_t *) |
| 48 | |
| 49 | #define MSM_CAM_IOCTL_RELEASE_STATS_BUFFER _IOW(MSM_CAM_IOCTL_MAGIC, 15, struct msm_stats_buf_t *) |
| 50 | |
| 51 | #define MSM_CAM_IOCTL_AXI_CONFIG _IOW(MSM_CAM_IOCTL_MAGIC, 16, struct msm_camera_vfe_cfg_cmd_t *) |
| 52 | |
| 53 | #define MSM_CAM_IOCTL_GET_PICTURE _IOW(MSM_CAM_IOCTL_MAGIC, 17, struct msm_camera_ctrl_cmd_t *) |
| 54 | |
| 55 | #define MSM_CAM_IOCTL_SET_CROP _IOW(MSM_CAM_IOCTL_MAGIC, 18, struct crop_info_t *) |
| 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_t *) |
| 60 | |
| 61 | #define MSM_CAM_IOCTL_SENSOR_IO_CFG _IOW(MSM_CAM_IOCTL_MAGIC, 21, struct sensor_cfg_data_t *) |
| 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_t *) |
| 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_t { |
| 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_t { |
| 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_t ctrl_cmd; |
| 105 | |
| 106 | struct msm_vfe_evt_msg_t stats_event; |
| 107 | }; |
| 108 | |
| 109 | struct msm_camera_cfg_cmd_t { |
| 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_t { |
| 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_t { |
| 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_t { |
| 168 | int type; |
| 169 | int fd; |
| 170 | void *vaddr; |
| 171 | uint32_t y_off; |
| 172 | uint32_t cbcr_off; |
| 173 | uint8_t active; |
| 174 | }; |
| 175 | |
| 176 | struct outputCfg_t { |
| 177 | uint32_t height; |
| 178 | uint32_t width; |
| 179 | |
| 180 | uint32_t window_height_firstline; |
| 181 | uint32_t window_height_lastline; |
| 182 | }; |
| 183 | |
| 184 | #define OUTPUT_1 0 |
| 185 | #define OUTPUT_2 1 |
| 186 | #define OUTPUT_1_AND_2 2 |
| 187 | #define CAMIF_TO_AXI_VIA_OUTPUT_2 3 |
| 188 | #define OUTPUT_1_AND_CAMIF_TO_AXI_VIA_OUTPUT_2 4 |
| 189 | #define OUTPUT_2_AND_CAMIF_TO_AXI_VIA_OUTPUT_1 5 |
| 190 | #define LAST_AXI_OUTPUT_MODE_ENUM = OUTPUT_2_AND_CAMIF_TO_AXI_VIA_OUTPUT_1 6 |
| 191 | |
| 192 | #define MSM_FRAME_PREV_1 0 |
| 193 | #define MSM_FRAME_PREV_2 1 |
| 194 | #define MSM_FRAME_ENC 2 |
| 195 | |
| 196 | struct msm_frame_t { |
| 197 | int path; |
| 198 | unsigned long buffer; |
| 199 | uint32_t y_off; |
| 200 | uint32_t cbcr_off; |
| 201 | int fd; |
| 202 | |
| 203 | void *cropinfo; |
| 204 | int croplen; |
| 205 | }; |
| 206 | |
| 207 | #define STAT_AEAW 0 |
| 208 | #define STAT_AF 1 |
| 209 | #define STAT_MAX 2 |
| 210 | |
| 211 | struct msm_stats_buf_t { |
| 212 | int type; |
| 213 | unsigned long buffer; |
| 214 | int fd; |
| 215 | }; |
| 216 | |
| 217 | #define MSM_V4L2_VID_CAP_TYPE 0 |
| 218 | #define MSM_V4L2_STREAM_ON 1 |
| 219 | #define MSM_V4L2_STREAM_OFF 2 |
| 220 | #define MSM_V4L2_SNAPSHOT 3 |
| 221 | #define MSM_V4L2_QUERY_CTRL 4 |
| 222 | #define MSM_V4L2_GET_CTRL 5 |
| 223 | #define MSM_V4L2_SET_CTRL 6 |
| 224 | #define MSM_V4L2_QUERY 7 |
| 225 | #define MSM_V4L2_MAX 8 |
| 226 | |
| 227 | struct crop_info_t { |
| 228 | void *info; |
| 229 | int len; |
| 230 | }; |
| 231 | |
| 232 | struct msm_postproc_t { |
| 233 | int ftnum; |
| 234 | struct msm_frame_t fthumnail; |
| 235 | int fmnum; |
| 236 | struct msm_frame_t fmain; |
| 237 | }; |
| 238 | |
| 239 | struct msm_snapshot_pp_status_t { |
| 240 | void *status; |
| 241 | }; |
| 242 | |
| 243 | #define CFG_SET_MODE 0 |
| 244 | #define CFG_SET_EFFECT 1 |
| 245 | #define CFG_START 2 |
| 246 | #define CFG_PWR_UP 3 |
| 247 | #define CFG_PWR_DOWN 4 |
| 248 | #define CFG_WRITE_EXPOSURE_GAIN 5 |
| 249 | #define CFG_SET_DEFAULT_FOCUS 6 |
| 250 | #define CFG_MOVE_FOCUS 7 |
| 251 | #define CFG_REGISTER_TO_REAL_GAIN 8 |
| 252 | #define CFG_REAL_TO_REGISTER_GAIN 9 |
| 253 | #define CFG_SET_FPS 10 |
| 254 | #define CFG_SET_PICT_FPS 11 |
| 255 | #define CFG_SET_BRIGHTNESS 12 |
| 256 | #define CFG_SET_CONTRAST 13 |
| 257 | #define CFG_SET_ZOOM 14 |
| 258 | #define CFG_SET_EXPOSURE_MODE 15 |
| 259 | #define CFG_SET_WB 16 |
| 260 | #define CFG_SET_ANTIBANDING 17 |
| 261 | #define CFG_SET_EXP_GAIN 18 |
| 262 | #define CFG_SET_PICT_EXP_GAIN 19 |
| 263 | #define CFG_SET_LENS_SHADING 20 |
| 264 | #define CFG_GET_PICT_FPS 21 |
| 265 | #define CFG_GET_PREV_L_PF 22 |
| 266 | #define CFG_GET_PREV_P_PL 23 |
| 267 | #define CFG_GET_PICT_L_PF 24 |
| 268 | #define CFG_GET_PICT_P_PL 25 |
| 269 | #define CFG_GET_AF_MAX_STEPS 26 |
| 270 | #define CFG_GET_PICT_MAX_EXP_LC 27 |
| 271 | #define CFG_MAX 28 |
| 272 | |
| 273 | #define MOVE_NEAR 0 |
| 274 | #define MOVE_FAR 1 |
| 275 | |
| 276 | #define SENSOR_PREVIEW_MODE 0 |
| 277 | #define SENSOR_SNAPSHOT_MODE 1 |
| 278 | #define SENSOR_RAW_SNAPSHOT_MODE 2 |
| 279 | |
| 280 | #define SENSOR_QTR_SIZE 0 |
| 281 | #define SENSOR_FULL_SIZE 1 |
| 282 | #define SENSOR_INVALID_SIZE 2 |
| 283 | |
| 284 | #define CAMERA_EFFECT_OFF 0 |
| 285 | #define CAMERA_EFFECT_MONO 1 |
| 286 | #define CAMERA_EFFECT_NEGATIVE 2 |
| 287 | #define CAMERA_EFFECT_SOLARIZE 3 |
| 288 | #define CAMERA_EFFECT_PASTEL 4 |
| 289 | #define CAMERA_EFFECT_MOSAIC 5 |
| 290 | #define CAMERA_EFFECT_RESIZE 6 |
| 291 | #define CAMERA_EFFECT_SEPIA 7 |
| 292 | #define CAMERA_EFFECT_POSTERIZE 8 |
| 293 | #define CAMERA_EFFECT_WHITEBOARD 9 |
| 294 | #define CAMERA_EFFECT_BLACKBOARD 10 |
| 295 | #define CAMERA_EFFECT_AQUA 11 |
| 296 | #define CAMERA_EFFECT_MAX 12 |
| 297 | |
| 298 | struct sensor_pict_fps { |
| 299 | uint16_t prevfps; |
| 300 | uint16_t pictfps; |
| 301 | }; |
| 302 | |
| 303 | struct exp_gain_cfg { |
| 304 | uint16_t gain; |
| 305 | uint32_t line; |
| 306 | }; |
| 307 | |
| 308 | struct focus_cfg { |
| 309 | int32_t steps; |
| 310 | int dir; |
| 311 | }; |
| 312 | |
| 313 | struct fps_cfg { |
| 314 | uint16_t f_mult; |
| 315 | uint16_t fps_div; |
| 316 | uint32_t pict_fps_div; |
| 317 | }; |
| 318 | |
| 319 | struct sensor_cfg_data_t { |
| 320 | int cfgtype; |
| 321 | int mode; |
| 322 | int rs; |
| 323 | uint8_t max_steps; |
| 324 | |
| 325 | union { |
| 326 | int8_t effect; |
| 327 | uint8_t lens_shading; |
| 328 | uint16_t prevl_pf; |
| 329 | uint16_t prevp_pl; |
| 330 | uint16_t pictl_pf; |
| 331 | uint16_t pictp_pl; |
| 332 | uint32_t pict_max_exp_lc; |
| 333 | uint16_t p_fps; |
| 334 | struct sensor_pict_fps gfps; |
| 335 | struct exp_gain_cfg exp_gain; |
| 336 | struct focus_cfg focus; |
| 337 | struct fps_cfg fps; |
| 338 | } cfg; |
| 339 | }; |
| 340 | |
| 341 | #define GET_NAME 0 |
| 342 | #define GET_PREVIEW_LINE_PER_FRAME 1 |
| 343 | #define GET_PREVIEW_PIXELS_PER_LINE 2 |
| 344 | #define GET_SNAPSHOT_LINE_PER_FRAME 3 |
| 345 | #define GET_SNAPSHOT_PIXELS_PER_LINE 4 |
| 346 | #define GET_SNAPSHOT_FPS 5 |
| 347 | #define GET_SNAPSHOT_MAX_EP_LINE_CNT 6 |
| 348 | |
| 349 | struct msm_camsensor_info_t { |
| 350 | char name[MAX_SENSOR_NAME]; |
| 351 | uint8_t flash_enabled; |
| 352 | }; |
| 353 | #endif |
| 354 | |