msm_camsensor_sdk.h revision 4d667bae0175a66dffc4d241a449e706bdee0a85
1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __LINUX_MSM_CAMSENSOR_SDK_H
20#define __LINUX_MSM_CAMSENSOR_SDK_H
21#include <linux/v4l2-mediabus.h>
22#define KVERSION 0x1
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define MAX_POWER_CONFIG 12
25#define GPIO_OUT_LOW (0 << 1)
26#define GPIO_OUT_HIGH (1 << 1)
27#define CSI_EMBED_DATA 0x12
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define CSI_RESERVED_DATA_0 0x13
30#define CSI_YUV422_8 0x1E
31#define CSI_RAW8 0x2A
32#define CSI_RAW10 0x2B
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34#define CSI_RAW12 0x2C
35#define CSI_DECODE_6BIT 0
36#define CSI_DECODE_8BIT 1
37#define CSI_DECODE_10BIT 2
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define CSI_DECODE_DPCM_10_8_10 5
40#define MAX_CID 16
41#define I2C_SEQ_REG_DATA_MAX 256
42#define MSM_V4L2_PIX_FMT_META v4l2_fourcc('M', 'E', 'T', 'A')
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44#define MSM_V4L2_PIX_FMT_SBGGR14 v4l2_fourcc('B', 'G', '1', '4')
45#define MSM_V4L2_PIX_FMT_SGBRG14 v4l2_fourcc('G', 'B', '1', '4')
46#define MSM_V4L2_PIX_FMT_SGRBG14 v4l2_fourcc('B', 'A', '1', '4')
47#define MSM_V4L2_PIX_FMT_SRGGB14 v4l2_fourcc('R', 'G', '1', '4')
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define MAX_ACTUATOR_REG_TBL_SIZE 8
50#define MAX_ACTUATOR_REGION 5
51#define NUM_ACTUATOR_DIR 2
52#define MAX_ACTUATOR_SCENARIO 8
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54#define MAX_ACT_MOD_NAME_SIZE 32
55#define MAX_ACT_NAME_SIZE 32
56#define MAX_ACTUATOR_INIT_SET 120
57#define MAX_I2C_REG_SET 12
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59#define MAX_NAME_SIZE 32
60#define MAX_LED_TRIGGERS 3
61enum msm_sensor_camera_id_t {
62 CAMERA_0,
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 CAMERA_1,
65 CAMERA_2,
66 CAMERA_3,
67 MAX_CAMERAS,
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69};
70enum i2c_freq_mode_t {
71 I2C_STANDARD_MODE,
72 I2C_FAST_MODE,
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 I2C_CUSTOM_MODE,
75 I2C_FAST_PLUS_MODE,
76 I2C_MAX_MODES,
77};
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79enum camb_position_t {
80 BACK_CAMERA_B,
81 FRONT_CAMERA_B,
82 INVALID_CAMERA_B,
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84};
85enum msm_sensor_power_seq_type_t {
86 SENSOR_CLK,
87 SENSOR_GPIO,
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 SENSOR_VREG,
90 SENSOR_I2C_MUX,
91 SENSOR_I2C,
92};
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94enum msm_camera_i2c_reg_addr_type {
95 MSM_CAMERA_I2C_BYTE_ADDR = 1,
96 MSM_CAMERA_I2C_WORD_ADDR,
97 MSM_CAMERA_I2C_3B_ADDR,
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 MSM_CAMERA_I2C_ADDR_TYPE_MAX,
100};
101enum msm_camera_i2c_data_type {
102 MSM_CAMERA_I2C_BYTE_DATA = 1,
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 MSM_CAMERA_I2C_WORD_DATA,
105 MSM_CAMERA_I2C_DWORD_DATA,
106 MSM_CAMERA_I2C_SET_BYTE_MASK,
107 MSM_CAMERA_I2C_UNSET_BYTE_MASK,
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109 MSM_CAMERA_I2C_SET_WORD_MASK,
110 MSM_CAMERA_I2C_UNSET_WORD_MASK,
111 MSM_CAMERA_I2C_SET_BYTE_WRITE_MASK_DATA,
112 MSM_CAMERA_I2C_DATA_TYPE_MAX,
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114};
115enum msm_sensor_power_seq_gpio_t {
116 SENSOR_GPIO_RESET,
117 SENSOR_GPIO_STANDBY,
118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 SENSOR_GPIO_AF_PWDM,
120 SENSOR_GPIO_VIO,
121 SENSOR_GPIO_VANA,
122 SENSOR_GPIO_VDIG,
123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 SENSOR_GPIO_VAF,
125 SENSOR_GPIO_FL_EN,
126 SENSOR_GPIO_FL_NOW,
127 SENSOR_GPIO_FL_RESET,
128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 SENSOR_GPIO_CUSTOM1,
130 SENSOR_GPIO_CUSTOM2,
131 SENSOR_GPIO_MAX,
132};
133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134enum msm_camera_vreg_name_t {
135 CAM_VDIG,
136 CAM_VIO,
137 CAM_VANA,
138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 CAM_VAF,
140 CAM_V_CUSTOM1,
141 CAM_V_CUSTOM2,
142 CAM_VREG_MAX,
143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144};
145enum msm_sensor_clk_type_t {
146 SENSOR_CAM_MCLK,
147 SENSOR_CAM_CLK,
148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 SENSOR_CAM_CLK_MAX,
150};
151enum camerab_mode_t {
152 CAMERA_MODE_2D_B = (1<<0),
153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154 CAMERA_MODE_3D_B = (1<<1),
155 CAMERA_MODE_INVALID = (1<<2),
156};
157enum sensor_stats_type {
158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159 YRGB,
160 YYYY,
161};
162enum msm_actuator_data_type {
163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 MSM_ACTUATOR_BYTE_DATA = 1,
165 MSM_ACTUATOR_WORD_DATA,
166};
167enum msm_actuator_addr_type {
168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169 MSM_ACTUATOR_BYTE_ADDR = 1,
170 MSM_ACTUATOR_WORD_ADDR,
171};
172enum msm_actuator_write_type {
173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174 MSM_ACTUATOR_WRITE_HW_DAMP,
175 MSM_ACTUATOR_WRITE_DAC,
176 MSM_ACTUATOR_WRITE,
177 MSM_ACTUATOR_WRITE_DIR_REG,
178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179 MSM_ACTUATOR_POLL,
180 MSM_ACTUATOR_READ_WRITE,
181};
182enum msm_actuator_i2c_operation {
183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184 MSM_ACT_WRITE = 0,
185 MSM_ACT_POLL,
186};
187enum actuator_type {
188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189 ACTUATOR_VCM,
190 ACTUATOR_PIEZO,
191 ACTUATOR_HVCM,
192 ACTUATOR_BIVCM,
193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194};
195enum msm_flash_driver_type {
196 FLASH_DRIVER_PMIC,
197 FLASH_DRIVER_I2C,
198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 FLASH_DRIVER_GPIO,
200 FLASH_DRIVER_DEFAULT
201};
202enum msm_flash_cfg_type_t {
203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204 CFG_FLASH_INIT,
205 CFG_FLASH_RELEASE,
206 CFG_FLASH_OFF,
207 CFG_FLASH_LOW,
208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209 CFG_FLASH_HIGH,
210};
211struct msm_sensor_power_setting {
212 enum msm_sensor_power_seq_type_t seq_type;
213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214 uint16_t seq_val;
215 long config_val;
216 uint16_t delay;
217 void *data[10];
218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219};
220struct msm_sensor_power_setting_array {
221 struct msm_sensor_power_setting power_setting_a[MAX_POWER_CONFIG];
222 struct msm_sensor_power_setting *power_setting;
223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224 uint16_t size;
225 struct msm_sensor_power_setting power_down_setting_a[MAX_POWER_CONFIG];
226 struct msm_sensor_power_setting *power_down_setting;
227 uint16_t size_down;
228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229};
230struct msm_sensor_init_params {
231 int modes_supported;
232 enum camb_position_t position;
233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234 uint32_t sensor_mount_angle;
235};
236struct msm_sensor_id_info_t {
237 uint16_t sensor_id_reg_addr;
238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 uint16_t sensor_id;
240 uint16_t sensor_id_mask;
241};
242struct msm_camera_sensor_slave_info {
243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 char sensor_name[32];
245 char eeprom_name[32];
246 char actuator_name[32];
247 char ois_name[32];
248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249 char flash_name[32];
250 enum msm_sensor_camera_id_t camera_id;
251 uint16_t slave_addr;
252 enum i2c_freq_mode_t i2c_freq_mode;
253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254 enum msm_camera_i2c_reg_addr_type addr_type;
255 struct msm_sensor_id_info_t sensor_id_info;
256 struct msm_sensor_power_setting_array power_setting_array;
257 uint8_t is_init_params_valid;
258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259 struct msm_sensor_init_params sensor_init_params;
260 uint8_t is_flash_supported;
261};
262struct msm_camera_i2c_reg_array {
263/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264 uint16_t reg_addr;
265 uint16_t reg_data;
266 uint32_t delay;
267};
268/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269struct msm_camera_i2c_reg_setting {
270 struct msm_camera_i2c_reg_array *reg_setting;
271 uint16_t size;
272 enum msm_camera_i2c_reg_addr_type addr_type;
273/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274 enum msm_camera_i2c_data_type data_type;
275 uint16_t delay;
276};
277struct msm_camera_csid_vc_cfg {
278/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279 uint8_t cid;
280 uint8_t dt;
281 uint8_t decode_format;
282};
283/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284struct msm_camera_csid_lut_params {
285 uint8_t num_cid;
286 struct msm_camera_csid_vc_cfg vc_cfg_a[MAX_CID];
287 struct msm_camera_csid_vc_cfg *vc_cfg[MAX_CID];
288/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289};
290struct msm_camera_csid_params {
291 uint8_t lane_cnt;
292 uint16_t lane_assign;
293/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
294 uint8_t phy_sel;
295 uint32_t csi_clk;
296 struct msm_camera_csid_lut_params lut_params;
297};
298/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
299struct msm_camera_csiphy_params {
300 uint8_t lane_cnt;
301 uint8_t settle_cnt;
302 uint16_t lane_mask;
303/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
304 uint8_t combo_mode;
305 uint8_t csid_core;
306 uint32_t csiphy_clk;
307};
308/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
309struct msm_camera_i2c_seq_reg_array {
310 uint16_t reg_addr;
311 uint8_t reg_data[I2C_SEQ_REG_DATA_MAX];
312 uint16_t reg_data_size;
313/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
314};
315struct msm_camera_i2c_seq_reg_setting {
316 struct msm_camera_i2c_seq_reg_array *reg_setting;
317 uint16_t size;
318/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
319 enum msm_camera_i2c_reg_addr_type addr_type;
320 uint16_t delay;
321};
322struct msm_actuator_reg_params_t {
323/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
324 enum msm_actuator_write_type reg_write_type;
325 uint32_t hw_mask;
326 uint16_t reg_addr;
327 uint16_t hw_shift;
328/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
329 uint16_t data_shift;
330 uint16_t data_type;
331 uint16_t addr_type;
332 uint16_t reg_data;
333/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
334 uint16_t delay;
335};
336struct damping_params_t {
337 uint32_t damping_step;
338/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
339 uint32_t damping_delay;
340 uint32_t hw_params;
341};
342struct region_params_t {
343/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
344 uint16_t step_bound[2];
345 uint16_t code_per_step;
346 uint32_t qvalue;
347};
348/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
349struct reg_settings_t {
350 uint16_t reg_addr;
351 enum msm_actuator_addr_type addr_type;
352 uint16_t reg_data;
353/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
354 enum msm_actuator_data_type data_type;
355 enum msm_actuator_i2c_operation i2c_operation;
356 uint32_t delay;
357};
358/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
359struct msm_camera_i2c_reg_setting_array {
360 struct msm_camera_i2c_reg_array reg_setting_a[MAX_I2C_REG_SET];
361 uint16_t size;
362 enum msm_camera_i2c_reg_addr_type addr_type;
363/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
364 enum msm_camera_i2c_data_type data_type;
365 uint16_t delay;
366};
367#endif
368/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
369
370