Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2009-2012, Code Aurora Forum. All rights reserved. |
| 2 | * |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 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 | |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 30 | #include <linux/msm_ion.h> |
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 | |
Mansoor Aftab | 5d41837 | 2011-07-26 17:01:26 -0700 | [diff] [blame] | 150 | #define MSM_CAM_IOCTL_V4L2_EVT_NOTIFY \ |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 151 | _IOR(MSM_CAM_IOCTL_MAGIC, 40, struct v4l2_event *) |
Mansoor Aftab | 5d41837 | 2011-07-26 17:01:26 -0700 | [diff] [blame] | 152 | |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 153 | #define MSM_CAM_IOCTL_SET_MEM_MAP_INFO \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 154 | _IOR(MSM_CAM_IOCTL_MAGIC, 41, struct msm_mem_map_info *) |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 155 | |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 156 | #define MSM_CAM_IOCTL_ACTUATOR_IO_CFG \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 157 | _IOW(MSM_CAM_IOCTL_MAGIC, 42, struct msm_actuator_cfg_data *) |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 158 | |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 159 | #define MSM_CAM_IOCTL_MCTL_POST_PROC \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 160 | _IOW(MSM_CAM_IOCTL_MAGIC, 43, struct msm_mctl_post_proc_cmd *) |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 161 | |
| 162 | #define MSM_CAM_IOCTL_RESERVE_FREE_FRAME \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 163 | _IOW(MSM_CAM_IOCTL_MAGIC, 44, struct msm_cam_evt_divert_frame *) |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 164 | |
| 165 | #define MSM_CAM_IOCTL_RELEASE_FREE_FRAME \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 166 | _IOR(MSM_CAM_IOCTL_MAGIC, 45, struct msm_cam_evt_divert_frame *) |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 167 | |
Mingcheng Zhu | 8feaa3f | 2011-11-23 11:33:52 -0800 | [diff] [blame] | 168 | #define MSM_CAM_IOCTL_PICT_PP_DIVERT_DONE \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 169 | _IOR(MSM_CAM_IOCTL_MAGIC, 46, struct msm_pp_frame *) |
Mingcheng Zhu | 8feaa3f | 2011-11-23 11:33:52 -0800 | [diff] [blame] | 170 | |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 171 | #define MSM_CAM_IOCTL_SENSOR_V4l2_S_CTRL \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 172 | _IOR(MSM_CAM_IOCTL_MAGIC, 47, struct v4l2_control) |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 173 | |
| 174 | #define MSM_CAM_IOCTL_SENSOR_V4l2_QUERY_CTRL \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 175 | _IOR(MSM_CAM_IOCTL_MAGIC, 48, struct v4l2_queryctrl) |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 176 | |
Guruprasad Gaonkar | 4c7758f | 2011-12-16 17:30:00 -0800 | [diff] [blame] | 177 | #define MSM_CAM_IOCTL_GET_KERNEL_SYSTEM_TIME \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 178 | _IOW(MSM_CAM_IOCTL_MAGIC, 49, struct timeval *) |
Guruprasad Gaonkar | 4c7758f | 2011-12-16 17:30:00 -0800 | [diff] [blame] | 179 | |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 180 | #define MSM_CAM_IOCTL_SET_VFE_OUTPUT_TYPE \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 181 | _IOW(MSM_CAM_IOCTL_MAGIC, 50, uint32_t *) |
Kiran Kumar H N | c3cb9ea | 2012-01-06 15:11:10 -0800 | [diff] [blame] | 182 | |
| 183 | #define MSM_CAM_IOCTL_MCTL_DIVERT_DONE \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 184 | _IOR(MSM_CAM_IOCTL_MAGIC, 51, struct msm_cam_evt_divert_frame *) |
Kiran Kumar H N | c3cb9ea | 2012-01-06 15:11:10 -0800 | [diff] [blame] | 185 | |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 186 | #define MSM_CAM_IOCTL_GET_ACTUATOR_INFO \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 187 | _IOW(MSM_CAM_IOCTL_MAGIC, 52, struct msm_actuator_cfg_data *) |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 188 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 189 | #define QCT_IOCTL_MAX 54 |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 190 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 191 | #define MSM_CAM_IOCTL_ENABLE_DROP_FRAME \ |
| 192 | _IOW(MSM_CAM_IOCTL_MAGIC, QCT_IOCTL_MAX+1, int *) |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 193 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 194 | #define MSM_CAM_IOCTL_SET_DROP_FRAME_NUM \ |
| 195 | _IOW(MSM_CAM_IOCTL_MAGIC, QCT_IOCTL_MAX+2, int *) |
Brian Muramatsu | 6d86949 | 2012-08-01 22:46:50 -0700 | [diff] [blame] | 196 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 197 | #define MSM_CAM_IOCTL_RETURN_FREE_FRAME \ |
| 198 | _IOR(MSM_CAM_IOCTL_MAGIC, QCT_IOCTL_MAX+3, struct msm_cam_evt_divert_frame *) |
Brian Muramatsu | 6d86949 | 2012-08-01 22:46:50 -0700 | [diff] [blame] | 199 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 200 | #define MSM_CAM_IOCTL_SET_PERF_LOCK \ |
| 201 | _IOW(MSM_CAM_IOCTL_MAGIC, QCT_IOCTL_MAX+4, int *) |
Brian Muramatsu | 6d86949 | 2012-08-01 22:46:50 -0700 | [diff] [blame] | 202 | |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 203 | struct msm_mctl_pp_cmd { |
| 204 | int32_t id; |
| 205 | uint16_t length; |
| 206 | void *value; |
| 207 | }; |
| 208 | |
| 209 | struct msm_mctl_post_proc_cmd { |
| 210 | int32_t type; |
| 211 | struct msm_mctl_pp_cmd cmd; |
| 212 | }; |
| 213 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 214 | #define MSM_CAMERA_LED_OFF 0 |
| 215 | #define MSM_CAMERA_LED_LOW 1 |
| 216 | #define MSM_CAMERA_LED_HIGH 2 |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 217 | #define MSM_CAMERA_LED_INIT 3 |
| 218 | #define MSM_CAMERA_LED_RELEASE 4 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 219 | |
| 220 | #define MSM_CAMERA_STROBE_FLASH_NONE 0 |
| 221 | #define MSM_CAMERA_STROBE_FLASH_XENON 1 |
| 222 | |
| 223 | #define MSM_MAX_CAMERA_SENSORS 5 |
| 224 | #define MAX_SENSOR_NAME 32 |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 225 | #define MAX_CAM_NAME_SIZE 32 |
| 226 | #define MAX_ACT_MOD_NAME_SIZE 32 |
| 227 | #define MAX_ACT_NAME_SIZE 32 |
| 228 | #define NUM_ACTUATOR_DIR 2 |
| 229 | #define MAX_ACTUATOR_SCENARIO 8 |
| 230 | #define MAX_ACTUATOR_REGION 5 |
| 231 | #define MAX_ACTUATOR_INIT_SET 12 |
| 232 | #define MAX_ACTUATOR_TYPE_SIZE 32 |
| 233 | #define MAX_ACTUATOR_REG_TBL_SIZE 8 |
| 234 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 235 | #define MSM_MAX_CAMERA_CONFIGS 2 |
| 236 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 237 | #define PP_SNAP 0x01 |
| 238 | #define PP_RAW_SNAP ((0x01)<<1) |
| 239 | #define PP_PREV ((0x01)<<2) |
| 240 | #define PP_THUMB ((0x01)<<3) |
Ankit Premrajka | 70613ec | 2012-01-26 16:24:23 -0800 | [diff] [blame] | 241 | #define PP_MASK (PP_SNAP|PP_RAW_SNAP|PP_PREV|PP_THUMB) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 242 | |
| 243 | #define MSM_CAM_CTRL_CMD_DONE 0 |
| 244 | #define MSM_CAM_SENSOR_VFE_CMD 1 |
| 245 | |
Kiran Kumar H N | ceea762 | 2011-08-23 14:01:03 -0700 | [diff] [blame] | 246 | #define MAX_PLANES 8 |
| 247 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 248 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 249 | struct msm_ctrl_cmd { |
| 250 | uint16_t type; |
| 251 | uint16_t length; |
| 252 | void *value; |
| 253 | uint16_t status; |
| 254 | uint32_t timeout_ms; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 255 | int resp_fd; |
| 256 | int vnode_id; |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 257 | int queue_idx; |
| 258 | uint32_t evt_id; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 259 | uint32_t stream_type; |
| 260 | int config_ident; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 261 | }; |
| 262 | |
| 263 | struct msm_cam_evt_msg { |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 264 | unsigned short type; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 265 | unsigned short msg_id; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 266 | unsigned int len; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 267 | uint32_t frame_id; |
| 268 | void *data; |
Ninad Mahimkar | ee55c19 | 2012-04-25 14:36:17 -0700 | [diff] [blame] | 269 | struct timespec timestamp; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 270 | }; |
| 271 | |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 272 | struct msm_pp_frame_sp { |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 273 | |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 274 | unsigned long phy_addr; |
| 275 | uint32_t y_off; |
| 276 | uint32_t cbcr_off; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 277 | |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 278 | uint32_t length; |
| 279 | int32_t fd; |
| 280 | uint32_t addr_offset; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 281 | |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 282 | unsigned long vaddr; |
| 283 | }; |
| 284 | |
| 285 | struct msm_pp_frame_mp { |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 286 | |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 287 | unsigned long phy_addr; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 288 | |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 289 | uint32_t data_offset; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 290 | |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 291 | uint32_t length; |
| 292 | int32_t fd; |
| 293 | uint32_t addr_offset; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 294 | |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 295 | unsigned long vaddr; |
| 296 | }; |
| 297 | |
| 298 | struct msm_pp_frame { |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 299 | uint32_t handle; |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 300 | uint32_t frame_id; |
Kevin Chan | 318d7cb | 2011-11-29 14:24:26 -0800 | [diff] [blame] | 301 | unsigned short buf_idx; |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 302 | int path; |
| 303 | unsigned short image_type; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 304 | unsigned short num_planes; |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 305 | struct timeval timestamp; |
| 306 | union { |
| 307 | struct msm_pp_frame_sp sp; |
| 308 | struct msm_pp_frame_mp mp[MAX_PLANES]; |
| 309 | }; |
Ankit Premrajka | 70613ec | 2012-01-26 16:24:23 -0800 | [diff] [blame] | 310 | int node_type; |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 311 | }; |
| 312 | |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 313 | struct msm_cam_evt_divert_frame { |
Mingcheng Zhu | 5b04d35 | 2011-07-22 21:18:42 -0700 | [diff] [blame] | 314 | unsigned short image_mode; |
| 315 | unsigned short op_mode; |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 316 | unsigned short inst_idx; |
| 317 | unsigned short node_idx; |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 318 | struct msm_pp_frame frame; |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 319 | int do_pp; |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 320 | }; |
| 321 | |
Kiran Kumar H N | 0b51780 | 2011-10-05 09:49:51 -0700 | [diff] [blame] | 322 | struct msm_mctl_pp_cmd_ack_event { |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 323 | uint32_t cmd; |
| 324 | int status; |
| 325 | uint32_t cookie; |
Kiran Kumar H N | 0b51780 | 2011-10-05 09:49:51 -0700 | [diff] [blame] | 326 | }; |
| 327 | |
| 328 | struct msm_mctl_pp_event_info { |
| 329 | int32_t event; |
| 330 | union { |
| 331 | struct msm_mctl_pp_cmd_ack_event ack; |
| 332 | }; |
| 333 | }; |
| 334 | |
| 335 | struct msm_isp_event_ctrl { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 336 | unsigned short resptype; |
| 337 | union { |
| 338 | struct msm_cam_evt_msg isp_msg; |
| 339 | struct msm_ctrl_cmd ctrl; |
Kiran Kumar H N | 0b51780 | 2011-10-05 09:49:51 -0700 | [diff] [blame] | 340 | struct msm_cam_evt_divert_frame div_frame; |
| 341 | struct msm_mctl_pp_event_info pp_event_info; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 342 | } isp_data; |
| 343 | }; |
| 344 | |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 345 | #define MSM_CAM_RESP_CTRL 0 |
| 346 | #define MSM_CAM_RESP_STAT_EVT_MSG 1 |
| 347 | #define MSM_CAM_RESP_STEREO_OP_1 2 |
| 348 | #define MSM_CAM_RESP_STEREO_OP_2 3 |
| 349 | #define MSM_CAM_RESP_V4L2 4 |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 350 | #define MSM_CAM_RESP_DIV_FRAME_EVT_MSG 5 |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 351 | #define MSM_CAM_RESP_DONE_EVENT 6 |
| 352 | #define MSM_CAM_RESP_MCTL_PP_EVENT 7 |
| 353 | #define MSM_CAM_RESP_MAX 8 |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 354 | |
Mingcheng Zhu | 270813a | 2011-08-10 17:23:18 -0700 | [diff] [blame] | 355 | #define MSM_CAM_APP_NOTIFY_EVENT 0 |
Kevin Chan | 4bb6ead | 2012-02-29 01:01:41 -0800 | [diff] [blame] | 356 | #define MSM_CAM_APP_NOTIFY_ERROR_EVENT 1 |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 357 | |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 358 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 359 | struct msm_stats_event_ctrl { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 360 | int resptype; |
| 361 | int timeout_ms; |
| 362 | struct msm_ctrl_cmd ctrl_cmd; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 363 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 364 | struct msm_cam_evt_msg stats_event; |
| 365 | }; |
| 366 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 367 | struct msm_camera_cfg_cmd { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 368 | uint16_t cfg_type; |
| 369 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 370 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 371 | uint16_t cmd_type; |
| 372 | uint16_t queue; |
| 373 | uint16_t length; |
| 374 | void *value; |
| 375 | }; |
| 376 | |
| 377 | #define CMD_GENERAL 0 |
| 378 | #define CMD_AXI_CFG_OUT1 1 |
| 379 | #define CMD_AXI_CFG_SNAP_O1_AND_O2 2 |
| 380 | #define CMD_AXI_CFG_OUT2 3 |
| 381 | #define CMD_PICT_T_AXI_CFG 4 |
| 382 | #define CMD_PICT_M_AXI_CFG 5 |
| 383 | #define CMD_RAW_PICT_AXI_CFG 6 |
| 384 | |
| 385 | #define CMD_FRAME_BUF_RELEASE 7 |
| 386 | #define CMD_PREV_BUF_CFG 8 |
| 387 | #define CMD_SNAP_BUF_RELEASE 9 |
| 388 | #define CMD_SNAP_BUF_CFG 10 |
| 389 | #define CMD_STATS_DISABLE 11 |
| 390 | #define CMD_STATS_AEC_AWB_ENABLE 12 |
| 391 | #define CMD_STATS_AF_ENABLE 13 |
| 392 | #define CMD_STATS_AEC_ENABLE 14 |
| 393 | #define CMD_STATS_AWB_ENABLE 15 |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 394 | #define CMD_STATS_ENABLE 16 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 395 | |
| 396 | #define CMD_STATS_AXI_CFG 17 |
| 397 | #define CMD_STATS_AEC_AXI_CFG 18 |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 398 | #define CMD_STATS_AF_AXI_CFG 19 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 399 | #define CMD_STATS_AWB_AXI_CFG 20 |
| 400 | #define CMD_STATS_RS_AXI_CFG 21 |
| 401 | #define CMD_STATS_CS_AXI_CFG 22 |
| 402 | #define CMD_STATS_IHIST_AXI_CFG 23 |
| 403 | #define CMD_STATS_SKIN_AXI_CFG 24 |
| 404 | |
| 405 | #define CMD_STATS_BUF_RELEASE 25 |
| 406 | #define CMD_STATS_AEC_BUF_RELEASE 26 |
| 407 | #define CMD_STATS_AF_BUF_RELEASE 27 |
| 408 | #define CMD_STATS_AWB_BUF_RELEASE 28 |
| 409 | #define CMD_STATS_RS_BUF_RELEASE 29 |
| 410 | #define CMD_STATS_CS_BUF_RELEASE 30 |
| 411 | #define CMD_STATS_IHIST_BUF_RELEASE 31 |
| 412 | #define CMD_STATS_SKIN_BUF_RELEASE 32 |
| 413 | |
| 414 | #define UPDATE_STATS_INVALID 33 |
| 415 | #define CMD_AXI_CFG_SNAP_GEMINI 34 |
| 416 | #define CMD_AXI_CFG_SNAP 35 |
| 417 | #define CMD_AXI_CFG_PREVIEW 36 |
| 418 | #define CMD_AXI_CFG_VIDEO 37 |
| 419 | |
| 420 | #define CMD_STATS_IHIST_ENABLE 38 |
| 421 | #define CMD_STATS_RS_ENABLE 39 |
| 422 | #define CMD_STATS_CS_ENABLE 40 |
| 423 | #define CMD_VPE 41 |
| 424 | #define CMD_AXI_CFG_VPE 42 |
| 425 | #define CMD_AXI_CFG_ZSL 43 |
| 426 | #define CMD_AXI_CFG_SNAP_VPE 44 |
| 427 | #define CMD_AXI_CFG_SNAP_THUMB_VPE 45 |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 428 | #define CMD_CONFIG_PING_ADDR 46 |
| 429 | #define CMD_CONFIG_PONG_ADDR 47 |
| 430 | #define CMD_CONFIG_FREE_BUF_ADDR 48 |
| 431 | #define CMD_AXI_CFG_ZSL_ALL_CHNLS 49 |
| 432 | #define CMD_AXI_CFG_VIDEO_ALL_CHNLS 50 |
Suresh Vankadara | 055cb8e | 2012-01-18 00:50:04 +0530 | [diff] [blame] | 433 | #define CMD_VFE_BUFFER_RELEASE 51 |
Kevin Chan | cf26486 | 2012-04-19 19:10:38 -0700 | [diff] [blame] | 434 | #define CMD_VFE_PROCESS_IRQ 52 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 435 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 436 | #define CMD_AXI_CFG_PRIM 0xF1 |
| 437 | #define CMD_AXI_CFG_PRIM_ALL_CHNLS 0xF2 |
| 438 | #define CMD_AXI_CFG_SEC 0xF4 |
| 439 | #define CMD_AXI_CFG_SEC_ALL_CHNLS 0xF8 |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 440 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 441 | struct msm_vfe_cfg_cmd { |
| 442 | int cmd_type; |
| 443 | uint16_t length; |
| 444 | void *value; |
| 445 | }; |
| 446 | |
| 447 | struct msm_vpe_cfg_cmd { |
| 448 | int cmd_type; |
| 449 | uint16_t length; |
| 450 | void *value; |
| 451 | }; |
| 452 | |
| 453 | #define MAX_CAMERA_ENABLE_NAME_LEN 32 |
| 454 | struct camera_enable_cmd { |
| 455 | char name[MAX_CAMERA_ENABLE_NAME_LEN]; |
| 456 | }; |
| 457 | |
| 458 | #define MSM_PMEM_OUTPUT1 0 |
| 459 | #define MSM_PMEM_OUTPUT2 1 |
| 460 | #define MSM_PMEM_OUTPUT1_OUTPUT2 2 |
| 461 | #define MSM_PMEM_THUMBNAIL 3 |
| 462 | #define MSM_PMEM_MAINIMG 4 |
| 463 | #define MSM_PMEM_RAW_MAINIMG 5 |
| 464 | #define MSM_PMEM_AEC_AWB 6 |
| 465 | #define MSM_PMEM_AF 7 |
| 466 | #define MSM_PMEM_AEC 8 |
| 467 | #define MSM_PMEM_AWB 9 |
| 468 | #define MSM_PMEM_RS 10 |
| 469 | #define MSM_PMEM_CS 11 |
| 470 | #define MSM_PMEM_IHIST 12 |
| 471 | #define MSM_PMEM_SKIN 13 |
| 472 | #define MSM_PMEM_VIDEO 14 |
| 473 | #define MSM_PMEM_PREVIEW 15 |
| 474 | #define MSM_PMEM_VIDEO_VPE 16 |
| 475 | #define MSM_PMEM_C2D 17 |
| 476 | #define MSM_PMEM_MAINIMG_VPE 18 |
| 477 | #define MSM_PMEM_THUMBNAIL_VPE 19 |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 478 | #define MSM_PMEM_MAX 20 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 479 | |
| 480 | #define STAT_AEAW 0 |
| 481 | #define STAT_AEC 1 |
| 482 | #define STAT_AF 2 |
| 483 | #define STAT_AWB 3 |
| 484 | #define STAT_RS 4 |
| 485 | #define STAT_CS 5 |
| 486 | #define STAT_IHIST 6 |
| 487 | #define STAT_SKIN 7 |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 488 | #define STAT_MAX 8 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 489 | |
| 490 | #define FRAME_PREVIEW_OUTPUT1 0 |
| 491 | #define FRAME_PREVIEW_OUTPUT2 1 |
| 492 | #define FRAME_SNAPSHOT 2 |
| 493 | #define FRAME_THUMBNAIL 3 |
| 494 | #define FRAME_RAW_SNAPSHOT 4 |
| 495 | #define FRAME_MAX 5 |
| 496 | |
| 497 | struct msm_pmem_info { |
| 498 | int type; |
| 499 | int fd; |
| 500 | void *vaddr; |
| 501 | uint32_t offset; |
| 502 | uint32_t len; |
Kiran Kumar H N | 5a19c68 | 2011-07-23 11:34:34 -0700 | [diff] [blame] | 503 | uint32_t y_off; |
| 504 | uint32_t cbcr_off; |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 505 | uint32_t planar0_off; |
| 506 | uint32_t planar1_off; |
| 507 | uint32_t planar2_off; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 508 | uint8_t active; |
| 509 | }; |
| 510 | |
| 511 | struct outputCfg { |
| 512 | uint32_t height; |
| 513 | uint32_t width; |
| 514 | |
| 515 | uint32_t window_height_firstline; |
| 516 | uint32_t window_height_lastline; |
| 517 | }; |
| 518 | |
Ankit Premrajka | 70613ec | 2012-01-26 16:24:23 -0800 | [diff] [blame] | 519 | #define VIDEO_NODE 0 |
| 520 | #define MCTL_NODE 1 |
| 521 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 522 | #define OUTPUT_1 0 |
| 523 | #define OUTPUT_2 1 |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 524 | #define OUTPUT_1_AND_2 2 |
| 525 | #define OUTPUT_1_AND_3 3 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 526 | #define CAMIF_TO_AXI_VIA_OUTPUT_2 4 |
| 527 | #define OUTPUT_1_AND_CAMIF_TO_AXI_VIA_OUTPUT_2 5 |
| 528 | #define OUTPUT_2_AND_CAMIF_TO_AXI_VIA_OUTPUT_1 6 |
| 529 | #define OUTPUT_1_2_AND_3 7 |
Kiran Kumar H N | 4cff94a | 2011-10-17 11:37:33 -0700 | [diff] [blame] | 530 | #define OUTPUT_ALL_CHNLS 8 |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 531 | #define OUTPUT_VIDEO_ALL_CHNLS 9 |
| 532 | #define OUTPUT_ZSL_ALL_CHNLS 10 |
| 533 | #define LAST_AXI_OUTPUT_MODE_ENUM = OUTPUT_ZSL_ALL_CHNLS |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 534 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 535 | #define OUTPUT_PRIM 0xF1 |
| 536 | #define OUTPUT_PRIM_ALL_CHNLS 0xF2 |
| 537 | #define OUTPUT_SEC 0xF4 |
| 538 | #define OUTPUT_SEC_ALL_CHNLS 0xF8 |
| 539 | |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 540 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 541 | #define MSM_FRAME_PREV_1 0 |
| 542 | #define MSM_FRAME_PREV_2 1 |
| 543 | #define MSM_FRAME_ENC 2 |
| 544 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 545 | #define OUTPUT_TYPE_P (1<<0) |
| 546 | #define OUTPUT_TYPE_T (1<<1) |
| 547 | #define OUTPUT_TYPE_S (1<<2) |
| 548 | #define OUTPUT_TYPE_V (1<<3) |
| 549 | #define OUTPUT_TYPE_L (1<<4) |
| 550 | #define OUTPUT_TYPE_ST_L (1<<5) |
| 551 | #define OUTPUT_TYPE_ST_R (1<<6) |
| 552 | #define OUTPUT_TYPE_ST_D (1<<7) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 553 | |
| 554 | struct fd_roi_info { |
| 555 | void *info; |
| 556 | int info_len; |
| 557 | }; |
| 558 | |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 559 | struct msm_mem_map_info { |
| 560 | uint32_t cookie; |
| 561 | uint32_t length; |
Mingcheng Zhu | fe7abc0 | 2011-08-09 13:27:39 -0700 | [diff] [blame] | 562 | uint32_t mem_type; |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 563 | }; |
| 564 | |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 565 | #define MSM_MEM_MMAP 0 |
| 566 | #define MSM_MEM_USERPTR 1 |
| 567 | #define MSM_PLANE_MAX 8 |
| 568 | #define MSM_PLANE_Y 0 |
| 569 | #define MSM_PLANE_UV 1 |
| 570 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 571 | struct msm_frame { |
| 572 | struct timespec ts; |
| 573 | int path; |
| 574 | int type; |
| 575 | unsigned long buffer; |
| 576 | uint32_t phy_offset; |
Kiran Kumar H N | 5a19c68 | 2011-07-23 11:34:34 -0700 | [diff] [blame] | 577 | uint32_t y_off; |
| 578 | uint32_t cbcr_off; |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 579 | uint32_t planar0_off; |
| 580 | uint32_t planar1_off; |
| 581 | uint32_t planar2_off; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 582 | int fd; |
| 583 | |
| 584 | void *cropinfo; |
| 585 | int croplen; |
| 586 | uint32_t error_code; |
| 587 | struct fd_roi_info roi_info; |
| 588 | uint32_t frame_id; |
| 589 | int stcam_quality_ind; |
| 590 | uint32_t stcam_conv_value; |
Ankit Premrajka | 3e90b9f | 2011-11-01 18:48:45 -0700 | [diff] [blame] | 591 | |
| 592 | struct ion_allocation_data ion_alloc; |
| 593 | struct ion_fd_data fd_data; |
Ankit Premrajka | e2c9c0b | 2012-06-07 17:18:25 -0700 | [diff] [blame] | 594 | int ion_dev_fd; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 595 | }; |
| 596 | |
| 597 | enum msm_st_frame_packing { |
| 598 | SIDE_BY_SIDE_HALF, |
| 599 | SIDE_BY_SIDE_FULL, |
| 600 | TOP_DOWN_HALF, |
| 601 | TOP_DOWN_FULL, |
| 602 | }; |
| 603 | |
| 604 | struct msm_st_crop { |
| 605 | uint32_t in_w; |
| 606 | uint32_t in_h; |
| 607 | uint32_t out_w; |
| 608 | uint32_t out_h; |
| 609 | }; |
| 610 | |
| 611 | struct msm_st_half { |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 612 | uint32_t buf_p0_off; |
| 613 | uint32_t buf_p1_off; |
| 614 | uint32_t buf_p0_stride; |
| 615 | uint32_t buf_p1_stride; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 616 | uint32_t pix_x_off; |
| 617 | uint32_t pix_y_off; |
| 618 | struct msm_st_crop stCropInfo; |
| 619 | }; |
| 620 | |
| 621 | struct msm_st_frame { |
| 622 | struct msm_frame buf_info; |
| 623 | int type; |
| 624 | enum msm_st_frame_packing packing; |
| 625 | struct msm_st_half L; |
| 626 | struct msm_st_half R; |
| 627 | int frame_id; |
| 628 | }; |
| 629 | |
| 630 | #define MSM_CAMERA_ERR_MASK (0xFFFFFFFF & 1) |
| 631 | |
| 632 | struct stats_buff { |
| 633 | unsigned long buff; |
| 634 | int fd; |
| 635 | }; |
| 636 | |
| 637 | struct msm_stats_buf { |
Lakshmi Narayana Kalavala | 4ab97a9 | 2011-07-26 15:30:14 -0700 | [diff] [blame] | 638 | uint8_t awb_ymin; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 639 | struct stats_buff aec; |
| 640 | struct stats_buff awb; |
| 641 | struct stats_buff af; |
| 642 | struct stats_buff ihist; |
| 643 | struct stats_buff rs; |
| 644 | struct stats_buff cs; |
| 645 | struct stats_buff skin; |
| 646 | int type; |
| 647 | uint32_t status_bits; |
| 648 | unsigned long buffer; |
| 649 | int fd; |
Ankit Premrajka | 073e0ca | 2012-03-06 12:26:08 -0800 | [diff] [blame] | 650 | int length; |
| 651 | struct ion_handle *handle; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 652 | uint32_t frame_id; |
| 653 | }; |
| 654 | #define MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT 0 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 655 | #define MSM_V4L2_EXT_CAPTURE_MODE_PREVIEW \ |
| 656 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+1) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 657 | #define MSM_V4L2_EXT_CAPTURE_MODE_VIDEO \ |
| 658 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+2) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 659 | #define MSM_V4L2_EXT_CAPTURE_MODE_MAIN (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+3) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 660 | #define MSM_V4L2_EXT_CAPTURE_MODE_THUMBNAIL \ |
| 661 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+4) |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 662 | #define MSM_V4L2_EXT_CAPTURE_MODE_RAW \ |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 663 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+5) |
| 664 | #define MSM_V4L2_EXT_CAPTURE_MODE_MAX (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+6) |
| 665 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 666 | |
| 667 | #define MSM_V4L2_PID_MOTION_ISO V4L2_CID_PRIVATE_BASE |
| 668 | #define MSM_V4L2_PID_EFFECT (V4L2_CID_PRIVATE_BASE+1) |
| 669 | #define MSM_V4L2_PID_HJR (V4L2_CID_PRIVATE_BASE+2) |
| 670 | #define MSM_V4L2_PID_LED_MODE (V4L2_CID_PRIVATE_BASE+3) |
| 671 | #define MSM_V4L2_PID_PREP_SNAPSHOT (V4L2_CID_PRIVATE_BASE+4) |
| 672 | #define MSM_V4L2_PID_EXP_METERING (V4L2_CID_PRIVATE_BASE+5) |
| 673 | #define MSM_V4L2_PID_ISO (V4L2_CID_PRIVATE_BASE+6) |
| 674 | #define MSM_V4L2_PID_CAM_MODE (V4L2_CID_PRIVATE_BASE+7) |
| 675 | #define MSM_V4L2_PID_LUMA_ADAPTATION (V4L2_CID_PRIVATE_BASE+8) |
| 676 | #define MSM_V4L2_PID_BEST_SHOT (V4L2_CID_PRIVATE_BASE+9) |
| 677 | #define MSM_V4L2_PID_FOCUS_MODE (V4L2_CID_PRIVATE_BASE+10) |
| 678 | #define MSM_V4L2_PID_BL_DETECTION (V4L2_CID_PRIVATE_BASE+11) |
| 679 | #define MSM_V4L2_PID_SNOW_DETECTION (V4L2_CID_PRIVATE_BASE+12) |
| 680 | #define MSM_V4L2_PID_CTRL_CMD (V4L2_CID_PRIVATE_BASE+13) |
| 681 | #define MSM_V4L2_PID_EVT_SUB_INFO (V4L2_CID_PRIVATE_BASE+14) |
Mingcheng Zhu | 5b04d35 | 2011-07-22 21:18:42 -0700 | [diff] [blame] | 682 | #define MSM_V4L2_PID_STROBE_FLASH (V4L2_CID_PRIVATE_BASE+15) |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 683 | #define MSM_V4L2_PID_MMAP_ENTRY (V4L2_CID_PRIVATE_BASE+16) |
Mingcheng Zhu | 5b04d35 | 2011-07-22 21:18:42 -0700 | [diff] [blame] | 684 | #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] | 685 | #define MSM_V4L2_PID_PP_PLANE_INFO (V4L2_CID_PRIVATE_BASE+18) |
| 686 | #define MSM_V4L2_PID_MAX MSM_V4L2_PID_PP_PLANE_INFO |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 687 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 688 | #define MSM_V4L2_CAM_OP_DEFAULT 0 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 689 | #define MSM_V4L2_CAM_OP_PREVIEW (MSM_V4L2_CAM_OP_DEFAULT+1) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 690 | #define MSM_V4L2_CAM_OP_VIDEO (MSM_V4L2_CAM_OP_DEFAULT+2) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 691 | #define MSM_V4L2_CAM_OP_CAPTURE (MSM_V4L2_CAM_OP_DEFAULT+3) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 692 | #define MSM_V4L2_CAM_OP_ZSL (MSM_V4L2_CAM_OP_DEFAULT+4) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 693 | #define MSM_V4L2_CAM_OP_RAW (MSM_V4L2_CAM_OP_DEFAULT+5) |
Jignesh Mehta | 6cf8a74 | 2012-02-04 23:40:50 -0800 | [diff] [blame] | 694 | #define MSM_V4L2_CAM_OP_JPEG_CAPTURE (MSM_V4L2_CAM_OP_DEFAULT+6) |
| 695 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 696 | |
| 697 | #define MSM_V4L2_VID_CAP_TYPE 0 |
| 698 | #define MSM_V4L2_STREAM_ON 1 |
| 699 | #define MSM_V4L2_STREAM_OFF 2 |
| 700 | #define MSM_V4L2_SNAPSHOT 3 |
| 701 | #define MSM_V4L2_QUERY_CTRL 4 |
| 702 | #define MSM_V4L2_GET_CTRL 5 |
| 703 | #define MSM_V4L2_SET_CTRL 6 |
| 704 | #define MSM_V4L2_QUERY 7 |
| 705 | #define MSM_V4L2_GET_CROP 8 |
| 706 | #define MSM_V4L2_SET_CROP 9 |
| 707 | #define MSM_V4L2_OPEN 10 |
| 708 | #define MSM_V4L2_CLOSE 11 |
| 709 | #define MSM_V4L2_SET_CTRL_CMD 12 |
| 710 | #define MSM_V4L2_EVT_SUB_MASK 13 |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 711 | #define MSM_V4L2_MAX 14 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 712 | #define V4L2_CAMERA_EXIT 43 |
| 713 | |
| 714 | struct crop_info { |
| 715 | void *info; |
| 716 | int len; |
| 717 | }; |
| 718 | |
| 719 | struct msm_postproc { |
| 720 | int ftnum; |
| 721 | struct msm_frame fthumnail; |
| 722 | int fmnum; |
| 723 | struct msm_frame fmain; |
| 724 | }; |
| 725 | |
| 726 | struct msm_snapshot_pp_status { |
| 727 | void *status; |
| 728 | }; |
| 729 | |
| 730 | #define CFG_SET_MODE 0 |
| 731 | #define CFG_SET_EFFECT 1 |
| 732 | #define CFG_START 2 |
| 733 | #define CFG_PWR_UP 3 |
| 734 | #define CFG_PWR_DOWN 4 |
| 735 | #define CFG_WRITE_EXPOSURE_GAIN 5 |
| 736 | #define CFG_SET_DEFAULT_FOCUS 6 |
| 737 | #define CFG_MOVE_FOCUS 7 |
| 738 | #define CFG_REGISTER_TO_REAL_GAIN 8 |
| 739 | #define CFG_REAL_TO_REGISTER_GAIN 9 |
| 740 | #define CFG_SET_FPS 10 |
| 741 | #define CFG_SET_PICT_FPS 11 |
| 742 | #define CFG_SET_BRIGHTNESS 12 |
| 743 | #define CFG_SET_CONTRAST 13 |
| 744 | #define CFG_SET_ZOOM 14 |
| 745 | #define CFG_SET_EXPOSURE_MODE 15 |
| 746 | #define CFG_SET_WB 16 |
| 747 | #define CFG_SET_ANTIBANDING 17 |
| 748 | #define CFG_SET_EXP_GAIN 18 |
| 749 | #define CFG_SET_PICT_EXP_GAIN 19 |
| 750 | #define CFG_SET_LENS_SHADING 20 |
| 751 | #define CFG_GET_PICT_FPS 21 |
| 752 | #define CFG_GET_PREV_L_PF 22 |
| 753 | #define CFG_GET_PREV_P_PL 23 |
| 754 | #define CFG_GET_PICT_L_PF 24 |
| 755 | #define CFG_GET_PICT_P_PL 25 |
| 756 | #define CFG_GET_AF_MAX_STEPS 26 |
| 757 | #define CFG_GET_PICT_MAX_EXP_LC 27 |
| 758 | #define CFG_SEND_WB_INFO 28 |
| 759 | #define CFG_SENSOR_INIT 29 |
| 760 | #define CFG_GET_3D_CALI_DATA 30 |
| 761 | #define CFG_GET_CALIB_DATA 31 |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 762 | #define CFG_GET_OUTPUT_INFO 32 |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 763 | #define CFG_GET_EEPROM_DATA 33 |
| 764 | #define CFG_SET_ACTUATOR_INFO 34 |
| 765 | #define CFG_GET_ACTUATOR_INFO 35 |
| 766 | #define CFG_SET_SATURATION 36 |
| 767 | #define CFG_SET_SHARPNESS 37 |
| 768 | #define CFG_SET_TOUCHAEC 38 |
| 769 | #define CFG_SET_AUTO_FOCUS 39 |
| 770 | #define CFG_SET_AUTOFLASH 40 |
| 771 | #define CFG_SET_EXPOSURE_COMPENSATION 41 |
| 772 | #define CFG_SET_ISO 42 |
| 773 | #if 1 |
| 774 | #define CFG_SET_OV_LSC_RAW_CAPTURE 43 |
| 775 | #define CFG_SET_COORDINATE 44 |
| 776 | #define CFG_RUN_AUTO_FOCUS 45 |
| 777 | #define CFG_CANCEL_AUTO_FOCUS 46 |
| 778 | #define CFG_GET_EXP_FOR_LED 47 |
| 779 | #define CFG_UPDATE_AEC_FOR_LED 48 |
| 780 | #define CFG_SET_FRONT_CAMERA_MODE 49 |
| 781 | #define CFG_SET_QCT_LSC_RAW_CAPTURE 50 |
| 782 | #define CFG_SET_QTR_SIZE_MODE 51 |
| 783 | #define CFG_GET_AF_STATE 52 |
| 784 | #define CFG_SET_DMODE 53 |
| 785 | #define CFG_SET_CALIBRATION 54 |
| 786 | #define CFG_SET_AF_MODE 55 |
| 787 | #define CFG_GET_SP3D_L_FRAME 56 |
| 788 | #define CFG_GET_SP3D_R_FRAME 57 |
| 789 | #define CFG_SET_FLASHLIGHT 58 |
| 790 | #define CFG_SET_FLASHLIGHT_EXP_DIV 59 |
| 791 | #define CFG_GET_ISO 60 |
| 792 | #define CFG_GET_EXP_GAIN 61 |
| 793 | #define CFG_SET_FRAMERATE 62 |
| 794 | #endif |
| 795 | #define CFG_GET_ACTUATOR_CURR_STEP_POS 63 |
| 796 | #define CFG_GET_VCM_OPTIMIZED_POSITIONS 64 |
| 797 | #define CFG_MAX 65 |
Lokesh Kumar Aakulu | 893778c | 2013-03-02 05:29:44 +0530 | [diff] [blame] | 798 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 799 | #define CFG_I2C_IOCTL_R_OTP 70 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 800 | |
| 801 | #define MOVE_NEAR 0 |
| 802 | #define MOVE_FAR 1 |
| 803 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 804 | #define SENSOR_PREVIEW_MODE 0 |
| 805 | #define SENSOR_SNAPSHOT_MODE 1 |
| 806 | #define SENSOR_RAW_SNAPSHOT_MODE 2 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 807 | #define SENSOR_HFR_60FPS_MODE 3 |
| 808 | #define SENSOR_HFR_90FPS_MODE 4 |
| 809 | #define SENSOR_HFR_120FPS_MODE 5 |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 810 | #define SENSOR_PREVIEW_MODE_WIDE 6 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 811 | |
| 812 | #define SENSOR_QTR_SIZE 0 |
| 813 | #define SENSOR_FULL_SIZE 1 |
| 814 | #define SENSOR_QVGA_SIZE 2 |
| 815 | #define SENSOR_INVALID_SIZE 3 |
| 816 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 817 | #define CAMERA_EFFECT_OFF 0 |
| 818 | #define CAMERA_EFFECT_MONO 1 |
| 819 | #define CAMERA_EFFECT_NEGATIVE 2 |
| 820 | #define CAMERA_EFFECT_SOLARIZE 3 |
| 821 | #define CAMERA_EFFECT_SEPIA 4 |
| 822 | #define CAMERA_EFFECT_POSTERIZE 5 |
| 823 | #define CAMERA_EFFECT_WHITEBOARD 6 |
| 824 | #define CAMERA_EFFECT_BLACKBOARD 7 |
| 825 | #define CAMERA_EFFECT_AQUA 8 |
| 826 | #define CAMERA_EFFECT_EMBOSS 9 |
| 827 | #define CAMERA_EFFECT_SKETCH 10 |
| 828 | #define CAMERA_EFFECT_NEON 11 |
| 829 | #define CAMERA_EFFECT_MAX 12 |
| 830 | |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 831 | #define CAMERA_EFFECT_BW 10 |
| 832 | #define CAMERA_EFFECT_BLUISH 12 |
| 833 | #define CAMERA_EFFECT_REDDISH 13 |
| 834 | #define CAMERA_EFFECT_GREENISH 14 |
| 835 | |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 836 | #define CAMERA_ANTIBANDING_OFF 0 |
| 837 | #define CAMERA_ANTIBANDING_50HZ 2 |
| 838 | #define CAMERA_ANTIBANDING_60HZ 1 |
| 839 | #define CAMERA_ANTIBANDING_AUTO 3 |
| 840 | |
| 841 | #define CAMERA_CONTRAST_LV0 0 |
| 842 | #define CAMERA_CONTRAST_LV1 1 |
| 843 | #define CAMERA_CONTRAST_LV2 2 |
| 844 | #define CAMERA_CONTRAST_LV3 3 |
| 845 | #define CAMERA_CONTRAST_LV4 4 |
| 846 | #define CAMERA_CONTRAST_LV5 5 |
| 847 | #define CAMERA_CONTRAST_LV6 6 |
| 848 | #define CAMERA_CONTRAST_LV7 7 |
| 849 | #define CAMERA_CONTRAST_LV8 8 |
| 850 | #define CAMERA_CONTRAST_LV9 9 |
| 851 | |
| 852 | #define CAMERA_BRIGHTNESS_LV0 0 |
| 853 | #define CAMERA_BRIGHTNESS_LV1 1 |
| 854 | #define CAMERA_BRIGHTNESS_LV2 2 |
| 855 | #define CAMERA_BRIGHTNESS_LV3 3 |
| 856 | #define CAMERA_BRIGHTNESS_LV4 4 |
| 857 | #define CAMERA_BRIGHTNESS_LV5 5 |
| 858 | #define CAMERA_BRIGHTNESS_LV6 6 |
| 859 | #define CAMERA_BRIGHTNESS_LV7 7 |
| 860 | #define CAMERA_BRIGHTNESS_LV8 8 |
| 861 | |
| 862 | |
| 863 | #define CAMERA_SATURATION_LV0 0 |
| 864 | #define CAMERA_SATURATION_LV1 1 |
| 865 | #define CAMERA_SATURATION_LV2 2 |
| 866 | #define CAMERA_SATURATION_LV3 3 |
| 867 | #define CAMERA_SATURATION_LV4 4 |
| 868 | #define CAMERA_SATURATION_LV5 5 |
| 869 | #define CAMERA_SATURATION_LV6 6 |
| 870 | #define CAMERA_SATURATION_LV7 7 |
| 871 | #define CAMERA_SATURATION_LV8 8 |
| 872 | |
| 873 | #define CAMERA_SHARPNESS_LV0 0 |
| 874 | #define CAMERA_SHARPNESS_LV1 3 |
| 875 | #define CAMERA_SHARPNESS_LV2 6 |
| 876 | #define CAMERA_SHARPNESS_LV3 9 |
| 877 | #define CAMERA_SHARPNESS_LV4 12 |
| 878 | #define CAMERA_SHARPNESS_LV5 15 |
| 879 | #define CAMERA_SHARPNESS_LV6 18 |
| 880 | #define CAMERA_SHARPNESS_LV7 21 |
| 881 | #define CAMERA_SHARPNESS_LV8 24 |
| 882 | #define CAMERA_SHARPNESS_LV9 27 |
| 883 | #define CAMERA_SHARPNESS_LV10 30 |
| 884 | |
| 885 | #define CAMERA_SETAE_AVERAGE 0 |
| 886 | #define CAMERA_SETAE_CENWEIGHT 1 |
| 887 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 888 | #define CAMERA_WB_AUTO 1 |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 889 | #define CAMERA_WB_CUSTOM 2 |
| 890 | #define CAMERA_WB_INCANDESCENT 3 |
| 891 | #define CAMERA_WB_FLUORESCENT 4 |
| 892 | #define CAMERA_WB_DAYLIGHT 5 |
| 893 | #define CAMERA_WB_CLOUDY_DAYLIGHT 6 |
| 894 | #define CAMERA_WB_TWILIGHT 7 |
| 895 | #define CAMERA_WB_SHADE 8 |
| 896 | |
| 897 | #define CAMERA_EXPOSURE_COMPENSATION_LV0 12 |
| 898 | #define CAMERA_EXPOSURE_COMPENSATION_LV1 6 |
| 899 | #define CAMERA_EXPOSURE_COMPENSATION_LV2 0 |
| 900 | #define CAMERA_EXPOSURE_COMPENSATION_LV3 -6 |
| 901 | #define CAMERA_EXPOSURE_COMPENSATION_LV4 -12 |
| 902 | |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 903 | enum msm_v4l2_saturation_level { |
| 904 | MSM_V4L2_SATURATION_L0, |
| 905 | MSM_V4L2_SATURATION_L1, |
| 906 | MSM_V4L2_SATURATION_L2, |
| 907 | MSM_V4L2_SATURATION_L3, |
| 908 | MSM_V4L2_SATURATION_L4, |
| 909 | MSM_V4L2_SATURATION_L5, |
| 910 | MSM_V4L2_SATURATION_L6, |
| 911 | MSM_V4L2_SATURATION_L7, |
| 912 | MSM_V4L2_SATURATION_L8, |
| 913 | MSM_V4L2_SATURATION_L9, |
| 914 | MSM_V4L2_SATURATION_L10, |
| 915 | }; |
Suresh Vankadara | 212d972 | 2012-05-30 15:51:20 +0530 | [diff] [blame] | 916 | enum msm_v4l2_contrast_level { |
| 917 | MSM_V4L2_CONTRAST_L0, |
| 918 | MSM_V4L2_CONTRAST_L1, |
| 919 | MSM_V4L2_CONTRAST_L2, |
| 920 | MSM_V4L2_CONTRAST_L3, |
| 921 | MSM_V4L2_CONTRAST_L4, |
| 922 | MSM_V4L2_CONTRAST_L5, |
| 923 | MSM_V4L2_CONTRAST_L6, |
| 924 | MSM_V4L2_CONTRAST_L7, |
| 925 | MSM_V4L2_CONTRAST_L8, |
| 926 | MSM_V4L2_CONTRAST_L9, |
| 927 | MSM_V4L2_CONTRAST_L10, |
| 928 | }; |
| 929 | |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 930 | enum msm_v4l2_exposure_level { |
| 931 | MSM_V4L2_EXPOSURE_N2, |
| 932 | MSM_V4L2_EXPOSURE_N1, |
| 933 | MSM_V4L2_EXPOSURE_D, |
| 934 | MSM_V4L2_EXPOSURE_P1, |
| 935 | MSM_V4L2_EXPOSURE_P2, |
| 936 | }; |
| 937 | |
| 938 | enum msm_v4l2_sharpness_level { |
| 939 | MSM_V4L2_SHARPNESS_L0, |
| 940 | MSM_V4L2_SHARPNESS_L1, |
| 941 | MSM_V4L2_SHARPNESS_L2, |
| 942 | MSM_V4L2_SHARPNESS_L3, |
| 943 | MSM_V4L2_SHARPNESS_L4, |
| 944 | MSM_V4L2_SHARPNESS_L5, |
| 945 | MSM_V4L2_SHARPNESS_L6, |
| 946 | }; |
| 947 | |
| 948 | enum msm_v4l2_expo_metering_mode { |
| 949 | MSM_V4L2_EXP_FRAME_AVERAGE, |
| 950 | MSM_V4L2_EXP_CENTER_WEIGHTED, |
| 951 | MSM_V4L2_EXP_SPOT_METERING, |
| 952 | }; |
| 953 | |
| 954 | enum msm_v4l2_iso_mode { |
| 955 | MSM_V4L2_ISO_AUTO = 0, |
| 956 | MSM_V4L2_ISO_DEBLUR, |
| 957 | MSM_V4L2_ISO_100, |
| 958 | MSM_V4L2_ISO_200, |
| 959 | MSM_V4L2_ISO_400, |
| 960 | MSM_V4L2_ISO_800, |
| 961 | MSM_V4L2_ISO_1600, |
| 962 | }; |
| 963 | |
| 964 | enum msm_v4l2_wb_mode { |
Suresh Vankadara | 212d972 | 2012-05-30 15:51:20 +0530 | [diff] [blame] | 965 | MSM_V4L2_WB_OFF, |
| 966 | MSM_V4L2_WB_AUTO , |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 967 | MSM_V4L2_WB_CUSTOM, |
| 968 | MSM_V4L2_WB_INCANDESCENT, |
| 969 | MSM_V4L2_WB_FLUORESCENT, |
| 970 | MSM_V4L2_WB_DAYLIGHT, |
| 971 | MSM_V4L2_WB_CLOUDY_DAYLIGHT, |
Suresh Vankadara | 212d972 | 2012-05-30 15:51:20 +0530 | [diff] [blame] | 972 | }; |
| 973 | |
| 974 | enum msm_v4l2_special_effect { |
| 975 | MSM_V4L2_EFFECT_OFF, |
| 976 | MSM_V4L2_EFFECT_MONO, |
| 977 | MSM_V4L2_EFFECT_NEGATIVE, |
| 978 | MSM_V4L2_EFFECT_SOLARIZE, |
| 979 | MSM_V4L2_EFFECT_SEPIA, |
| 980 | MSM_V4L2_EFFECT_POSTERAIZE, |
| 981 | MSM_V4L2_EFFECT_WHITEBOARD, |
| 982 | MSM_V4L2_EFFECT_BLACKBOARD, |
| 983 | MSM_V4L2_EFFECT_AQUA, |
| 984 | MSM_V4L2_EFFECT_EMBOSS, |
| 985 | MSM_V4L2_EFFECT_SKETCH, |
| 986 | MSM_V4L2_EFFECT_NEON, |
| 987 | MSM_V4L2_EFFECT_MAX, |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 988 | }; |
| 989 | |
| 990 | enum msm_v4l2_power_line_frequency { |
| 991 | MSM_V4L2_POWER_LINE_OFF, |
| 992 | MSM_V4L2_POWER_LINE_60HZ, |
| 993 | MSM_V4L2_POWER_LINE_50HZ, |
| 994 | MSM_V4L2_POWER_LINE_AUTO, |
| 995 | }; |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 996 | |
Su Liu | 6c3bb32 | 2012-02-14 02:15:05 +0530 | [diff] [blame] | 997 | #define CAMERA_ISO_TYPE_AUTO 0 |
| 998 | #define CAMEAR_ISO_TYPE_HJR 1 |
| 999 | #define CAMEAR_ISO_TYPE_100 2 |
| 1000 | #define CAMERA_ISO_TYPE_200 3 |
| 1001 | #define CAMERA_ISO_TYPE_400 4 |
| 1002 | #define CAMEAR_ISO_TYPE_800 5 |
| 1003 | #define CAMERA_ISO_TYPE_1600 6 |
| 1004 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1005 | struct sensor_pict_fps { |
| 1006 | uint16_t prevfps; |
| 1007 | uint16_t pictfps; |
| 1008 | }; |
| 1009 | |
| 1010 | struct exp_gain_cfg { |
| 1011 | uint16_t gain; |
| 1012 | uint32_t line; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1013 | uint16_t dig_gain; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1014 | }; |
| 1015 | |
| 1016 | struct focus_cfg { |
| 1017 | int32_t steps; |
| 1018 | int dir; |
| 1019 | }; |
| 1020 | |
| 1021 | struct fps_cfg { |
| 1022 | uint16_t f_mult; |
| 1023 | uint16_t fps_div; |
| 1024 | uint32_t pict_fps_div; |
| 1025 | }; |
| 1026 | struct wb_info_cfg { |
| 1027 | uint16_t red_gain; |
| 1028 | uint16_t green_gain; |
| 1029 | uint16_t blue_gain; |
| 1030 | }; |
| 1031 | struct sensor_3d_exp_cfg { |
| 1032 | uint16_t gain; |
| 1033 | uint32_t line; |
| 1034 | uint16_t r_gain; |
| 1035 | uint16_t b_gain; |
| 1036 | uint16_t gr_gain; |
| 1037 | uint16_t gb_gain; |
| 1038 | uint16_t gain_adjust; |
| 1039 | }; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1040 | struct sensor_3d_cali_data_t{ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1041 | unsigned char left_p_matrix[3][4][8]; |
| 1042 | unsigned char right_p_matrix[3][4][8]; |
| 1043 | unsigned char square_len[8]; |
| 1044 | unsigned char focal_len[8]; |
| 1045 | unsigned char pixel_pitch[8]; |
| 1046 | uint16_t left_r; |
| 1047 | uint16_t left_b; |
| 1048 | uint16_t left_gb; |
| 1049 | uint16_t left_af_far; |
| 1050 | uint16_t left_af_mid; |
| 1051 | uint16_t left_af_short; |
| 1052 | uint16_t left_af_5um; |
| 1053 | uint16_t left_af_50up; |
| 1054 | uint16_t left_af_50down; |
| 1055 | uint16_t right_r; |
| 1056 | uint16_t right_b; |
| 1057 | uint16_t right_gb; |
| 1058 | uint16_t right_af_far; |
| 1059 | uint16_t right_af_mid; |
| 1060 | uint16_t right_af_short; |
| 1061 | uint16_t right_af_5um; |
| 1062 | uint16_t right_af_50up; |
| 1063 | uint16_t right_af_50down; |
| 1064 | }; |
| 1065 | struct sensor_init_cfg { |
| 1066 | uint8_t prev_res; |
| 1067 | uint8_t pict_res; |
| 1068 | }; |
| 1069 | |
| 1070 | struct sensor_calib_data { |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1071 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1072 | uint16_t r_over_g; |
| 1073 | uint16_t b_over_g; |
| 1074 | uint16_t gr_over_gb; |
| 1075 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1076 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1077 | uint16_t macro_2_inf; |
| 1078 | uint16_t inf_2_macro; |
| 1079 | uint16_t stroke_amt; |
| 1080 | uint16_t af_pos_1m; |
| 1081 | uint16_t af_pos_inf; |
| 1082 | }; |
| 1083 | |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1084 | enum msm_sensor_resolution_t { |
Kevin Chan | 36e2bdc | 2011-08-30 17:21:21 -0700 | [diff] [blame] | 1085 | MSM_SENSOR_RES_FULL, |
| 1086 | MSM_SENSOR_RES_QTR, |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1087 | MSM_SENSOR_RES_VIDEO, |
| 1088 | MSM_SENSOR_RES_VIDEO_HFR, |
| 1089 | MSM_SENSOR_RES_16_9, |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1090 | MSM_SENSOR_RES_2, |
| 1091 | MSM_SENSOR_RES_3, |
| 1092 | MSM_SENSOR_RES_4, |
| 1093 | MSM_SENSOR_RES_5, |
| 1094 | MSM_SENSOR_RES_6, |
| 1095 | MSM_SENSOR_RES_7, |
| 1096 | MSM_SENSOR_INVALID_RES, |
| 1097 | }; |
| 1098 | |
| 1099 | struct msm_sensor_output_info_t { |
| 1100 | uint16_t x_output; |
| 1101 | uint16_t y_output; |
| 1102 | uint16_t line_length_pclk; |
| 1103 | uint16_t frame_length_lines; |
Kevin Chan | e30d369 | 2011-10-14 16:11:01 -0700 | [diff] [blame] | 1104 | uint32_t vt_pixel_clk; |
| 1105 | uint32_t op_pixel_clk; |
Kevin Chan | 272f660 | 2011-10-18 14:20:03 -0700 | [diff] [blame] | 1106 | uint16_t binning_factor; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1107 | |
| 1108 | uint16_t x_addr_start; |
| 1109 | uint16_t y_addr_start; |
| 1110 | uint16_t x_addr_end; |
| 1111 | uint16_t y_addr_end; |
| 1112 | uint16_t x_even_inc; |
| 1113 | uint16_t x_odd_inc; |
| 1114 | uint16_t y_even_inc; |
| 1115 | uint16_t y_odd_inc; |
| 1116 | uint8_t binning_rawchip; |
| 1117 | |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1118 | }; |
| 1119 | |
| 1120 | struct sensor_output_info_t { |
| 1121 | struct msm_sensor_output_info_t *output_info; |
| 1122 | uint16_t num_info; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1123 | |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1124 | uint16_t vert_offset; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1125 | uint16_t min_vert; |
| 1126 | int mirror_flip; |
| 1127 | uint32_t sensor_max_linecount; |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1128 | }; |
| 1129 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1130 | struct sensor_eeprom_data_t { |
| 1131 | void *eeprom_data; |
| 1132 | uint16_t index; |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1133 | }; |
| 1134 | |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 1135 | struct mirror_flip { |
| 1136 | int32_t x_mirror; |
| 1137 | int32_t y_flip; |
| 1138 | }; |
| 1139 | |
| 1140 | struct cord { |
| 1141 | uint32_t x; |
| 1142 | uint32_t y; |
| 1143 | }; |
| 1144 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1145 | #if 1 |
| 1146 | enum antibanding_mode{ |
| 1147 | CAMERA_ANTI_BANDING_50HZ, |
| 1148 | CAMERA_ANTI_BANDING_60HZ, |
| 1149 | CAMERA_ANTI_BANDING_AUTO, |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 1150 | }; |
| 1151 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1152 | enum brightness_t{ |
| 1153 | CAMERA_BRIGHTNESS_N3, |
| 1154 | CAMERA_BRIGHTNESS_N2, |
| 1155 | CAMERA_BRIGHTNESS_N1, |
| 1156 | CAMERA_BRIGHTNESS_D, |
| 1157 | CAMERA_BRIGHTNESS_P1, |
| 1158 | CAMERA_BRIGHTNESS_P2, |
| 1159 | CAMERA_BRIGHTNESS_P3, |
| 1160 | CAMERA_BRIGHTNESS_P4, |
| 1161 | CAMERA_BRIGHTNESS_N4, |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1162 | }; |
| 1163 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1164 | enum frontcam_t{ |
| 1165 | CAMERA_MIRROR, |
| 1166 | CAMERA_REVERSE, |
| 1167 | CAMERA_PORTRAIT_REVERSE, |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1168 | }; |
| 1169 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1170 | enum wb_mode{ |
| 1171 | CAMERA_AWB_AUTO, |
| 1172 | CAMERA_AWB_CLOUDY, |
| 1173 | CAMERA_AWB_INDOOR_HOME, |
| 1174 | CAMERA_AWB_INDOOR_OFFICE, |
| 1175 | CAMERA_AWB_SUNNY, |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1176 | }; |
| 1177 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1178 | enum iso_mode{ |
| 1179 | CAMERA_ISO_MODE_AUTO = 0, |
| 1180 | CAMERA_ISO_MODE_DEBLUR, |
| 1181 | CAMERA_ISO_MODE_100, |
| 1182 | CAMERA_ISO_MODE_200, |
| 1183 | CAMERA_ISO_MODE_400, |
| 1184 | CAMERA_ISO_MODE_800, |
| 1185 | CAMERA_ISO_MODE_1250, |
| 1186 | CAMERA_ISO_MODE_1600, |
| 1187 | CAMERA_ISO_MODE_MAX |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1188 | }; |
| 1189 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1190 | enum sharpness_mode{ |
| 1191 | CAMERA_SHARPNESS_X0, |
| 1192 | CAMERA_SHARPNESS_X1, |
| 1193 | CAMERA_SHARPNESS_X2, |
| 1194 | CAMERA_SHARPNESS_X3, |
| 1195 | CAMERA_SHARPNESS_X4, |
| 1196 | CAMERA_SHARPNESS_X5, |
| 1197 | CAMERA_SHARPNESS_X6, |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1198 | }; |
| 1199 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1200 | enum saturation_mode{ |
| 1201 | CAMERA_SATURATION_X0, |
| 1202 | CAMERA_SATURATION_X05, |
| 1203 | CAMERA_SATURATION_X1, |
| 1204 | CAMERA_SATURATION_X15, |
| 1205 | CAMERA_SATURATION_X2, |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1206 | }; |
| 1207 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1208 | enum contrast_mode{ |
| 1209 | CAMERA_CONTRAST_N2, |
| 1210 | CAMERA_CONTRAST_N1, |
| 1211 | CAMERA_CONTRAST_D, |
| 1212 | CAMERA_CONTRAST_P1, |
| 1213 | CAMERA_CONTRAST_P2, |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1214 | }; |
| 1215 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1216 | enum qtr_size_mode{ |
| 1217 | NORMAL_QTR_SIZE_MODE, |
| 1218 | LARGER_QTR_SIZE_MODE, |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1219 | }; |
| 1220 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1221 | enum sensor_af_mode{ |
| 1222 | SENSOR_AF_MODE_AUTO, |
| 1223 | SENSOR_AF_MODE_NORMAL, |
| 1224 | SENSOR_AF_MODE_MACRO, |
| 1225 | }; |
| 1226 | #endif |
| 1227 | |
| 1228 | struct fuse_id{ |
| 1229 | uint32_t fuse_id_word1; |
| 1230 | uint32_t fuse_id_word2; |
| 1231 | uint32_t fuse_id_word3; |
| 1232 | uint32_t fuse_id_word4; |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1233 | }; |
| 1234 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1235 | typedef struct{ |
| 1236 | uint16_t min; |
| 1237 | uint16_t med; |
| 1238 | uint16_t max; |
| 1239 | }vcm_pos; |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1240 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1241 | struct sensor_cfg_data { |
| 1242 | int cfgtype; |
| 1243 | int mode; |
| 1244 | int rs; |
| 1245 | uint8_t max_steps; |
| 1246 | |
| 1247 | union { |
| 1248 | int8_t effect; |
| 1249 | uint8_t lens_shading; |
| 1250 | uint16_t prevl_pf; |
| 1251 | uint16_t prevp_pl; |
| 1252 | uint16_t pictl_pf; |
| 1253 | uint16_t pictp_pl; |
| 1254 | uint32_t pict_max_exp_lc; |
| 1255 | uint16_t p_fps; |
Su Liu | 6c3bb32 | 2012-02-14 02:15:05 +0530 | [diff] [blame] | 1256 | uint8_t iso_type; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1257 | struct sensor_init_cfg init_info; |
| 1258 | struct sensor_pict_fps gfps; |
| 1259 | struct exp_gain_cfg exp_gain; |
| 1260 | struct focus_cfg focus; |
| 1261 | struct fps_cfg fps; |
| 1262 | struct wb_info_cfg wb_info; |
| 1263 | struct sensor_3d_exp_cfg sensor_3d_exp; |
| 1264 | struct sensor_calib_data calib_info; |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1265 | struct sensor_output_info_t output_info; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1266 | struct sensor_eeprom_data_t eeprom_data; |
| 1267 | |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 1268 | uint16_t antibanding; |
| 1269 | uint8_t contrast; |
| 1270 | uint8_t saturation; |
| 1271 | uint8_t sharpness; |
| 1272 | int8_t brightness; |
| 1273 | int ae_mode; |
| 1274 | uint8_t wb_val; |
| 1275 | int8_t exp_compensation; |
| 1276 | struct cord aec_cord; |
| 1277 | int is_autoflash; |
| 1278 | struct mirror_flip mirror_flip; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1279 | |
| 1280 | |
| 1281 | |
| 1282 | struct fuse_id fuse; |
| 1283 | |
| 1284 | vcm_pos calib_vcm_pos; |
| 1285 | #if 1 |
| 1286 | enum antibanding_mode antibanding_value; |
| 1287 | enum brightness_t brightness_value; |
| 1288 | enum frontcam_t frontcam_value; |
| 1289 | enum wb_mode wb_value; |
| 1290 | enum iso_mode iso_value; |
| 1291 | enum sharpness_mode sharpness_value; |
| 1292 | enum saturation_mode saturation_value; |
| 1293 | enum contrast_mode contrast_value; |
| 1294 | enum qtr_size_mode qtr_size_mode_value; |
| 1295 | enum sensor_af_mode af_mode_value; |
| 1296 | #endif |
| 1297 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1298 | } cfg; |
| 1299 | }; |
| 1300 | |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1301 | struct damping_params_t { |
| 1302 | uint32_t damping_step; |
| 1303 | uint32_t damping_delay; |
| 1304 | uint32_t hw_params; |
| 1305 | }; |
| 1306 | |
| 1307 | enum actuator_type { |
| 1308 | ACTUATOR_VCM, |
| 1309 | ACTUATOR_PIEZO, |
| 1310 | }; |
| 1311 | |
| 1312 | enum msm_actuator_data_type { |
| 1313 | MSM_ACTUATOR_BYTE_DATA = 1, |
| 1314 | MSM_ACTUATOR_WORD_DATA, |
| 1315 | }; |
| 1316 | |
| 1317 | enum msm_actuator_addr_type { |
| 1318 | MSM_ACTUATOR_BYTE_ADDR = 1, |
| 1319 | MSM_ACTUATOR_WORD_ADDR, |
| 1320 | }; |
| 1321 | |
| 1322 | enum msm_actuator_write_type { |
| 1323 | MSM_ACTUATOR_WRITE_HW_DAMP, |
| 1324 | MSM_ACTUATOR_WRITE_DAC, |
| 1325 | }; |
| 1326 | |
| 1327 | struct msm_actuator_reg_params_t { |
| 1328 | enum msm_actuator_write_type reg_write_type; |
| 1329 | uint32_t hw_mask; |
| 1330 | uint16_t reg_addr; |
| 1331 | uint16_t hw_shift; |
| 1332 | uint16_t data_shift; |
| 1333 | }; |
| 1334 | |
| 1335 | struct reg_settings_t { |
| 1336 | uint16_t reg_addr; |
| 1337 | uint16_t reg_data; |
| 1338 | }; |
| 1339 | |
| 1340 | struct region_params_t { |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1341 | uint16_t step_bound[2]; |
| 1342 | uint16_t code_per_step; |
| 1343 | }; |
| 1344 | |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1345 | struct msm_actuator_move_params_t { |
| 1346 | int8_t dir; |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1347 | int8_t sign_dir; |
| 1348 | int16_t dest_step_pos; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1349 | int32_t num_steps; |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1350 | struct damping_params_t *ringing_params; |
| 1351 | }; |
| 1352 | |
| 1353 | struct msm_actuator_tuning_params_t { |
| 1354 | int16_t initial_code; |
| 1355 | uint16_t pwd_step; |
| 1356 | uint16_t region_size; |
| 1357 | uint32_t total_steps; |
| 1358 | struct region_params_t *region_params; |
| 1359 | }; |
| 1360 | |
| 1361 | struct msm_actuator_params_t { |
| 1362 | enum actuator_type act_type; |
| 1363 | uint8_t reg_tbl_size; |
| 1364 | uint16_t data_size; |
| 1365 | uint16_t init_setting_size; |
| 1366 | uint32_t i2c_addr; |
| 1367 | enum msm_actuator_addr_type i2c_addr_type; |
| 1368 | enum msm_actuator_data_type i2c_data_type; |
| 1369 | struct msm_actuator_reg_params_t *reg_tbl_params; |
| 1370 | struct reg_settings_t *init_settings; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1371 | }; |
| 1372 | |
| 1373 | struct msm_actuator_set_info_t { |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1374 | uint32_t total_steps; |
| 1375 | uint16_t gross_steps; |
| 1376 | uint16_t fine_steps; |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1377 | struct msm_actuator_params_t actuator_params; |
| 1378 | struct msm_actuator_tuning_params_t af_tuning_params; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1379 | }; |
| 1380 | |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1381 | struct msm_actuator_get_info_t { |
| 1382 | uint32_t focal_length_num; |
| 1383 | uint32_t focal_length_den; |
| 1384 | uint32_t f_number_num; |
| 1385 | uint32_t f_number_den; |
| 1386 | uint32_t f_pix_num; |
| 1387 | uint32_t f_pix_den; |
| 1388 | uint32_t total_f_dist_num; |
| 1389 | uint32_t total_f_dist_den; |
Jeyaprakash Soundrapandian | 0459200 | 2012-02-08 10:29:50 -0800 | [diff] [blame] | 1390 | uint32_t hor_view_angle_num; |
| 1391 | uint32_t hor_view_angle_den; |
| 1392 | uint32_t ver_view_angle_num; |
| 1393 | uint32_t ver_view_angle_den; |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1394 | }; |
| 1395 | |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1396 | enum af_camera_name { |
| 1397 | ACTUATOR_MAIN_CAM_0, |
| 1398 | ACTUATOR_MAIN_CAM_1, |
| 1399 | ACTUATOR_MAIN_CAM_2, |
| 1400 | ACTUATOR_MAIN_CAM_3, |
| 1401 | ACTUATOR_MAIN_CAM_4, |
| 1402 | ACTUATOR_MAIN_CAM_5, |
| 1403 | ACTUATOR_WEB_CAM_0, |
| 1404 | ACTUATOR_WEB_CAM_1, |
| 1405 | ACTUATOR_WEB_CAM_2, |
| 1406 | }; |
| 1407 | |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1408 | struct msm_actuator_cfg_data { |
| 1409 | int cfgtype; |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1410 | uint8_t is_af_supported; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1411 | union { |
| 1412 | struct msm_actuator_move_params_t move; |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1413 | struct msm_actuator_set_info_t set_info; |
| 1414 | struct msm_actuator_get_info_t get_info; |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1415 | enum af_camera_name cam_name; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1416 | int16_t curr_step_pos; |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 1417 | } cfg; |
| 1418 | }; |
| 1419 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1420 | struct sensor_large_data { |
| 1421 | int cfgtype; |
| 1422 | union { |
| 1423 | struct sensor_3d_cali_data_t sensor_3d_cali_data; |
| 1424 | } data; |
| 1425 | }; |
| 1426 | |
| 1427 | enum sensor_type_t { |
| 1428 | BAYER, |
| 1429 | YUV, |
| 1430 | JPEG_SOC, |
| 1431 | }; |
| 1432 | |
| 1433 | enum flash_type { |
| 1434 | LED_FLASH, |
| 1435 | STROBE_FLASH, |
| 1436 | }; |
| 1437 | |
| 1438 | enum strobe_flash_ctrl_type { |
| 1439 | STROBE_FLASH_CTRL_INIT, |
| 1440 | STROBE_FLASH_CTRL_CHARGE, |
| 1441 | STROBE_FLASH_CTRL_RELEASE |
| 1442 | }; |
| 1443 | |
| 1444 | struct strobe_flash_ctrl_data { |
| 1445 | enum strobe_flash_ctrl_type type; |
| 1446 | int charge_en; |
| 1447 | }; |
| 1448 | |
| 1449 | struct msm_camera_info { |
| 1450 | int num_cameras; |
| 1451 | uint8_t has_3d_support[MSM_MAX_CAMERA_SENSORS]; |
| 1452 | uint8_t is_internal_cam[MSM_MAX_CAMERA_SENSORS]; |
| 1453 | uint32_t s_mount_angle[MSM_MAX_CAMERA_SENSORS]; |
| 1454 | const char *video_dev_name[MSM_MAX_CAMERA_SENSORS]; |
| 1455 | enum sensor_type_t sensor_type[MSM_MAX_CAMERA_SENSORS]; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1456 | }; |
| 1457 | |
| 1458 | struct msm_cam_config_dev_info { |
| 1459 | int num_config_nodes; |
| 1460 | const char *config_dev_name[MSM_MAX_CAMERA_CONFIGS]; |
Ankit Premrajka | f94bcc6 | 2011-08-22 15:23:53 -0700 | [diff] [blame] | 1461 | int config_dev_id[MSM_MAX_CAMERA_CONFIGS]; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1462 | }; |
| 1463 | |
Kiran Kumar H N | c3cb9ea | 2012-01-06 15:11:10 -0800 | [diff] [blame] | 1464 | struct msm_mctl_node_info { |
| 1465 | int num_mctl_nodes; |
| 1466 | const char *mctl_node_name[MSM_MAX_CAMERA_SENSORS]; |
| 1467 | }; |
| 1468 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1469 | struct flash_ctrl_data { |
| 1470 | int flashtype; |
| 1471 | union { |
| 1472 | int led_state; |
| 1473 | struct strobe_flash_ctrl_data strobe_ctrl; |
| 1474 | } ctrl_data; |
| 1475 | }; |
| 1476 | |
| 1477 | #define GET_NAME 0 |
| 1478 | #define GET_PREVIEW_LINE_PER_FRAME 1 |
| 1479 | #define GET_PREVIEW_PIXELS_PER_LINE 2 |
| 1480 | #define GET_SNAPSHOT_LINE_PER_FRAME 3 |
| 1481 | #define GET_SNAPSHOT_PIXELS_PER_LINE 4 |
| 1482 | #define GET_SNAPSHOT_FPS 5 |
| 1483 | #define GET_SNAPSHOT_MAX_EP_LINE_CNT 6 |
| 1484 | |
| 1485 | struct msm_camsensor_info { |
| 1486 | char name[MAX_SENSOR_NAME]; |
| 1487 | uint8_t flash_enabled; |
Sreesudhan Ramakrish Ramkumar | a268882 | 2012-04-05 20:22:50 -0700 | [diff] [blame] | 1488 | uint8_t strobe_flash_enabled; |
| 1489 | uint8_t actuator_enabled; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1490 | int8_t total_steps; |
| 1491 | uint8_t support_3d; |
Mingcheng Zhu | c85b8ad | 2012-03-08 17:47:17 -0800 | [diff] [blame] | 1492 | enum flash_type flashtype; |
| 1493 | enum sensor_type_t sensor_type; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1494 | uint32_t pxlcode; |
| 1495 | uint32_t camera_type; |
Mingcheng Zhu | c85b8ad | 2012-03-08 17:47:17 -0800 | [diff] [blame] | 1496 | int mount_angle; |
| 1497 | uint32_t max_width; |
| 1498 | uint32_t max_height; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1499 | uint8_t use_rawchip; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1500 | }; |
Kiran Kumar H N | ceea762 | 2011-08-23 14:01:03 -0700 | [diff] [blame] | 1501 | |
| 1502 | #define V4L2_SINGLE_PLANE 0 |
| 1503 | #define V4L2_MULTI_PLANE_Y 0 |
| 1504 | #define V4L2_MULTI_PLANE_CBCR 1 |
| 1505 | #define V4L2_MULTI_PLANE_CB 1 |
| 1506 | #define V4L2_MULTI_PLANE_CR 2 |
| 1507 | |
| 1508 | struct plane_data { |
| 1509 | int plane_id; |
| 1510 | uint32_t offset; |
| 1511 | unsigned long size; |
| 1512 | }; |
| 1513 | |
| 1514 | struct img_plane_info { |
| 1515 | uint32_t width; |
| 1516 | uint32_t height; |
| 1517 | uint32_t pixelformat; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1518 | uint8_t buffer_type; |
Kiran Kumar H N | ceea762 | 2011-08-23 14:01:03 -0700 | [diff] [blame] | 1519 | uint8_t output_port; |
| 1520 | uint32_t ext_mode; |
| 1521 | uint8_t num_planes; |
| 1522 | struct plane_data plane[MAX_PLANES]; |
Mingcheng Zhu | 996be18 | 2011-10-16 16:04:23 -0700 | [diff] [blame] | 1523 | uint32_t sp_y_offset; |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1524 | uint8_t vpe_can_use; |
Kiran Kumar H N | ceea762 | 2011-08-23 14:01:03 -0700 | [diff] [blame] | 1525 | }; |
| 1526 | |
Kevin Chan | 210061f | 2012-02-14 20:56:16 -0800 | [diff] [blame] | 1527 | #define QCAMERA_NAME "qcamera" |
| 1528 | #define QCAMERA_DEVICE_GROUP_ID 1 |
| 1529 | #define QCAMERA_VNODE_GROUP_ID 2 |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 1530 | #define MSM_CAM_V4L2_IOCTL_GET_CAMERA_INFO \ |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1531 | _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t *) |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 1532 | |
| 1533 | #define MSM_CAM_V4L2_IOCTL_GET_CONFIG_INFO \ |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1534 | _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t *) |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 1535 | |
| 1536 | #define MSM_CAM_V4L2_IOCTL_GET_MCTL_INFO \ |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1537 | _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t *) |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 1538 | |
| 1539 | #define MSM_CAM_V4L2_IOCTL_CTRL_CMD_DONE \ |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1540 | _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t *) |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 1541 | |
| 1542 | #define MSM_CAM_V4L2_IOCTL_GET_EVENT_PAYLOAD \ |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1543 | _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t *) |
| 1544 | |
Sunid Wilson | 4584b5f | 2012-04-13 12:48:25 -0700 | [diff] [blame] | 1545 | #define MSM_CAM_IOCTL_SEND_EVENT \ |
| 1546 | _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct v4l2_event) |
| 1547 | |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 1548 | struct msm_camera_v4l2_ioctl_t { |
Azam Sadiq Pasha Kapatrala Syed | 92fa99c | 2012-11-28 18:56:19 -0800 | [diff] [blame] | 1549 | void __user *ioctl_ptr; |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 1550 | }; |
| 1551 | |
Lakshmi Narayana Kalavala | cd3d81e | 2012-07-31 13:04:03 -0700 | [diff] [blame] | 1552 | |
Flemmard | 50537de | 2013-05-20 14:28:45 -0700 | [diff] [blame] | 1553 | #endif |