Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 1 | #ifndef __MSMB_ISP__ |
| 2 | #define __MSMB_ISP__ |
| 3 | |
| 4 | #include <linux/videodev2.h> |
| 5 | |
| 6 | #define MAX_PLANES_PER_STREAM 3 |
| 7 | #define MAX_NUM_STREAM 7 |
| 8 | |
| 9 | #define ISP_VERSION_40 40 |
| 10 | #define ISP_VERSION_32 32 |
Mingcheng Zhu | 503a6f9 | 2013-01-06 13:23:24 -0800 | [diff] [blame] | 11 | #define ISP_NATIVE_BUF_BIT 0x10000 |
Peter Liu | 11cbc22 | 2013-03-13 15:27:24 -0700 | [diff] [blame] | 12 | #define ISP0_BIT 0x20000 |
| 13 | #define ISP1_BIT 0x40000 |
Mingcheng Zhu | 1e6b5e3 | 2013-06-23 17:11:41 -0700 | [diff] [blame] | 14 | #define ISP_META_CHANNEL_BIT 0x80000 |
Mingcheng Zhu | 503a6f9 | 2013-01-06 13:23:24 -0800 | [diff] [blame] | 15 | #define ISP_STATS_STREAM_BIT 0x80000000 |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 16 | |
| 17 | enum ISP_START_PIXEL_PATTERN { |
| 18 | ISP_BAYER_RGRGRG, |
| 19 | ISP_BAYER_GRGRGR, |
| 20 | ISP_BAYER_BGBGBG, |
| 21 | ISP_BAYER_GBGBGB, |
| 22 | ISP_YUV_YCbYCr, |
| 23 | ISP_YUV_YCrYCb, |
| 24 | ISP_YUV_CbYCrY, |
| 25 | ISP_YUV_CrYCbY, |
| 26 | ISP_PIX_PATTERN_MAX |
| 27 | }; |
| 28 | |
| 29 | enum msm_vfe_plane_fmt { |
| 30 | Y_PLANE, |
| 31 | CB_PLANE, |
| 32 | CR_PLANE, |
| 33 | CRCB_PLANE, |
| 34 | CBCR_PLANE, |
| 35 | VFE_PLANE_FMT_MAX |
| 36 | }; |
| 37 | |
| 38 | enum msm_vfe_input_src { |
| 39 | VFE_PIX_0, |
| 40 | VFE_RAW_0, |
| 41 | VFE_RAW_1, |
| 42 | VFE_RAW_2, |
| 43 | VFE_SRC_MAX, |
| 44 | }; |
| 45 | |
| 46 | enum msm_vfe_axi_stream_src { |
| 47 | PIX_ENCODER, |
| 48 | PIX_VIEWFINDER, |
| 49 | CAMIF_RAW, |
| 50 | IDEAL_RAW, |
Kevin Chan | 80b7b6d | 2013-01-31 16:08:35 -0800 | [diff] [blame] | 51 | RDI_INTF_0, |
| 52 | RDI_INTF_1, |
| 53 | RDI_INTF_2, |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 54 | VFE_AXI_SRC_MAX |
| 55 | }; |
| 56 | |
| 57 | enum msm_vfe_frame_skip_pattern { |
| 58 | NO_SKIP, |
| 59 | EVERY_2FRAME, |
Kevin Chan | 1fe7fb7 | 2013-02-12 19:33:38 -0800 | [diff] [blame] | 60 | EVERY_3FRAME, |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 61 | EVERY_4FRAME, |
Kevin Chan | 1fe7fb7 | 2013-02-12 19:33:38 -0800 | [diff] [blame] | 62 | EVERY_5FRAME, |
| 63 | EVERY_6FRAME, |
| 64 | EVERY_7FRAME, |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 65 | EVERY_8FRAME, |
| 66 | EVERY_16FRAME, |
| 67 | EVERY_32FRAME, |
Kevin Chan | 87cedbd | 2013-04-27 03:14:35 -0700 | [diff] [blame] | 68 | SKIP_ALL, |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 69 | MAX_SKIP, |
| 70 | }; |
| 71 | |
| 72 | enum msm_vfe_camif_input { |
| 73 | CAMIF_DISABLED, |
| 74 | CAMIF_PAD_REG_INPUT, |
| 75 | CAMIF_MIDDI_INPUT, |
| 76 | CAMIF_MIPI_INPUT, |
| 77 | }; |
| 78 | |
| 79 | struct msm_vfe_camif_cfg { |
| 80 | uint32_t lines_per_frame; |
| 81 | uint32_t pixels_per_line; |
| 82 | uint32_t first_pixel; |
| 83 | uint32_t last_pixel; |
| 84 | uint32_t first_line; |
| 85 | uint32_t last_line; |
| 86 | uint32_t epoch_line0; |
| 87 | uint32_t epoch_line1; |
| 88 | enum msm_vfe_camif_input camif_input; |
| 89 | }; |
| 90 | |
| 91 | enum msm_vfe_inputmux { |
| 92 | CAMIF, |
| 93 | TESTGEN, |
| 94 | EXTERNAL_READ, |
| 95 | }; |
| 96 | |
| 97 | struct msm_vfe_pix_cfg { |
| 98 | struct msm_vfe_camif_cfg camif_cfg; |
| 99 | enum msm_vfe_inputmux input_mux; |
| 100 | enum ISP_START_PIXEL_PATTERN pixel_pattern; |
Kevin Chan | 9fd18a2 | 2013-06-24 16:21:02 -0700 | [diff] [blame] | 101 | uint32_t input_format; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 102 | }; |
| 103 | |
Kevin Chan | 80b7b6d | 2013-01-31 16:08:35 -0800 | [diff] [blame] | 104 | struct msm_vfe_rdi_cfg { |
| 105 | uint8_t cid; |
| 106 | uint8_t frame_based; |
| 107 | }; |
| 108 | |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 109 | struct msm_vfe_input_cfg { |
| 110 | union { |
| 111 | struct msm_vfe_pix_cfg pix_cfg; |
Kevin Chan | 80b7b6d | 2013-01-31 16:08:35 -0800 | [diff] [blame] | 112 | struct msm_vfe_rdi_cfg rdi_cfg; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 113 | } d; |
| 114 | enum msm_vfe_input_src input_src; |
Kevin Chan | 9a8301b1 | 2013-03-18 15:39:37 -0700 | [diff] [blame] | 115 | uint32_t input_pix_clk; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 116 | }; |
| 117 | |
| 118 | struct msm_vfe_axi_plane_cfg { |
| 119 | uint32_t output_width; /*Include padding*/ |
| 120 | uint32_t output_height; |
| 121 | uint32_t output_stride; |
| 122 | uint32_t output_scan_lines; |
| 123 | uint32_t output_plane_format; /*Y/Cb/Cr/CbCr*/ |
Kevin Chan | baf0a13 | 2013-03-05 20:08:23 -0800 | [diff] [blame] | 124 | uint32_t plane_addr_offset; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 125 | uint8_t csid_src; /*RDI 0-2*/ |
| 126 | uint8_t rdi_cid;/*CID 1-16*/ |
| 127 | }; |
| 128 | |
| 129 | struct msm_vfe_axi_stream_request_cmd { |
| 130 | uint32_t session_id; |
| 131 | uint32_t stream_id; |
Alok Kediya | 6b1f21f | 2013-10-04 18:13:32 +0530 | [diff] [blame] | 132 | uint32_t vt_enable; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 133 | uint32_t output_format;/*Planar/RAW/Misc*/ |
| 134 | enum msm_vfe_axi_stream_src stream_src; /*CAMIF/IDEAL/RDIs*/ |
| 135 | struct msm_vfe_axi_plane_cfg plane_cfg[MAX_PLANES_PER_STREAM]; |
| 136 | |
| 137 | uint32_t burst_count; |
| 138 | uint32_t hfr_mode; |
| 139 | uint8_t frame_base; |
| 140 | |
| 141 | uint32_t init_frame_drop; /*MAX 31 Frames*/ |
| 142 | enum msm_vfe_frame_skip_pattern frame_skip_pattern; |
| 143 | uint8_t buf_divert; /* if TRUE no vb2 buf done. */ |
| 144 | /*Return values*/ |
| 145 | uint32_t axi_stream_handle; |
| 146 | }; |
| 147 | |
| 148 | struct msm_vfe_axi_stream_release_cmd { |
| 149 | uint32_t stream_handle; |
| 150 | }; |
| 151 | |
| 152 | enum msm_vfe_axi_stream_cmd { |
| 153 | STOP_STREAM, |
| 154 | START_STREAM, |
Abhishek Kondaveeti | 74c1b27 | 2013-11-12 17:13:45 +0530 | [diff] [blame] | 155 | STOP_IMMEDIATELY, |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 156 | }; |
| 157 | |
| 158 | struct msm_vfe_axi_stream_cfg_cmd { |
| 159 | uint8_t num_streams; |
| 160 | uint32_t stream_handle[MAX_NUM_STREAM]; |
| 161 | enum msm_vfe_axi_stream_cmd cmd; |
| 162 | }; |
| 163 | |
Kevin Chan | 5bebd2e | 2013-01-30 20:25:05 -0800 | [diff] [blame] | 164 | enum msm_vfe_axi_stream_update_type { |
| 165 | ENABLE_STREAM_BUF_DIVERT, |
| 166 | DISABLE_STREAM_BUF_DIVERT, |
| 167 | UPDATE_STREAM_FRAMEDROP_PATTERN, |
Kevin Chan | d5dfce2 | 2013-05-16 00:34:25 -0700 | [diff] [blame] | 168 | UPDATE_STREAM_AXI_CONFIG, |
| 169 | }; |
| 170 | |
| 171 | struct msm_vfe_axi_stream_cfg_update_info { |
| 172 | uint32_t stream_handle; |
| 173 | uint32_t output_format; |
| 174 | enum msm_vfe_frame_skip_pattern skip_pattern; |
| 175 | struct msm_vfe_axi_plane_cfg plane_cfg[MAX_PLANES_PER_STREAM]; |
Kevin Chan | 5bebd2e | 2013-01-30 20:25:05 -0800 | [diff] [blame] | 176 | }; |
| 177 | |
| 178 | struct msm_vfe_axi_stream_update_cmd { |
Kevin Chan | d5dfce2 | 2013-05-16 00:34:25 -0700 | [diff] [blame] | 179 | uint32_t num_streams; |
Kevin Chan | 5bebd2e | 2013-01-30 20:25:05 -0800 | [diff] [blame] | 180 | enum msm_vfe_axi_stream_update_type update_type; |
Kevin Chan | d5dfce2 | 2013-05-16 00:34:25 -0700 | [diff] [blame] | 181 | struct msm_vfe_axi_stream_cfg_update_info update_info[MAX_NUM_STREAM]; |
Kevin Chan | 5bebd2e | 2013-01-30 20:25:05 -0800 | [diff] [blame] | 182 | }; |
| 183 | |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 184 | enum msm_isp_stats_type { |
| 185 | MSM_ISP_STATS_AEC, /* legacy based AEC */ |
| 186 | MSM_ISP_STATS_AF, /* legacy based AF */ |
| 187 | MSM_ISP_STATS_AWB, /* legacy based AWB */ |
| 188 | MSM_ISP_STATS_RS, /* legacy based RS */ |
| 189 | MSM_ISP_STATS_CS, /* legacy based CS */ |
| 190 | MSM_ISP_STATS_IHIST, /* legacy based HIST */ |
| 191 | MSM_ISP_STATS_SKIN, /* legacy based SKIN */ |
| 192 | MSM_ISP_STATS_BG, /* Bayer Grids */ |
| 193 | MSM_ISP_STATS_BF, /* Bayer Focus */ |
| 194 | MSM_ISP_STATS_BE, /* Bayer Exposure*/ |
| 195 | MSM_ISP_STATS_BHIST, /* Bayer Hist */ |
| 196 | MSM_ISP_STATS_MAX /* MAX */ |
| 197 | }; |
| 198 | |
| 199 | struct msm_vfe_stats_stream_request_cmd { |
| 200 | uint32_t session_id; |
| 201 | uint32_t stream_id; |
| 202 | enum msm_isp_stats_type stats_type; |
Kevin Chan | 1f15249 | 2013-03-21 23:36:48 -0700 | [diff] [blame] | 203 | uint32_t composite_flag; |
Mingcheng Zhu | 503a6f9 | 2013-01-06 13:23:24 -0800 | [diff] [blame] | 204 | uint32_t framedrop_pattern; |
Kevin Chan | 3454e2b | 2013-01-17 19:18:57 -0800 | [diff] [blame] | 205 | uint32_t irq_subsample_pattern; |
Kevin Chan | ce198ee | 2013-03-14 18:47:18 -0700 | [diff] [blame] | 206 | uint32_t buffer_offset; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 207 | uint32_t stream_handle; |
| 208 | }; |
Kevin Chan | 3454e2b | 2013-01-17 19:18:57 -0800 | [diff] [blame] | 209 | |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 210 | struct msm_vfe_stats_stream_release_cmd { |
| 211 | uint32_t stream_handle; |
| 212 | }; |
| 213 | struct msm_vfe_stats_stream_cfg_cmd { |
| 214 | uint8_t num_streams; |
| 215 | uint32_t stream_handle[MSM_ISP_STATS_MAX]; |
| 216 | uint8_t enable; |
| 217 | }; |
Kevin Chan | 3454e2b | 2013-01-17 19:18:57 -0800 | [diff] [blame] | 218 | |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 219 | enum msm_vfe_reg_cfg_type { |
| 220 | VFE_WRITE, |
| 221 | VFE_WRITE_MB, |
| 222 | VFE_READ, |
Kevin Chan | 7672ef3 | 2013-01-21 22:10:53 -0800 | [diff] [blame] | 223 | VFE_CFG_MASK, |
| 224 | VFE_WRITE_DMI_16BIT, |
| 225 | VFE_WRITE_DMI_32BIT, |
| 226 | VFE_WRITE_DMI_64BIT, |
| 227 | VFE_READ_DMI_16BIT, |
| 228 | VFE_READ_DMI_32BIT, |
| 229 | VFE_READ_DMI_64BIT, |
Slavi Dimitrov | 8dec27c | 2013-07-25 00:16:18 -0700 | [diff] [blame] | 230 | GET_SOC_HW_VER, |
Sreesudhan Ramakrish Ramkumar | bebd6dc | 2013-11-21 10:54:53 -0800 | [diff] [blame] | 231 | GET_MAX_CLK_RATE, |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 232 | }; |
| 233 | |
| 234 | struct msm_vfe_cfg_cmd2 { |
| 235 | uint16_t num_cfg; |
| 236 | uint16_t cmd_len; |
| 237 | void __user *cfg_data; |
| 238 | void __user *cfg_cmd; |
| 239 | }; |
| 240 | |
Kevin Chan | 7672ef3 | 2013-01-21 22:10:53 -0800 | [diff] [blame] | 241 | struct msm_vfe_reg_rw_info { |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 242 | uint32_t reg_offset; |
Kevin Chan | 7672ef3 | 2013-01-21 22:10:53 -0800 | [diff] [blame] | 243 | uint32_t cmd_data_offset; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 244 | uint32_t len; |
Kevin Chan | 7672ef3 | 2013-01-21 22:10:53 -0800 | [diff] [blame] | 245 | }; |
| 246 | |
| 247 | struct msm_vfe_reg_mask_info { |
| 248 | uint32_t reg_offset; |
| 249 | uint32_t mask; |
| 250 | uint32_t val; |
| 251 | }; |
| 252 | |
| 253 | struct msm_vfe_reg_dmi_info { |
| 254 | uint32_t hi_tbl_offset; /*Optional*/ |
| 255 | uint32_t lo_tbl_offset; /*Required*/ |
| 256 | uint32_t len; |
| 257 | }; |
| 258 | |
| 259 | struct msm_vfe_reg_cfg_cmd { |
| 260 | union { |
| 261 | struct msm_vfe_reg_rw_info rw_info; |
| 262 | struct msm_vfe_reg_mask_info mask_info; |
| 263 | struct msm_vfe_reg_dmi_info dmi_info; |
| 264 | } u; |
| 265 | |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 266 | enum msm_vfe_reg_cfg_type cmd_type; |
| 267 | }; |
| 268 | |
Kevin Chan | baf0a13 | 2013-03-05 20:08:23 -0800 | [diff] [blame] | 269 | enum msm_isp_buf_type { |
| 270 | ISP_PRIVATE_BUF, |
| 271 | ISP_SHARE_BUF, |
| 272 | MAX_ISP_BUF_TYPE, |
| 273 | }; |
| 274 | |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 275 | struct msm_isp_buf_request { |
| 276 | uint32_t session_id; |
| 277 | uint32_t stream_id; |
| 278 | uint8_t num_buf; |
| 279 | uint32_t handle; |
Kevin Chan | baf0a13 | 2013-03-05 20:08:23 -0800 | [diff] [blame] | 280 | enum msm_isp_buf_type buf_type; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 281 | }; |
| 282 | |
| 283 | struct msm_isp_qbuf_info { |
| 284 | uint32_t handle; |
| 285 | int buf_idx; |
| 286 | /*Only used for prepare buffer*/ |
| 287 | struct v4l2_buffer buffer; |
Kevin Chan | 5bebd2e | 2013-01-30 20:25:05 -0800 | [diff] [blame] | 288 | /*Only used for diverted buffer*/ |
| 289 | uint32_t dirty_buf; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 290 | }; |
| 291 | |
| 292 | struct msm_vfe_axi_src_state { |
| 293 | enum msm_vfe_input_src input_src; |
| 294 | uint32_t src_active; |
| 295 | }; |
| 296 | |
| 297 | enum msm_isp_event_idx { |
| 298 | ISP_REG_UPDATE = 0, |
| 299 | ISP_START_ACK = 1, |
| 300 | ISP_STOP_ACK = 2, |
| 301 | ISP_IRQ_VIOLATION = 3, |
| 302 | ISP_WM_BUS_OVERFLOW = 4, |
| 303 | ISP_STATS_OVERFLOW = 5, |
| 304 | ISP_CAMIF_ERROR = 6, |
Kevin Chan | 9c74c52 | 2013-02-06 22:27:47 -0800 | [diff] [blame] | 305 | ISP_SOF = 7, |
| 306 | ISP_EOF = 8, |
| 307 | ISP_EVENT_MAX = 9 |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 308 | }; |
| 309 | |
Kevin Chan | 9c74c52 | 2013-02-06 22:27:47 -0800 | [diff] [blame] | 310 | #define ISP_EVENT_OFFSET 8 |
| 311 | #define ISP_EVENT_BASE (V4L2_EVENT_PRIVATE_START) |
| 312 | #define ISP_BUF_EVENT_BASE (ISP_EVENT_BASE + (1 << ISP_EVENT_OFFSET)) |
| 313 | #define ISP_STATS_EVENT_BASE (ISP_EVENT_BASE + (2 << ISP_EVENT_OFFSET)) |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 314 | #define ISP_EVENT_REG_UPDATE (ISP_EVENT_BASE + ISP_REG_UPDATE) |
| 315 | #define ISP_EVENT_START_ACK (ISP_EVENT_BASE + ISP_START_ACK) |
| 316 | #define ISP_EVENT_STOP_ACK (ISP_EVENT_BASE + ISP_STOP_ACK) |
| 317 | #define ISP_EVENT_IRQ_VIOLATION (ISP_EVENT_BASE + ISP_IRQ_VIOLATION) |
| 318 | #define ISP_EVENT_WM_BUS_OVERFLOW (ISP_EVENT_BASE + ISP_WM_BUS_OVERFLOW) |
| 319 | #define ISP_EVENT_STATS_OVERFLOW (ISP_EVENT_BASE + ISP_STATS_OVERFLOW) |
| 320 | #define ISP_EVENT_CAMIF_ERROR (ISP_EVENT_BASE + ISP_CAMIF_ERROR) |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 321 | #define ISP_EVENT_SOF (ISP_EVENT_BASE + ISP_SOF) |
| 322 | #define ISP_EVENT_EOF (ISP_EVENT_BASE + ISP_EOF) |
Kevin Chan | 9c74c52 | 2013-02-06 22:27:47 -0800 | [diff] [blame] | 323 | #define ISP_EVENT_BUF_DIVERT (ISP_BUF_EVENT_BASE) |
| 324 | #define ISP_EVENT_STATS_NOTIFY (ISP_STATS_EVENT_BASE) |
Kevin Chan | 1f15249 | 2013-03-21 23:36:48 -0700 | [diff] [blame] | 325 | #define ISP_EVENT_COMP_STATS_NOTIFY (ISP_EVENT_STATS_NOTIFY + MSM_ISP_STATS_MAX) |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 326 | /* The msm_v4l2_event_data structure should match the |
| 327 | * v4l2_event.u.data field. |
| 328 | * should not exceed 64 bytes */ |
| 329 | |
| 330 | struct msm_isp_buf_event { |
| 331 | uint32_t session_id; |
| 332 | uint32_t stream_id; |
| 333 | uint32_t handle; |
Kevin Chan | d5dfce2 | 2013-05-16 00:34:25 -0700 | [diff] [blame] | 334 | uint32_t output_format; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 335 | int8_t buf_idx; |
| 336 | }; |
| 337 | struct msm_isp_stats_event { |
| 338 | uint32_t stats_mask; /* 4 bytes */ |
| 339 | uint8_t stats_buf_idxs[MSM_ISP_STATS_MAX]; /* 11 bytes */ |
| 340 | }; |
| 341 | |
| 342 | struct msm_isp_stream_ack { |
| 343 | uint32_t session_id; |
| 344 | uint32_t stream_id; |
| 345 | uint32_t handle; |
| 346 | }; |
| 347 | |
| 348 | struct msm_isp_event_data { |
Kevin Chan | 9f7785c | 2013-02-22 22:09:57 -0800 | [diff] [blame] | 349 | /*Wall clock except for buffer divert events |
| 350 | *which use monotonic clock |
| 351 | */ |
| 352 | struct timeval timestamp; |
Shuzhen Wang | 1384475 | 2013-05-20 15:13:45 -0700 | [diff] [blame] | 353 | /* Monotonic timestamp since bootup */ |
| 354 | struct timeval mono_timestamp; |
Kevin Chan | 195687f | 2013-06-25 19:01:17 -0700 | [diff] [blame] | 355 | enum msm_vfe_input_src input_intf; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 356 | uint32_t frame_id; |
| 357 | union { |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 358 | struct msm_isp_stats_event stats; |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 359 | struct msm_isp_buf_event buf_done; |
| 360 | } u; /* union can have max 52 bytes */ |
| 361 | }; |
| 362 | |
Kevin Chan | 80b7b6d | 2013-01-31 16:08:35 -0800 | [diff] [blame] | 363 | #define V4L2_PIX_FMT_QBGGR8 v4l2_fourcc('Q', 'B', 'G', '8') |
| 364 | #define V4L2_PIX_FMT_QGBRG8 v4l2_fourcc('Q', 'G', 'B', '8') |
| 365 | #define V4L2_PIX_FMT_QGRBG8 v4l2_fourcc('Q', 'G', 'R', '8') |
| 366 | #define V4L2_PIX_FMT_QRGGB8 v4l2_fourcc('Q', 'R', 'G', '8') |
| 367 | #define V4L2_PIX_FMT_QBGGR10 v4l2_fourcc('Q', 'B', 'G', '0') |
| 368 | #define V4L2_PIX_FMT_QGBRG10 v4l2_fourcc('Q', 'G', 'B', '0') |
| 369 | #define V4L2_PIX_FMT_QGRBG10 v4l2_fourcc('Q', 'G', 'R', '0') |
| 370 | #define V4L2_PIX_FMT_QRGGB10 v4l2_fourcc('Q', 'R', 'G', '0') |
| 371 | #define V4L2_PIX_FMT_QBGGR12 v4l2_fourcc('Q', 'B', 'G', '2') |
| 372 | #define V4L2_PIX_FMT_QGBRG12 v4l2_fourcc('Q', 'G', 'B', '2') |
| 373 | #define V4L2_PIX_FMT_QGRBG12 v4l2_fourcc('Q', 'G', 'R', '2') |
| 374 | #define V4L2_PIX_FMT_QRGGB12 v4l2_fourcc('Q', 'R', 'G', '2') |
Kevin Chan | d5dfce2 | 2013-05-16 00:34:25 -0700 | [diff] [blame] | 375 | #define V4L2_PIX_FMT_NV14 v4l2_fourcc('N', 'V', '1', '4') |
| 376 | #define V4L2_PIX_FMT_NV41 v4l2_fourcc('N', 'V', '4', '1') |
Harsh Shah | 1852493 | 2013-03-29 17:20:40 -0700 | [diff] [blame] | 377 | #define V4L2_PIX_FMT_META v4l2_fourcc('Q', 'M', 'E', 'T') |
Kevin Chan | 80b7b6d | 2013-01-31 16:08:35 -0800 | [diff] [blame] | 378 | |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 379 | #define VIDIOC_MSM_VFE_REG_CFG \ |
| 380 | _IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_vfe_cfg_cmd2) |
| 381 | |
| 382 | #define VIDIOC_MSM_ISP_REQUEST_BUF \ |
| 383 | _IOWR('V', BASE_VIDIOC_PRIVATE+1, struct msm_isp_buf_request) |
| 384 | |
| 385 | #define VIDIOC_MSM_ISP_ENQUEUE_BUF \ |
| 386 | _IOWR('V', BASE_VIDIOC_PRIVATE+2, struct msm_isp_qbuf_info) |
| 387 | |
| 388 | #define VIDIOC_MSM_ISP_RELEASE_BUF \ |
| 389 | _IOWR('V', BASE_VIDIOC_PRIVATE+3, struct msm_isp_buf_request) |
| 390 | |
| 391 | #define VIDIOC_MSM_ISP_REQUEST_STREAM \ |
| 392 | _IOWR('V', BASE_VIDIOC_PRIVATE+4, struct msm_vfe_axi_stream_request_cmd) |
| 393 | |
| 394 | #define VIDIOC_MSM_ISP_CFG_STREAM \ |
| 395 | _IOWR('V', BASE_VIDIOC_PRIVATE+5, struct msm_vfe_axi_stream_cfg_cmd) |
| 396 | |
| 397 | #define VIDIOC_MSM_ISP_RELEASE_STREAM \ |
| 398 | _IOWR('V', BASE_VIDIOC_PRIVATE+6, struct msm_vfe_axi_stream_release_cmd) |
| 399 | |
| 400 | #define VIDIOC_MSM_ISP_INPUT_CFG \ |
| 401 | _IOWR('V', BASE_VIDIOC_PRIVATE+7, struct msm_vfe_input_cfg) |
| 402 | |
| 403 | #define VIDIOC_MSM_ISP_SET_SRC_STATE \ |
| 404 | _IOWR('V', BASE_VIDIOC_PRIVATE+8, struct msm_vfe_axi_src_state) |
| 405 | |
| 406 | #define VIDIOC_MSM_ISP_REQUEST_STATS_STREAM \ |
| 407 | _IOWR('V', BASE_VIDIOC_PRIVATE+9, \ |
| 408 | struct msm_vfe_stats_stream_request_cmd) |
| 409 | |
| 410 | #define VIDIOC_MSM_ISP_CFG_STATS_STREAM \ |
| 411 | _IOWR('V', BASE_VIDIOC_PRIVATE+10, struct msm_vfe_stats_stream_cfg_cmd) |
| 412 | |
| 413 | #define VIDIOC_MSM_ISP_RELEASE_STATS_STREAM \ |
| 414 | _IOWR('V', BASE_VIDIOC_PRIVATE+11, \ |
| 415 | struct msm_vfe_stats_stream_release_cmd) |
| 416 | |
Kevin Chan | 5bebd2e | 2013-01-30 20:25:05 -0800 | [diff] [blame] | 417 | #define VIDIOC_MSM_ISP_UPDATE_STREAM \ |
| 418 | _IOWR('V', BASE_VIDIOC_PRIVATE+13, struct msm_vfe_axi_stream_update_cmd) |
| 419 | |
Kevin Chan | 1d5fd4a | 2013-01-11 14:08:14 -0800 | [diff] [blame] | 420 | #endif /* __MSMB_ISP__ */ |