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