Shuzhen Wang | b4f4c92 | 2013-01-08 14:32:08 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2009-2013, The Linux Foundation. All rights reserved. |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 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 |
Ankit Premrajka | 8c9bf5d | 2012-08-07 15:45:31 -0700 | [diff] [blame] | 19 | #include <linux/videodev2.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 20 | #include <linux/types.h> |
| 21 | #include <linux/ioctl.h> |
Philippe Gravel | 4a3b942 | 2012-03-23 14:21:04 -0700 | [diff] [blame] | 22 | #ifdef __KERNEL__ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 23 | #include <linux/cdev.h> |
Philippe Gravel | 4a3b942 | 2012-03-23 14:21:04 -0700 | [diff] [blame] | 24 | #endif |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 25 | #ifdef MSM_CAMERA_GCC |
| 26 | #include <time.h> |
| 27 | #else |
| 28 | #include <linux/time.h> |
| 29 | #endif |
| 30 | |
Mitchel Humpherys | 252fa6a | 2012-09-06 10:28:47 -0700 | [diff] [blame] | 31 | #include <linux/msm_ion.h> |
Philippe Gravel | 4a3b942 | 2012-03-23 14:21:04 -0700 | [diff] [blame] | 32 | |
Nishant Pandit | 5dd5442 | 2012-06-26 22:52:44 +0530 | [diff] [blame] | 33 | #define BIT(nr) (1UL << (nr)) |
| 34 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 35 | #define MSM_CAM_IOCTL_MAGIC 'm' |
| 36 | |
Ankit Premrajka | 06079c8 | 2012-08-22 14:10:27 -0700 | [diff] [blame] | 37 | #define MAX_SERVER_PAYLOAD_LENGTH 8192 |
| 38 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 39 | #define MSM_CAM_IOCTL_GET_SENSOR_INFO \ |
| 40 | _IOR(MSM_CAM_IOCTL_MAGIC, 1, struct msm_camsensor_info *) |
| 41 | |
| 42 | #define MSM_CAM_IOCTL_REGISTER_PMEM \ |
| 43 | _IOW(MSM_CAM_IOCTL_MAGIC, 2, struct msm_pmem_info *) |
| 44 | |
| 45 | #define MSM_CAM_IOCTL_UNREGISTER_PMEM \ |
| 46 | _IOW(MSM_CAM_IOCTL_MAGIC, 3, unsigned) |
| 47 | |
| 48 | #define MSM_CAM_IOCTL_CTRL_COMMAND \ |
| 49 | _IOW(MSM_CAM_IOCTL_MAGIC, 4, struct msm_ctrl_cmd *) |
| 50 | |
| 51 | #define MSM_CAM_IOCTL_CONFIG_VFE \ |
| 52 | _IOW(MSM_CAM_IOCTL_MAGIC, 5, struct msm_camera_vfe_cfg_cmd *) |
| 53 | |
| 54 | #define MSM_CAM_IOCTL_GET_STATS \ |
| 55 | _IOR(MSM_CAM_IOCTL_MAGIC, 6, struct msm_camera_stats_event_ctrl *) |
| 56 | |
| 57 | #define MSM_CAM_IOCTL_GETFRAME \ |
| 58 | _IOR(MSM_CAM_IOCTL_MAGIC, 7, struct msm_camera_get_frame *) |
| 59 | |
| 60 | #define MSM_CAM_IOCTL_ENABLE_VFE \ |
| 61 | _IOW(MSM_CAM_IOCTL_MAGIC, 8, struct camera_enable_cmd *) |
| 62 | |
| 63 | #define MSM_CAM_IOCTL_CTRL_CMD_DONE \ |
| 64 | _IOW(MSM_CAM_IOCTL_MAGIC, 9, struct camera_cmd *) |
| 65 | |
| 66 | #define MSM_CAM_IOCTL_CONFIG_CMD \ |
| 67 | _IOW(MSM_CAM_IOCTL_MAGIC, 10, struct camera_cmd *) |
| 68 | |
| 69 | #define MSM_CAM_IOCTL_DISABLE_VFE \ |
| 70 | _IOW(MSM_CAM_IOCTL_MAGIC, 11, struct camera_enable_cmd *) |
| 71 | |
| 72 | #define MSM_CAM_IOCTL_PAD_REG_RESET2 \ |
| 73 | _IOW(MSM_CAM_IOCTL_MAGIC, 12, struct camera_enable_cmd *) |
| 74 | |
| 75 | #define MSM_CAM_IOCTL_VFE_APPS_RESET \ |
| 76 | _IOW(MSM_CAM_IOCTL_MAGIC, 13, struct camera_enable_cmd *) |
| 77 | |
| 78 | #define MSM_CAM_IOCTL_RELEASE_FRAME_BUFFER \ |
| 79 | _IOW(MSM_CAM_IOCTL_MAGIC, 14, struct camera_enable_cmd *) |
| 80 | |
| 81 | #define MSM_CAM_IOCTL_RELEASE_STATS_BUFFER \ |
| 82 | _IOW(MSM_CAM_IOCTL_MAGIC, 15, struct msm_stats_buf *) |
| 83 | |
| 84 | #define MSM_CAM_IOCTL_AXI_CONFIG \ |
| 85 | _IOW(MSM_CAM_IOCTL_MAGIC, 16, struct msm_camera_vfe_cfg_cmd *) |
| 86 | |
| 87 | #define MSM_CAM_IOCTL_GET_PICTURE \ |
| 88 | _IOW(MSM_CAM_IOCTL_MAGIC, 17, struct msm_frame *) |
| 89 | |
| 90 | #define MSM_CAM_IOCTL_SET_CROP \ |
| 91 | _IOW(MSM_CAM_IOCTL_MAGIC, 18, struct crop_info *) |
| 92 | |
| 93 | #define MSM_CAM_IOCTL_PICT_PP \ |
| 94 | _IOW(MSM_CAM_IOCTL_MAGIC, 19, uint8_t *) |
| 95 | |
| 96 | #define MSM_CAM_IOCTL_PICT_PP_DONE \ |
| 97 | _IOW(MSM_CAM_IOCTL_MAGIC, 20, struct msm_snapshot_pp_status *) |
| 98 | |
| 99 | #define MSM_CAM_IOCTL_SENSOR_IO_CFG \ |
| 100 | _IOW(MSM_CAM_IOCTL_MAGIC, 21, struct sensor_cfg_data *) |
| 101 | |
| 102 | #define MSM_CAM_IOCTL_FLASH_LED_CFG \ |
| 103 | _IOW(MSM_CAM_IOCTL_MAGIC, 22, unsigned *) |
| 104 | |
| 105 | #define MSM_CAM_IOCTL_UNBLOCK_POLL_FRAME \ |
| 106 | _IO(MSM_CAM_IOCTL_MAGIC, 23) |
| 107 | |
| 108 | #define MSM_CAM_IOCTL_CTRL_COMMAND_2 \ |
| 109 | _IOW(MSM_CAM_IOCTL_MAGIC, 24, struct msm_ctrl_cmd *) |
| 110 | |
| 111 | #define MSM_CAM_IOCTL_AF_CTRL \ |
| 112 | _IOR(MSM_CAM_IOCTL_MAGIC, 25, struct msm_ctrl_cmt_t *) |
| 113 | |
| 114 | #define MSM_CAM_IOCTL_AF_CTRL_DONE \ |
| 115 | _IOW(MSM_CAM_IOCTL_MAGIC, 26, struct msm_ctrl_cmt_t *) |
| 116 | |
| 117 | #define MSM_CAM_IOCTL_CONFIG_VPE \ |
| 118 | _IOW(MSM_CAM_IOCTL_MAGIC, 27, struct msm_camera_vpe_cfg_cmd *) |
| 119 | |
| 120 | #define MSM_CAM_IOCTL_AXI_VPE_CONFIG \ |
| 121 | _IOW(MSM_CAM_IOCTL_MAGIC, 28, struct msm_camera_vpe_cfg_cmd *) |
| 122 | |
| 123 | #define MSM_CAM_IOCTL_STROBE_FLASH_CFG \ |
| 124 | _IOW(MSM_CAM_IOCTL_MAGIC, 29, uint32_t *) |
| 125 | |
| 126 | #define MSM_CAM_IOCTL_STROBE_FLASH_CHARGE \ |
| 127 | _IOW(MSM_CAM_IOCTL_MAGIC, 30, uint32_t *) |
| 128 | |
| 129 | #define MSM_CAM_IOCTL_STROBE_FLASH_RELEASE \ |
| 130 | _IO(MSM_CAM_IOCTL_MAGIC, 31) |
| 131 | |
| 132 | #define MSM_CAM_IOCTL_FLASH_CTRL \ |
| 133 | _IOW(MSM_CAM_IOCTL_MAGIC, 32, struct flash_ctrl_data *) |
| 134 | |
| 135 | #define MSM_CAM_IOCTL_ERROR_CONFIG \ |
| 136 | _IOW(MSM_CAM_IOCTL_MAGIC, 33, uint32_t *) |
| 137 | |
| 138 | #define MSM_CAM_IOCTL_ABORT_CAPTURE \ |
| 139 | _IO(MSM_CAM_IOCTL_MAGIC, 34) |
| 140 | |
| 141 | #define MSM_CAM_IOCTL_SET_FD_ROI \ |
| 142 | _IOW(MSM_CAM_IOCTL_MAGIC, 35, struct fd_roi_info *) |
| 143 | |
| 144 | #define MSM_CAM_IOCTL_GET_CAMERA_INFO \ |
| 145 | _IOR(MSM_CAM_IOCTL_MAGIC, 36, struct msm_camera_info *) |
| 146 | |
| 147 | #define MSM_CAM_IOCTL_UNBLOCK_POLL_PIC_FRAME \ |
| 148 | _IO(MSM_CAM_IOCTL_MAGIC, 37) |
| 149 | |
| 150 | #define MSM_CAM_IOCTL_RELEASE_PIC_BUFFER \ |
| 151 | _IOW(MSM_CAM_IOCTL_MAGIC, 38, struct camera_enable_cmd *) |
| 152 | |
| 153 | #define MSM_CAM_IOCTL_PUT_ST_FRAME \ |
| 154 | _IOW(MSM_CAM_IOCTL_MAGIC, 39, struct msm_camera_st_frame *) |
| 155 | |
Mansoor Aftab | 5d41837 | 2011-07-26 17:01:26 -0700 | [diff] [blame] | 156 | #define MSM_CAM_IOCTL_V4L2_EVT_NOTIFY \ |
Ankit Premrajka | 8c9bf5d | 2012-08-07 15:45:31 -0700 | [diff] [blame] | 157 | _IOW(MSM_CAM_IOCTL_MAGIC, 40, struct v4l2_event_and_payload) |
Mansoor Aftab | 5d41837 | 2011-07-26 17:01:26 -0700 | [diff] [blame] | 158 | |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 159 | #define MSM_CAM_IOCTL_SET_MEM_MAP_INFO \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 160 | _IOR(MSM_CAM_IOCTL_MAGIC, 41, struct msm_mem_map_info *) |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 161 | |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 162 | #define MSM_CAM_IOCTL_ACTUATOR_IO_CFG \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 163 | _IOW(MSM_CAM_IOCTL_MAGIC, 42, struct msm_actuator_cfg_data *) |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 164 | |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 165 | #define MSM_CAM_IOCTL_MCTL_POST_PROC \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 166 | _IOW(MSM_CAM_IOCTL_MAGIC, 43, struct msm_mctl_post_proc_cmd *) |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 167 | |
| 168 | #define MSM_CAM_IOCTL_RESERVE_FREE_FRAME \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 169 | _IOW(MSM_CAM_IOCTL_MAGIC, 44, struct msm_cam_evt_divert_frame *) |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 170 | |
| 171 | #define MSM_CAM_IOCTL_RELEASE_FREE_FRAME \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 172 | _IOR(MSM_CAM_IOCTL_MAGIC, 45, struct msm_cam_evt_divert_frame *) |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 173 | |
Mingcheng Zhu | 8feaa3f | 2011-11-23 11:33:52 -0800 | [diff] [blame] | 174 | #define MSM_CAM_IOCTL_PICT_PP_DIVERT_DONE \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 175 | _IOR(MSM_CAM_IOCTL_MAGIC, 46, struct msm_pp_frame *) |
Mingcheng Zhu | 8feaa3f | 2011-11-23 11:33:52 -0800 | [diff] [blame] | 176 | |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 177 | #define MSM_CAM_IOCTL_SENSOR_V4l2_S_CTRL \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 178 | _IOR(MSM_CAM_IOCTL_MAGIC, 47, struct v4l2_control) |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 179 | |
| 180 | #define MSM_CAM_IOCTL_SENSOR_V4l2_QUERY_CTRL \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 181 | _IOR(MSM_CAM_IOCTL_MAGIC, 48, struct v4l2_queryctrl) |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 182 | |
Guruprasad Gaonkar | 4c7758f | 2011-12-16 17:30:00 -0800 | [diff] [blame] | 183 | #define MSM_CAM_IOCTL_GET_KERNEL_SYSTEM_TIME \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 184 | _IOW(MSM_CAM_IOCTL_MAGIC, 49, struct timeval *) |
Guruprasad Gaonkar | 4c7758f | 2011-12-16 17:30:00 -0800 | [diff] [blame] | 185 | |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 186 | #define MSM_CAM_IOCTL_SET_VFE_OUTPUT_TYPE \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 187 | _IOW(MSM_CAM_IOCTL_MAGIC, 50, uint32_t *) |
Kiran Kumar H N | c3cb9ea | 2012-01-06 15:11:10 -0800 | [diff] [blame] | 188 | |
| 189 | #define MSM_CAM_IOCTL_MCTL_DIVERT_DONE \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 190 | _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] | 191 | |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 192 | #define MSM_CAM_IOCTL_GET_ACTUATOR_INFO \ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 193 | _IOW(MSM_CAM_IOCTL_MAGIC, 52, struct msm_actuator_cfg_data *) |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 194 | |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 195 | #define MSM_CAM_IOCTL_EEPROM_IO_CFG \ |
| 196 | _IOW(MSM_CAM_IOCTL_MAGIC, 53, struct msm_eeprom_cfg_data *) |
| 197 | |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 198 | #define MSM_CAM_IOCTL_ISPIF_IO_CFG \ |
| 199 | _IOR(MSM_CAM_IOCTL_MAGIC, 54, struct ispif_cfg_data *) |
| 200 | |
Lakshmi Narayana Kalavala | 2db3384 | 2012-06-26 22:41:32 -0700 | [diff] [blame] | 201 | #define MSM_CAM_IOCTL_STATS_REQBUF \ |
| 202 | _IOR(MSM_CAM_IOCTL_MAGIC, 55, struct msm_stats_reqbuf *) |
| 203 | |
| 204 | #define MSM_CAM_IOCTL_STATS_ENQUEUEBUF \ |
| 205 | _IOR(MSM_CAM_IOCTL_MAGIC, 56, struct msm_stats_buf_info *) |
| 206 | |
| 207 | #define MSM_CAM_IOCTL_STATS_FLUSH_BUFQ \ |
| 208 | _IOR(MSM_CAM_IOCTL_MAGIC, 57, struct msm_stats_flush_bufq *) |
| 209 | |
Ankit Premrajka | 4b3443f | 2012-06-11 14:06:31 -0700 | [diff] [blame] | 210 | #define MSM_CAM_IOCTL_SET_MCTL_SDEV \ |
| 211 | _IOW(MSM_CAM_IOCTL_MAGIC, 58, struct msm_mctl_set_sdev_data *) |
| 212 | |
| 213 | #define MSM_CAM_IOCTL_UNSET_MCTL_SDEV \ |
| 214 | _IOW(MSM_CAM_IOCTL_MAGIC, 59, struct msm_mctl_set_sdev_data *) |
| 215 | |
Kiran Kumar H N | 9078590 | 2012-07-05 13:59:38 -0700 | [diff] [blame] | 216 | #define MSM_CAM_IOCTL_GET_INST_HANDLE \ |
| 217 | _IOR(MSM_CAM_IOCTL_MAGIC, 60, uint32_t *) |
| 218 | |
Lakshmi Narayana Kalavala | 58243db | 2012-07-24 00:06:27 -0700 | [diff] [blame] | 219 | #define MSM_CAM_IOCTL_STATS_UNREG_BUF \ |
| 220 | _IOR(MSM_CAM_IOCTL_MAGIC, 61, struct msm_stats_flush_bufq *) |
| 221 | |
Sreesudhan Ramakrish Ramkumar | 254f7e7 | 2012-03-17 17:27:34 -0700 | [diff] [blame] | 222 | #define MSM_CAM_IOCTL_CSIC_IO_CFG \ |
| 223 | _IOWR(MSM_CAM_IOCTL_MAGIC, 62, struct csic_cfg_data *) |
| 224 | |
| 225 | #define MSM_CAM_IOCTL_CSID_IO_CFG \ |
| 226 | _IOWR(MSM_CAM_IOCTL_MAGIC, 63, struct csid_cfg_data *) |
| 227 | |
| 228 | #define MSM_CAM_IOCTL_CSIPHY_IO_CFG \ |
| 229 | _IOR(MSM_CAM_IOCTL_MAGIC, 64, struct csiphy_cfg_data *) |
Lakshmi Narayana Kalavala | 58243db | 2012-07-24 00:06:27 -0700 | [diff] [blame] | 230 | |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 231 | #define MSM_CAM_IOCTL_OEM \ |
| 232 | _IOW(MSM_CAM_IOCTL_MAGIC, 65, struct sensor_cfg_data *) |
| 233 | |
Nishant Pandit | 221a948 | 2012-09-03 05:36:04 +0530 | [diff] [blame] | 234 | #define MSM_CAM_IOCTL_AXI_INIT \ |
| 235 | _IOWR(MSM_CAM_IOCTL_MAGIC, 66, uint8_t *) |
| 236 | |
| 237 | #define MSM_CAM_IOCTL_AXI_RELEASE \ |
| 238 | _IO(MSM_CAM_IOCTL_MAGIC, 67) |
| 239 | |
Ankit Premrajka | 8c9bf5d | 2012-08-07 15:45:31 -0700 | [diff] [blame] | 240 | struct v4l2_event_and_payload { |
| 241 | struct v4l2_event evt; |
| 242 | uint32_t payload_length; |
| 243 | uint32_t transaction_id; |
| 244 | void *payload; |
| 245 | }; |
| 246 | |
Lakshmi Narayana Kalavala | 2db3384 | 2012-06-26 22:41:32 -0700 | [diff] [blame] | 247 | struct msm_stats_reqbuf { |
| 248 | int num_buf; /* how many buffers requested */ |
| 249 | int stats_type; /* stats type */ |
| 250 | }; |
| 251 | |
| 252 | struct msm_stats_flush_bufq { |
| 253 | int stats_type; /* enum msm_stats_enum_type */ |
| 254 | }; |
| 255 | |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 256 | struct msm_mctl_pp_cmd { |
| 257 | int32_t id; |
| 258 | uint16_t length; |
| 259 | void *value; |
| 260 | }; |
| 261 | |
| 262 | struct msm_mctl_post_proc_cmd { |
| 263 | int32_t type; |
| 264 | struct msm_mctl_pp_cmd cmd; |
| 265 | }; |
| 266 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 267 | #define MSM_CAMERA_LED_OFF 0 |
| 268 | #define MSM_CAMERA_LED_LOW 1 |
| 269 | #define MSM_CAMERA_LED_HIGH 2 |
Nishant Pandit | 474f225 | 2011-07-23 23:17:56 +0530 | [diff] [blame] | 270 | #define MSM_CAMERA_LED_INIT 3 |
| 271 | #define MSM_CAMERA_LED_RELEASE 4 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 272 | |
| 273 | #define MSM_CAMERA_STROBE_FLASH_NONE 0 |
| 274 | #define MSM_CAMERA_STROBE_FLASH_XENON 1 |
| 275 | |
| 276 | #define MSM_MAX_CAMERA_SENSORS 5 |
| 277 | #define MAX_SENSOR_NAME 32 |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 278 | #define MAX_CAM_NAME_SIZE 32 |
| 279 | #define MAX_ACT_MOD_NAME_SIZE 32 |
| 280 | #define MAX_ACT_NAME_SIZE 32 |
| 281 | #define NUM_ACTUATOR_DIR 2 |
| 282 | #define MAX_ACTUATOR_SCENARIO 8 |
| 283 | #define MAX_ACTUATOR_REGION 5 |
| 284 | #define MAX_ACTUATOR_INIT_SET 12 |
| 285 | #define MAX_ACTUATOR_TYPE_SIZE 32 |
| 286 | #define MAX_ACTUATOR_REG_TBL_SIZE 8 |
| 287 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 288 | |
| 289 | #define MSM_MAX_CAMERA_CONFIGS 2 |
| 290 | |
| 291 | #define PP_SNAP 0x01 |
| 292 | #define PP_RAW_SNAP ((0x01)<<1) |
| 293 | #define PP_PREV ((0x01)<<2) |
Ankit Premrajka | 70613ec | 2012-01-26 16:24:23 -0800 | [diff] [blame] | 294 | #define PP_THUMB ((0x01)<<3) |
| 295 | #define PP_MASK (PP_SNAP|PP_RAW_SNAP|PP_PREV|PP_THUMB) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 296 | |
| 297 | #define MSM_CAM_CTRL_CMD_DONE 0 |
| 298 | #define MSM_CAM_SENSOR_VFE_CMD 1 |
| 299 | |
Kiran Kumar H N | ceea762 | 2011-08-23 14:01:03 -0700 | [diff] [blame] | 300 | /* Should be same as VIDEO_MAX_PLANES in videodev2.h */ |
| 301 | #define MAX_PLANES 8 |
| 302 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 303 | /***************************************************** |
| 304 | * structure |
| 305 | *****************************************************/ |
| 306 | |
| 307 | /* define five type of structures for userspace <==> kernel |
| 308 | * space communication: |
| 309 | * command 1 - 2 are from userspace ==> kernel |
| 310 | * command 3 - 4 are from kernel ==> userspace |
| 311 | * |
| 312 | * 1. control command: control command(from control thread), |
| 313 | * control status (from config thread); |
| 314 | */ |
| 315 | struct msm_ctrl_cmd { |
| 316 | uint16_t type; |
| 317 | uint16_t length; |
| 318 | void *value; |
| 319 | uint16_t status; |
| 320 | uint32_t timeout_ms; |
| 321 | int resp_fd; /* FIXME: to be used by the kernel, pass-through for now */ |
| 322 | int vnode_id; /* video dev id. Can we overload resp_fd? */ |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 323 | int queue_idx; |
| 324 | uint32_t evt_id; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 325 | uint32_t stream_type; /* used to pass value to qcamera server */ |
Ankit Premrajka | f94bcc6 | 2011-08-22 15:23:53 -0700 | [diff] [blame] | 326 | int config_ident; /*used as identifier for config node*/ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 327 | }; |
| 328 | |
| 329 | struct msm_cam_evt_msg { |
| 330 | unsigned short type; /* 1 == event (RPC), 0 == message (adsp) */ |
| 331 | unsigned short msg_id; |
| 332 | unsigned int len; /* size in, number of bytes out */ |
| 333 | uint32_t frame_id; |
| 334 | void *data; |
Ninad Mahimkar | ee55c19 | 2012-04-25 14:36:17 -0700 | [diff] [blame] | 335 | struct timespec timestamp; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 336 | }; |
| 337 | |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 338 | struct msm_pp_frame_sp { |
| 339 | /* phy addr of the buffer */ |
| 340 | unsigned long phy_addr; |
| 341 | uint32_t y_off; |
| 342 | uint32_t cbcr_off; |
| 343 | /* buffer length */ |
| 344 | uint32_t length; |
| 345 | int32_t fd; |
| 346 | uint32_t addr_offset; |
| 347 | /* mapped addr */ |
| 348 | unsigned long vaddr; |
| 349 | }; |
| 350 | |
| 351 | struct msm_pp_frame_mp { |
| 352 | /* phy addr of the plane */ |
| 353 | unsigned long phy_addr; |
| 354 | /* offset of plane data */ |
| 355 | uint32_t data_offset; |
| 356 | /* plane length */ |
| 357 | uint32_t length; |
| 358 | int32_t fd; |
| 359 | uint32_t addr_offset; |
| 360 | /* mapped addr */ |
| 361 | unsigned long vaddr; |
| 362 | }; |
| 363 | |
| 364 | struct msm_pp_frame { |
| 365 | uint32_t handle; /* stores vb cookie */ |
| 366 | uint32_t frame_id; |
Kevin Chan | 318d7cb | 2011-11-29 14:24:26 -0800 | [diff] [blame] | 367 | unsigned short buf_idx; |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 368 | int path; |
| 369 | unsigned short image_type; |
| 370 | unsigned short num_planes; /* 1 for sp */ |
| 371 | struct timeval timestamp; |
| 372 | union { |
| 373 | struct msm_pp_frame_sp sp; |
| 374 | struct msm_pp_frame_mp mp[MAX_PLANES]; |
| 375 | }; |
Ankit Premrajka | 70613ec | 2012-01-26 16:24:23 -0800 | [diff] [blame] | 376 | int node_type; |
Kiran Kumar H N | 9078590 | 2012-07-05 13:59:38 -0700 | [diff] [blame] | 377 | uint32_t inst_handle; |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 378 | }; |
| 379 | |
Kiran Kumar H N | 2e68e33 | 2012-08-07 21:07:30 -0700 | [diff] [blame] | 380 | struct msm_pp_crop { |
| 381 | uint32_t src_x; |
| 382 | uint32_t src_y; |
| 383 | uint32_t src_w; |
| 384 | uint32_t src_h; |
| 385 | uint32_t dst_x; |
| 386 | uint32_t dst_y; |
| 387 | uint32_t dst_w; |
| 388 | uint32_t dst_h; |
| 389 | uint8_t update_flag; |
| 390 | }; |
| 391 | |
| 392 | struct msm_mctl_pp_frame_cmd { |
| 393 | uint32_t cookie; |
| 394 | uint8_t vpe_output_action; |
| 395 | struct msm_pp_frame src_frame; |
| 396 | struct msm_pp_frame dest_frame; |
| 397 | struct msm_pp_crop crop; |
| 398 | int path; |
| 399 | }; |
| 400 | |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 401 | struct msm_cam_evt_divert_frame { |
Mingcheng Zhu | 5b04d35 | 2011-07-22 21:18:42 -0700 | [diff] [blame] | 402 | unsigned short image_mode; |
| 403 | unsigned short op_mode; |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 404 | unsigned short inst_idx; |
| 405 | unsigned short node_idx; |
Kiran Kumar H N | cd7bc3b | 2011-10-12 16:14:48 -0700 | [diff] [blame] | 406 | struct msm_pp_frame frame; |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 407 | int do_pp; |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 408 | }; |
| 409 | |
Kiran Kumar H N | 0b51780 | 2011-10-05 09:49:51 -0700 | [diff] [blame] | 410 | struct msm_mctl_pp_cmd_ack_event { |
| 411 | uint32_t cmd; /* VPE_CMD_ZOOM? */ |
| 412 | int status; /* 0 done, < 0 err */ |
| 413 | uint32_t cookie; /* daemon's cookie */ |
| 414 | }; |
| 415 | |
| 416 | struct msm_mctl_pp_event_info { |
| 417 | int32_t event; |
| 418 | union { |
| 419 | struct msm_mctl_pp_cmd_ack_event ack; |
| 420 | }; |
| 421 | }; |
| 422 | |
| 423 | struct msm_isp_event_ctrl { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 424 | unsigned short resptype; |
| 425 | union { |
| 426 | struct msm_cam_evt_msg isp_msg; |
| 427 | struct msm_ctrl_cmd ctrl; |
Kiran Kumar H N | 0b51780 | 2011-10-05 09:49:51 -0700 | [diff] [blame] | 428 | struct msm_cam_evt_divert_frame div_frame; |
| 429 | struct msm_mctl_pp_event_info pp_event_info; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 430 | } isp_data; |
| 431 | }; |
| 432 | |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 433 | #define MSM_CAM_RESP_CTRL 0 |
| 434 | #define MSM_CAM_RESP_STAT_EVT_MSG 1 |
| 435 | #define MSM_CAM_RESP_STEREO_OP_1 2 |
| 436 | #define MSM_CAM_RESP_STEREO_OP_2 3 |
| 437 | #define MSM_CAM_RESP_V4L2 4 |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 438 | #define MSM_CAM_RESP_DIV_FRAME_EVT_MSG 5 |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 439 | #define MSM_CAM_RESP_DONE_EVENT 6 |
| 440 | #define MSM_CAM_RESP_MCTL_PP_EVENT 7 |
| 441 | #define MSM_CAM_RESP_MAX 8 |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 442 | |
Mingcheng Zhu | 270813a | 2011-08-10 17:23:18 -0700 | [diff] [blame] | 443 | #define MSM_CAM_APP_NOTIFY_EVENT 0 |
Kevin Chan | 4bb6ead | 2012-02-29 01:01:41 -0800 | [diff] [blame] | 444 | #define MSM_CAM_APP_NOTIFY_ERROR_EVENT 1 |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 445 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 446 | /* this one is used to send ctrl/status up to config thread */ |
Mingcheng Zhu | 8e9f99e | 2011-08-26 16:33:32 -0700 | [diff] [blame] | 447 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 448 | struct msm_stats_event_ctrl { |
| 449 | /* 0 - ctrl_cmd from control thread, |
| 450 | * 1 - stats/event kernel, |
| 451 | * 2 - V4L control or read request */ |
| 452 | int resptype; |
| 453 | int timeout_ms; |
| 454 | struct msm_ctrl_cmd ctrl_cmd; |
| 455 | /* struct vfe_event_t stats_event; */ |
| 456 | struct msm_cam_evt_msg stats_event; |
| 457 | }; |
| 458 | |
| 459 | /* 2. config command: config command(from config thread); */ |
| 460 | struct msm_camera_cfg_cmd { |
| 461 | /* what to config: |
| 462 | * 1 - sensor config, 2 - vfe config */ |
| 463 | uint16_t cfg_type; |
| 464 | |
| 465 | /* sensor config type */ |
| 466 | uint16_t cmd_type; |
| 467 | uint16_t queue; |
| 468 | uint16_t length; |
| 469 | void *value; |
| 470 | }; |
| 471 | |
| 472 | #define CMD_GENERAL 0 |
| 473 | #define CMD_AXI_CFG_OUT1 1 |
| 474 | #define CMD_AXI_CFG_SNAP_O1_AND_O2 2 |
| 475 | #define CMD_AXI_CFG_OUT2 3 |
| 476 | #define CMD_PICT_T_AXI_CFG 4 |
| 477 | #define CMD_PICT_M_AXI_CFG 5 |
| 478 | #define CMD_RAW_PICT_AXI_CFG 6 |
| 479 | |
| 480 | #define CMD_FRAME_BUF_RELEASE 7 |
| 481 | #define CMD_PREV_BUF_CFG 8 |
| 482 | #define CMD_SNAP_BUF_RELEASE 9 |
| 483 | #define CMD_SNAP_BUF_CFG 10 |
| 484 | #define CMD_STATS_DISABLE 11 |
| 485 | #define CMD_STATS_AEC_AWB_ENABLE 12 |
| 486 | #define CMD_STATS_AF_ENABLE 13 |
| 487 | #define CMD_STATS_AEC_ENABLE 14 |
| 488 | #define CMD_STATS_AWB_ENABLE 15 |
| 489 | #define CMD_STATS_ENABLE 16 |
| 490 | |
| 491 | #define CMD_STATS_AXI_CFG 17 |
| 492 | #define CMD_STATS_AEC_AXI_CFG 18 |
| 493 | #define CMD_STATS_AF_AXI_CFG 19 |
| 494 | #define CMD_STATS_AWB_AXI_CFG 20 |
| 495 | #define CMD_STATS_RS_AXI_CFG 21 |
| 496 | #define CMD_STATS_CS_AXI_CFG 22 |
| 497 | #define CMD_STATS_IHIST_AXI_CFG 23 |
| 498 | #define CMD_STATS_SKIN_AXI_CFG 24 |
| 499 | |
| 500 | #define CMD_STATS_BUF_RELEASE 25 |
| 501 | #define CMD_STATS_AEC_BUF_RELEASE 26 |
| 502 | #define CMD_STATS_AF_BUF_RELEASE 27 |
| 503 | #define CMD_STATS_AWB_BUF_RELEASE 28 |
| 504 | #define CMD_STATS_RS_BUF_RELEASE 29 |
| 505 | #define CMD_STATS_CS_BUF_RELEASE 30 |
| 506 | #define CMD_STATS_IHIST_BUF_RELEASE 31 |
| 507 | #define CMD_STATS_SKIN_BUF_RELEASE 32 |
| 508 | |
| 509 | #define UPDATE_STATS_INVALID 33 |
| 510 | #define CMD_AXI_CFG_SNAP_GEMINI 34 |
| 511 | #define CMD_AXI_CFG_SNAP 35 |
| 512 | #define CMD_AXI_CFG_PREVIEW 36 |
| 513 | #define CMD_AXI_CFG_VIDEO 37 |
| 514 | |
| 515 | #define CMD_STATS_IHIST_ENABLE 38 |
| 516 | #define CMD_STATS_RS_ENABLE 39 |
| 517 | #define CMD_STATS_CS_ENABLE 40 |
| 518 | #define CMD_VPE 41 |
| 519 | #define CMD_AXI_CFG_VPE 42 |
| 520 | #define CMD_AXI_CFG_ZSL 43 |
| 521 | #define CMD_AXI_CFG_SNAP_VPE 44 |
| 522 | #define CMD_AXI_CFG_SNAP_THUMB_VPE 45 |
Lakshmi Narayana Kalavala | bc315ea | 2012-07-24 09:55:48 -0700 | [diff] [blame] | 523 | |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 524 | #define CMD_CONFIG_PING_ADDR 46 |
| 525 | #define CMD_CONFIG_PONG_ADDR 47 |
| 526 | #define CMD_CONFIG_FREE_BUF_ADDR 48 |
| 527 | #define CMD_AXI_CFG_ZSL_ALL_CHNLS 49 |
| 528 | #define CMD_AXI_CFG_VIDEO_ALL_CHNLS 50 |
Suresh Vankadara | 055cb8e | 2012-01-18 00:50:04 +0530 | [diff] [blame] | 529 | #define CMD_VFE_BUFFER_RELEASE 51 |
Kevin Chan | cf26486 | 2012-04-19 19:10:38 -0700 | [diff] [blame] | 530 | #define CMD_VFE_PROCESS_IRQ 52 |
Lakshmi Narayana Kalavala | bc315ea | 2012-07-24 09:55:48 -0700 | [diff] [blame] | 531 | #define CMD_STATS_BG_ENABLE 53 |
| 532 | #define CMD_STATS_BF_ENABLE 54 |
| 533 | #define CMD_STATS_BHIST_ENABLE 55 |
| 534 | #define CMD_STATS_BG_BUF_RELEASE 56 |
| 535 | #define CMD_STATS_BF_BUF_RELEASE 57 |
| 536 | #define CMD_STATS_BHIST_BUF_RELEASE 58 |
Ankit Premrajka | 5d00d66 | 2012-07-30 09:42:26 -0700 | [diff] [blame] | 537 | #define CMD_VFE_PIX_SOF_COUNT_UPDATE 59 |
| 538 | #define CMD_VFE_COUNT_PIX_SOF_ENABLE 60 |
Peter Liu | efc1225 | 2012-09-13 12:19:13 -0700 | [diff] [blame] | 539 | #define CMD_STATS_BE_ENABLE 61 |
| 540 | #define CMD_STATS_BE_BUF_RELEASE 62 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 541 | |
Nishant Pandit | 5dd5442 | 2012-06-26 22:52:44 +0530 | [diff] [blame] | 542 | #define CMD_AXI_CFG_PRIM BIT(8) |
| 543 | #define CMD_AXI_CFG_PRIM_ALL_CHNLS BIT(9) |
| 544 | #define CMD_AXI_CFG_SEC BIT(10) |
| 545 | #define CMD_AXI_CFG_SEC_ALL_CHNLS BIT(11) |
| 546 | #define CMD_AXI_CFG_TERT1 BIT(12) |
| 547 | #define CMD_AXI_CFG_TERT2 BIT(13) |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 548 | |
Azam Sadiq Pasha Kapatrala Syed | 7c81518 | 2012-05-31 19:28:09 -0700 | [diff] [blame] | 549 | #define CMD_AXI_START 0xE1 |
| 550 | #define CMD_AXI_STOP 0xE2 |
Shuzhen Wang | 109c211 | 2012-07-23 17:28:11 -0700 | [diff] [blame] | 551 | #define CMD_AXI_RESET 0xE3 |
Nishant Pandit | d778571 | 2012-07-31 19:09:11 +0530 | [diff] [blame] | 552 | #define CMD_AXI_ABORT 0xE4 |
| 553 | |
Azam Sadiq Pasha Kapatrala Syed | 7c81518 | 2012-05-31 19:28:09 -0700 | [diff] [blame] | 554 | |
Lakshmi Narayana Kalavala | cd3d81e | 2012-07-31 13:04:03 -0700 | [diff] [blame] | 555 | |
| 556 | #define AXI_CMD_PREVIEW BIT(0) |
| 557 | #define AXI_CMD_CAPTURE BIT(1) |
| 558 | #define AXI_CMD_RECORD BIT(2) |
| 559 | #define AXI_CMD_ZSL BIT(3) |
| 560 | #define AXI_CMD_RAW_CAPTURE BIT(4) |
Lakshmi Narayana Kalavala | 3e8a1d1 | 2012-07-31 15:00:09 -0700 | [diff] [blame] | 561 | #define AXI_CMD_LIVESHOT BIT(5) |
Lakshmi Narayana Kalavala | cd3d81e | 2012-07-31 13:04:03 -0700 | [diff] [blame] | 562 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 563 | /* vfe config command: config command(from config thread)*/ |
| 564 | struct msm_vfe_cfg_cmd { |
| 565 | int cmd_type; |
| 566 | uint16_t length; |
| 567 | void *value; |
| 568 | }; |
| 569 | |
| 570 | struct msm_vpe_cfg_cmd { |
| 571 | int cmd_type; |
| 572 | uint16_t length; |
| 573 | void *value; |
| 574 | }; |
| 575 | |
| 576 | #define MAX_CAMERA_ENABLE_NAME_LEN 32 |
| 577 | struct camera_enable_cmd { |
| 578 | char name[MAX_CAMERA_ENABLE_NAME_LEN]; |
| 579 | }; |
| 580 | |
| 581 | #define MSM_PMEM_OUTPUT1 0 |
| 582 | #define MSM_PMEM_OUTPUT2 1 |
| 583 | #define MSM_PMEM_OUTPUT1_OUTPUT2 2 |
| 584 | #define MSM_PMEM_THUMBNAIL 3 |
| 585 | #define MSM_PMEM_MAINIMG 4 |
| 586 | #define MSM_PMEM_RAW_MAINIMG 5 |
| 587 | #define MSM_PMEM_AEC_AWB 6 |
| 588 | #define MSM_PMEM_AF 7 |
| 589 | #define MSM_PMEM_AEC 8 |
| 590 | #define MSM_PMEM_AWB 9 |
| 591 | #define MSM_PMEM_RS 10 |
| 592 | #define MSM_PMEM_CS 11 |
| 593 | #define MSM_PMEM_IHIST 12 |
| 594 | #define MSM_PMEM_SKIN 13 |
| 595 | #define MSM_PMEM_VIDEO 14 |
| 596 | #define MSM_PMEM_PREVIEW 15 |
| 597 | #define MSM_PMEM_VIDEO_VPE 16 |
| 598 | #define MSM_PMEM_C2D 17 |
| 599 | #define MSM_PMEM_MAINIMG_VPE 18 |
| 600 | #define MSM_PMEM_THUMBNAIL_VPE 19 |
Lakshmi Narayana Kalavala | bc315ea | 2012-07-24 09:55:48 -0700 | [diff] [blame] | 601 | #define MSM_PMEM_BAYER_GRID 20 |
| 602 | #define MSM_PMEM_BAYER_FOCUS 21 |
| 603 | #define MSM_PMEM_BAYER_HIST 22 |
Peter Liu | efc1225 | 2012-09-13 12:19:13 -0700 | [diff] [blame] | 604 | #define MSM_PMEM_BAYER_EXPOSURE 23 |
| 605 | #define MSM_PMEM_MAX 24 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 606 | |
| 607 | #define STAT_AEAW 0 |
| 608 | #define STAT_AEC 1 |
| 609 | #define STAT_AF 2 |
| 610 | #define STAT_AWB 3 |
| 611 | #define STAT_RS 4 |
| 612 | #define STAT_CS 5 |
| 613 | #define STAT_IHIST 6 |
| 614 | #define STAT_SKIN 7 |
Lakshmi Narayana Kalavala | bc315ea | 2012-07-24 09:55:48 -0700 | [diff] [blame] | 615 | #define STAT_BG 8 |
| 616 | #define STAT_BF 9 |
Peter Liu | efc1225 | 2012-09-13 12:19:13 -0700 | [diff] [blame] | 617 | #define STAT_BE 10 |
| 618 | #define STAT_BHIST 11 |
| 619 | #define STAT_MAX 12 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 620 | |
| 621 | #define FRAME_PREVIEW_OUTPUT1 0 |
| 622 | #define FRAME_PREVIEW_OUTPUT2 1 |
| 623 | #define FRAME_SNAPSHOT 2 |
| 624 | #define FRAME_THUMBNAIL 3 |
| 625 | #define FRAME_RAW_SNAPSHOT 4 |
| 626 | #define FRAME_MAX 5 |
| 627 | |
Lakshmi Narayana Kalavala | 2db3384 | 2012-06-26 22:41:32 -0700 | [diff] [blame] | 628 | enum msm_stats_enum_type { |
| 629 | MSM_STATS_TYPE_AEC, /* legacy based AEC */ |
| 630 | MSM_STATS_TYPE_AF, /* legacy based AF */ |
| 631 | MSM_STATS_TYPE_AWB, /* legacy based AWB */ |
| 632 | MSM_STATS_TYPE_RS, /* legacy based RS */ |
| 633 | MSM_STATS_TYPE_CS, /* legacy based CS */ |
| 634 | MSM_STATS_TYPE_IHIST, /* legacy based HIST */ |
| 635 | MSM_STATS_TYPE_SKIN, /* legacy based SKIN */ |
| 636 | MSM_STATS_TYPE_BG, /* Bayer Grids */ |
| 637 | MSM_STATS_TYPE_BF, /* Bayer Focus */ |
Peter Liu | efc1225 | 2012-09-13 12:19:13 -0700 | [diff] [blame] | 638 | MSM_STATS_TYPE_BE, /* Bayer Exposure*/ |
Lakshmi Narayana Kalavala | 2db3384 | 2012-06-26 22:41:32 -0700 | [diff] [blame] | 639 | MSM_STATS_TYPE_BHIST, /* Bayer Hist */ |
| 640 | MSM_STATS_TYPE_AE_AW, /* legacy stats for vfe 2.x*/ |
Lakshmi Narayana Kalavala | 47e5657 | 2012-08-10 20:05:55 -0700 | [diff] [blame] | 641 | MSM_STATS_TYPE_COMP, /* Composite stats */ |
Lakshmi Narayana Kalavala | 2db3384 | 2012-06-26 22:41:32 -0700 | [diff] [blame] | 642 | MSM_STATS_TYPE_MAX /* MAX */ |
| 643 | }; |
| 644 | |
| 645 | struct msm_stats_buf_info { |
| 646 | int type; /* msm_stats_enum_type */ |
| 647 | int fd; |
| 648 | void *vaddr; |
| 649 | uint32_t offset; |
| 650 | uint32_t len; |
| 651 | uint32_t y_off; |
| 652 | uint32_t cbcr_off; |
| 653 | uint32_t planar0_off; |
| 654 | uint32_t planar1_off; |
| 655 | uint32_t planar2_off; |
| 656 | uint8_t active; |
| 657 | int buf_idx; |
| 658 | }; |
| 659 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 660 | struct msm_pmem_info { |
| 661 | int type; |
| 662 | int fd; |
| 663 | void *vaddr; |
| 664 | uint32_t offset; |
| 665 | uint32_t len; |
Kiran Kumar H N | 5a19c68 | 2011-07-23 11:34:34 -0700 | [diff] [blame] | 666 | uint32_t y_off; |
| 667 | uint32_t cbcr_off; |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 668 | uint32_t planar0_off; |
| 669 | uint32_t planar1_off; |
| 670 | uint32_t planar2_off; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 671 | uint8_t active; |
| 672 | }; |
| 673 | |
| 674 | struct outputCfg { |
| 675 | uint32_t height; |
| 676 | uint32_t width; |
| 677 | |
| 678 | uint32_t window_height_firstline; |
| 679 | uint32_t window_height_lastline; |
| 680 | }; |
| 681 | |
Ankit Premrajka | 70613ec | 2012-01-26 16:24:23 -0800 | [diff] [blame] | 682 | #define VIDEO_NODE 0 |
| 683 | #define MCTL_NODE 1 |
| 684 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 685 | #define OUTPUT_1 0 |
| 686 | #define OUTPUT_2 1 |
| 687 | #define OUTPUT_1_AND_2 2 /* snapshot only */ |
| 688 | #define OUTPUT_1_AND_3 3 /* video */ |
| 689 | #define CAMIF_TO_AXI_VIA_OUTPUT_2 4 |
| 690 | #define OUTPUT_1_AND_CAMIF_TO_AXI_VIA_OUTPUT_2 5 |
| 691 | #define OUTPUT_2_AND_CAMIF_TO_AXI_VIA_OUTPUT_1 6 |
| 692 | #define OUTPUT_1_2_AND_3 7 |
Kiran Kumar H N | 4cff94a | 2011-10-17 11:37:33 -0700 | [diff] [blame] | 693 | #define OUTPUT_ALL_CHNLS 8 |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 694 | #define OUTPUT_VIDEO_ALL_CHNLS 9 |
| 695 | #define OUTPUT_ZSL_ALL_CHNLS 10 |
| 696 | #define LAST_AXI_OUTPUT_MODE_ENUM = OUTPUT_ZSL_ALL_CHNLS |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 697 | |
Nishant Pandit | 5dd5442 | 2012-06-26 22:52:44 +0530 | [diff] [blame] | 698 | #define OUTPUT_PRIM BIT(8) |
| 699 | #define OUTPUT_PRIM_ALL_CHNLS BIT(9) |
| 700 | #define OUTPUT_SEC BIT(10) |
| 701 | #define OUTPUT_SEC_ALL_CHNLS BIT(11) |
| 702 | #define OUTPUT_TERT1 BIT(12) |
| 703 | #define OUTPUT_TERT2 BIT(13) |
| 704 | |
Kiran Kumar H N | dd12847 | 2011-12-01 09:35:34 -0800 | [diff] [blame] | 705 | |
| 706 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 707 | #define MSM_FRAME_PREV_1 0 |
| 708 | #define MSM_FRAME_PREV_2 1 |
| 709 | #define MSM_FRAME_ENC 2 |
| 710 | |
Nishant Pandit | 5dd5442 | 2012-06-26 22:52:44 +0530 | [diff] [blame] | 711 | #define OUTPUT_TYPE_P BIT(0) |
| 712 | #define OUTPUT_TYPE_T BIT(1) |
| 713 | #define OUTPUT_TYPE_S BIT(2) |
| 714 | #define OUTPUT_TYPE_V BIT(3) |
| 715 | #define OUTPUT_TYPE_L BIT(4) |
| 716 | #define OUTPUT_TYPE_ST_L BIT(5) |
| 717 | #define OUTPUT_TYPE_ST_R BIT(6) |
| 718 | #define OUTPUT_TYPE_ST_D BIT(7) |
| 719 | #define OUTPUT_TYPE_R BIT(8) |
| 720 | #define OUTPUT_TYPE_R1 BIT(9) |
Lakshmi Narayana Kalavala | 47e5657 | 2012-08-10 20:05:55 -0700 | [diff] [blame] | 721 | #define OUTPUT_TYPE_SAEC BIT(10) |
| 722 | #define OUTPUT_TYPE_SAFC BIT(11) |
| 723 | #define OUTPUT_TYPE_SAWB BIT(12) |
| 724 | #define OUTPUT_TYPE_IHST BIT(13) |
| 725 | #define OUTPUT_TYPE_CSTA BIT(14) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 726 | |
| 727 | struct fd_roi_info { |
| 728 | void *info; |
| 729 | int info_len; |
| 730 | }; |
| 731 | |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 732 | struct msm_mem_map_info { |
| 733 | uint32_t cookie; |
| 734 | uint32_t length; |
Mingcheng Zhu | fe7abc0 | 2011-08-09 13:27:39 -0700 | [diff] [blame] | 735 | uint32_t mem_type; |
Mingcheng Zhu | 9559ee4 | 2011-08-09 11:54:22 -0700 | [diff] [blame] | 736 | }; |
| 737 | |
Mingcheng Zhu | 4950550 | 2011-07-19 20:44:36 -0700 | [diff] [blame] | 738 | #define MSM_MEM_MMAP 0 |
| 739 | #define MSM_MEM_USERPTR 1 |
| 740 | #define MSM_PLANE_MAX 8 |
| 741 | #define MSM_PLANE_Y 0 |
| 742 | #define MSM_PLANE_UV 1 |
| 743 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 744 | struct msm_frame { |
| 745 | struct timespec ts; |
| 746 | int path; |
| 747 | int type; |
| 748 | unsigned long buffer; |
| 749 | uint32_t phy_offset; |
Kiran Kumar H N | 5a19c68 | 2011-07-23 11:34:34 -0700 | [diff] [blame] | 750 | uint32_t y_off; |
| 751 | uint32_t cbcr_off; |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 752 | uint32_t planar0_off; |
| 753 | uint32_t planar1_off; |
| 754 | uint32_t planar2_off; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 755 | int fd; |
| 756 | |
| 757 | void *cropinfo; |
| 758 | int croplen; |
| 759 | uint32_t error_code; |
| 760 | struct fd_roi_info roi_info; |
| 761 | uint32_t frame_id; |
| 762 | int stcam_quality_ind; |
| 763 | uint32_t stcam_conv_value; |
Ankit Premrajka | 3e90b9f | 2011-11-01 18:48:45 -0700 | [diff] [blame] | 764 | |
| 765 | struct ion_allocation_data ion_alloc; |
| 766 | struct ion_fd_data fd_data; |
Ankit Premrajka | e2c9c0b | 2012-06-07 17:18:25 -0700 | [diff] [blame] | 767 | int ion_dev_fd; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 768 | }; |
| 769 | |
| 770 | enum msm_st_frame_packing { |
| 771 | SIDE_BY_SIDE_HALF, |
| 772 | SIDE_BY_SIDE_FULL, |
| 773 | TOP_DOWN_HALF, |
| 774 | TOP_DOWN_FULL, |
| 775 | }; |
| 776 | |
| 777 | struct msm_st_crop { |
| 778 | uint32_t in_w; |
| 779 | uint32_t in_h; |
| 780 | uint32_t out_w; |
| 781 | uint32_t out_h; |
| 782 | }; |
| 783 | |
| 784 | struct msm_st_half { |
Alekhya,Monika | fc81e10 | 2011-12-29 15:17:33 +0530 | [diff] [blame] | 785 | uint32_t buf_p0_off; |
| 786 | uint32_t buf_p1_off; |
| 787 | uint32_t buf_p0_stride; |
| 788 | uint32_t buf_p1_stride; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 789 | uint32_t pix_x_off; |
| 790 | uint32_t pix_y_off; |
| 791 | struct msm_st_crop stCropInfo; |
| 792 | }; |
| 793 | |
| 794 | struct msm_st_frame { |
| 795 | struct msm_frame buf_info; |
| 796 | int type; |
| 797 | enum msm_st_frame_packing packing; |
| 798 | struct msm_st_half L; |
| 799 | struct msm_st_half R; |
| 800 | int frame_id; |
| 801 | }; |
| 802 | |
| 803 | #define MSM_CAMERA_ERR_MASK (0xFFFFFFFF & 1) |
| 804 | |
| 805 | struct stats_buff { |
| 806 | unsigned long buff; |
| 807 | int fd; |
| 808 | }; |
| 809 | |
| 810 | struct msm_stats_buf { |
Lakshmi Narayana Kalavala | 4ab97a9 | 2011-07-26 15:30:14 -0700 | [diff] [blame] | 811 | uint8_t awb_ymin; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 812 | struct stats_buff aec; |
| 813 | struct stats_buff awb; |
| 814 | struct stats_buff af; |
Peter Liu | efc1225 | 2012-09-13 12:19:13 -0700 | [diff] [blame] | 815 | struct stats_buff be; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 816 | struct stats_buff ihist; |
| 817 | struct stats_buff rs; |
| 818 | struct stats_buff cs; |
| 819 | struct stats_buff skin; |
| 820 | int type; |
| 821 | uint32_t status_bits; |
| 822 | unsigned long buffer; |
| 823 | int fd; |
Ankit Premrajka | 073e0ca | 2012-03-06 12:26:08 -0800 | [diff] [blame] | 824 | int length; |
| 825 | struct ion_handle *handle; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 826 | uint32_t frame_id; |
Lakshmi Narayana Kalavala | 2db3384 | 2012-06-26 22:41:32 -0700 | [diff] [blame] | 827 | int buf_idx; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 828 | }; |
| 829 | #define MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT 0 |
| 830 | /* video capture mode in VIDIOC_S_PARM */ |
| 831 | #define MSM_V4L2_EXT_CAPTURE_MODE_PREVIEW \ |
| 832 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+1) |
| 833 | /* extendedmode for video recording in VIDIOC_S_PARM */ |
| 834 | #define MSM_V4L2_EXT_CAPTURE_MODE_VIDEO \ |
| 835 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+2) |
| 836 | /* extendedmode for the full size main image in VIDIOC_S_PARM */ |
| 837 | #define MSM_V4L2_EXT_CAPTURE_MODE_MAIN (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+3) |
| 838 | /* extendedmode for the thumb nail image in VIDIOC_S_PARM */ |
| 839 | #define MSM_V4L2_EXT_CAPTURE_MODE_THUMBNAIL \ |
| 840 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+4) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 841 | /* ISP_PIX_OUTPUT1: no pp, directly send output1 buf to user */ |
| 842 | #define MSM_V4L2_EXT_CAPTURE_MODE_ISP_PIX_OUTPUT1 \ |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 843 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+5) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 844 | /* ISP_PIX_OUTPUT2: no pp, directly send output2 buf to user */ |
| 845 | #define MSM_V4L2_EXT_CAPTURE_MODE_ISP_PIX_OUTPUT2 \ |
Nishant Pandit | 5dd5442 | 2012-06-26 22:52:44 +0530 | [diff] [blame] | 846 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+6) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 847 | /* raw image type */ |
| 848 | #define MSM_V4L2_EXT_CAPTURE_MODE_RAW \ |
Nishant Pandit | 5dd5442 | 2012-06-26 22:52:44 +0530 | [diff] [blame] | 849 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+7) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 850 | /* RDI dump */ |
| 851 | #define MSM_V4L2_EXT_CAPTURE_MODE_RDI \ |
Nishant Pandit | 5dd5442 | 2012-06-26 22:52:44 +0530 | [diff] [blame] | 852 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+8) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 853 | /* RDI dump 1 */ |
| 854 | #define MSM_V4L2_EXT_CAPTURE_MODE_RDI1 \ |
Mingcheng Zhu | 96458e2 | 2012-08-07 21:45:43 -0700 | [diff] [blame] | 855 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+9) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 856 | /* RDI dump 2 */ |
| 857 | #define MSM_V4L2_EXT_CAPTURE_MODE_RDI2 \ |
Mingcheng Zhu | 96458e2 | 2012-08-07 21:45:43 -0700 | [diff] [blame] | 858 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+10) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 859 | #define MSM_V4L2_EXT_CAPTURE_MODE_AEC \ |
Mingcheng Zhu | 96458e2 | 2012-08-07 21:45:43 -0700 | [diff] [blame] | 860 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+11) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 861 | #define MSM_V4L2_EXT_CAPTURE_MODE_AWB \ |
Mingcheng Zhu | 96458e2 | 2012-08-07 21:45:43 -0700 | [diff] [blame] | 862 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+12) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 863 | #define MSM_V4L2_EXT_CAPTURE_MODE_AF \ |
Mingcheng Zhu | 96458e2 | 2012-08-07 21:45:43 -0700 | [diff] [blame] | 864 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+13) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 865 | #define MSM_V4L2_EXT_CAPTURE_MODE_IHIST \ |
Mingcheng Zhu | 96458e2 | 2012-08-07 21:45:43 -0700 | [diff] [blame] | 866 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+14) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 867 | #define MSM_V4L2_EXT_CAPTURE_MODE_CS \ |
Lakshmi Narayana Kalavala | 47e5657 | 2012-08-10 20:05:55 -0700 | [diff] [blame] | 868 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+15) |
Mingcheng Zhu | 51dbdc5 | 2012-08-19 22:01:09 -0700 | [diff] [blame] | 869 | #define MSM_V4L2_EXT_CAPTURE_MODE_RS \ |
| 870 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+16) |
| 871 | #define MSM_V4L2_EXT_CAPTURE_MODE_CSTA \ |
| 872 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+17) |
Aditya Jonnalagadda | 7ea9650 | 2012-09-12 12:45:18 +0530 | [diff] [blame] | 873 | #define MSM_V4L2_EXT_CAPTURE_MODE_V2X_LIVESHOT \ |
| 874 | (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+18) |
| 875 | #define MSM_V4L2_EXT_CAPTURE_MODE_MAX (MSM_V4L2_EXT_CAPTURE_MODE_DEFAULT+19) |
| 876 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 877 | |
| 878 | #define MSM_V4L2_PID_MOTION_ISO V4L2_CID_PRIVATE_BASE |
| 879 | #define MSM_V4L2_PID_EFFECT (V4L2_CID_PRIVATE_BASE+1) |
| 880 | #define MSM_V4L2_PID_HJR (V4L2_CID_PRIVATE_BASE+2) |
| 881 | #define MSM_V4L2_PID_LED_MODE (V4L2_CID_PRIVATE_BASE+3) |
| 882 | #define MSM_V4L2_PID_PREP_SNAPSHOT (V4L2_CID_PRIVATE_BASE+4) |
| 883 | #define MSM_V4L2_PID_EXP_METERING (V4L2_CID_PRIVATE_BASE+5) |
| 884 | #define MSM_V4L2_PID_ISO (V4L2_CID_PRIVATE_BASE+6) |
| 885 | #define MSM_V4L2_PID_CAM_MODE (V4L2_CID_PRIVATE_BASE+7) |
| 886 | #define MSM_V4L2_PID_LUMA_ADAPTATION (V4L2_CID_PRIVATE_BASE+8) |
| 887 | #define MSM_V4L2_PID_BEST_SHOT (V4L2_CID_PRIVATE_BASE+9) |
| 888 | #define MSM_V4L2_PID_FOCUS_MODE (V4L2_CID_PRIVATE_BASE+10) |
| 889 | #define MSM_V4L2_PID_BL_DETECTION (V4L2_CID_PRIVATE_BASE+11) |
| 890 | #define MSM_V4L2_PID_SNOW_DETECTION (V4L2_CID_PRIVATE_BASE+12) |
| 891 | #define MSM_V4L2_PID_CTRL_CMD (V4L2_CID_PRIVATE_BASE+13) |
| 892 | #define MSM_V4L2_PID_EVT_SUB_INFO (V4L2_CID_PRIVATE_BASE+14) |
Mingcheng Zhu | 5b04d35 | 2011-07-22 21:18:42 -0700 | [diff] [blame] | 893 | #define MSM_V4L2_PID_STROBE_FLASH (V4L2_CID_PRIVATE_BASE+15) |
Kiran Kumar H N | 9078590 | 2012-07-05 13:59:38 -0700 | [diff] [blame] | 894 | #define MSM_V4L2_PID_INST_HANDLE (V4L2_CID_PRIVATE_BASE+16) |
Mingcheng Zhu | 5b04d35 | 2011-07-22 21:18:42 -0700 | [diff] [blame] | 895 | #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] | 896 | #define MSM_V4L2_PID_PP_PLANE_INFO (V4L2_CID_PRIVATE_BASE+18) |
| 897 | #define MSM_V4L2_PID_MAX MSM_V4L2_PID_PP_PLANE_INFO |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 898 | |
| 899 | /* camera operation mode for video recording - two frame output queues */ |
| 900 | #define MSM_V4L2_CAM_OP_DEFAULT 0 |
| 901 | /* camera operation mode for video recording - two frame output queues */ |
| 902 | #define MSM_V4L2_CAM_OP_PREVIEW (MSM_V4L2_CAM_OP_DEFAULT+1) |
| 903 | /* camera operation mode for video recording - two frame output queues */ |
| 904 | #define MSM_V4L2_CAM_OP_VIDEO (MSM_V4L2_CAM_OP_DEFAULT+2) |
| 905 | /* camera operation mode for standard shapshot - two frame output queues */ |
| 906 | #define MSM_V4L2_CAM_OP_CAPTURE (MSM_V4L2_CAM_OP_DEFAULT+3) |
| 907 | /* camera operation mode for zsl shapshot - three output queues */ |
| 908 | #define MSM_V4L2_CAM_OP_ZSL (MSM_V4L2_CAM_OP_DEFAULT+4) |
| 909 | /* camera operation mode for raw snapshot - one frame output queue */ |
| 910 | #define MSM_V4L2_CAM_OP_RAW (MSM_V4L2_CAM_OP_DEFAULT+5) |
Jignesh Mehta | 6cf8a74 | 2012-02-04 23:40:50 -0800 | [diff] [blame] | 911 | /* camera operation mode for jpeg snapshot - one frame output queue */ |
| 912 | #define MSM_V4L2_CAM_OP_JPEG_CAPTURE (MSM_V4L2_CAM_OP_DEFAULT+6) |
| 913 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 914 | |
| 915 | #define MSM_V4L2_VID_CAP_TYPE 0 |
| 916 | #define MSM_V4L2_STREAM_ON 1 |
| 917 | #define MSM_V4L2_STREAM_OFF 2 |
| 918 | #define MSM_V4L2_SNAPSHOT 3 |
| 919 | #define MSM_V4L2_QUERY_CTRL 4 |
| 920 | #define MSM_V4L2_GET_CTRL 5 |
| 921 | #define MSM_V4L2_SET_CTRL 6 |
| 922 | #define MSM_V4L2_QUERY 7 |
| 923 | #define MSM_V4L2_GET_CROP 8 |
| 924 | #define MSM_V4L2_SET_CROP 9 |
| 925 | #define MSM_V4L2_OPEN 10 |
| 926 | #define MSM_V4L2_CLOSE 11 |
| 927 | #define MSM_V4L2_SET_CTRL_CMD 12 |
| 928 | #define MSM_V4L2_EVT_SUB_MASK 13 |
Ankit Premrajka | 8c9bf5d | 2012-08-07 15:45:31 -0700 | [diff] [blame] | 929 | #define MSM_V4L2_PRIVATE_CMD 14 |
| 930 | #define MSM_V4L2_MAX 15 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 931 | #define V4L2_CAMERA_EXIT 43 |
| 932 | |
| 933 | struct crop_info { |
| 934 | void *info; |
| 935 | int len; |
| 936 | }; |
| 937 | |
| 938 | struct msm_postproc { |
| 939 | int ftnum; |
| 940 | struct msm_frame fthumnail; |
| 941 | int fmnum; |
| 942 | struct msm_frame fmain; |
| 943 | }; |
| 944 | |
| 945 | struct msm_snapshot_pp_status { |
| 946 | void *status; |
| 947 | }; |
| 948 | |
| 949 | #define CFG_SET_MODE 0 |
| 950 | #define CFG_SET_EFFECT 1 |
| 951 | #define CFG_START 2 |
| 952 | #define CFG_PWR_UP 3 |
| 953 | #define CFG_PWR_DOWN 4 |
| 954 | #define CFG_WRITE_EXPOSURE_GAIN 5 |
| 955 | #define CFG_SET_DEFAULT_FOCUS 6 |
| 956 | #define CFG_MOVE_FOCUS 7 |
| 957 | #define CFG_REGISTER_TO_REAL_GAIN 8 |
| 958 | #define CFG_REAL_TO_REGISTER_GAIN 9 |
| 959 | #define CFG_SET_FPS 10 |
| 960 | #define CFG_SET_PICT_FPS 11 |
| 961 | #define CFG_SET_BRIGHTNESS 12 |
| 962 | #define CFG_SET_CONTRAST 13 |
| 963 | #define CFG_SET_ZOOM 14 |
| 964 | #define CFG_SET_EXPOSURE_MODE 15 |
| 965 | #define CFG_SET_WB 16 |
| 966 | #define CFG_SET_ANTIBANDING 17 |
| 967 | #define CFG_SET_EXP_GAIN 18 |
| 968 | #define CFG_SET_PICT_EXP_GAIN 19 |
| 969 | #define CFG_SET_LENS_SHADING 20 |
| 970 | #define CFG_GET_PICT_FPS 21 |
| 971 | #define CFG_GET_PREV_L_PF 22 |
| 972 | #define CFG_GET_PREV_P_PL 23 |
| 973 | #define CFG_GET_PICT_L_PF 24 |
| 974 | #define CFG_GET_PICT_P_PL 25 |
| 975 | #define CFG_GET_AF_MAX_STEPS 26 |
| 976 | #define CFG_GET_PICT_MAX_EXP_LC 27 |
| 977 | #define CFG_SEND_WB_INFO 28 |
| 978 | #define CFG_SENSOR_INIT 29 |
| 979 | #define CFG_GET_3D_CALI_DATA 30 |
| 980 | #define CFG_GET_CALIB_DATA 31 |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 981 | #define CFG_GET_OUTPUT_INFO 32 |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 982 | #define CFG_GET_EEPROM_INFO 33 |
| 983 | #define CFG_GET_EEPROM_DATA 34 |
| 984 | #define CFG_SET_ACTUATOR_INFO 35 |
| 985 | #define CFG_GET_ACTUATOR_INFO 36 |
Su Liu | 6c3bb32 | 2012-02-14 02:15:05 +0530 | [diff] [blame] | 986 | /* TBD: QRD */ |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 987 | #define CFG_SET_SATURATION 37 |
| 988 | #define CFG_SET_SHARPNESS 38 |
| 989 | #define CFG_SET_TOUCHAEC 39 |
| 990 | #define CFG_SET_AUTO_FOCUS 40 |
| 991 | #define CFG_SET_AUTOFLASH 41 |
| 992 | #define CFG_SET_EXPOSURE_COMPENSATION 42 |
| 993 | #define CFG_SET_ISO 43 |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 994 | #define CFG_START_STREAM 44 |
| 995 | #define CFG_STOP_STREAM 45 |
| 996 | #define CFG_GET_CSI_PARAMS 46 |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 997 | #define CFG_POWER_UP 47 |
| 998 | #define CFG_POWER_DOWN 48 |
| 999 | #define CFG_WRITE_I2C_ARRAY 49 |
| 1000 | #define CFG_READ_I2C_ARRAY 50 |
| 1001 | #define CFG_PCLK_CHANGE 51 |
| 1002 | #define CFG_CONFIG_VREG_ARRAY 52 |
| 1003 | #define CFG_CONFIG_CLK_ARRAY 53 |
| 1004 | #define CFG_GPIO_OP 54 |
| 1005 | #define CFG_MAX 55 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1006 | |
| 1007 | |
| 1008 | #define MOVE_NEAR 0 |
| 1009 | #define MOVE_FAR 1 |
| 1010 | |
| 1011 | #define SENSOR_PREVIEW_MODE 0 |
| 1012 | #define SENSOR_SNAPSHOT_MODE 1 |
| 1013 | #define SENSOR_RAW_SNAPSHOT_MODE 2 |
| 1014 | #define SENSOR_HFR_60FPS_MODE 3 |
| 1015 | #define SENSOR_HFR_90FPS_MODE 4 |
| 1016 | #define SENSOR_HFR_120FPS_MODE 5 |
| 1017 | |
| 1018 | #define SENSOR_QTR_SIZE 0 |
| 1019 | #define SENSOR_FULL_SIZE 1 |
| 1020 | #define SENSOR_QVGA_SIZE 2 |
| 1021 | #define SENSOR_INVALID_SIZE 3 |
| 1022 | |
| 1023 | #define CAMERA_EFFECT_OFF 0 |
| 1024 | #define CAMERA_EFFECT_MONO 1 |
| 1025 | #define CAMERA_EFFECT_NEGATIVE 2 |
| 1026 | #define CAMERA_EFFECT_SOLARIZE 3 |
| 1027 | #define CAMERA_EFFECT_SEPIA 4 |
| 1028 | #define CAMERA_EFFECT_POSTERIZE 5 |
| 1029 | #define CAMERA_EFFECT_WHITEBOARD 6 |
| 1030 | #define CAMERA_EFFECT_BLACKBOARD 7 |
| 1031 | #define CAMERA_EFFECT_AQUA 8 |
Yonggui Mao | c0055a1 | 2011-09-29 19:31:47 -0700 | [diff] [blame] | 1032 | #define CAMERA_EFFECT_EMBOSS 9 |
| 1033 | #define CAMERA_EFFECT_SKETCH 10 |
| 1034 | #define CAMERA_EFFECT_NEON 11 |
Hariram Purushothaman | d29699f | 2012-10-29 16:46:26 -0700 | [diff] [blame] | 1035 | #define CAMERA_EFFECT_FADED 12 |
| 1036 | #define CAMERA_EFFECT_VINTAGECOOL 13 |
| 1037 | #define CAMERA_EFFECT_VINTAGEWARM 14 |
| 1038 | #define CAMERA_EFFECT_ACCENT_BLUE 15 |
| 1039 | #define CAMERA_EFFECT_ACCENT_GREEN 16 |
| 1040 | #define CAMERA_EFFECT_ACCENT_ORANGE 17 |
| 1041 | #define CAMERA_EFFECT_MAX 18 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1042 | |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 1043 | /* QRD */ |
| 1044 | #define CAMERA_EFFECT_BW 10 |
| 1045 | #define CAMERA_EFFECT_BLUISH 12 |
| 1046 | #define CAMERA_EFFECT_REDDISH 13 |
| 1047 | #define CAMERA_EFFECT_GREENISH 14 |
| 1048 | |
| 1049 | /* QRD */ |
| 1050 | #define CAMERA_ANTIBANDING_OFF 0 |
| 1051 | #define CAMERA_ANTIBANDING_50HZ 2 |
| 1052 | #define CAMERA_ANTIBANDING_60HZ 1 |
| 1053 | #define CAMERA_ANTIBANDING_AUTO 3 |
| 1054 | |
| 1055 | #define CAMERA_CONTRAST_LV0 0 |
| 1056 | #define CAMERA_CONTRAST_LV1 1 |
| 1057 | #define CAMERA_CONTRAST_LV2 2 |
| 1058 | #define CAMERA_CONTRAST_LV3 3 |
| 1059 | #define CAMERA_CONTRAST_LV4 4 |
| 1060 | #define CAMERA_CONTRAST_LV5 5 |
| 1061 | #define CAMERA_CONTRAST_LV6 6 |
| 1062 | #define CAMERA_CONTRAST_LV7 7 |
| 1063 | #define CAMERA_CONTRAST_LV8 8 |
| 1064 | #define CAMERA_CONTRAST_LV9 9 |
| 1065 | |
| 1066 | #define CAMERA_BRIGHTNESS_LV0 0 |
| 1067 | #define CAMERA_BRIGHTNESS_LV1 1 |
| 1068 | #define CAMERA_BRIGHTNESS_LV2 2 |
| 1069 | #define CAMERA_BRIGHTNESS_LV3 3 |
| 1070 | #define CAMERA_BRIGHTNESS_LV4 4 |
| 1071 | #define CAMERA_BRIGHTNESS_LV5 5 |
| 1072 | #define CAMERA_BRIGHTNESS_LV6 6 |
| 1073 | #define CAMERA_BRIGHTNESS_LV7 7 |
| 1074 | #define CAMERA_BRIGHTNESS_LV8 8 |
| 1075 | |
| 1076 | |
| 1077 | #define CAMERA_SATURATION_LV0 0 |
| 1078 | #define CAMERA_SATURATION_LV1 1 |
| 1079 | #define CAMERA_SATURATION_LV2 2 |
| 1080 | #define CAMERA_SATURATION_LV3 3 |
| 1081 | #define CAMERA_SATURATION_LV4 4 |
| 1082 | #define CAMERA_SATURATION_LV5 5 |
| 1083 | #define CAMERA_SATURATION_LV6 6 |
| 1084 | #define CAMERA_SATURATION_LV7 7 |
| 1085 | #define CAMERA_SATURATION_LV8 8 |
| 1086 | |
| 1087 | #define CAMERA_SHARPNESS_LV0 0 |
| 1088 | #define CAMERA_SHARPNESS_LV1 3 |
| 1089 | #define CAMERA_SHARPNESS_LV2 6 |
| 1090 | #define CAMERA_SHARPNESS_LV3 9 |
| 1091 | #define CAMERA_SHARPNESS_LV4 12 |
| 1092 | #define CAMERA_SHARPNESS_LV5 15 |
| 1093 | #define CAMERA_SHARPNESS_LV6 18 |
| 1094 | #define CAMERA_SHARPNESS_LV7 21 |
| 1095 | #define CAMERA_SHARPNESS_LV8 24 |
| 1096 | #define CAMERA_SHARPNESS_LV9 27 |
| 1097 | #define CAMERA_SHARPNESS_LV10 30 |
| 1098 | |
| 1099 | #define CAMERA_SETAE_AVERAGE 0 |
| 1100 | #define CAMERA_SETAE_CENWEIGHT 1 |
| 1101 | |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 1102 | #define CAMERA_WB_AUTO 1 /* This list must match aeecamera.h */ |
| 1103 | #define CAMERA_WB_CUSTOM 2 |
| 1104 | #define CAMERA_WB_INCANDESCENT 3 |
| 1105 | #define CAMERA_WB_FLUORESCENT 4 |
| 1106 | #define CAMERA_WB_DAYLIGHT 5 |
| 1107 | #define CAMERA_WB_CLOUDY_DAYLIGHT 6 |
| 1108 | #define CAMERA_WB_TWILIGHT 7 |
| 1109 | #define CAMERA_WB_SHADE 8 |
| 1110 | |
| 1111 | #define CAMERA_EXPOSURE_COMPENSATION_LV0 12 |
| 1112 | #define CAMERA_EXPOSURE_COMPENSATION_LV1 6 |
| 1113 | #define CAMERA_EXPOSURE_COMPENSATION_LV2 0 |
| 1114 | #define CAMERA_EXPOSURE_COMPENSATION_LV3 -6 |
| 1115 | #define CAMERA_EXPOSURE_COMPENSATION_LV4 -12 |
| 1116 | |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 1117 | enum msm_v4l2_saturation_level { |
| 1118 | MSM_V4L2_SATURATION_L0, |
| 1119 | MSM_V4L2_SATURATION_L1, |
| 1120 | MSM_V4L2_SATURATION_L2, |
| 1121 | MSM_V4L2_SATURATION_L3, |
| 1122 | MSM_V4L2_SATURATION_L4, |
| 1123 | MSM_V4L2_SATURATION_L5, |
| 1124 | MSM_V4L2_SATURATION_L6, |
| 1125 | MSM_V4L2_SATURATION_L7, |
| 1126 | MSM_V4L2_SATURATION_L8, |
| 1127 | MSM_V4L2_SATURATION_L9, |
| 1128 | MSM_V4L2_SATURATION_L10, |
| 1129 | }; |
| 1130 | |
Suresh Vankadara | 212d972 | 2012-05-30 15:51:20 +0530 | [diff] [blame] | 1131 | enum msm_v4l2_contrast_level { |
| 1132 | MSM_V4L2_CONTRAST_L0, |
| 1133 | MSM_V4L2_CONTRAST_L1, |
| 1134 | MSM_V4L2_CONTRAST_L2, |
| 1135 | MSM_V4L2_CONTRAST_L3, |
| 1136 | MSM_V4L2_CONTRAST_L4, |
| 1137 | MSM_V4L2_CONTRAST_L5, |
| 1138 | MSM_V4L2_CONTRAST_L6, |
| 1139 | MSM_V4L2_CONTRAST_L7, |
| 1140 | MSM_V4L2_CONTRAST_L8, |
| 1141 | MSM_V4L2_CONTRAST_L9, |
| 1142 | MSM_V4L2_CONTRAST_L10, |
| 1143 | }; |
| 1144 | |
| 1145 | |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 1146 | enum msm_v4l2_exposure_level { |
| 1147 | MSM_V4L2_EXPOSURE_N2, |
| 1148 | MSM_V4L2_EXPOSURE_N1, |
| 1149 | MSM_V4L2_EXPOSURE_D, |
| 1150 | MSM_V4L2_EXPOSURE_P1, |
| 1151 | MSM_V4L2_EXPOSURE_P2, |
| 1152 | }; |
| 1153 | |
| 1154 | enum msm_v4l2_sharpness_level { |
| 1155 | MSM_V4L2_SHARPNESS_L0, |
| 1156 | MSM_V4L2_SHARPNESS_L1, |
| 1157 | MSM_V4L2_SHARPNESS_L2, |
| 1158 | MSM_V4L2_SHARPNESS_L3, |
| 1159 | MSM_V4L2_SHARPNESS_L4, |
| 1160 | MSM_V4L2_SHARPNESS_L5, |
| 1161 | MSM_V4L2_SHARPNESS_L6, |
| 1162 | }; |
| 1163 | |
| 1164 | enum msm_v4l2_expo_metering_mode { |
| 1165 | MSM_V4L2_EXP_FRAME_AVERAGE, |
| 1166 | MSM_V4L2_EXP_CENTER_WEIGHTED, |
| 1167 | MSM_V4L2_EXP_SPOT_METERING, |
| 1168 | }; |
| 1169 | |
| 1170 | enum msm_v4l2_iso_mode { |
| 1171 | MSM_V4L2_ISO_AUTO = 0, |
| 1172 | MSM_V4L2_ISO_DEBLUR, |
| 1173 | MSM_V4L2_ISO_100, |
| 1174 | MSM_V4L2_ISO_200, |
| 1175 | MSM_V4L2_ISO_400, |
| 1176 | MSM_V4L2_ISO_800, |
| 1177 | MSM_V4L2_ISO_1600, |
| 1178 | }; |
| 1179 | |
| 1180 | enum msm_v4l2_wb_mode { |
Suresh Vankadara | 212d972 | 2012-05-30 15:51:20 +0530 | [diff] [blame] | 1181 | MSM_V4L2_WB_OFF, |
| 1182 | MSM_V4L2_WB_AUTO , |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 1183 | MSM_V4L2_WB_CUSTOM, |
| 1184 | MSM_V4L2_WB_INCANDESCENT, |
| 1185 | MSM_V4L2_WB_FLUORESCENT, |
| 1186 | MSM_V4L2_WB_DAYLIGHT, |
| 1187 | MSM_V4L2_WB_CLOUDY_DAYLIGHT, |
Suresh Vankadara | 212d972 | 2012-05-30 15:51:20 +0530 | [diff] [blame] | 1188 | }; |
| 1189 | |
| 1190 | enum msm_v4l2_special_effect { |
| 1191 | MSM_V4L2_EFFECT_OFF, |
| 1192 | MSM_V4L2_EFFECT_MONO, |
| 1193 | MSM_V4L2_EFFECT_NEGATIVE, |
| 1194 | MSM_V4L2_EFFECT_SOLARIZE, |
| 1195 | MSM_V4L2_EFFECT_SEPIA, |
| 1196 | MSM_V4L2_EFFECT_POSTERAIZE, |
| 1197 | MSM_V4L2_EFFECT_WHITEBOARD, |
| 1198 | MSM_V4L2_EFFECT_BLACKBOARD, |
| 1199 | MSM_V4L2_EFFECT_AQUA, |
| 1200 | MSM_V4L2_EFFECT_EMBOSS, |
| 1201 | MSM_V4L2_EFFECT_SKETCH, |
| 1202 | MSM_V4L2_EFFECT_NEON, |
| 1203 | MSM_V4L2_EFFECT_MAX, |
Rajakumar Govindaram | 6bc004a | 2011-12-05 20:58:19 -0800 | [diff] [blame] | 1204 | }; |
| 1205 | |
| 1206 | enum msm_v4l2_power_line_frequency { |
| 1207 | MSM_V4L2_POWER_LINE_OFF, |
| 1208 | MSM_V4L2_POWER_LINE_60HZ, |
| 1209 | MSM_V4L2_POWER_LINE_50HZ, |
| 1210 | MSM_V4L2_POWER_LINE_AUTO, |
| 1211 | }; |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 1212 | |
Su Liu | 6c3bb32 | 2012-02-14 02:15:05 +0530 | [diff] [blame] | 1213 | #define CAMERA_ISO_TYPE_AUTO 0 |
| 1214 | #define CAMEAR_ISO_TYPE_HJR 1 |
| 1215 | #define CAMEAR_ISO_TYPE_100 2 |
| 1216 | #define CAMERA_ISO_TYPE_200 3 |
| 1217 | #define CAMERA_ISO_TYPE_400 4 |
| 1218 | #define CAMEAR_ISO_TYPE_800 5 |
| 1219 | #define CAMERA_ISO_TYPE_1600 6 |
| 1220 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1221 | struct sensor_pict_fps { |
| 1222 | uint16_t prevfps; |
| 1223 | uint16_t pictfps; |
| 1224 | }; |
| 1225 | |
| 1226 | struct exp_gain_cfg { |
| 1227 | uint16_t gain; |
| 1228 | uint32_t line; |
| 1229 | }; |
| 1230 | |
| 1231 | struct focus_cfg { |
| 1232 | int32_t steps; |
| 1233 | int dir; |
| 1234 | }; |
| 1235 | |
| 1236 | struct fps_cfg { |
| 1237 | uint16_t f_mult; |
| 1238 | uint16_t fps_div; |
| 1239 | uint32_t pict_fps_div; |
| 1240 | }; |
| 1241 | struct wb_info_cfg { |
| 1242 | uint16_t red_gain; |
| 1243 | uint16_t green_gain; |
| 1244 | uint16_t blue_gain; |
| 1245 | }; |
| 1246 | struct sensor_3d_exp_cfg { |
| 1247 | uint16_t gain; |
| 1248 | uint32_t line; |
| 1249 | uint16_t r_gain; |
| 1250 | uint16_t b_gain; |
| 1251 | uint16_t gr_gain; |
| 1252 | uint16_t gb_gain; |
| 1253 | uint16_t gain_adjust; |
| 1254 | }; |
| 1255 | struct sensor_3d_cali_data_t{ |
| 1256 | unsigned char left_p_matrix[3][4][8]; |
| 1257 | unsigned char right_p_matrix[3][4][8]; |
| 1258 | unsigned char square_len[8]; |
| 1259 | unsigned char focal_len[8]; |
| 1260 | unsigned char pixel_pitch[8]; |
| 1261 | uint16_t left_r; |
| 1262 | uint16_t left_b; |
| 1263 | uint16_t left_gb; |
| 1264 | uint16_t left_af_far; |
| 1265 | uint16_t left_af_mid; |
| 1266 | uint16_t left_af_short; |
| 1267 | uint16_t left_af_5um; |
| 1268 | uint16_t left_af_50up; |
| 1269 | uint16_t left_af_50down; |
| 1270 | uint16_t right_r; |
| 1271 | uint16_t right_b; |
| 1272 | uint16_t right_gb; |
| 1273 | uint16_t right_af_far; |
| 1274 | uint16_t right_af_mid; |
| 1275 | uint16_t right_af_short; |
| 1276 | uint16_t right_af_5um; |
| 1277 | uint16_t right_af_50up; |
| 1278 | uint16_t right_af_50down; |
| 1279 | }; |
| 1280 | struct sensor_init_cfg { |
| 1281 | uint8_t prev_res; |
| 1282 | uint8_t pict_res; |
| 1283 | }; |
| 1284 | |
| 1285 | struct sensor_calib_data { |
| 1286 | /* Color Related Measurements */ |
| 1287 | uint16_t r_over_g; |
| 1288 | uint16_t b_over_g; |
| 1289 | uint16_t gr_over_gb; |
| 1290 | |
| 1291 | /* Lens Related Measurements */ |
| 1292 | uint16_t macro_2_inf; |
| 1293 | uint16_t inf_2_macro; |
| 1294 | uint16_t stroke_amt; |
| 1295 | uint16_t af_pos_1m; |
| 1296 | uint16_t af_pos_inf; |
| 1297 | }; |
| 1298 | |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1299 | enum msm_sensor_resolution_t { |
Kevin Chan | 36e2bdc | 2011-08-30 17:21:21 -0700 | [diff] [blame] | 1300 | MSM_SENSOR_RES_FULL, |
| 1301 | MSM_SENSOR_RES_QTR, |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1302 | MSM_SENSOR_RES_2, |
| 1303 | MSM_SENSOR_RES_3, |
| 1304 | MSM_SENSOR_RES_4, |
| 1305 | MSM_SENSOR_RES_5, |
| 1306 | MSM_SENSOR_RES_6, |
| 1307 | MSM_SENSOR_RES_7, |
| 1308 | MSM_SENSOR_INVALID_RES, |
| 1309 | }; |
| 1310 | |
| 1311 | struct msm_sensor_output_info_t { |
| 1312 | uint16_t x_output; |
| 1313 | uint16_t y_output; |
| 1314 | uint16_t line_length_pclk; |
| 1315 | uint16_t frame_length_lines; |
Kevin Chan | e30d369 | 2011-10-14 16:11:01 -0700 | [diff] [blame] | 1316 | uint32_t vt_pixel_clk; |
| 1317 | uint32_t op_pixel_clk; |
Kevin Chan | 272f660 | 2011-10-18 14:20:03 -0700 | [diff] [blame] | 1318 | uint16_t binning_factor; |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1319 | }; |
| 1320 | |
| 1321 | struct sensor_output_info_t { |
| 1322 | struct msm_sensor_output_info_t *output_info; |
| 1323 | uint16_t num_info; |
| 1324 | }; |
| 1325 | |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 1326 | struct msm_sensor_exp_gain_info_t { |
| 1327 | uint16_t coarse_int_time_addr; |
| 1328 | uint16_t global_gain_addr; |
| 1329 | uint16_t vert_offset; |
| 1330 | }; |
| 1331 | |
| 1332 | struct msm_sensor_output_reg_addr_t { |
| 1333 | uint16_t x_output; |
| 1334 | uint16_t y_output; |
| 1335 | uint16_t line_length_pclk; |
| 1336 | uint16_t frame_length_lines; |
| 1337 | }; |
| 1338 | |
| 1339 | struct sensor_driver_params_type { |
| 1340 | struct msm_camera_i2c_reg_setting *init_settings; |
| 1341 | uint16_t init_settings_size; |
| 1342 | struct msm_camera_i2c_reg_setting *mode_settings; |
| 1343 | uint16_t mode_settings_size; |
| 1344 | struct msm_sensor_output_reg_addr_t *sensor_output_reg_addr; |
| 1345 | struct msm_camera_i2c_reg_setting *start_settings; |
| 1346 | struct msm_camera_i2c_reg_setting *stop_settings; |
| 1347 | struct msm_camera_i2c_reg_setting *groupon_settings; |
| 1348 | struct msm_camera_i2c_reg_setting *groupoff_settings; |
| 1349 | struct msm_sensor_exp_gain_info_t *sensor_exp_gain_info; |
| 1350 | struct msm_sensor_output_info_t *output_info; |
| 1351 | }; |
| 1352 | |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 1353 | struct mirror_flip { |
| 1354 | int32_t x_mirror; |
| 1355 | int32_t y_flip; |
| 1356 | }; |
| 1357 | |
| 1358 | struct cord { |
| 1359 | uint32_t x; |
| 1360 | uint32_t y; |
| 1361 | }; |
| 1362 | |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 1363 | struct msm_eeprom_data_t { |
| 1364 | void *eeprom_data; |
| 1365 | uint16_t index; |
| 1366 | }; |
| 1367 | |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1368 | struct msm_camera_csid_vc_cfg { |
| 1369 | uint8_t cid; |
| 1370 | uint8_t dt; |
| 1371 | uint8_t decode_format; |
| 1372 | }; |
| 1373 | |
| 1374 | struct csi_lane_params_t { |
Kevin Chan | bdcf7ef | 2012-08-24 08:33:33 -0700 | [diff] [blame] | 1375 | uint16_t csi_lane_assign; |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1376 | uint8_t csi_lane_mask; |
| 1377 | uint8_t csi_if; |
Sreesudhan Ramakrish Ramkumar | 254f7e7 | 2012-03-17 17:27:34 -0700 | [diff] [blame] | 1378 | uint8_t csid_core[2]; |
Sreesudhan Ramakrish Ramkumar | 4f9d27f | 2012-08-28 23:51:38 -0700 | [diff] [blame] | 1379 | uint8_t csi_phy_sel; |
Sreesudhan Ramakrish Ramkumar | 254f7e7 | 2012-03-17 17:27:34 -0700 | [diff] [blame] | 1380 | }; |
| 1381 | |
| 1382 | struct msm_camera_csid_lut_params { |
| 1383 | uint8_t num_cid; |
| 1384 | struct msm_camera_csid_vc_cfg *vc_cfg; |
| 1385 | }; |
| 1386 | |
| 1387 | struct msm_camera_csid_params { |
| 1388 | uint8_t lane_cnt; |
| 1389 | uint16_t lane_assign; |
| 1390 | uint8_t phy_sel; |
| 1391 | struct msm_camera_csid_lut_params lut_params; |
| 1392 | }; |
| 1393 | |
| 1394 | struct msm_camera_csiphy_params { |
| 1395 | uint8_t lane_cnt; |
| 1396 | uint8_t settle_cnt; |
| 1397 | uint16_t lane_mask; |
| 1398 | uint8_t combo_mode; |
Evgeniy Borisov | 4de5331 | 2013-03-27 05:14:41 -0700 | [diff] [blame] | 1399 | uint8_t csid_core; |
Sreesudhan Ramakrish Ramkumar | 254f7e7 | 2012-03-17 17:27:34 -0700 | [diff] [blame] | 1400 | }; |
| 1401 | |
| 1402 | struct msm_camera_csi2_params { |
| 1403 | struct msm_camera_csid_params csid_params; |
| 1404 | struct msm_camera_csiphy_params csiphy_params; |
| 1405 | }; |
| 1406 | |
| 1407 | enum msm_camera_csi_data_format { |
| 1408 | CSI_8BIT, |
| 1409 | CSI_10BIT, |
| 1410 | CSI_12BIT, |
| 1411 | }; |
| 1412 | |
| 1413 | struct msm_camera_csi_params { |
| 1414 | enum msm_camera_csi_data_format data_format; |
| 1415 | uint8_t lane_cnt; |
| 1416 | uint8_t lane_assign; |
| 1417 | uint8_t settle_cnt; |
| 1418 | uint8_t dpcm_scheme; |
| 1419 | }; |
| 1420 | |
| 1421 | enum csic_cfg_type_t { |
| 1422 | CSIC_INIT, |
| 1423 | CSIC_CFG, |
| 1424 | }; |
| 1425 | |
| 1426 | struct csic_cfg_data { |
| 1427 | enum csic_cfg_type_t cfgtype; |
| 1428 | struct msm_camera_csi_params *csic_params; |
| 1429 | }; |
| 1430 | |
| 1431 | enum csid_cfg_type_t { |
| 1432 | CSID_INIT, |
| 1433 | CSID_CFG, |
| 1434 | }; |
| 1435 | |
| 1436 | struct csid_cfg_data { |
| 1437 | enum csid_cfg_type_t cfgtype; |
| 1438 | union { |
| 1439 | uint32_t csid_version; |
| 1440 | struct msm_camera_csid_params *csid_params; |
| 1441 | } cfg; |
| 1442 | }; |
| 1443 | |
| 1444 | enum csiphy_cfg_type_t { |
| 1445 | CSIPHY_INIT, |
| 1446 | CSIPHY_CFG, |
| 1447 | }; |
| 1448 | |
| 1449 | struct csiphy_cfg_data { |
| 1450 | enum csiphy_cfg_type_t cfgtype; |
| 1451 | struct msm_camera_csiphy_params *csiphy_params; |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1452 | }; |
| 1453 | |
| 1454 | #define CSI_EMBED_DATA 0x12 |
| 1455 | #define CSI_RESERVED_DATA_0 0x13 |
| 1456 | #define CSI_YUV422_8 0x1E |
| 1457 | #define CSI_RAW8 0x2A |
| 1458 | #define CSI_RAW10 0x2B |
| 1459 | #define CSI_RAW12 0x2C |
| 1460 | |
| 1461 | #define CSI_DECODE_6BIT 0 |
| 1462 | #define CSI_DECODE_8BIT 1 |
| 1463 | #define CSI_DECODE_10BIT 2 |
| 1464 | #define CSI_DECODE_DPCM_10_8_10 5 |
| 1465 | |
Sreesudhan Ramakrish Ramkumar | d812321 | 2012-06-30 13:15:27 -0700 | [diff] [blame] | 1466 | #define ISPIF_STREAM(intf, action, vfe) (((intf)<<ISPIF_S_STREAM_SHIFT)+\ |
| 1467 | (action)+((vfe)<<ISPIF_VFE_INTF_SHIFT)) |
| 1468 | #define ISPIF_ON_FRAME_BOUNDARY (0x01 << 0) |
| 1469 | #define ISPIF_OFF_FRAME_BOUNDARY (0x01 << 1) |
| 1470 | #define ISPIF_OFF_IMMEDIATELY (0x01 << 2) |
| 1471 | #define ISPIF_S_STREAM_SHIFT 4 |
| 1472 | #define ISPIF_VFE_INTF_SHIFT 12 |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1473 | |
| 1474 | #define PIX_0 (0x01 << 0) |
| 1475 | #define RDI_0 (0x01 << 1) |
| 1476 | #define PIX_1 (0x01 << 2) |
| 1477 | #define RDI_1 (0x01 << 3) |
Sreesudhan Ramakrish Ramkumar | d812321 | 2012-06-30 13:15:27 -0700 | [diff] [blame] | 1478 | #define RDI_2 (0x01 << 4) |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1479 | |
Sreesudhan Ramakrish Ramkumar | d812321 | 2012-06-30 13:15:27 -0700 | [diff] [blame] | 1480 | enum msm_ispif_vfe_intf { |
| 1481 | VFE0, |
| 1482 | VFE1, |
| 1483 | VFE_MAX, |
| 1484 | }; |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1485 | |
| 1486 | enum msm_ispif_intftype { |
| 1487 | PIX0, |
| 1488 | RDI0, |
| 1489 | PIX1, |
| 1490 | RDI1, |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1491 | RDI2, |
| 1492 | INTF_MAX, |
| 1493 | }; |
| 1494 | |
| 1495 | enum msm_ispif_vc { |
| 1496 | VC0, |
| 1497 | VC1, |
| 1498 | VC2, |
| 1499 | VC3, |
| 1500 | }; |
| 1501 | |
| 1502 | enum msm_ispif_cid { |
| 1503 | CID0, |
| 1504 | CID1, |
| 1505 | CID2, |
| 1506 | CID3, |
| 1507 | CID4, |
| 1508 | CID5, |
| 1509 | CID6, |
| 1510 | CID7, |
| 1511 | CID8, |
| 1512 | CID9, |
| 1513 | CID10, |
| 1514 | CID11, |
| 1515 | CID12, |
| 1516 | CID13, |
| 1517 | CID14, |
| 1518 | CID15, |
| 1519 | }; |
| 1520 | |
| 1521 | struct msm_ispif_params { |
| 1522 | uint8_t intftype; |
| 1523 | uint16_t cid_mask; |
| 1524 | uint8_t csid; |
Sreesudhan Ramakrish Ramkumar | d812321 | 2012-06-30 13:15:27 -0700 | [diff] [blame] | 1525 | uint8_t vfe_intf; |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1526 | }; |
| 1527 | |
| 1528 | struct msm_ispif_params_list { |
| 1529 | uint32_t len; |
| 1530 | struct msm_ispif_params params[4]; |
| 1531 | }; |
| 1532 | |
| 1533 | enum ispif_cfg_type_t { |
| 1534 | ISPIF_INIT, |
| 1535 | ISPIF_SET_CFG, |
| 1536 | ISPIF_SET_ON_FRAME_BOUNDARY, |
| 1537 | ISPIF_SET_OFF_FRAME_BOUNDARY, |
| 1538 | ISPIF_SET_OFF_IMMEDIATELY, |
| 1539 | ISPIF_RELEASE, |
| 1540 | }; |
| 1541 | |
| 1542 | struct ispif_cfg_data { |
| 1543 | enum ispif_cfg_type_t cfgtype; |
| 1544 | union { |
| 1545 | uint32_t csid_version; |
| 1546 | int cmd; |
| 1547 | struct msm_ispif_params_list ispif_params; |
| 1548 | } cfg; |
| 1549 | }; |
| 1550 | |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 1551 | enum msm_camera_i2c_reg_addr_type { |
| 1552 | MSM_CAMERA_I2C_BYTE_ADDR = 1, |
| 1553 | MSM_CAMERA_I2C_WORD_ADDR, |
Junjie Wu | 1d4e60d | 2013-03-13 20:17:15 -0700 | [diff] [blame] | 1554 | MSM_CAMERA_I2C_3B_ADDR, |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 1555 | }; |
| 1556 | |
| 1557 | struct msm_camera_i2c_reg_array { |
| 1558 | uint16_t reg_addr; |
| 1559 | uint16_t reg_data; |
| 1560 | }; |
| 1561 | |
| 1562 | enum msm_camera_i2c_data_type { |
| 1563 | MSM_CAMERA_I2C_BYTE_DATA = 1, |
| 1564 | MSM_CAMERA_I2C_WORD_DATA, |
| 1565 | MSM_CAMERA_I2C_SET_BYTE_MASK, |
| 1566 | MSM_CAMERA_I2C_UNSET_BYTE_MASK, |
| 1567 | MSM_CAMERA_I2C_SET_WORD_MASK, |
| 1568 | MSM_CAMERA_I2C_UNSET_WORD_MASK, |
| 1569 | MSM_CAMERA_I2C_SET_BYTE_WRITE_MASK_DATA, |
| 1570 | }; |
| 1571 | |
| 1572 | struct msm_camera_i2c_reg_setting { |
| 1573 | struct msm_camera_i2c_reg_array *reg_setting; |
| 1574 | uint16_t size; |
| 1575 | enum msm_camera_i2c_reg_addr_type addr_type; |
| 1576 | enum msm_camera_i2c_data_type data_type; |
| 1577 | uint16_t delay; |
| 1578 | }; |
| 1579 | |
| 1580 | enum oem_setting_type { |
| 1581 | I2C_READ = 1, |
| 1582 | I2C_WRITE, |
| 1583 | GPIO_OP, |
| 1584 | EEPROM_READ, |
| 1585 | VREG_SET, |
| 1586 | CLK_SET, |
| 1587 | }; |
| 1588 | |
| 1589 | struct sensor_oem_setting { |
| 1590 | enum oem_setting_type type; |
| 1591 | void *data; |
| 1592 | }; |
| 1593 | |
| 1594 | enum camera_vreg_type { |
| 1595 | REG_LDO, |
| 1596 | REG_VS, |
| 1597 | REG_GPIO, |
| 1598 | }; |
| 1599 | |
Shuzhen Wang | b4f4c92 | 2013-01-08 14:32:08 -0800 | [diff] [blame] | 1600 | enum msm_camera_vreg_name_t { |
| 1601 | CAM_VDIG, |
| 1602 | CAM_VIO, |
| 1603 | CAM_VANA, |
| 1604 | CAM_VAF, |
| 1605 | CAM_VREG_MAX, |
| 1606 | }; |
| 1607 | |
| 1608 | struct msm_camera_csi_lane_params { |
| 1609 | uint16_t csi_lane_assign; |
| 1610 | uint16_t csi_lane_mask; |
| 1611 | }; |
| 1612 | |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 1613 | struct camera_vreg_t { |
| 1614 | const char *reg_name; |
| 1615 | enum camera_vreg_type type; |
| 1616 | int min_voltage; |
| 1617 | int max_voltage; |
| 1618 | int op_mode; |
| 1619 | uint32_t delay; |
| 1620 | }; |
| 1621 | |
| 1622 | struct msm_camera_vreg_setting { |
| 1623 | struct camera_vreg_t *cam_vreg; |
| 1624 | uint16_t num_vreg; |
| 1625 | uint8_t enable; |
| 1626 | }; |
| 1627 | |
| 1628 | struct msm_cam_clk_info { |
| 1629 | const char *clk_name; |
| 1630 | long clk_rate; |
| 1631 | uint32_t delay; |
| 1632 | }; |
| 1633 | |
| 1634 | struct msm_cam_clk_setting { |
| 1635 | struct msm_cam_clk_info *clk_info; |
| 1636 | uint16_t num_clk_info; |
| 1637 | uint8_t enable; |
| 1638 | }; |
| 1639 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1640 | struct sensor_cfg_data { |
| 1641 | int cfgtype; |
| 1642 | int mode; |
| 1643 | int rs; |
| 1644 | uint8_t max_steps; |
| 1645 | |
| 1646 | union { |
| 1647 | int8_t effect; |
| 1648 | uint8_t lens_shading; |
| 1649 | uint16_t prevl_pf; |
| 1650 | uint16_t prevp_pl; |
| 1651 | uint16_t pictl_pf; |
| 1652 | uint16_t pictp_pl; |
| 1653 | uint32_t pict_max_exp_lc; |
| 1654 | uint16_t p_fps; |
Su Liu | 6c3bb32 | 2012-02-14 02:15:05 +0530 | [diff] [blame] | 1655 | uint8_t iso_type; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1656 | struct sensor_init_cfg init_info; |
| 1657 | struct sensor_pict_fps gfps; |
| 1658 | struct exp_gain_cfg exp_gain; |
| 1659 | struct focus_cfg focus; |
| 1660 | struct fps_cfg fps; |
| 1661 | struct wb_info_cfg wb_info; |
| 1662 | struct sensor_3d_exp_cfg sensor_3d_exp; |
| 1663 | struct sensor_calib_data calib_info; |
Kevin Chan | a980f39 | 2011-08-01 20:55:00 -0700 | [diff] [blame] | 1664 | struct sensor_output_info_t output_info; |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 1665 | struct msm_eeprom_data_t eeprom_data; |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1666 | struct csi_lane_params_t csi_lane_params; |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 1667 | /* QRD */ |
| 1668 | uint16_t antibanding; |
| 1669 | uint8_t contrast; |
| 1670 | uint8_t saturation; |
| 1671 | uint8_t sharpness; |
| 1672 | int8_t brightness; |
| 1673 | int ae_mode; |
| 1674 | uint8_t wb_val; |
| 1675 | int8_t exp_compensation; |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 1676 | uint32_t pclk; |
Taniya Das | a9bdb01 | 2011-09-08 11:21:33 +0530 | [diff] [blame] | 1677 | struct cord aec_cord; |
| 1678 | int is_autoflash; |
| 1679 | struct mirror_flip mirror_flip; |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 1680 | void *setting; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1681 | } cfg; |
| 1682 | }; |
| 1683 | |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 1684 | enum gpio_operation_type { |
| 1685 | GPIO_REQUEST, |
| 1686 | GPIO_FREE, |
| 1687 | GPIO_SET_DIRECTION_OUTPUT, |
| 1688 | GPIO_SET_DIRECTION_INPUT, |
| 1689 | GPIO_GET_VALUE, |
| 1690 | GPIO_SET_VALUE, |
| 1691 | }; |
| 1692 | |
| 1693 | struct msm_cam_gpio_operation { |
| 1694 | enum gpio_operation_type op_type; |
| 1695 | unsigned address; |
| 1696 | int value; |
| 1697 | const char *tag; |
| 1698 | }; |
| 1699 | |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1700 | struct damping_params_t { |
| 1701 | uint32_t damping_step; |
| 1702 | uint32_t damping_delay; |
| 1703 | uint32_t hw_params; |
| 1704 | }; |
| 1705 | |
| 1706 | enum actuator_type { |
| 1707 | ACTUATOR_VCM, |
| 1708 | ACTUATOR_PIEZO, |
| 1709 | }; |
| 1710 | |
| 1711 | enum msm_actuator_data_type { |
| 1712 | MSM_ACTUATOR_BYTE_DATA = 1, |
| 1713 | MSM_ACTUATOR_WORD_DATA, |
| 1714 | }; |
| 1715 | |
| 1716 | enum msm_actuator_addr_type { |
| 1717 | MSM_ACTUATOR_BYTE_ADDR = 1, |
| 1718 | MSM_ACTUATOR_WORD_ADDR, |
| 1719 | }; |
| 1720 | |
| 1721 | enum msm_actuator_write_type { |
| 1722 | MSM_ACTUATOR_WRITE_HW_DAMP, |
| 1723 | MSM_ACTUATOR_WRITE_DAC, |
| 1724 | }; |
| 1725 | |
| 1726 | struct msm_actuator_reg_params_t { |
| 1727 | enum msm_actuator_write_type reg_write_type; |
| 1728 | uint32_t hw_mask; |
| 1729 | uint16_t reg_addr; |
| 1730 | uint16_t hw_shift; |
| 1731 | uint16_t data_shift; |
| 1732 | }; |
| 1733 | |
| 1734 | struct reg_settings_t { |
| 1735 | uint16_t reg_addr; |
| 1736 | uint16_t reg_data; |
| 1737 | }; |
| 1738 | |
| 1739 | struct region_params_t { |
| 1740 | /* [0] = ForwardDirection Macro boundary |
| 1741 | [1] = ReverseDirection Inf boundary |
| 1742 | */ |
| 1743 | uint16_t step_bound[2]; |
| 1744 | uint16_t code_per_step; |
| 1745 | }; |
| 1746 | |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1747 | struct msm_actuator_move_params_t { |
| 1748 | int8_t dir; |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1749 | int8_t sign_dir; |
| 1750 | int16_t dest_step_pos; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1751 | int32_t num_steps; |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1752 | struct damping_params_t *ringing_params; |
| 1753 | }; |
| 1754 | |
| 1755 | struct msm_actuator_tuning_params_t { |
| 1756 | int16_t initial_code; |
| 1757 | uint16_t pwd_step; |
| 1758 | uint16_t region_size; |
| 1759 | uint32_t total_steps; |
| 1760 | struct region_params_t *region_params; |
| 1761 | }; |
| 1762 | |
| 1763 | struct msm_actuator_params_t { |
| 1764 | enum actuator_type act_type; |
| 1765 | uint8_t reg_tbl_size; |
| 1766 | uint16_t data_size; |
| 1767 | uint16_t init_setting_size; |
| 1768 | uint32_t i2c_addr; |
| 1769 | enum msm_actuator_addr_type i2c_addr_type; |
| 1770 | enum msm_actuator_data_type i2c_data_type; |
| 1771 | struct msm_actuator_reg_params_t *reg_tbl_params; |
| 1772 | struct reg_settings_t *init_settings; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1773 | }; |
| 1774 | |
| 1775 | struct msm_actuator_set_info_t { |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1776 | struct msm_actuator_params_t actuator_params; |
| 1777 | struct msm_actuator_tuning_params_t af_tuning_params; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1778 | }; |
| 1779 | |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1780 | struct msm_actuator_get_info_t { |
| 1781 | uint32_t focal_length_num; |
| 1782 | uint32_t focal_length_den; |
| 1783 | uint32_t f_number_num; |
| 1784 | uint32_t f_number_den; |
| 1785 | uint32_t f_pix_num; |
| 1786 | uint32_t f_pix_den; |
| 1787 | uint32_t total_f_dist_num; |
| 1788 | uint32_t total_f_dist_den; |
Jeyaprakash Soundrapandian | 0459200 | 2012-02-08 10:29:50 -0800 | [diff] [blame] | 1789 | uint32_t hor_view_angle_num; |
| 1790 | uint32_t hor_view_angle_den; |
| 1791 | uint32_t ver_view_angle_num; |
| 1792 | uint32_t ver_view_angle_den; |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1793 | }; |
| 1794 | |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1795 | enum af_camera_name { |
| 1796 | ACTUATOR_MAIN_CAM_0, |
| 1797 | ACTUATOR_MAIN_CAM_1, |
| 1798 | ACTUATOR_MAIN_CAM_2, |
| 1799 | ACTUATOR_MAIN_CAM_3, |
| 1800 | ACTUATOR_MAIN_CAM_4, |
| 1801 | ACTUATOR_MAIN_CAM_5, |
| 1802 | ACTUATOR_WEB_CAM_0, |
| 1803 | ACTUATOR_WEB_CAM_1, |
| 1804 | ACTUATOR_WEB_CAM_2, |
| 1805 | }; |
| 1806 | |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1807 | struct msm_actuator_cfg_data { |
| 1808 | int cfgtype; |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1809 | uint8_t is_af_supported; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1810 | union { |
| 1811 | struct msm_actuator_move_params_t move; |
Sreesudhan Ramakrish Ramkumar | 5f4b344 | 2011-09-08 14:56:35 -0700 | [diff] [blame] | 1812 | struct msm_actuator_set_info_t set_info; |
| 1813 | struct msm_actuator_get_info_t get_info; |
Rajakumar Govindaram | 6627b36 | 2012-01-29 19:00:30 -0800 | [diff] [blame] | 1814 | enum af_camera_name cam_name; |
Sreesudhan Ramakrish Ramkumar | a4b5f30 | 2011-09-12 16:23:22 -0700 | [diff] [blame] | 1815 | } cfg; |
| 1816 | }; |
| 1817 | |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 1818 | struct msm_eeprom_support { |
| 1819 | uint16_t is_supported; |
| 1820 | uint16_t size; |
| 1821 | uint16_t index; |
| 1822 | uint16_t qvalue; |
| 1823 | }; |
| 1824 | |
| 1825 | struct msm_calib_wb { |
| 1826 | uint16_t r_over_g; |
| 1827 | uint16_t b_over_g; |
| 1828 | uint16_t gr_over_gb; |
| 1829 | }; |
| 1830 | |
| 1831 | struct msm_calib_af { |
| 1832 | uint16_t macro_dac; |
| 1833 | uint16_t inf_dac; |
| 1834 | uint16_t start_dac; |
| 1835 | }; |
| 1836 | |
| 1837 | struct msm_calib_lsc { |
| 1838 | uint16_t r_gain[221]; |
| 1839 | uint16_t b_gain[221]; |
| 1840 | uint16_t gr_gain[221]; |
| 1841 | uint16_t gb_gain[221]; |
| 1842 | }; |
| 1843 | |
| 1844 | struct pixel_t { |
| 1845 | int x; |
| 1846 | int y; |
| 1847 | }; |
| 1848 | |
| 1849 | struct msm_calib_dpc { |
| 1850 | uint16_t validcount; |
| 1851 | struct pixel_t snapshot_coord[128]; |
| 1852 | struct pixel_t preview_coord[128]; |
| 1853 | struct pixel_t video_coord[128]; |
| 1854 | }; |
| 1855 | |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 1856 | struct msm_calib_raw { |
| 1857 | uint8_t *data; |
| 1858 | uint32_t size; |
| 1859 | }; |
| 1860 | |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 1861 | struct msm_camera_eeprom_info_t { |
| 1862 | struct msm_eeprom_support af; |
| 1863 | struct msm_eeprom_support wb; |
| 1864 | struct msm_eeprom_support lsc; |
| 1865 | struct msm_eeprom_support dpc; |
Jack Wang | b88c8c2 | 2012-07-26 11:33:36 -0700 | [diff] [blame] | 1866 | struct msm_eeprom_support raw; |
Jeyaprakash Soundrapandian | 734476b | 2012-05-03 20:08:15 -0700 | [diff] [blame] | 1867 | }; |
| 1868 | |
| 1869 | struct msm_eeprom_cfg_data { |
| 1870 | int cfgtype; |
| 1871 | uint8_t is_eeprom_supported; |
| 1872 | union { |
| 1873 | struct msm_eeprom_data_t get_data; |
| 1874 | struct msm_camera_eeprom_info_t get_info; |
| 1875 | } cfg; |
| 1876 | }; |
| 1877 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1878 | struct sensor_large_data { |
| 1879 | int cfgtype; |
| 1880 | union { |
| 1881 | struct sensor_3d_cali_data_t sensor_3d_cali_data; |
| 1882 | } data; |
| 1883 | }; |
| 1884 | |
| 1885 | enum sensor_type_t { |
| 1886 | BAYER, |
| 1887 | YUV, |
| 1888 | JPEG_SOC, |
| 1889 | }; |
| 1890 | |
| 1891 | enum flash_type { |
| 1892 | LED_FLASH, |
| 1893 | STROBE_FLASH, |
| 1894 | }; |
| 1895 | |
| 1896 | enum strobe_flash_ctrl_type { |
| 1897 | STROBE_FLASH_CTRL_INIT, |
| 1898 | STROBE_FLASH_CTRL_CHARGE, |
| 1899 | STROBE_FLASH_CTRL_RELEASE |
| 1900 | }; |
| 1901 | |
| 1902 | struct strobe_flash_ctrl_data { |
| 1903 | enum strobe_flash_ctrl_type type; |
| 1904 | int charge_en; |
| 1905 | }; |
| 1906 | |
| 1907 | struct msm_camera_info { |
| 1908 | int num_cameras; |
| 1909 | uint8_t has_3d_support[MSM_MAX_CAMERA_SENSORS]; |
| 1910 | uint8_t is_internal_cam[MSM_MAX_CAMERA_SENSORS]; |
| 1911 | uint32_t s_mount_angle[MSM_MAX_CAMERA_SENSORS]; |
| 1912 | const char *video_dev_name[MSM_MAX_CAMERA_SENSORS]; |
| 1913 | enum sensor_type_t sensor_type[MSM_MAX_CAMERA_SENSORS]; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1914 | }; |
| 1915 | |
| 1916 | struct msm_cam_config_dev_info { |
| 1917 | int num_config_nodes; |
| 1918 | const char *config_dev_name[MSM_MAX_CAMERA_CONFIGS]; |
Ankit Premrajka | f94bcc6 | 2011-08-22 15:23:53 -0700 | [diff] [blame] | 1919 | int config_dev_id[MSM_MAX_CAMERA_CONFIGS]; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1920 | }; |
| 1921 | |
Kiran Kumar H N | c3cb9ea | 2012-01-06 15:11:10 -0800 | [diff] [blame] | 1922 | struct msm_mctl_node_info { |
| 1923 | int num_mctl_nodes; |
| 1924 | const char *mctl_node_name[MSM_MAX_CAMERA_SENSORS]; |
| 1925 | }; |
| 1926 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1927 | struct flash_ctrl_data { |
| 1928 | int flashtype; |
| 1929 | union { |
| 1930 | int led_state; |
| 1931 | struct strobe_flash_ctrl_data strobe_ctrl; |
| 1932 | } ctrl_data; |
| 1933 | }; |
| 1934 | |
| 1935 | #define GET_NAME 0 |
| 1936 | #define GET_PREVIEW_LINE_PER_FRAME 1 |
| 1937 | #define GET_PREVIEW_PIXELS_PER_LINE 2 |
| 1938 | #define GET_SNAPSHOT_LINE_PER_FRAME 3 |
| 1939 | #define GET_SNAPSHOT_PIXELS_PER_LINE 4 |
| 1940 | #define GET_SNAPSHOT_FPS 5 |
| 1941 | #define GET_SNAPSHOT_MAX_EP_LINE_CNT 6 |
| 1942 | |
| 1943 | struct msm_camsensor_info { |
| 1944 | char name[MAX_SENSOR_NAME]; |
| 1945 | uint8_t flash_enabled; |
Sreesudhan Ramakrish Ramkumar | a268882 | 2012-04-05 20:22:50 -0700 | [diff] [blame] | 1946 | uint8_t strobe_flash_enabled; |
| 1947 | uint8_t actuator_enabled; |
Nishant Pandit | b2157c9 | 2012-04-25 01:09:28 +0530 | [diff] [blame] | 1948 | uint8_t ispif_supported; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1949 | int8_t total_steps; |
| 1950 | uint8_t support_3d; |
Mingcheng Zhu | c85b8ad | 2012-03-08 17:47:17 -0800 | [diff] [blame] | 1951 | enum flash_type flashtype; |
| 1952 | enum sensor_type_t sensor_type; |
| 1953 | uint32_t pxlcode; /* enum v4l2_mbus_pixelcode */ |
| 1954 | uint32_t camera_type; /* msm_camera_type */ |
| 1955 | int mount_angle; |
| 1956 | uint32_t max_width; |
| 1957 | uint32_t max_height; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 1958 | }; |
Kiran Kumar H N | ceea762 | 2011-08-23 14:01:03 -0700 | [diff] [blame] | 1959 | |
| 1960 | #define V4L2_SINGLE_PLANE 0 |
| 1961 | #define V4L2_MULTI_PLANE_Y 0 |
| 1962 | #define V4L2_MULTI_PLANE_CBCR 1 |
| 1963 | #define V4L2_MULTI_PLANE_CB 1 |
| 1964 | #define V4L2_MULTI_PLANE_CR 2 |
| 1965 | |
| 1966 | struct plane_data { |
| 1967 | int plane_id; |
| 1968 | uint32_t offset; |
| 1969 | unsigned long size; |
| 1970 | }; |
| 1971 | |
| 1972 | struct img_plane_info { |
| 1973 | uint32_t width; |
| 1974 | uint32_t height; |
| 1975 | uint32_t pixelformat; |
| 1976 | uint8_t buffer_type; /*Single/Multi planar*/ |
| 1977 | uint8_t output_port; |
| 1978 | uint32_t ext_mode; |
| 1979 | uint8_t num_planes; |
| 1980 | struct plane_data plane[MAX_PLANES]; |
Mingcheng Zhu | 996be18 | 2011-10-16 16:04:23 -0700 | [diff] [blame] | 1981 | uint32_t sp_y_offset; |
Kiran Kumar H N | 9078590 | 2012-07-05 13:59:38 -0700 | [diff] [blame] | 1982 | uint32_t inst_handle; |
Kiran Kumar H N | ceea762 | 2011-08-23 14:01:03 -0700 | [diff] [blame] | 1983 | }; |
| 1984 | |
Kevin Chan | 210061f | 2012-02-14 20:56:16 -0800 | [diff] [blame] | 1985 | #define QCAMERA_NAME "qcamera" |
Ankit Premrajka | 4b3443f | 2012-06-11 14:06:31 -0700 | [diff] [blame] | 1986 | #define QCAMERA_SERVER_NAME "qcamera_server" |
Kevin Chan | 210061f | 2012-02-14 20:56:16 -0800 | [diff] [blame] | 1987 | #define QCAMERA_DEVICE_GROUP_ID 1 |
| 1988 | #define QCAMERA_VNODE_GROUP_ID 2 |
| 1989 | |
Ankit Premrajka | 4b3443f | 2012-06-11 14:06:31 -0700 | [diff] [blame] | 1990 | enum msm_cam_subdev_type { |
| 1991 | CSIPHY_DEV, |
| 1992 | CSID_DEV, |
| 1993 | CSIC_DEV, |
| 1994 | ISPIF_DEV, |
| 1995 | VFE_DEV, |
| 1996 | AXI_DEV, |
| 1997 | VPE_DEV, |
| 1998 | SENSOR_DEV, |
| 1999 | ACTUATOR_DEV, |
| 2000 | EEPROM_DEV, |
| 2001 | GESTURE_DEV, |
| 2002 | IRQ_ROUTER_DEV, |
| 2003 | CPP_DEV, |
Sreesudhan Ramakrish Ramkumar | c842b61 | 2012-05-21 17:23:24 -0700 | [diff] [blame] | 2004 | CCI_DEV, |
Sreesudhan Ramakrish Ramkumar | 7f723dc | 2012-10-12 22:58:13 -0700 | [diff] [blame] | 2005 | FLASH_DEV, |
Ankit Premrajka | 4b3443f | 2012-06-11 14:06:31 -0700 | [diff] [blame] | 2006 | }; |
| 2007 | |
| 2008 | struct msm_mctl_set_sdev_data { |
| 2009 | uint32_t revision; |
| 2010 | enum msm_cam_subdev_type sdev_type; |
| 2011 | }; |
| 2012 | |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 2013 | #define MSM_CAM_V4L2_IOCTL_GET_CAMERA_INFO \ |
Kevin Chan | 41a3870 | 2012-06-06 22:25:41 -0700 | [diff] [blame] | 2014 | _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t) |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 2015 | |
| 2016 | #define MSM_CAM_V4L2_IOCTL_GET_CONFIG_INFO \ |
Kevin Chan | 41a3870 | 2012-06-06 22:25:41 -0700 | [diff] [blame] | 2017 | _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t) |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 2018 | |
| 2019 | #define MSM_CAM_V4L2_IOCTL_GET_MCTL_INFO \ |
Kevin Chan | 41a3870 | 2012-06-06 22:25:41 -0700 | [diff] [blame] | 2020 | _IOWR('V', BASE_VIDIOC_PRIVATE + 3, struct msm_camera_v4l2_ioctl_t) |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 2021 | |
| 2022 | #define MSM_CAM_V4L2_IOCTL_CTRL_CMD_DONE \ |
Kevin Chan | 41a3870 | 2012-06-06 22:25:41 -0700 | [diff] [blame] | 2023 | _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct msm_camera_v4l2_ioctl_t) |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 2024 | |
| 2025 | #define MSM_CAM_V4L2_IOCTL_GET_EVENT_PAYLOAD \ |
Kevin Chan | 41a3870 | 2012-06-06 22:25:41 -0700 | [diff] [blame] | 2026 | _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct msm_camera_v4l2_ioctl_t) |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 2027 | |
Sunid Wilson | 4584b5f | 2012-04-13 12:48:25 -0700 | [diff] [blame] | 2028 | #define MSM_CAM_IOCTL_SEND_EVENT \ |
| 2029 | _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct v4l2_event) |
| 2030 | |
Kiran Kumar H N | 64bd23c | 2012-05-25 12:06:21 -0700 | [diff] [blame] | 2031 | #define MSM_CAM_V4L2_IOCTL_CFG_VPE \ |
| 2032 | _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_vpe_cfg_cmd) |
| 2033 | |
Kevin Chan | 41a3870 | 2012-06-06 22:25:41 -0700 | [diff] [blame] | 2034 | #define MSM_CAM_V4L2_IOCTL_PRIVATE_S_CTRL \ |
| 2035 | _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_camera_v4l2_ioctl_t) |
| 2036 | |
Kiran Kumar H N | 9078590 | 2012-07-05 13:59:38 -0700 | [diff] [blame] | 2037 | #define MSM_CAM_V4L2_IOCTL_PRIVATE_G_CTRL \ |
| 2038 | _IOWR('V', BASE_VIDIOC_PRIVATE + 9, struct msm_camera_v4l2_ioctl_t) |
| 2039 | |
Ankit Premrajka | 8c9bf5d | 2012-08-07 15:45:31 -0700 | [diff] [blame] | 2040 | #define MSM_CAM_V4L2_IOCTL_PRIVATE_GENERAL \ |
| 2041 | _IOW('V', BASE_VIDIOC_PRIVATE + 10, struct msm_camera_v4l2_ioctl_t) |
| 2042 | |
Ankit Premrajka | 4b3443f | 2012-06-11 14:06:31 -0700 | [diff] [blame] | 2043 | #define VIDIOC_MSM_VPE_INIT \ |
| 2044 | _IO('V', BASE_VIDIOC_PRIVATE + 15) |
| 2045 | |
| 2046 | #define VIDIOC_MSM_VPE_RELEASE \ |
| 2047 | _IO('V', BASE_VIDIOC_PRIVATE + 16) |
| 2048 | |
| 2049 | #define VIDIOC_MSM_VPE_CFG \ |
| 2050 | _IOWR('V', BASE_VIDIOC_PRIVATE + 17, struct msm_mctl_pp_params *) |
| 2051 | |
| 2052 | #define VIDIOC_MSM_AXI_INIT \ |
Nishant Pandit | 221a948 | 2012-09-03 05:36:04 +0530 | [diff] [blame] | 2053 | _IOWR('V', BASE_VIDIOC_PRIVATE + 18, uint8_t *) |
Ankit Premrajka | 4b3443f | 2012-06-11 14:06:31 -0700 | [diff] [blame] | 2054 | |
| 2055 | #define VIDIOC_MSM_AXI_RELEASE \ |
| 2056 | _IO('V', BASE_VIDIOC_PRIVATE + 19) |
| 2057 | |
| 2058 | #define VIDIOC_MSM_AXI_CFG \ |
| 2059 | _IOWR('V', BASE_VIDIOC_PRIVATE + 20, void *) |
| 2060 | |
| 2061 | #define VIDIOC_MSM_AXI_IRQ \ |
| 2062 | _IOWR('V', BASE_VIDIOC_PRIVATE + 21, void *) |
| 2063 | |
| 2064 | #define VIDIOC_MSM_AXI_BUF_CFG \ |
| 2065 | _IOWR('V', BASE_VIDIOC_PRIVATE + 22, void *) |
| 2066 | |
Ankit Premrajka | 5d00d66 | 2012-07-30 09:42:26 -0700 | [diff] [blame] | 2067 | #define VIDIOC_MSM_AXI_RDI_COUNT_UPDATE \ |
| 2068 | _IOWR('V', BASE_VIDIOC_PRIVATE + 23, struct rdi_count_msg) |
| 2069 | |
Ankit Premrajka | 4b3443f | 2012-06-11 14:06:31 -0700 | [diff] [blame] | 2070 | #define VIDIOC_MSM_VFE_INIT \ |
Ankit Premrajka | 5d00d66 | 2012-07-30 09:42:26 -0700 | [diff] [blame] | 2071 | _IO('V', BASE_VIDIOC_PRIVATE + 24) |
Ankit Premrajka | 4b3443f | 2012-06-11 14:06:31 -0700 | [diff] [blame] | 2072 | |
| 2073 | #define VIDIOC_MSM_VFE_RELEASE \ |
Ankit Premrajka | 5d00d66 | 2012-07-30 09:42:26 -0700 | [diff] [blame] | 2074 | _IO('V', BASE_VIDIOC_PRIVATE + 25) |
Ankit Premrajka | 4b3443f | 2012-06-11 14:06:31 -0700 | [diff] [blame] | 2075 | |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 2076 | struct msm_camera_v4l2_ioctl_t { |
Kevin Chan | 41a3870 | 2012-06-06 22:25:41 -0700 | [diff] [blame] | 2077 | uint32_t id; |
Kevin Chan | 41a3870 | 2012-06-06 22:25:41 -0700 | [diff] [blame] | 2078 | uint32_t len; |
Ankit Premrajka | 8c9bf5d | 2012-08-07 15:45:31 -0700 | [diff] [blame] | 2079 | uint32_t trans_code; |
| 2080 | void __user *ioctl_ptr; |
Kevin Chan | 94b4c83 | 2012-03-02 21:27:16 -0800 | [diff] [blame] | 2081 | }; |
| 2082 | |
Lakshmi Narayana Kalavala | cd3d81e | 2012-07-31 13:04:03 -0700 | [diff] [blame] | 2083 | struct msm_camera_vfe_params_t { |
| 2084 | uint32_t operation_mode; |
| 2085 | uint32_t capture_count; |
Nishant Pandit | 221a948 | 2012-09-03 05:36:04 +0530 | [diff] [blame] | 2086 | uint8_t skip_reset; |
Nishant Pandit | d778571 | 2012-07-31 19:09:11 +0530 | [diff] [blame] | 2087 | uint8_t stop_immediately; |
Lakshmi Narayana Kalavala | cd3d81e | 2012-07-31 13:04:03 -0700 | [diff] [blame] | 2088 | uint16_t port_info; |
Lakshmi Narayana Kalavala | 3e8a1d1 | 2012-07-31 15:00:09 -0700 | [diff] [blame] | 2089 | uint32_t inst_handle; |
Lakshmi Narayana Kalavala | cd3d81e | 2012-07-31 13:04:03 -0700 | [diff] [blame] | 2090 | uint16_t cmd_type; |
| 2091 | }; |
| 2092 | |
Kiran Kumar H N | b4a278e | 2012-06-18 19:25:47 -0700 | [diff] [blame] | 2093 | enum msm_camss_irq_idx { |
| 2094 | CAMERA_SS_IRQ_0, |
| 2095 | CAMERA_SS_IRQ_1, |
| 2096 | CAMERA_SS_IRQ_2, |
| 2097 | CAMERA_SS_IRQ_3, |
| 2098 | CAMERA_SS_IRQ_4, |
| 2099 | CAMERA_SS_IRQ_5, |
| 2100 | CAMERA_SS_IRQ_6, |
| 2101 | CAMERA_SS_IRQ_7, |
| 2102 | CAMERA_SS_IRQ_8, |
| 2103 | CAMERA_SS_IRQ_9, |
| 2104 | CAMERA_SS_IRQ_10, |
| 2105 | CAMERA_SS_IRQ_11, |
| 2106 | CAMERA_SS_IRQ_12, |
| 2107 | CAMERA_SS_IRQ_MAX |
| 2108 | }; |
| 2109 | |
| 2110 | enum msm_cam_hw_idx { |
| 2111 | MSM_CAM_HW_MICRO, |
| 2112 | MSM_CAM_HW_CCI, |
| 2113 | MSM_CAM_HW_CSI0, |
| 2114 | MSM_CAM_HW_CSI1, |
| 2115 | MSM_CAM_HW_CSI2, |
| 2116 | MSM_CAM_HW_CSI3, |
| 2117 | MSM_CAM_HW_ISPIF, |
| 2118 | MSM_CAM_HW_CPP, |
| 2119 | MSM_CAM_HW_VFE0, |
| 2120 | MSM_CAM_HW_VFE1, |
| 2121 | MSM_CAM_HW_JPEG0, |
| 2122 | MSM_CAM_HW_JPEG1, |
| 2123 | MSM_CAM_HW_JPEG2, |
| 2124 | MSM_CAM_HW_MAX |
| 2125 | }; |
| 2126 | |
| 2127 | struct msm_camera_irq_cfg { |
| 2128 | /* Bit mask of all the camera hardwares that needs to |
| 2129 | * be composited into a single IRQ to the MSM. |
| 2130 | * Current usage: (may be updated based on hw changes) |
| 2131 | * Bits 31:13 - Reserved. |
| 2132 | * Bits 12:0 |
| 2133 | * 12 - MSM_CAM_HW_JPEG2 |
| 2134 | * 11 - MSM_CAM_HW_JPEG1 |
| 2135 | * 10 - MSM_CAM_HW_JPEG0 |
| 2136 | * 9 - MSM_CAM_HW_VFE1 |
| 2137 | * 8 - MSM_CAM_HW_VFE0 |
| 2138 | * 7 - MSM_CAM_HW_CPP |
| 2139 | * 6 - MSM_CAM_HW_ISPIF |
| 2140 | * 5 - MSM_CAM_HW_CSI3 |
| 2141 | * 4 - MSM_CAM_HW_CSI2 |
| 2142 | * 3 - MSM_CAM_HW_CSI1 |
| 2143 | * 2 - MSM_CAM_HW_CSI0 |
| 2144 | * 1 - MSM_CAM_HW_CCI |
| 2145 | * 0 - MSM_CAM_HW_MICRO |
| 2146 | */ |
| 2147 | uint32_t cam_hw_mask; |
| 2148 | uint8_t irq_idx; |
| 2149 | uint8_t num_hwcore; |
| 2150 | }; |
| 2151 | |
| 2152 | #define MSM_IRQROUTER_CFG_COMPIRQ \ |
| 2153 | _IOWR('V', BASE_VIDIOC_PRIVATE, void __user *) |
| 2154 | |
Kevin Chan | 73ec728 | 2012-06-07 01:32:00 -0700 | [diff] [blame] | 2155 | #define MAX_NUM_CPP_STRIPS 8 |
| 2156 | |
| 2157 | enum msm_cpp_frame_type { |
| 2158 | MSM_CPP_OFFLINE_FRAME, |
| 2159 | MSM_CPP_REALTIME_FRAME, |
| 2160 | }; |
| 2161 | |
| 2162 | struct msm_cpp_frame_strip_info { |
| 2163 | int scale_v_en; |
| 2164 | int scale_h_en; |
| 2165 | |
| 2166 | int upscale_v_en; |
| 2167 | int upscale_h_en; |
| 2168 | |
| 2169 | int src_start_x; |
| 2170 | int src_end_x; |
| 2171 | int src_start_y; |
| 2172 | int src_end_y; |
| 2173 | |
| 2174 | /* Padding is required for upscaler because it does not |
| 2175 | * pad internally like other blocks, also needed for rotation |
| 2176 | * rotation expects all the blocks in the stripe to be the same size |
| 2177 | * Padding is done such that all the extra padded pixels |
| 2178 | * are on the right and bottom |
| 2179 | */ |
| 2180 | int pad_bottom; |
| 2181 | int pad_top; |
| 2182 | int pad_right; |
| 2183 | int pad_left; |
| 2184 | |
| 2185 | int v_init_phase; |
| 2186 | int h_init_phase; |
| 2187 | int h_phase_step; |
| 2188 | int v_phase_step; |
| 2189 | |
| 2190 | int prescale_crop_width_first_pixel; |
| 2191 | int prescale_crop_width_last_pixel; |
| 2192 | int prescale_crop_height_first_line; |
| 2193 | int prescale_crop_height_last_line; |
| 2194 | |
| 2195 | int postscale_crop_height_first_line; |
| 2196 | int postscale_crop_height_last_line; |
| 2197 | int postscale_crop_width_first_pixel; |
| 2198 | int postscale_crop_width_last_pixel; |
| 2199 | |
| 2200 | int dst_start_x; |
| 2201 | int dst_end_x; |
| 2202 | int dst_start_y; |
| 2203 | int dst_end_y; |
| 2204 | |
| 2205 | int bytes_per_pixel; |
| 2206 | unsigned int source_address; |
| 2207 | unsigned int destination_address; |
| 2208 | unsigned int src_stride; |
| 2209 | unsigned int dst_stride; |
| 2210 | int rotate_270; |
| 2211 | int horizontal_flip; |
| 2212 | int vertical_flip; |
| 2213 | int scale_output_width; |
| 2214 | int scale_output_height; |
| 2215 | }; |
| 2216 | |
| 2217 | struct msm_cpp_frame_info_t { |
| 2218 | int32_t frame_id; |
| 2219 | uint32_t inst_id; |
| 2220 | uint32_t client_id; |
| 2221 | enum msm_cpp_frame_type frame_type; |
| 2222 | uint32_t num_strips; |
| 2223 | struct msm_cpp_frame_strip_info *strip_info; |
| 2224 | }; |
| 2225 | |
Lakshmi Narayana Kalavala | bc315ea | 2012-07-24 09:55:48 -0700 | [diff] [blame] | 2226 | struct msm_ver_num_info { |
| 2227 | uint32_t main; |
| 2228 | uint32_t minor; |
| 2229 | uint32_t rev; |
| 2230 | }; |
| 2231 | |
Kevin Chan | 73ec728 | 2012-06-07 01:32:00 -0700 | [diff] [blame] | 2232 | #define VIDIOC_MSM_CPP_CFG \ |
| 2233 | _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_camera_v4l2_ioctl_t) |
| 2234 | |
| 2235 | #define VIDIOC_MSM_CPP_GET_EVENTPAYLOAD \ |
| 2236 | _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct msm_camera_v4l2_ioctl_t) |
| 2237 | |
| 2238 | #define VIDIOC_MSM_CPP_GET_INST_INFO \ |
| 2239 | _IOWR('V', BASE_VIDIOC_PRIVATE + 2, struct msm_camera_v4l2_ioctl_t) |
| 2240 | |
| 2241 | #define V4L2_EVENT_CPP_FRAME_DONE (V4L2_EVENT_PRIVATE_START + 0) |
| 2242 | |
Kiran Kumar H N | 9078590 | 2012-07-05 13:59:38 -0700 | [diff] [blame] | 2243 | /* Instance Handle - inst_handle |
| 2244 | * Data bundle containing the information about where |
| 2245 | * to get a buffer for a particular camera instance. |
| 2246 | * This is a bitmask containing the following data: |
| 2247 | * Buffer Handle Bitmask: |
| 2248 | * ------------------------------------ |
| 2249 | * Bits : Purpose |
| 2250 | * ------------------------------------ |
Mingcheng Zhu | 86ec84f | 2012-09-08 21:20:51 -0700 | [diff] [blame] | 2251 | * 31 : is Dev ID valid? |
| 2252 | * 30 - 24 : Dev ID. |
Kiran Kumar H N | 9078590 | 2012-07-05 13:59:38 -0700 | [diff] [blame] | 2253 | * 23 : is Image mode valid? |
| 2254 | * 22 - 16 : Image mode. |
| 2255 | * 15 : is MCTL PP inst idx valid? |
| 2256 | * 14 - 8 : MCTL PP inst idx. |
| 2257 | * 7 : is Video inst idx valid? |
| 2258 | * 6 - 0 : Video inst idx. |
| 2259 | */ |
Mingcheng Zhu | 86ec84f | 2012-09-08 21:20:51 -0700 | [diff] [blame] | 2260 | #define CLR_DEVID_MODE(handle) (handle &= 0x00FFFFFF) |
| 2261 | #define SET_DEVID_MODE(handle, data) \ |
| 2262 | (handle |= ((0x1 << 31) | ((data & 0x7F) << 24))) |
| 2263 | #define GET_DEVID_MODE(handle) \ |
| 2264 | ((handle & 0x80000000) ? ((handle & 0x7F000000) >> 24) : 0xFF) |
| 2265 | |
Kiran Kumar H N | 9078590 | 2012-07-05 13:59:38 -0700 | [diff] [blame] | 2266 | #define CLR_IMG_MODE(handle) (handle &= 0xFF00FFFF) |
| 2267 | #define SET_IMG_MODE(handle, data) \ |
| 2268 | (handle |= ((0x1 << 23) | ((data & 0x7F) << 16))) |
| 2269 | #define GET_IMG_MODE(handle) \ |
| 2270 | ((handle & 0x800000) ? ((handle & 0x7F0000) >> 16) : 0xFF) |
| 2271 | |
| 2272 | #define CLR_MCTLPP_INST_IDX(handle) (handle &= 0xFFFF00FF) |
| 2273 | #define SET_MCTLPP_INST_IDX(handle, data) \ |
| 2274 | (handle |= ((0x1 << 15) | ((data & 0x7F) << 8))) |
| 2275 | #define GET_MCTLPP_INST_IDX(handle) \ |
| 2276 | ((handle & 0x8000) ? ((handle & 0x7F00) >> 8) : 0xFF) |
| 2277 | |
| 2278 | #define CLR_VIDEO_INST_IDX(handle) (handle &= 0xFFFFFF00) |
| 2279 | #define GET_VIDEO_INST_IDX(handle) \ |
| 2280 | ((handle & 0x80) ? (handle & 0x7F) : 0xFF) |
| 2281 | #define SET_VIDEO_INST_IDX(handle, data) \ |
| 2282 | (handle |= (0x1 << 7) | (data & 0x7F)) |
| 2283 | |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2284 | #endif /* __LINUX_MSM_CAMERA_H */ |