Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 13 | #ifndef __LINUX_MSM_CAMERA_H |
| 14 | #define __LINUX_MSM_CAMERA_H |
| 15 | |
| 16 | #ifdef MSM_CAMERA_BIONIC |
| 17 | #include <sys/types.h> |
| 18 | #endif |
| 19 | #include <linux/types.h> |
| 20 | #include <linux/ioctl.h> |
| 21 | #include <linux/cdev.h> |
| 22 | #ifdef MSM_CAMERA_GCC |
| 23 | #include <time.h> |
| 24 | #else |
| 25 | #include <linux/time.h> |
| 26 | #endif |
| 27 | |
Ankit Premrajka | 3e90b9f | 2011-11-01 18:48:45 -0700 | [diff] [blame] | 28 | #ifdef __KERNEL__ |
| 29 | #include <linux/ion.h> |
| 30 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 31 | #define MSM_CAM_IOCTL_MAGIC 'm' |
| 32 | |
| 33 | #define MSM_CAM_IOCTL_GET_SENSOR_INFO \ |
| 34 | _IOR(MSM_CAM_IOCTL_MAGIC, 1, struct msm_camsensor_info *) |
| 35 | |
| 36 | #define MSM_CAM_IOCTL_REGISTER_PMEM \ |
| 37 | _IOW(MSM_CAM_IOCTL_MAGIC, 2, struct msm_pmem_info *) |
| 38 | |
| 39 | #define MSM_CAM_IOCTL_UNREGISTER_PMEM \ |
| 40 | _IOW(MSM_CAM_IOCTL_MAGIC, 3, unsigned) |
| 41 | |
| 42 | #define MSM_CAM_IOCTL_CTRL_COMMAND \ |
| 43 | _IOW(MSM_CAM_IOCTL_MAGIC, 4, struct msm_ctrl_cmd *) |
| 44 | |
| 45 | #define MSM_CAM_IOCTL_CONFIG_VFE \ |
| 46 | _IOW(MSM_CAM_IOCTL_MAGIC, 5, struct msm_camera_vfe_cfg_cmd *) |
| 47 | |
| 48 | #define MSM_CAM_IOCTL_GET_STATS \ |
| 49 | _IOR(MSM_CAM_IOCTL_MAGIC, 6, struct msm_camera_stats_event_ctrl *) |
| 50 | |
| 51 | #define MSM_CAM_IOCTL_GETFRAME \ |
| 52 | _IOR(MSM_CAM_IOCTL_MAGIC, 7, struct msm_camera_get_frame *) |
| 53 | |
| 54 | #define MSM_CAM_IOCTL_ENABLE_VFE \ |
| 55 | _IOW(MSM_CAM_IOCTL_MAGIC, 8, struct camera_enable_cmd *) |
| 56 | |
| 57 | #define MSM_CAM_IOCTL_CTRL_CMD_DONE \ |
| 58 | _IOW(MSM_CAM_IOCTL_MAGIC, 9, struct camera_cmd *) |
| 59 | |
| 60 | #define MSM_CAM_IOCTL_CONFIG_CMD \ |
| 61 | _IOW(MSM_CAM_IOCTL_MAGIC, 10, struct camera_cmd *) |
| 62 | |
| 63 | #define MSM_CAM_IOCTL_DISABLE_VFE \ |
| 64 | _IOW(MSM_CAM_IOCTL_MAGIC, 11, struct camera_enable_cmd *) |
| 65 | |
| 66 | #define MSM_CAM_IOCTL_PAD_REG_RESET2 \ |
| 67 | _IOW(MSM_CAM_IOCTL_MAGIC, 12, struct camera_enable_cmd *) |
| 68 | |
| 69 | #define MSM_CAM_IOCTL_VFE_APPS_RESET \ |
| 70 | _IOW(MSM_CAM_IOCTL_MAGIC, 13, struct camera_enable_cmd *) |
| 71 | |
| 72 | #define MSM_CAM_IOCTL_RELEASE_FRAME_BUFFER \ |
| 73 | _IOW(MSM_CAM_IOCTL_MAGIC, 14, struct camera_enable_cmd *) |
| 74 | |
| 75 | #define MSM_CAM_IOCTL_RELEASE_STATS_BUFFER \ |
| 76 | _IOW(MSM_CAM_IOCTL_MAGIC, 15, struct msm_stats_buf *) |
| 77 | |
| 78 | #define MSM_CAM_IOCTL_AXI_CONFIG \ |
| 79 | _IOW(MSM_CAM_IOCTL_MAGIC, 16, struct msm_camera_vfe_cfg_cmd *) |
| 80 | |
| 81 | #define MSM_CAM_IOCTL_GET_PICTURE \ |
| 82 | _IOW(MSM_CAM_IOCTL_MAGIC, 17, struct msm_frame *) |
| 83 | |
| 84 | #define MSM_CAM_IOCTL_SET_CROP \ |
| 85 | _IOW(MSM_CAM_IOCTL_MAGIC, 18, struct crop_info *) |
| 86 | |
| 87 | #define MSM_CAM_IOCTL_PICT_PP \ |
| 88 | _IOW(MSM_CAM_IOCTL_MAGIC, 19, uint8_t *) |
| 89 | |
| 90 | #define MSM_CAM_IOCTL_PICT_PP_DONE \ |
| 91 | _IOW(MSM_CAM_IOCTL_MAGIC, 20, struct msm_snapshot_pp_status *) |
| 92 | |
| 93 | #define MSM_CAM_IOCTL_SENSOR_IO_CFG \ |
| 94 | _IOW(MSM_CAM_IOCTL_MAGIC, 21, struct sensor_cfg_data *) |
| 95 | |
| 96 | #define MSM_CAM_IOCTL_FLASH_LED_CFG \ |
| 97 | _IOW(MSM_CAM_IOCTL_MAGIC, 22, unsigned *) |
| 98 | |
| 99 | #define MSM_CAM_IOCTL_UNBLOCK_POLL_FRAME \ |
| 100 | _IO(MSM_CAM_IOCTL_MAGIC, 23) |
| 101 | |
| 102 | #define MSM_CAM_IOCTL_CTRL_COMMAND_2 \ |
| 103 | _IOW(MSM_CAM_IOCTL_MAGIC, 24, struct msm_ctrl_cmd *) |
| 104 | |
| 105 | #define MSM_CAM_IOCTL_AF_CTRL \ |
| 106 | _IOR(MSM_CAM_IOCTL_MAGIC, 25, struct msm_ctrl_cmt_t *) |
| 107 | |
| 108 | #define MSM_CAM_IOCTL_AF_CTRL_DONE \ |
| 109 | _IOW(MSM_CAM_IOCTL_MAGIC, 26, struct msm_ctrl_cmt_t *) |
| 110 | |
| 111 | #define MSM_CAM_IOCTL_CONFIG_VPE \ |
| 112 | _IOW(MSM_CAM_IOCTL_MAGIC, 27, struct msm_camera_vpe_cfg_cmd *) |
| 113 | |
| 114 | #define MSM_CAM_IOCTL_AXI_VPE_CONFIG \ |
| 115 | _IOW(MSM_CAM_IOCTL_MAGIC, 28, struct msm_camera_vpe_cfg_cmd *) |
| 116 | |
| 117 | #define MSM_CAM_IOCTL_STROBE_FLASH_CFG \ |
| 118 | _IOW(MSM_CAM_IOCTL_MAGIC, 29, uint32_t *) |
| 119 | |
| 120 | #define MSM_CAM_IOCTL_STROBE_FLASH_CHARGE \ |
| 121 | _IOW(MSM_CAM_IOCTL_MAGIC, 30, uint32_t *) |
| 122 | |
| 123 | #define MSM_CAM_IOCTL_STROBE_FLASH_RELEASE \ |
| 124 | _IO(MSM_CAM_IOCTL_MAGIC, 31) |
| 125 | |
| 126 | #define MSM_CAM_IOCTL_FLASH_CTRL \ |
| 127 | _IOW(MSM_CAM_IOCTL_MAGIC, 32, struct flash_ctrl_data *) |
| 128 | |
| 129 | #define MSM_CAM_IOCTL_ERROR_CONFIG \ |
| 130 | _IOW(MSM_CAM_IOCTL_MAGIC, 33, uint32_t *) |
| 131 | |
| 132 | #define MSM_CAM_IOCTL_ABORT_CAPTURE \ |
| 133 | _IO(MSM_CAM_IOCTL_MAGIC, 34) |
| 134 | |
| 135 | #define MSM_CAM_IOCTL_SET_FD_ROI \ |
| 136 | _IOW(MSM_CAM_IOCTL_MAGIC, 35, struct fd_roi_info *) |
| 137 | |
| 138 | #define MSM_CAM_IOCTL_GET_CAMERA_INFO \ |
| 139 | _IOR(MSM_CAM_IOCTL_MAGIC, 36, struct msm_camera_info *) |
| 140 | |
| 141 | #define MSM_CAM_IOCTL_UNBLOCK_POLL_PIC_FRAME \ |
| 142 | _IO(MSM_CAM_IOCTL_MAGIC, 37) |
| 143 | |
| 144 | #define MSM_CAM_IOCTL_RELEASE_PIC_BUFFER \ |
| 145 | _IOW(MSM_CAM_IOCTL_MAGIC, 38, struct camera_enable_cmd *) |
| 146 | |
| 147 | #define MSM_CAM_IOCTL_PUT_ST_FRAME \ |
| 148 | _IOW(MSM_CAM_IOCTL_MAGIC, 39, struct msm_camera_st_frame *) |
| 149 | |
| 150 | #define MSM_CAM_IOCTL_GET_CONFIG_INFO \ |
| 151 | _IOR(MSM_CAM_IOCTL_MAGIC, 40, struct msm_cam_config_dev_info *) |
| 152 | |
Mansoor Aftab | 5d41837 | 2011-07-26 17:01:26 -0700 | [diff] [blame] | 153 | #define MSM_CAM_IOCTL_V4L2_EVT_NOTIFY \ |
Shuzhen Wang | 0d9277c | 2011-07-28 10:19:10 -0700 | [diff] [blame] | 154 | _IOR(MSM_CAM_IOCTL_MAGIC, 41, struct v4l2_event *) |
Mansoor Aftab | 5d41837 | 2011-07-26 17:01:26 -0700 | [diff] [blame] | 155 | |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 156 | #define MSM_CAM_IOCTL_SET_MEM_MAP_INFO \ |
| 157 | _IOR(MSM_CAM_IOCTL_MAGIC, 42, struct msm_mem_map_info *) |
| 158 | |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 159 | #define MSM_CAM_IOCTL_ACTUATOR_IO_CFG \ |
| 160 | _IOW(MSM_CAM_IOCTL_MAGIC, 43, struct msm_actuator_cfg_data *) |
| 161 | |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 162 | #define MSM_CAM_IOCTL_MCTL_POST_PROC \ |
| 163 | _IOW(MSM_CAM_IOCTL_MAGIC, 44, struct msm_mctl_post_proc_cmd *) |
| 164 | |
| 165 | #define MSM_CAM_IOCTL_RESERVE_FREE_FRAME \ |
| 166 | _IOW(MSM_CAM_IOCTL_MAGIC, 45, struct msm_cam_evt_divert_frame *) |
| 167 | |
| 168 | #define MSM_CAM_IOCTL_RELEASE_FREE_FRAME \ |
| 169 | _IOR(MSM_CAM_IOCTL_MAGIC, 46, struct msm_cam_evt_divert_frame *) |
| 170 | |
Mingcheng Zhu | 8feaa3f | 2011-11-23 11:33:52 -0800 | [diff] [blame] | 171 | #define MSM_CAM_IOCTL_PICT_PP_DIVERT_DONE \ |
| 172 | _IOR(MSM_CAM_IOCTL_MAGIC, 47, struct msm_pp_frame *) |
| 173 | |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 174 | #define MSM_CAM_IOCTL_SENSOR_V4l2_S_CTRL \ |
| 175 | _IOR(MSM_CAM_IOCTL_MAGIC, 48, struct v4l2_control) |
| 176 | |
| 177 | #define MSM_CAM_IOCTL_SENSOR_V4l2_QUERY_CTRL \ |
| 178 | _IOR(MSM_CAM_IOCTL_MAGIC, 49, struct v4l2_queryctrl) |
| 179 | |
Guruprasad Gaonkar | 4c7758f | 2011-12-16 17:30:00 -0800 | [diff] [blame] | 180 | #define MSM_CAM_IOCTL_GET_KERNEL_SYSTEM_TIME \ |
| 181 | _IOW(MSM_CAM_IOCTL_MAGIC, 50, struct timeval *) |
| 182 | |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 183 | #define MSM_CAM_IOCTL_SET_VFE_OUTPUT_TYPE \ |
| 184 | _IOW(MSM_CAM_IOCTL_MAGIC, 51, uint32_t *) |
| 185 | |
Kiran Kumar H N | c3cb9ea | 2012-01-06 15:11:10 -0800 | [diff] [blame] | 186 | #define MSM_CAM_IOCTL_GET_MCTL_INFO \ |
| 187 | _IOR(MSM_CAM_IOCTL_MAGIC, 51, struct msm_mctl_node_info *) |
| 188 | |
| 189 | #define MSM_CAM_IOCTL_MCTL_DIVERT_DONE \ |
| 190 | _IOR(MSM_CAM_IOCTL_MAGIC, 52, struct msm_cam_evt_divert_frame *) |
| 191 | |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 192 | struct msm_mctl_pp_cmd { |
| 193 | int32_t id; |
| 194 | uint16_t length; |
| 195 | void *value; |
| 196 | }; |
| 197 | |
| 198 | struct msm_mctl_post_proc_cmd { |
| 199 | int32_t type; |
| 200 | struct msm_mctl_pp_cmd cmd; |
| 201 | }; |
| 202 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 203 | #define MSM_CAMERA_LED_OFF 0 |
| 204 | #define MSM_CAMERA_LED_LOW 1 |
| 205 | #define MSM_CAMERA_LED_HIGH 2 |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 206 | #define MSM_CAMERA_LED_INIT 3 |
| 207 | #define MSM_CAMERA_LED_RELEASE 4 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 208 | |
| 209 | #define MSM_CAMERA_STROBE_FLASH_NONE 0 |
| 210 | #define MSM_CAMERA_STROBE_FLASH_XENON 1 |
| 211 | |
| 212 | #define MSM_MAX_CAMERA_SENSORS 5 |
| 213 | #define MAX_SENSOR_NAME 32 |
| 214 | |
| 215 | #define MSM_MAX_CAMERA_CONFIGS 2 |
| 216 | |
| 217 | #define PP_SNAP 0x01 |
| 218 | #define PP_RAW_SNAP ((0x01)<<1) |
| 219 | #define PP_PREV ((0x01)<<2) |
| 220 | #define PP_MASK (PP_SNAP|PP_RAW_SNAP|PP_PREV) |
| 221 | |
| 222 | #define MSM_CAM_CTRL_CMD_DONE 0 |
| 223 | #define MSM_CAM_SENSOR_VFE_CMD 1 |
| 224 | |
Kiran Kumar H N | ceea762 | 2011-08-23 14:01:03 -0700 | [diff] [blame] | 225 | /* Should be same as VIDEO_MAX_PLANES in videodev2.h */ |
| 226 | #define MAX_PLANES 8 |
| 227 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 228 | /***************************************************** |
| 229 | * structure |
| 230 | *****************************************************/ |
| 231 | |
| 232 | /* define five type of structures for userspace <==> kernel |
| 233 | * space communication: |
| 234 | * command 1 - 2 are from userspace ==> kernel |
| 235 | * command 3 - 4 are from kernel ==> userspace |
| 236 | * |
| 237 | * 1. control command: control command(from control thread), |
| 238 | * control status (from config thread); |
| 239 | */ |
| 240 | struct msm_ctrl_cmd { |
| 241 | uint16_t type; |
| 242 | uint16_t length; |
| 243 | void *value; |
| 244 | uint16_t status; |
| 245 | uint32_t timeout_ms; |
| 246 | int resp_fd; /* FIXME: to be used by the kernel, pass-through for now */ |
| 247 | int vnode_id; /* video dev id. Can we overload resp_fd? */ |
| 248 | uint32_t stream_type; /* used to pass value to qcamera server */ |
Ankit Premrajka | f94bcc6 | 2011-08-22 15:23:53 -0700 | [diff] [blame] | 249 | int config_ident; /*used as identifier for config node*/ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 250 | }; |
| 251 | |
| 252 | struct msm_cam_evt_msg { |
| 253 | unsigned short type; /* 1 == event (RPC), 0 == message (adsp) */ |
| 254 | unsigned short msg_id; |
| 255 | unsigned int len; /* size in, number of bytes out */ |
| 256 | uint32_t frame_id; |
| 257 | void *data; |
| 258 | }; |
| 259 | |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 260 | struct msm_pp_frame_sp { |
| 261 | /* phy addr of the buffer */ |
| 262 | unsigned long phy_addr; |
| 263 | uint32_t y_off; |
| 264 | uint32_t cbcr_off; |
| 265 | /* buffer length */ |
| 266 | uint32_t length; |
| 267 | int32_t fd; |
| 268 | uint32_t addr_offset; |
| 269 | /* mapped addr */ |
| 270 | unsigned long vaddr; |
| 271 | }; |
| 272 | |
| 273 | struct msm_pp_frame_mp { |
| 274 | /* phy addr of the plane */ |
| 275 | unsigned long phy_addr; |
| 276 | /* offset of plane data */ |
| 277 | uint32_t data_offset; |
| 278 | /* plane length */ |
| 279 | uint32_t length; |
| 280 | int32_t fd; |
| 281 | uint32_t addr_offset; |
| 282 | /* mapped addr */ |
| 283 | unsigned long vaddr; |
| 284 | }; |
| 285 | |
| 286 | struct msm_pp_frame { |
| 287 | uint32_t handle; /* stores vb cookie */ |
| 288 | uint32_t frame_id; |
Kevin Chan | 318d7cb | 2011-11-29 14:24:26 -0800 | [diff] [blame] | 289 | unsigned short buf_idx; |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 290 | int path; |
| 291 | unsigned short image_type; |
| 292 | unsigned short num_planes; /* 1 for sp */ |
| 293 | struct timeval timestamp; |
| 294 | union { |
| 295 | struct msm_pp_frame_sp sp; |
| 296 | struct msm_pp_frame_mp mp[MAX_PLANES]; |
| 297 | }; |
| 298 | }; |
| 299 | |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 300 | struct msm_cam_evt_divert_frame { |
Mingcheng Zhu | 5b04d35 | 2011-07-22 21:18:42 -0700 | [diff] [blame] | 301 | unsigned short image_mode; |
| 302 | unsigned short op_mode; |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 303 | unsigned short inst_idx; |
| 304 | unsigned short node_idx; |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 305 | struct msm_pp_frame frame; |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 306 | int do_pp; |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 307 | }; |
| 308 | |
Kiran Kumar H N | 0b51780 | 2011-10-05 09:49:51 -0700 | [diff] [blame] | 309 | struct msm_mctl_pp_cmd_ack_event { |
| 310 | uint32_t cmd; /* VPE_CMD_ZOOM? */ |
| 311 | int status; /* 0 done, < 0 err */ |
| 312 | uint32_t cookie; /* daemon's cookie */ |
| 313 | }; |
| 314 | |
| 315 | struct msm_mctl_pp_event_info { |
| 316 | int32_t event; |
| 317 | union { |
| 318 | struct msm_mctl_pp_cmd_ack_event ack; |
| 319 | }; |
| 320 | }; |
| 321 | |
| 322 | struct msm_isp_event_ctrl { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 323 | unsigned short resptype; |
| 324 | union { |
| 325 | struct msm_cam_evt_msg isp_msg; |
| 326 | struct msm_ctrl_cmd ctrl; |
Kiran Kumar H N | 0b51780 | 2011-10-05 09:49:51 -0700 | [diff] [blame] | 327 | struct msm_cam_evt_divert_frame div_frame; |
| 328 | struct msm_mctl_pp_event_info pp_event_info; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 329 | } isp_data; |
| 330 | }; |
| 331 | |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 332 | #define MSM_CAM_RESP_CTRL 0 |
| 333 | #define MSM_CAM_RESP_STAT_EVT_MSG 1 |
| 334 | #define MSM_CAM_RESP_STEREO_OP_1 2 |
| 335 | #define MSM_CAM_RESP_STEREO_OP_2 3 |
| 336 | #define MSM_CAM_RESP_V4L2 4 |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 337 | #define MSM_CAM_RESP_DIV_FRAME_EVT_MSG 5 |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 338 | #define MSM_CAM_RESP_DONE_EVENT 6 |
| 339 | #define MSM_CAM_RESP_MCTL_PP_EVENT 7 |
| 340 | #define MSM_CAM_RESP_MAX 8 |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 341 | |
Mingcheng Zhu | 270813a | 2011-08-10 17:23:18 -0700 | [diff] [blame] | 342 | #define MSM_CAM_APP_NOTIFY_EVENT 0 |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 343 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 344 | /* this one is used to send ctrl/status up to config thread */ |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 345 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 346 | struct msm_stats_event_ctrl { |
| 347 | /* 0 - ctrl_cmd from control thread, |
| 348 | * 1 - stats/event kernel, |
| 349 | * 2 - V4L control or read request */ |
| 350 | int resptype; |
| 351 | int timeout_ms; |
| 352 | struct msm_ctrl_cmd ctrl_cmd; |
| 353 | /* struct vfe_event_t stats_event; */ |
| 354 | struct msm_cam_evt_msg stats_event; |
| 355 | }; |
| 356 | |
| 357 | /* 2. config command: config command(from config thread); */ |
| 358 | struct msm_camera_cfg_cmd { |
| 359 | /* what to config: |
| 360 | * 1 - sensor config, 2 - vfe config */ |
| 361 | uint16_t cfg_type; |
| 362 | |
| 363 | /* sensor config type */ |
| 364 | uint16_t cmd_type; |
| 365 | uint16_t queue; |
| 366 | uint16_t length; |
| 367 | void *value; |
| 368 | }; |
| 369 | |
| 370 | #define CMD_GENERAL 0 |
| 371 | #define CMD_AXI_CFG_OUT1 1 |
| 372 | #define CMD_AXI_CFG_SNAP_O1_AND_O2 2 |
| 373 | #define CMD_AXI_CFG_OUT2 3 |
| 374 | #define CMD_PICT_T_AXI_CFG 4 |
| 375 | #define CMD_PICT_M_AXI_CFG 5 |
| 376 | #define CMD_RAW_PICT_AXI_CFG 6 |
| 377 | |
| 378 | #define CMD_FRAME_BUF_RELEASE 7 |
| 379 | #define CMD_PREV_BUF_CFG 8 |
| 380 | #define CMD_SNAP_BUF_RELEASE 9 |
| 381 | #define CMD_SNAP_BUF_CFG 10 |
| 382 | #define CMD_STATS_DISABLE 11 |
| 383 | #define CMD_STATS_AEC_AWB_ENABLE 12 |
| 384 | #define CMD_STATS_AF_ENABLE 13 |
| 385 | #define CMD_STATS_AEC_ENABLE 14 |
| 386 | #define CMD_STATS_AWB_ENABLE 15 |
| 387 | #define CMD_STATS_ENABLE 16 |
| 388 | |
| 389 | #define CMD_STATS_AXI_CFG 17 |
| 390 | #define CMD_STATS_AEC_AXI_CFG 18 |
| 391 | #define CMD_STATS_AF_AXI_CFG 19 |
| 392 | #define CMD_STATS_AWB_AXI_CFG 20 |
| 393 | #define CMD_STATS_RS_AXI_CFG 21 |
| 394 | #define CMD_STATS_CS_AXI_CFG 22 |
| 395 | #define CMD_STATS_IHIST_AXI_CFG 23 |
| 396 | #define CMD_STATS_SKIN_AXI_CFG 24 |
| 397 | |
| 398 | #define CMD_STATS_BUF_RELEASE 25 |
| 399 | #define CMD_STATS_AEC_BUF_RELEASE 26 |
| 400 | #define CMD_STATS_AF_BUF_RELEASE 27 |
| 401 | #define CMD_STATS_AWB_BUF_RELEASE 28 |
| 402 | #define CMD_STATS_RS_BUF_RELEASE 29 |
| 403 | #define CMD_STATS_CS_BUF_RELEASE 30 |
| 404 | #define CMD_STATS_IHIST_BUF_RELEASE 31 |
| 405 | #define CMD_STATS_SKIN_BUF_RELEASE 32 |
| 406 | |
| 407 | #define UPDATE_STATS_INVALID 33 |
| 408 | #define CMD_AXI_CFG_SNAP_GEMINI 34 |
| 409 | #define CMD_AXI_CFG_SNAP 35 |
| 410 | #define CMD_AXI_CFG_PREVIEW 36 |
| 411 | #define CMD_AXI_CFG_VIDEO 37 |
| 412 | |
| 413 | #define CMD_STATS_IHIST_ENABLE 38 |
| 414 | #define CMD_STATS_RS_ENABLE 39 |
| 415 | #define CMD_STATS_CS_ENABLE 40 |
| 416 | #define CMD_VPE 41 |
| 417 | #define CMD_AXI_CFG_VPE 42 |
| 418 | #define CMD_AXI_CFG_ZSL 43 |
| 419 | #define CMD_AXI_CFG_SNAP_VPE 44 |
| 420 | #define CMD_AXI_CFG_SNAP_THUMB_VPE 45 |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 421 | #define CMD_CONFIG_PING_ADDR 46 |
| 422 | #define CMD_CONFIG_PONG_ADDR 47 |
| 423 | #define CMD_CONFIG_FREE_BUF_ADDR 48 |
| 424 | #define CMD_AXI_CFG_ZSL_ALL_CHNLS 49 |
| 425 | #define CMD_AXI_CFG_VIDEO_ALL_CHNLS 50 |
Suresh Vankadara | 055cb8e | 2012-01-18 00:50:04 +0530 | [diff] [blame] | 426 | #define CMD_VFE_BUFFER_RELEASE 51 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 427 | |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 428 | #define CMD_AXI_CFG_PRIM 0xF1 |
| 429 | #define CMD_AXI_CFG_PRIM_ALL_CHNLS 0xF2 |
| 430 | #define CMD_AXI_CFG_SEC 0xF4 |
| 431 | #define CMD_AXI_CFG_SEC_ALL_CHNLS 0xF8 |
| 432 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 433 | /* vfe config command: config command(from config thread)*/ |
| 434 | struct msm_vfe_cfg_cmd { |
| 435 | int cmd_type; |
| 436 | uint16_t length; |
| 437 | void *value; |
| 438 | }; |
| 439 | |
| 440 | struct msm_vpe_cfg_cmd { |
| 441 | int cmd_type; |
| 442 | uint16_t length; |
| 443 | void *value; |
| 444 | }; |
| 445 | |
| 446 | #define MAX_CAMERA_ENABLE_NAME_LEN 32 |
| 447 | struct camera_enable_cmd { |
| 448 | char name[MAX_CAMERA_ENABLE_NAME_LEN]; |
| 449 | }; |
| 450 | |
| 451 | #define MSM_PMEM_OUTPUT1 0 |
| 452 | #define MSM_PMEM_OUTPUT2 1 |
| 453 | #define MSM_PMEM_OUTPUT1_OUTPUT2 2 |
| 454 | #define MSM_PMEM_THUMBNAIL 3 |
| 455 | #define MSM_PMEM_MAINIMG 4 |
| 456 | #define MSM_PMEM_RAW_MAINIMG 5 |
| 457 | #define MSM_PMEM_AEC_AWB 6 |
| 458 | #define MSM_PMEM_AF 7 |
| 459 | #define MSM_PMEM_AEC 8 |
| 460 | #define MSM_PMEM_AWB 9 |
| 461 | #define MSM_PMEM_RS 10 |
| 462 | #define MSM_PMEM_CS 11 |
| 463 | #define MSM_PMEM_IHIST 12 |
| 464 | #define MSM_PMEM_SKIN 13 |
| 465 | #define MSM_PMEM_VIDEO 14 |
| 466 | #define MSM_PMEM_PREVIEW 15 |
| 467 | #define MSM_PMEM_VIDEO_VPE 16 |
| 468 | #define MSM_PMEM_C2D 17 |
| 469 | #define MSM_PMEM_MAINIMG_VPE 18 |
| 470 | #define MSM_PMEM_THUMBNAIL_VPE 19 |
| 471 | #define MSM_PMEM_MAX 20 |
| 472 | |
| 473 | #define STAT_AEAW 0 |
| 474 | #define STAT_AEC 1 |
| 475 | #define STAT_AF 2 |
| 476 | #define STAT_AWB 3 |
| 477 | #define STAT_RS 4 |
| 478 | #define STAT_CS 5 |
| 479 | #define STAT_IHIST 6 |
| 480 | #define STAT_SKIN 7 |
| 481 | #define STAT_MAX 8 |
| 482 | |
| 483 | #define FRAME_PREVIEW_OUTPUT1 0 |
| 484 | #define FRAME_PREVIEW_OUTPUT2 1 |
| 485 | #define FRAME_SNAPSHOT 2 |
| 486 | #define FRAME_THUMBNAIL 3 |
| 487 | #define FRAME_RAW_SNAPSHOT 4 |
| 488 | #define FRAME_MAX 5 |
| 489 | |
| 490 | struct msm_pmem_info { |
| 491 | int type; |
| 492 | int fd; |
| 493 | void *vaddr; |
| 494 | uint32_t offset; |
| 495 | uint32_t len; |
Kiran Kumar H N | 5a19c68 | 2011-07-23 11:34:34 -0700 | [diff] [blame] | 496 | uint32_t y_off; |
| 497 | uint32_t cbcr_off; |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 498 | uint32_t planar0_off; |
| 499 | uint32_t planar1_off; |
| 500 | uint32_t planar2_off; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 501 | uint8_t active; |
| 502 | }; |
| 503 | |
| 504 | struct outputCfg { |
| 505 | uint32_t height; |
| 506 | uint32_t width; |
| 507 | |
| 508 | uint32_t window_height_firstline; |
| 509 | uint32_t window_height_lastline; |
| 510 | }; |
| 511 | |
| 512 | #define OUTPUT_1 0 |
| 513 | #define OUTPUT_2 1 |
| 514 | #define OUTPUT_1_AND_2 2 /* snapshot only */ |
| 515 | #define OUTPUT_1_AND_3 3 /* video */ |
| 516 | #define CAMIF_TO_AXI_VIA_OUTPUT_2 4 |
| 517 | #define OUTPUT_1_AND_CAMIF_TO_AXI_VIA_OUTPUT_2 5 |
| 518 | #define OUTPUT_2_AND_CAMIF_TO_AXI_VIA_OUTPUT_1 6 |
| 519 | #define OUTPUT_1_2_AND_3 7 |
Kiran Kumar H N | 4cff94a | 2011-10-17 11:37:33 -0700 | [diff] [blame] | 520 | #define OUTPUT_ALL_CHNLS 8 |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 521 | #define OUTPUT_VIDEO_ALL_CHNLS 9 |
| 522 | #define OUTPUT_ZSL_ALL_CHNLS 10 |
| 523 | #define LAST_AXI_OUTPUT_MODE_ENUM = OUTPUT_ZSL_ALL_CHNLS |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 524 | |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 525 | #define OUTPUT_PRIM 0xF1 |
| 526 | #define OUTPUT_PRIM_ALL_CHNLS 0xF2 |
| 527 | #define OUTPUT_SEC 0xF4 |
| 528 | #define OUTPUT_SEC_ALL_CHNLS 0xF8 |
| 529 | |
| 530 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 531 | #define MSM_FRAME_PREV_1 0 |
| 532 | #define MSM_FRAME_PREV_2 1 |
| 533 | #define MSM_FRAME_ENC 2 |
| 534 | |
| 535 | #define OUTPUT_TYPE_P (1<<0) |
| 536 | #define OUTPUT_TYPE_T (1<<1) |
| 537 | #define OUTPUT_TYPE_S (1<<2) |
| 538 | #define OUTPUT_TYPE_V (1<<3) |
| 539 | #define OUTPUT_TYPE_L (1<<4) |
| 540 | #define OUTPUT_TYPE_ST_L (1<<5) |
| 541 | #define OUTPUT_TYPE_ST_R (1<<6) |
| 542 | #define OUTPUT_TYPE_ST_D (1<<7) |
| 543 | |
| 544 | struct fd_roi_info { |
| 545 | void *info; |
| 546 | int info_len; |
| 547 | }; |
| 548 | |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 549 | struct msm_mem_map_info { |
| 550 | uint32_t cookie; |
| 551 | uint32_t length; |
Mingcheng Zhu | fe7abc0 | 2011-08-09 13:27:39 -0700 | [diff] [blame] | 552 | uint32_t mem_type; |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 553 | }; |
| 554 | |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 555 | #define MSM_MEM_MMAP 0 |
| 556 | #define MSM_MEM_USERPTR 1 |
| 557 | #define MSM_PLANE_MAX 8 |
| 558 | #define MSM_PLANE_Y 0 |
| 559 | #define MSM_PLANE_UV 1 |
| 560 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 561 | struct msm_frame { |
| 562 | struct timespec ts; |
| 563 | int path; |
| 564 | int type; |
| 565 | unsigned long buffer; |
| 566 | uint32_t phy_offset; |
Kiran Kumar H N | 5a19c68 | 2011-07-23 11:34:34 -0700 | [diff] [blame] | 567 | uint32_t y_off; |
| 568 | uint32_t cbcr_off; |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 569 | uint32_t planar0_off; |
| 570 | uint32_t planar1_off; |
| 571 | uint32_t planar2_off; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 572 | int fd; |
| 573 | |
| 574 | void *cropinfo; |
| 575 | int croplen; |
| 576 | uint32_t error_code; |
| 577 | struct fd_roi_info roi_info; |
| 578 | uint32_t frame_id; |
| 579 | int stcam_quality_ind; |
| 580 | uint32_t stcam_conv_value; |
Ankit Premrajka | 3e90b9f | 2011-11-01 18:48:45 -0700 | [diff] [blame] | 581 | |
| 582 | struct ion_allocation_data ion_alloc; |
| 583 | struct ion_fd_data fd_data; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 584 | }; |
| 585 | |
| 586 | enum msm_st_frame_packing { |
| 587 | SIDE_BY_SIDE_HALF, |
| 588 | SIDE_BY_SIDE_FULL, |
| 589 | TOP_DOWN_HALF, |
| 590 | TOP_DOWN_FULL, |
| 591 | }; |
| 592 | |
| 593 | struct msm_st_crop { |
| 594 | uint32_t in_w; |
| 595 | uint32_t in_h; |
| 596 | uint32_t out_w; |
| 597 | uint32_t out_h; |
| 598 | }; |
| 599 | |
| 600 | struct msm_st_half { |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 601 | uint32_t buf_p0_off; |
| 602 | uint32_t buf_p1_off; |
| 603 | uint32_t buf_p0_stride; |
| 604 | uint32_t buf_p1_stride; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 605 | uint32_t pix_x_off; |
| 606 | uint32_t pix_y_off; |
| 607 | struct msm_st_crop stCropInfo; |
| 608 | }; |
| 609 | |
| 610 | struct msm_st_frame { |
| 611 | struct msm_frame buf_info; |
| 612 | int type; |
| 613 | enum msm_st_frame_packing packing; |
| 614 | struct msm_st_half L; |
| 615 | struct msm_st_half R; |
| 616 | int frame_id; |
| 617 | }; |
| 618 | |
| 619 | #define MSM_CAMERA_ERR_MASK (0xFFFFFFFF & 1) |
| 620 | |
| 621 | struct stats_buff { |
| 622 | unsigned long buff; |
| 623 | int fd; |
| 624 | }; |
| 625 | |
| 626 | struct msm_stats_buf { |
Lakshmi Narayana Kalavala | 4ab97a9 | 2011-07-26 15:30:14 -0700 | [diff] [blame] | 627 | uint8_t awb_ymin; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 628 | struct stats_buff aec; |
| 629 | struct stats_buff awb; |
| 630 | struct stats_buff af; |
| 631 | struct stats_buff ihist; |
| 632 | struct stats_buff rs; |
| 633 | struct stats_buff cs; |
| 634 | struct stats_buff skin; |
| 635 | int type; |
| 636 | uint32_t status_bits; |
| 637 | unsigned long buffer; |
| 638 | int fd; |
| 639 | uint32_t frame_id; |
| 640 | }; |
| 641 | #define MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT 0 |
| 642 | /* video capture mode in VIDIOC_S_PARM */ |
| 643 | #define MSM_V4L2_EXT_CAPTURE_MODE_PREVIEW \ |
| 644 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+1) |
| 645 | /* extendedmode for video recording in VIDIOC_S_PARM */ |
| 646 | #define MSM_V4L2_EXT_CAPTURE_MODE_VIDEO \ |
| 647 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+2) |
| 648 | /* extendedmode for the full size main image in VIDIOC_S_PARM */ |
| 649 | #define MSM_V4L2_EXT_CAPTURE_MODE_MAIN (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+3) |
| 650 | /* extendedmode for the thumb nail image in VIDIOC_S_PARM */ |
| 651 | #define MSM_V4L2_EXT_CAPTURE_MODE_THUMBNAIL \ |
| 652 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+4) |
| 653 | #define MSM_V4L2_EXT_CAPTURE_MODE_RAW \ |
| 654 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+5) |
| 655 | #define MSM_V4L2_EXT_CAPTURE_MODE_MAX (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+6) |
| 656 | |
| 657 | |
| 658 | #define MSM_V4L2_PID_MOTION_ISO V4L2_CID_PRIVATE_BASE |
| 659 | #define MSM_V4L2_PID_EFFECT (V4L2_CID_PRIVATE_BASE+1) |
| 660 | #define MSM_V4L2_PID_HJR (V4L2_CID_PRIVATE_BASE+2) |
| 661 | #define MSM_V4L2_PID_LED_MODE (V4L2_CID_PRIVATE_BASE+3) |
| 662 | #define MSM_V4L2_PID_PREP_SNAPSHOT (V4L2_CID_PRIVATE_BASE+4) |
| 663 | #define MSM_V4L2_PID_EXP_METERING (V4L2_CID_PRIVATE_BASE+5) |
| 664 | #define MSM_V4L2_PID_ISO (V4L2_CID_PRIVATE_BASE+6) |
| 665 | #define MSM_V4L2_PID_CAM_MODE (V4L2_CID_PRIVATE_BASE+7) |
| 666 | #define MSM_V4L2_PID_LUMA_ADAPTATION (V4L2_CID_PRIVATE_BASE+8) |
| 667 | #define MSM_V4L2_PID_BEST_SHOT (V4L2_CID_PRIVATE_BASE+9) |
| 668 | #define MSM_V4L2_PID_FOCUS_MODE (V4L2_CID_PRIVATE_BASE+10) |
| 669 | #define MSM_V4L2_PID_BL_DETECTION (V4L2_CID_PRIVATE_BASE+11) |
| 670 | #define MSM_V4L2_PID_SNOW_DETECTION (V4L2_CID_PRIVATE_BASE+12) |
| 671 | #define MSM_V4L2_PID_CTRL_CMD (V4L2_CID_PRIVATE_BASE+13) |
| 672 | #define MSM_V4L2_PID_EVT_SUB_INFO (V4L2_CID_PRIVATE_BASE+14) |
Mingcheng Zhu | 5b04d35 | 2011-07-22 21:18:42 -0700 | [diff] [blame] | 673 | #define MSM_V4L2_PID_STROBE_FLASH (V4L2_CID_PRIVATE_BASE+15) |
| 674 | #define MSM_V4L2_PID_MMAP_ENTRY (V4L2_CID_PRIVATE_BASE+16) |
| 675 | #define MSM_V4L2_PID_MMAP_INST (V4L2_CID_PRIVATE_BASE+17) |
Kiran Kumar H N | c3cb9ea | 2012-01-06 15:11:10 -0800 | [diff] [blame] | 676 | #define MSM_V4L2_PID_PP_PLANE_INFO (V4L2_CID_PRIVATE_BASE+18) |
| 677 | #define MSM_V4L2_PID_MAX MSM_V4L2_PID_PP_PLANE_INFO |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 678 | |
| 679 | /* camera operation mode for video recording - two frame output queues */ |
| 680 | #define MSM_V4L2_CAM_OP_DEFAULT 0 |
| 681 | /* camera operation mode for video recording - two frame output queues */ |
| 682 | #define MSM_V4L2_CAM_OP_PREVIEW (MSM_V4L2_CAM_OP_DEFAULT+1) |
| 683 | /* camera operation mode for video recording - two frame output queues */ |
| 684 | #define MSM_V4L2_CAM_OP_VIDEO (MSM_V4L2_CAM_OP_DEFAULT+2) |
| 685 | /* camera operation mode for standard shapshot - two frame output queues */ |
| 686 | #define MSM_V4L2_CAM_OP_CAPTURE (MSM_V4L2_CAM_OP_DEFAULT+3) |
| 687 | /* camera operation mode for zsl shapshot - three output queues */ |
| 688 | #define MSM_V4L2_CAM_OP_ZSL (MSM_V4L2_CAM_OP_DEFAULT+4) |
| 689 | /* camera operation mode for raw snapshot - one frame output queue */ |
| 690 | #define MSM_V4L2_CAM_OP_RAW (MSM_V4L2_CAM_OP_DEFAULT+5) |
| 691 | |
| 692 | #define MSM_V4L2_VID_CAP_TYPE 0 |
| 693 | #define MSM_V4L2_STREAM_ON 1 |
| 694 | #define MSM_V4L2_STREAM_OFF 2 |
| 695 | #define MSM_V4L2_SNAPSHOT 3 |
| 696 | #define MSM_V4L2_QUERY_CTRL 4 |
| 697 | #define MSM_V4L2_GET_CTRL 5 |
| 698 | #define MSM_V4L2_SET_CTRL 6 |
| 699 | #define MSM_V4L2_QUERY 7 |
| 700 | #define MSM_V4L2_GET_CROP 8 |
| 701 | #define MSM_V4L2_SET_CROP 9 |
| 702 | #define MSM_V4L2_OPEN 10 |
| 703 | #define MSM_V4L2_CLOSE 11 |
| 704 | #define MSM_V4L2_SET_CTRL_CMD 12 |
| 705 | #define MSM_V4L2_EVT_SUB_MASK 13 |
| 706 | #define MSM_V4L2_MAX 14 |
| 707 | #define V4L2_CAMERA_EXIT 43 |
| 708 | |
| 709 | struct crop_info { |
| 710 | void *info; |
| 711 | int len; |
| 712 | }; |
| 713 | |
| 714 | struct msm_postproc { |
| 715 | int ftnum; |
| 716 | struct msm_frame fthumnail; |
| 717 | int fmnum; |
| 718 | struct msm_frame fmain; |
| 719 | }; |
| 720 | |
| 721 | struct msm_snapshot_pp_status { |
| 722 | void *status; |
| 723 | }; |
| 724 | |
| 725 | #define CFG_SET_MODE 0 |
| 726 | #define CFG_SET_EFFECT 1 |
| 727 | #define CFG_START 2 |
| 728 | #define CFG_PWR_UP 3 |
| 729 | #define CFG_PWR_DOWN 4 |
| 730 | #define CFG_WRITE_EXPOSURE_GAIN 5 |
| 731 | #define CFG_SET_DEFAULT_FOCUS 6 |
| 732 | #define CFG_MOVE_FOCUS 7 |
| 733 | #define CFG_REGISTER_TO_REAL_GAIN 8 |
| 734 | #define CFG_REAL_TO_REGISTER_GAIN 9 |
| 735 | #define CFG_SET_FPS 10 |
| 736 | #define CFG_SET_PICT_FPS 11 |
| 737 | #define CFG_SET_BRIGHTNESS 12 |
| 738 | #define CFG_SET_CONTRAST 13 |
| 739 | #define CFG_SET_ZOOM 14 |
| 740 | #define CFG_SET_EXPOSURE_MODE 15 |
| 741 | #define CFG_SET_WB 16 |
| 742 | #define CFG_SET_ANTIBANDING 17 |
| 743 | #define CFG_SET_EXP_GAIN 18 |
| 744 | #define CFG_SET_PICT_EXP_GAIN 19 |
| 745 | #define CFG_SET_LENS_SHADING 20 |
| 746 | #define CFG_GET_PICT_FPS 21 |
| 747 | #define CFG_GET_PREV_L_PF 22 |
| 748 | #define CFG_GET_PREV_P_PL 23 |
| 749 | #define CFG_GET_PICT_L_PF 24 |
| 750 | #define CFG_GET_PICT_P_PL 25 |
| 751 | #define CFG_GET_AF_MAX_STEPS 26 |
| 752 | #define CFG_GET_PICT_MAX_EXP_LC 27 |
| 753 | #define CFG_SEND_WB_INFO 28 |
| 754 | #define CFG_SENSOR_INIT 29 |
| 755 | #define CFG_GET_3D_CALI_DATA 30 |
| 756 | #define CFG_GET_CALIB_DATA 31 |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 757 | #define CFG_GET_OUTPUT_INFO 32 |
Kevin Chan | 07f710c | 2011-08-26 19:35:18 -0700 | [diff] [blame] | 758 | #define CFG_GET_EEPROM_DATA 33 |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 759 | #define CFG_SET_ACTUATOR_INFO 34 |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 760 | #define CFG_GET_ACTUATOR_INFO 35 |
| 761 | #define CFG_MAX 36 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 762 | |
| 763 | |
| 764 | #define MOVE_NEAR 0 |
| 765 | #define MOVE_FAR 1 |
| 766 | |
| 767 | #define SENSOR_PREVIEW_MODE 0 |
| 768 | #define SENSOR_SNAPSHOT_MODE 1 |
| 769 | #define SENSOR_RAW_SNAPSHOT_MODE 2 |
| 770 | #define SENSOR_HFR_60FPS_MODE 3 |
| 771 | #define SENSOR_HFR_90FPS_MODE 4 |
| 772 | #define SENSOR_HFR_120FPS_MODE 5 |
| 773 | |
| 774 | #define SENSOR_QTR_SIZE 0 |
| 775 | #define SENSOR_FULL_SIZE 1 |
| 776 | #define SENSOR_QVGA_SIZE 2 |
| 777 | #define SENSOR_INVALID_SIZE 3 |
| 778 | |
| 779 | #define CAMERA_EFFECT_OFF 0 |
| 780 | #define CAMERA_EFFECT_MONO 1 |
| 781 | #define CAMERA_EFFECT_NEGATIVE 2 |
| 782 | #define CAMERA_EFFECT_SOLARIZE 3 |
| 783 | #define CAMERA_EFFECT_SEPIA 4 |
| 784 | #define CAMERA_EFFECT_POSTERIZE 5 |
| 785 | #define CAMERA_EFFECT_WHITEBOARD 6 |
| 786 | #define CAMERA_EFFECT_BLACKBOARD 7 |
| 787 | #define CAMERA_EFFECT_AQUA 8 |
Yonggui Mao | c0055a1 | 2011-09-29 19:31:47 -0700 | [diff] [blame] | 788 | #define CAMERA_EFFECT_EMBOSS 9 |
| 789 | #define CAMERA_EFFECT_SKETCH 10 |
| 790 | #define CAMERA_EFFECT_NEON 11 |
| 791 | #define CAMERA_EFFECT_MAX 12 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 792 | |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 793 | /* QRD */ |
| 794 | #define CAMERA_EFFECT_BW 10 |
| 795 | #define CAMERA_EFFECT_BLUISH 12 |
| 796 | #define CAMERA_EFFECT_REDDISH 13 |
| 797 | #define CAMERA_EFFECT_GREENISH 14 |
| 798 | |
| 799 | /* QRD */ |
| 800 | #define CAMERA_ANTIBANDING_OFF 0 |
| 801 | #define CAMERA_ANTIBANDING_50HZ 2 |
| 802 | #define CAMERA_ANTIBANDING_60HZ 1 |
| 803 | #define CAMERA_ANTIBANDING_AUTO 3 |
| 804 | |
| 805 | #define CAMERA_CONTRAST_LV0 0 |
| 806 | #define CAMERA_CONTRAST_LV1 1 |
| 807 | #define CAMERA_CONTRAST_LV2 2 |
| 808 | #define CAMERA_CONTRAST_LV3 3 |
| 809 | #define CAMERA_CONTRAST_LV4 4 |
| 810 | #define CAMERA_CONTRAST_LV5 5 |
| 811 | #define CAMERA_CONTRAST_LV6 6 |
| 812 | #define CAMERA_CONTRAST_LV7 7 |
| 813 | #define CAMERA_CONTRAST_LV8 8 |
| 814 | #define CAMERA_CONTRAST_LV9 9 |
| 815 | |
| 816 | #define CAMERA_BRIGHTNESS_LV0 0 |
| 817 | #define CAMERA_BRIGHTNESS_LV1 1 |
| 818 | #define CAMERA_BRIGHTNESS_LV2 2 |
| 819 | #define CAMERA_BRIGHTNESS_LV3 3 |
| 820 | #define CAMERA_BRIGHTNESS_LV4 4 |
| 821 | #define CAMERA_BRIGHTNESS_LV5 5 |
| 822 | #define CAMERA_BRIGHTNESS_LV6 6 |
| 823 | #define CAMERA_BRIGHTNESS_LV7 7 |
| 824 | #define CAMERA_BRIGHTNESS_LV8 8 |
| 825 | |
| 826 | |
| 827 | #define CAMERA_SATURATION_LV0 0 |
| 828 | #define CAMERA_SATURATION_LV1 1 |
| 829 | #define CAMERA_SATURATION_LV2 2 |
| 830 | #define CAMERA_SATURATION_LV3 3 |
| 831 | #define CAMERA_SATURATION_LV4 4 |
| 832 | #define CAMERA_SATURATION_LV5 5 |
| 833 | #define CAMERA_SATURATION_LV6 6 |
| 834 | #define CAMERA_SATURATION_LV7 7 |
| 835 | #define CAMERA_SATURATION_LV8 8 |
| 836 | |
| 837 | #define CAMERA_SHARPNESS_LV0 0 |
| 838 | #define CAMERA_SHARPNESS_LV1 3 |
| 839 | #define CAMERA_SHARPNESS_LV2 6 |
| 840 | #define CAMERA_SHARPNESS_LV3 9 |
| 841 | #define CAMERA_SHARPNESS_LV4 12 |
| 842 | #define CAMERA_SHARPNESS_LV5 15 |
| 843 | #define CAMERA_SHARPNESS_LV6 18 |
| 844 | #define CAMERA_SHARPNESS_LV7 21 |
| 845 | #define CAMERA_SHARPNESS_LV8 24 |
| 846 | #define CAMERA_SHARPNESS_LV9 27 |
| 847 | #define CAMERA_SHARPNESS_LV10 30 |
| 848 | |
| 849 | #define CAMERA_SETAE_AVERAGE 0 |
| 850 | #define CAMERA_SETAE_CENWEIGHT 1 |
| 851 | |
| 852 | #define CFG_SET_SATURATION 30 |
| 853 | #define CFG_SET_SHARPNESS 31 |
| 854 | #define CFG_SET_TOUCHAEC 32 |
| 855 | #define CFG_SET_AUTO_FOCUS 33 |
| 856 | #define CFG_SET_AUTOFLASH 34 |
| 857 | /* QRD */ |
| 858 | #define CFG_SET_EXPOSURE_COMPENSATION 35 |
| 859 | |
| 860 | #define CAMERA_WB_AUTO 1 /* This list must match aeecamera.h */ |
| 861 | #define CAMERA_WB_CUSTOM 2 |
| 862 | #define CAMERA_WB_INCANDESCENT 3 |
| 863 | #define CAMERA_WB_FLUORESCENT 4 |
| 864 | #define CAMERA_WB_DAYLIGHT 5 |
| 865 | #define CAMERA_WB_CLOUDY_DAYLIGHT 6 |
| 866 | #define CAMERA_WB_TWILIGHT 7 |
| 867 | #define CAMERA_WB_SHADE 8 |
| 868 | |
| 869 | #define CAMERA_EXPOSURE_COMPENSATION_LV0 12 |
| 870 | #define CAMERA_EXPOSURE_COMPENSATION_LV1 6 |
| 871 | #define CAMERA_EXPOSURE_COMPENSATION_LV2 0 |
| 872 | #define CAMERA_EXPOSURE_COMPENSATION_LV3 -6 |
| 873 | #define CAMERA_EXPOSURE_COMPENSATION_LV4 -12 |
| 874 | |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 875 | enum msm_v4l2_saturation_level { |
| 876 | MSM_V4L2_SATURATION_L0, |
| 877 | MSM_V4L2_SATURATION_L1, |
| 878 | MSM_V4L2_SATURATION_L2, |
| 879 | MSM_V4L2_SATURATION_L3, |
| 880 | MSM_V4L2_SATURATION_L4, |
| 881 | MSM_V4L2_SATURATION_L5, |
| 882 | MSM_V4L2_SATURATION_L6, |
| 883 | MSM_V4L2_SATURATION_L7, |
| 884 | MSM_V4L2_SATURATION_L8, |
| 885 | MSM_V4L2_SATURATION_L9, |
| 886 | MSM_V4L2_SATURATION_L10, |
| 887 | }; |
| 888 | |
| 889 | enum msm_v4l2_exposure_level { |
| 890 | MSM_V4L2_EXPOSURE_N2, |
| 891 | MSM_V4L2_EXPOSURE_N1, |
| 892 | MSM_V4L2_EXPOSURE_D, |
| 893 | MSM_V4L2_EXPOSURE_P1, |
| 894 | MSM_V4L2_EXPOSURE_P2, |
| 895 | }; |
| 896 | |
| 897 | enum msm_v4l2_sharpness_level { |
| 898 | MSM_V4L2_SHARPNESS_L0, |
| 899 | MSM_V4L2_SHARPNESS_L1, |
| 900 | MSM_V4L2_SHARPNESS_L2, |
| 901 | MSM_V4L2_SHARPNESS_L3, |
| 902 | MSM_V4L2_SHARPNESS_L4, |
| 903 | MSM_V4L2_SHARPNESS_L5, |
| 904 | MSM_V4L2_SHARPNESS_L6, |
| 905 | }; |
| 906 | |
| 907 | enum msm_v4l2_expo_metering_mode { |
| 908 | MSM_V4L2_EXP_FRAME_AVERAGE, |
| 909 | MSM_V4L2_EXP_CENTER_WEIGHTED, |
| 910 | MSM_V4L2_EXP_SPOT_METERING, |
| 911 | }; |
| 912 | |
| 913 | enum msm_v4l2_iso_mode { |
| 914 | MSM_V4L2_ISO_AUTO = 0, |
| 915 | MSM_V4L2_ISO_DEBLUR, |
| 916 | MSM_V4L2_ISO_100, |
| 917 | MSM_V4L2_ISO_200, |
| 918 | MSM_V4L2_ISO_400, |
| 919 | MSM_V4L2_ISO_800, |
| 920 | MSM_V4L2_ISO_1600, |
| 921 | }; |
| 922 | |
| 923 | enum msm_v4l2_wb_mode { |
| 924 | MSM_V4L2_WB_MIN_MINUS_1, |
| 925 | MSM_V4L2_WB_AUTO = 1, |
| 926 | MSM_V4L2_WB_CUSTOM, |
| 927 | MSM_V4L2_WB_INCANDESCENT, |
| 928 | MSM_V4L2_WB_FLUORESCENT, |
| 929 | MSM_V4L2_WB_DAYLIGHT, |
| 930 | MSM_V4L2_WB_CLOUDY_DAYLIGHT, |
| 931 | MSM_V4L2_WB_TWILIGHT, |
| 932 | MSM_V4L2_WB_SHADE, |
| 933 | MSM_V4L2_WB_OFF, |
| 934 | }; |
| 935 | |
| 936 | enum msm_v4l2_power_line_frequency { |
| 937 | MSM_V4L2_POWER_LINE_OFF, |
| 938 | MSM_V4L2_POWER_LINE_60HZ, |
| 939 | MSM_V4L2_POWER_LINE_50HZ, |
| 940 | MSM_V4L2_POWER_LINE_AUTO, |
| 941 | }; |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 942 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 943 | struct sensor_pict_fps { |
| 944 | uint16_t prevfps; |
| 945 | uint16_t pictfps; |
| 946 | }; |
| 947 | |
| 948 | struct exp_gain_cfg { |
| 949 | uint16_t gain; |
| 950 | uint32_t line; |
| 951 | }; |
| 952 | |
| 953 | struct focus_cfg { |
| 954 | int32_t steps; |
| 955 | int dir; |
| 956 | }; |
| 957 | |
| 958 | struct fps_cfg { |
| 959 | uint16_t f_mult; |
| 960 | uint16_t fps_div; |
| 961 | uint32_t pict_fps_div; |
| 962 | }; |
| 963 | struct wb_info_cfg { |
| 964 | uint16_t red_gain; |
| 965 | uint16_t green_gain; |
| 966 | uint16_t blue_gain; |
| 967 | }; |
| 968 | struct sensor_3d_exp_cfg { |
| 969 | uint16_t gain; |
| 970 | uint32_t line; |
| 971 | uint16_t r_gain; |
| 972 | uint16_t b_gain; |
| 973 | uint16_t gr_gain; |
| 974 | uint16_t gb_gain; |
| 975 | uint16_t gain_adjust; |
| 976 | }; |
| 977 | struct sensor_3d_cali_data_t{ |
| 978 | unsigned char left_p_matrix[3][4][8]; |
| 979 | unsigned char right_p_matrix[3][4][8]; |
| 980 | unsigned char square_len[8]; |
| 981 | unsigned char focal_len[8]; |
| 982 | unsigned char pixel_pitch[8]; |
| 983 | uint16_t left_r; |
| 984 | uint16_t left_b; |
| 985 | uint16_t left_gb; |
| 986 | uint16_t left_af_far; |
| 987 | uint16_t left_af_mid; |
| 988 | uint16_t left_af_short; |
| 989 | uint16_t left_af_5um; |
| 990 | uint16_t left_af_50up; |
| 991 | uint16_t left_af_50down; |
| 992 | uint16_t right_r; |
| 993 | uint16_t right_b; |
| 994 | uint16_t right_gb; |
| 995 | uint16_t right_af_far; |
| 996 | uint16_t right_af_mid; |
| 997 | uint16_t right_af_short; |
| 998 | uint16_t right_af_5um; |
| 999 | uint16_t right_af_50up; |
| 1000 | uint16_t right_af_50down; |
| 1001 | }; |
| 1002 | struct sensor_init_cfg { |
| 1003 | uint8_t prev_res; |
| 1004 | uint8_t pict_res; |
| 1005 | }; |
| 1006 | |
| 1007 | struct sensor_calib_data { |
| 1008 | /* Color Related Measurements */ |
| 1009 | uint16_t r_over_g; |
| 1010 | uint16_t b_over_g; |
| 1011 | uint16_t gr_over_gb; |
| 1012 | |
| 1013 | /* Lens Related Measurements */ |
| 1014 | uint16_t macro_2_inf; |
| 1015 | uint16_t inf_2_macro; |
| 1016 | uint16_t stroke_amt; |
| 1017 | uint16_t af_pos_1m; |
| 1018 | uint16_t af_pos_inf; |
| 1019 | }; |
| 1020 | |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1021 | enum msm_sensor_resolution_t { |
Kevin Chan | 36e2bdc | 2011-08-30 17:21:21 -0700 | [diff] [blame] | 1022 | MSM_SENSOR_RES_FULL, |
| 1023 | MSM_SENSOR_RES_QTR, |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1024 | MSM_SENSOR_RES_2, |
| 1025 | MSM_SENSOR_RES_3, |
| 1026 | MSM_SENSOR_RES_4, |
| 1027 | MSM_SENSOR_RES_5, |
| 1028 | MSM_SENSOR_RES_6, |
| 1029 | MSM_SENSOR_RES_7, |
| 1030 | MSM_SENSOR_INVALID_RES, |
| 1031 | }; |
| 1032 | |
| 1033 | struct msm_sensor_output_info_t { |
| 1034 | uint16_t x_output; |
| 1035 | uint16_t y_output; |
| 1036 | uint16_t line_length_pclk; |
| 1037 | uint16_t frame_length_lines; |
Kevin Chan | e30d369 | 2011-10-14 16:11:01 -0700 | [diff] [blame] | 1038 | uint32_t vt_pixel_clk; |
| 1039 | uint32_t op_pixel_clk; |
Kevin Chan | 272f660 | 2011-10-18 14:20:03 -0700 | [diff] [blame] | 1040 | uint16_t binning_factor; |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1041 | }; |
| 1042 | |
| 1043 | struct sensor_output_info_t { |
| 1044 | struct msm_sensor_output_info_t *output_info; |
| 1045 | uint16_t num_info; |
| 1046 | }; |
| 1047 | |
Kevin Chan | 07f710c | 2011-08-26 19:35:18 -0700 | [diff] [blame] | 1048 | struct sensor_eeprom_data_t { |
| 1049 | void *eeprom_data; |
| 1050 | uint16_t index; |
| 1051 | }; |
| 1052 | |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 1053 | struct mirror_flip { |
| 1054 | int32_t x_mirror; |
| 1055 | int32_t y_flip; |
| 1056 | }; |
| 1057 | |
| 1058 | struct cord { |
| 1059 | uint32_t x; |
| 1060 | uint32_t y; |
| 1061 | }; |
| 1062 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1063 | struct sensor_cfg_data { |
| 1064 | int cfgtype; |
| 1065 | int mode; |
| 1066 | int rs; |
| 1067 | uint8_t max_steps; |
| 1068 | |
| 1069 | union { |
| 1070 | int8_t effect; |
| 1071 | uint8_t lens_shading; |
| 1072 | uint16_t prevl_pf; |
| 1073 | uint16_t prevp_pl; |
| 1074 | uint16_t pictl_pf; |
| 1075 | uint16_t pictp_pl; |
| 1076 | uint32_t pict_max_exp_lc; |
| 1077 | uint16_t p_fps; |
| 1078 | struct sensor_init_cfg init_info; |
| 1079 | struct sensor_pict_fps gfps; |
| 1080 | struct exp_gain_cfg exp_gain; |
| 1081 | struct focus_cfg focus; |
| 1082 | struct fps_cfg fps; |
| 1083 | struct wb_info_cfg wb_info; |
| 1084 | struct sensor_3d_exp_cfg sensor_3d_exp; |
| 1085 | struct sensor_calib_data calib_info; |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1086 | struct sensor_output_info_t output_info; |
Kevin Chan | 07f710c | 2011-08-26 19:35:18 -0700 | [diff] [blame] | 1087 | struct sensor_eeprom_data_t eeprom_data; |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 1088 | /* QRD */ |
| 1089 | uint16_t antibanding; |
| 1090 | uint8_t contrast; |
| 1091 | uint8_t saturation; |
| 1092 | uint8_t sharpness; |
| 1093 | int8_t brightness; |
| 1094 | int ae_mode; |
| 1095 | uint8_t wb_val; |
| 1096 | int8_t exp_compensation; |
| 1097 | struct cord aec_cord; |
| 1098 | int is_autoflash; |
| 1099 | struct mirror_flip mirror_flip; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1100 | } cfg; |
| 1101 | }; |
| 1102 | |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1103 | struct msm_actuator_move_params_t { |
| 1104 | int8_t dir; |
| 1105 | int32_t num_steps; |
| 1106 | }; |
| 1107 | |
| 1108 | struct msm_actuator_set_info_t { |
| 1109 | uint32_t total_steps; |
| 1110 | uint16_t gross_steps; |
| 1111 | uint16_t fine_steps; |
| 1112 | }; |
| 1113 | |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1114 | struct msm_actuator_get_info_t { |
| 1115 | uint32_t focal_length_num; |
| 1116 | uint32_t focal_length_den; |
| 1117 | uint32_t f_number_num; |
| 1118 | uint32_t f_number_den; |
| 1119 | uint32_t f_pix_num; |
| 1120 | uint32_t f_pix_den; |
| 1121 | uint32_t total_f_dist_num; |
| 1122 | uint32_t total_f_dist_den; |
| 1123 | }; |
| 1124 | |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1125 | struct msm_actuator_cfg_data { |
| 1126 | int cfgtype; |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1127 | uint8_t is_af_supported; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1128 | union { |
| 1129 | struct msm_actuator_move_params_t move; |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1130 | struct msm_actuator_set_info_t set_info; |
| 1131 | struct msm_actuator_get_info_t get_info; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1132 | } cfg; |
| 1133 | }; |
| 1134 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1135 | struct sensor_large_data { |
| 1136 | int cfgtype; |
| 1137 | union { |
| 1138 | struct sensor_3d_cali_data_t sensor_3d_cali_data; |
| 1139 | } data; |
| 1140 | }; |
| 1141 | |
| 1142 | enum sensor_type_t { |
| 1143 | BAYER, |
| 1144 | YUV, |
| 1145 | JPEG_SOC, |
| 1146 | }; |
| 1147 | |
| 1148 | enum flash_type { |
| 1149 | LED_FLASH, |
| 1150 | STROBE_FLASH, |
| 1151 | }; |
| 1152 | |
| 1153 | enum strobe_flash_ctrl_type { |
| 1154 | STROBE_FLASH_CTRL_INIT, |
| 1155 | STROBE_FLASH_CTRL_CHARGE, |
| 1156 | STROBE_FLASH_CTRL_RELEASE |
| 1157 | }; |
| 1158 | |
| 1159 | struct strobe_flash_ctrl_data { |
| 1160 | enum strobe_flash_ctrl_type type; |
| 1161 | int charge_en; |
| 1162 | }; |
| 1163 | |
| 1164 | struct msm_camera_info { |
| 1165 | int num_cameras; |
| 1166 | uint8_t has_3d_support[MSM_MAX_CAMERA_SENSORS]; |
| 1167 | uint8_t is_internal_cam[MSM_MAX_CAMERA_SENSORS]; |
| 1168 | uint32_t s_mount_angle[MSM_MAX_CAMERA_SENSORS]; |
| 1169 | const char *video_dev_name[MSM_MAX_CAMERA_SENSORS]; |
| 1170 | enum sensor_type_t sensor_type[MSM_MAX_CAMERA_SENSORS]; |
| 1171 | |
| 1172 | }; |
| 1173 | |
| 1174 | struct msm_cam_config_dev_info { |
| 1175 | int num_config_nodes; |
| 1176 | const char *config_dev_name[MSM_MAX_CAMERA_CONFIGS]; |
Ankit Premrajka | f94bcc6 | 2011-08-22 15:23:53 -0700 | [diff] [blame] | 1177 | int config_dev_id[MSM_MAX_CAMERA_CONFIGS]; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1178 | }; |
| 1179 | |
Kiran Kumar H N | c3cb9ea | 2012-01-06 15:11:10 -0800 | [diff] [blame] | 1180 | struct msm_mctl_node_info { |
| 1181 | int num_mctl_nodes; |
| 1182 | const char *mctl_node_name[MSM_MAX_CAMERA_SENSORS]; |
| 1183 | }; |
| 1184 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1185 | struct flash_ctrl_data { |
| 1186 | int flashtype; |
| 1187 | union { |
| 1188 | int led_state; |
| 1189 | struct strobe_flash_ctrl_data strobe_ctrl; |
| 1190 | } ctrl_data; |
| 1191 | }; |
| 1192 | |
| 1193 | #define GET_NAME 0 |
| 1194 | #define GET_PREVIEW_LINE_PER_FRAME 1 |
| 1195 | #define GET_PREVIEW_PIXELS_PER_LINE 2 |
| 1196 | #define GET_SNAPSHOT_LINE_PER_FRAME 3 |
| 1197 | #define GET_SNAPSHOT_PIXELS_PER_LINE 4 |
| 1198 | #define GET_SNAPSHOT_FPS 5 |
| 1199 | #define GET_SNAPSHOT_MAX_EP_LINE_CNT 6 |
| 1200 | |
| 1201 | struct msm_camsensor_info { |
| 1202 | char name[MAX_SENSOR_NAME]; |
| 1203 | uint8_t flash_enabled; |
| 1204 | int8_t total_steps; |
| 1205 | uint8_t support_3d; |
| 1206 | }; |
Kiran Kumar H N | ceea762 | 2011-08-23 14:01:03 -0700 | [diff] [blame] | 1207 | |
| 1208 | #define V4L2_SINGLE_PLANE 0 |
| 1209 | #define V4L2_MULTI_PLANE_Y 0 |
| 1210 | #define V4L2_MULTI_PLANE_CBCR 1 |
| 1211 | #define V4L2_MULTI_PLANE_CB 1 |
| 1212 | #define V4L2_MULTI_PLANE_CR 2 |
| 1213 | |
| 1214 | struct plane_data { |
| 1215 | int plane_id; |
| 1216 | uint32_t offset; |
| 1217 | unsigned long size; |
| 1218 | }; |
| 1219 | |
| 1220 | struct img_plane_info { |
| 1221 | uint32_t width; |
| 1222 | uint32_t height; |
| 1223 | uint32_t pixelformat; |
| 1224 | uint8_t buffer_type; /*Single/Multi planar*/ |
| 1225 | uint8_t output_port; |
| 1226 | uint32_t ext_mode; |
| 1227 | uint8_t num_planes; |
| 1228 | struct plane_data plane[MAX_PLANES]; |
Mingcheng Zhu | 996be18 | 2011-10-16 16:04:23 -0700 | [diff] [blame] | 1229 | uint32_t sp_y_offset; |
Kiran Kumar H N | ceea762 | 2011-08-23 14:01:03 -0700 | [diff] [blame] | 1230 | uint8_t vpe_can_use; |
| 1231 | }; |
| 1232 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1233 | #endif /* __LINUX_MSM_CAMERA_H */ |