Home | History | Annotate | Download | only in media
      1 #ifndef __LINUX_MSM_CAM_SENSOR_H
      2 #define __LINUX_MSM_CAM_SENSOR_H
      3 
      4 #ifdef MSM_CAMERA_BIONIC
      5 #include <sys/types.h>
      6 #endif
      7 
      8 #include <linux/v4l2-mediabus.h>
      9 #include <media/msm_camsensor_sdk.h>
     10 
     11 #include <linux/types.h>
     12 #include <linux/i2c.h>
     13 #ifdef CONFIG_COMPAT
     14 #include <linux/compat.h>
     15 #endif
     16 
     17 #define I2C_SEQ_REG_SETTING_MAX   5
     18 
     19 #define MSM_SENSOR_MCLK_8HZ   8000000
     20 #define MSM_SENSOR_MCLK_16HZ  16000000
     21 #define MSM_SENSOR_MCLK_24HZ  24000000
     22 
     23 #define MAX_SENSOR_NAME 32
     24 #define MAX_ACTUATOR_AF_TOTAL_STEPS 1024
     25 
     26 #define MAX_OIS_MOD_NAME_SIZE 32
     27 #define MAX_OIS_NAME_SIZE 32
     28 #define MAX_OIS_REG_SETTINGS 800
     29 
     30 #define MOVE_NEAR 0
     31 #define MOVE_FAR  1
     32 
     33 #define MSM_ACTUATOR_MOVE_SIGNED_FAR -1
     34 #define MSM_ACTUATOR_MOVE_SIGNED_NEAR  1
     35 
     36 #define MAX_EEPROM_NAME 32
     37 
     38 #define MAX_AF_ITERATIONS 3
     39 #define MAX_NUMBER_OF_STEPS 47
     40 
     41 #define MSM_V4L2_PIX_FMT_META v4l2_fourcc('M', 'E', 'T', 'A') /* META */
     42 #define MSM_V4L2_PIX_FMT_SBGGR14 v4l2_fourcc('B', 'G', '1', '4')
     43 	/* 14  BGBG.. GRGR.. */
     44 #define MSM_V4L2_PIX_FMT_SGBRG14 v4l2_fourcc('G', 'B', '1', '4')
     45 	/* 14  GBGB.. RGRG.. */
     46 #define MSM_V4L2_PIX_FMT_SGRBG14 v4l2_fourcc('B', 'A', '1', '4')
     47 	/* 14  GRGR.. BGBG.. */
     48 #define MSM_V4L2_PIX_FMT_SRGGB14 v4l2_fourcc('R', 'G', '1', '4')
     49 	/* 14  RGRG.. GBGB.. */
     50 
     51 enum flash_type {
     52 	LED_FLASH = 1,
     53 	STROBE_FLASH,
     54 	GPIO_FLASH
     55 };
     56 
     57 enum msm_sensor_resolution_t {
     58 	MSM_SENSOR_RES_FULL,
     59 	MSM_SENSOR_RES_QTR,
     60 	MSM_SENSOR_RES_2,
     61 	MSM_SENSOR_RES_3,
     62 	MSM_SENSOR_RES_4,
     63 	MSM_SENSOR_RES_5,
     64 	MSM_SENSOR_RES_6,
     65 	MSM_SENSOR_RES_7,
     66 	MSM_SENSOR_INVALID_RES,
     67 };
     68 
     69 enum msm_camera_stream_type_t {
     70 	MSM_CAMERA_STREAM_PREVIEW,
     71 	MSM_CAMERA_STREAM_SNAPSHOT,
     72 	MSM_CAMERA_STREAM_VIDEO,
     73 	MSM_CAMERA_STREAM_INVALID,
     74 };
     75 
     76 enum sensor_sub_module_t {
     77 	SUB_MODULE_SENSOR,
     78 	SUB_MODULE_CHROMATIX,
     79 	SUB_MODULE_ACTUATOR,
     80 	SUB_MODULE_EEPROM,
     81 	SUB_MODULE_LED_FLASH,
     82 	SUB_MODULE_STROBE_FLASH,
     83 	SUB_MODULE_CSID,
     84 	SUB_MODULE_CSID_3D,
     85 	SUB_MODULE_CSIPHY,
     86 	SUB_MODULE_CSIPHY_3D,
     87 	SUB_MODULE_OIS,
     88 	SUB_MODULE_MAX,
     89 };
     90 
     91 enum {
     92 	MSM_CAMERA_EFFECT_MODE_OFF,
     93 	MSM_CAMERA_EFFECT_MODE_MONO,
     94 	MSM_CAMERA_EFFECT_MODE_NEGATIVE,
     95 	MSM_CAMERA_EFFECT_MODE_SOLARIZE,
     96 	MSM_CAMERA_EFFECT_MODE_SEPIA,
     97 	MSM_CAMERA_EFFECT_MODE_POSTERIZE,
     98 	MSM_CAMERA_EFFECT_MODE_WHITEBOARD,
     99 	MSM_CAMERA_EFFECT_MODE_BLACKBOARD,
    100 	MSM_CAMERA_EFFECT_MODE_AQUA,
    101 	MSM_CAMERA_EFFECT_MODE_EMBOSS,
    102 	MSM_CAMERA_EFFECT_MODE_SKETCH,
    103 	MSM_CAMERA_EFFECT_MODE_NEON,
    104 	MSM_CAMERA_EFFECT_MODE_MAX
    105 };
    106 
    107 enum {
    108 	MSM_CAMERA_WB_MODE_AUTO,
    109 	MSM_CAMERA_WB_MODE_CUSTOM,
    110 	MSM_CAMERA_WB_MODE_INCANDESCENT,
    111 	MSM_CAMERA_WB_MODE_FLUORESCENT,
    112 	MSM_CAMERA_WB_MODE_WARM_FLUORESCENT,
    113 	MSM_CAMERA_WB_MODE_DAYLIGHT,
    114 	MSM_CAMERA_WB_MODE_CLOUDY_DAYLIGHT,
    115 	MSM_CAMERA_WB_MODE_TWILIGHT,
    116 	MSM_CAMERA_WB_MODE_SHADE,
    117 	MSM_CAMERA_WB_MODE_OFF,
    118 	MSM_CAMERA_WB_MODE_MAX
    119 };
    120 
    121 enum {
    122 	MSM_CAMERA_SCENE_MODE_OFF,
    123 	MSM_CAMERA_SCENE_MODE_AUTO,
    124 	MSM_CAMERA_SCENE_MODE_LANDSCAPE,
    125 	MSM_CAMERA_SCENE_MODE_SNOW,
    126 	MSM_CAMERA_SCENE_MODE_BEACH,
    127 	MSM_CAMERA_SCENE_MODE_SUNSET,
    128 	MSM_CAMERA_SCENE_MODE_NIGHT,
    129 	MSM_CAMERA_SCENE_MODE_PORTRAIT,
    130 	MSM_CAMERA_SCENE_MODE_BACKLIGHT,
    131 	MSM_CAMERA_SCENE_MODE_SPORTS,
    132 	MSM_CAMERA_SCENE_MODE_ANTISHAKE,
    133 	MSM_CAMERA_SCENE_MODE_FLOWERS,
    134 	MSM_CAMERA_SCENE_MODE_CANDLELIGHT,
    135 	MSM_CAMERA_SCENE_MODE_FIREWORKS,
    136 	MSM_CAMERA_SCENE_MODE_PARTY,
    137 	MSM_CAMERA_SCENE_MODE_NIGHT_PORTRAIT,
    138 	MSM_CAMERA_SCENE_MODE_THEATRE,
    139 	MSM_CAMERA_SCENE_MODE_ACTION,
    140 	MSM_CAMERA_SCENE_MODE_AR,
    141 	MSM_CAMERA_SCENE_MODE_FACE_PRIORITY,
    142 	MSM_CAMERA_SCENE_MODE_BARCODE,
    143 	MSM_CAMERA_SCENE_MODE_HDR,
    144 	MSM_CAMERA_SCENE_MODE_MAX
    145 };
    146 
    147 enum csid_cfg_type_t {
    148 	CSID_INIT,
    149 	CSID_CFG,
    150 	CSID_RELEASE,
    151 };
    152 
    153 enum csiphy_cfg_type_t {
    154 	CSIPHY_INIT,
    155 	CSIPHY_CFG,
    156 	CSIPHY_RELEASE,
    157 };
    158 
    159 enum camera_vreg_type {
    160 	VREG_TYPE_DEFAULT,
    161 	VREG_TYPE_CUSTOM,
    162 };
    163 
    164 enum sensor_af_t {
    165 	SENSOR_AF_FOCUSSED,
    166 	SENSOR_AF_NOT_FOCUSSED,
    167 };
    168 
    169 enum cci_i2c_master_t {
    170 	MASTER_0,
    171 	MASTER_1,
    172 	MASTER_MAX,
    173 };
    174 
    175 struct msm_camera_i2c_array_write_config {
    176 	struct msm_camera_i2c_reg_setting conf_array;
    177 	uint16_t slave_addr;
    178 };
    179 
    180 struct msm_camera_i2c_read_config {
    181 	uint16_t slave_addr;
    182 	uint16_t reg_addr;
    183 	enum msm_camera_i2c_data_type data_type;
    184 	uint16_t data;
    185 };
    186 
    187 struct msm_camera_csi2_params {
    188 	struct msm_camera_csid_params csid_params;
    189 	struct msm_camera_csiphy_params csiphy_params;
    190 	uint8_t csi_clk_scale_enable;
    191 };
    192 
    193 struct msm_camera_csi_lane_params {
    194 	uint16_t csi_lane_assign;
    195 	uint16_t csi_lane_mask;
    196 };
    197 
    198 struct csi_lane_params_t {
    199 	uint16_t csi_lane_assign;
    200 	uint8_t csi_lane_mask;
    201 	uint8_t csi_if;
    202 	int8_t csid_core[2];
    203 	uint8_t csi_phy_sel;
    204 };
    205 
    206 struct msm_sensor_info_t {
    207 	char     sensor_name[MAX_SENSOR_NAME];
    208 	uint32_t session_id;
    209 	int32_t  subdev_id[SUB_MODULE_MAX];
    210 	int32_t  subdev_intf[SUB_MODULE_MAX];
    211 	uint8_t  is_mount_angle_valid;
    212 	uint32_t sensor_mount_angle;
    213 	int modes_supported;
    214 	enum camb_position_t position;
    215 };
    216 
    217 struct camera_vreg_t {
    218 	const char *reg_name;
    219 	int min_voltage;
    220 	int max_voltage;
    221 	int op_mode;
    222 	uint32_t delay;
    223 	const char *custom_vreg_name;
    224 	enum camera_vreg_type type;
    225 };
    226 
    227 struct sensorb_cfg_data {
    228 	int cfgtype;
    229 	union {
    230 		struct msm_sensor_info_t      sensor_info;
    231 		struct msm_sensor_init_params sensor_init_params;
    232 		void                         *setting;
    233 	} cfg;
    234 };
    235 
    236 struct csid_cfg_data {
    237 	enum csid_cfg_type_t cfgtype;
    238 	union {
    239 		uint32_t csid_version;
    240 		struct msm_camera_csid_params *csid_params;
    241 	} cfg;
    242 };
    243 
    244 struct csiphy_cfg_data {
    245 	enum csiphy_cfg_type_t cfgtype;
    246 	union {
    247 		struct msm_camera_csiphy_params *csiphy_params;
    248 		struct msm_camera_csi_lane_params *csi_lane_params;
    249 	} cfg;
    250 };
    251 
    252 enum eeprom_cfg_type_t {
    253 	CFG_EEPROM_GET_INFO,
    254 	CFG_EEPROM_GET_CAL_DATA,
    255 	CFG_EEPROM_READ_CAL_DATA,
    256 	CFG_EEPROM_WRITE_DATA,
    257 	CFG_EEPROM_GET_MM_INFO,
    258 };
    259 
    260 struct eeprom_get_t {
    261 	uint32_t num_bytes;
    262 };
    263 
    264 struct eeprom_read_t {
    265 	uint8_t *dbuffer;
    266 	uint32_t num_bytes;
    267 };
    268 
    269 struct eeprom_write_t {
    270 	uint8_t *dbuffer;
    271 	uint32_t num_bytes;
    272 };
    273 
    274 struct eeprom_get_cmm_t {
    275 	uint32_t cmm_support;
    276 	uint32_t cmm_compression;
    277 	uint32_t cmm_size;
    278 };
    279 
    280 struct msm_eeprom_cfg_data {
    281 	enum eeprom_cfg_type_t cfgtype;
    282 	uint8_t is_supported;
    283 	union {
    284 		char eeprom_name[MAX_SENSOR_NAME];
    285 		struct eeprom_get_t get_data;
    286 		struct eeprom_read_t read_data;
    287 		struct eeprom_write_t write_data;
    288 		struct eeprom_get_cmm_t get_cmm_data;
    289 	} cfg;
    290 };
    291 
    292 #ifdef CONFIG_COMPAT
    293 struct msm_sensor_power_setting32 {
    294 	enum msm_sensor_power_seq_type_t seq_type;
    295 	uint16_t seq_val;
    296 	compat_uint_t config_val;
    297 	uint16_t delay;
    298 	compat_uptr_t data[10];
    299 };
    300 
    301 struct msm_sensor_power_setting_array32 {
    302 	struct msm_sensor_power_setting32 power_setting_a[MAX_POWER_CONFIG];
    303 	compat_uptr_t power_setting;
    304 	uint16_t size;
    305 	struct msm_sensor_power_setting32
    306 		power_down_setting_a[MAX_POWER_CONFIG];
    307 	compat_uptr_t power_down_setting;
    308 	uint16_t size_down;
    309 };
    310 
    311 struct msm_camera_sensor_slave_info32 {
    312 	char sensor_name[32];
    313 	char eeprom_name[32];
    314 	char actuator_name[32];
    315 	char ois_name[32];
    316 	char flash_name[32];
    317 	enum msm_sensor_camera_id_t camera_id;
    318 	uint16_t slave_addr;
    319 	enum i2c_freq_mode_t i2c_freq_mode;
    320 	enum msm_camera_i2c_reg_addr_type addr_type;
    321 	struct msm_sensor_id_info_t sensor_id_info;
    322 	struct msm_sensor_power_setting_array32 power_setting_array;
    323 	uint8_t  is_init_params_valid;
    324 	struct msm_sensor_init_params sensor_init_params;
    325 	uint8_t is_flash_supported;
    326 };
    327 
    328 struct msm_camera_csid_lut_params32 {
    329 	uint8_t num_cid;
    330 	struct msm_camera_csid_vc_cfg vc_cfg_a[MAX_CID];
    331 	compat_uptr_t vc_cfg[MAX_CID];
    332 };
    333 
    334 struct msm_camera_csid_params32 {
    335 	uint8_t lane_cnt;
    336 	uint16_t lane_assign;
    337 	uint8_t phy_sel;
    338 	uint32_t csi_clk;
    339 	struct msm_camera_csid_lut_params32 lut_params;
    340 };
    341 
    342 struct msm_camera_csi2_params32 {
    343 	struct msm_camera_csid_params32 csid_params;
    344 	struct msm_camera_csiphy_params csiphy_params;
    345 	uint8_t csi_clk_scale_enable;
    346 };
    347 
    348 struct csid_cfg_data32 {
    349 	enum csid_cfg_type_t cfgtype;
    350 	union {
    351 		uint32_t csid_version;
    352 		compat_uptr_t csid_params;
    353 	} cfg;
    354 };
    355 
    356 struct eeprom_read_t32 {
    357 	compat_uptr_t dbuffer;
    358 	uint32_t num_bytes;
    359 };
    360 
    361 struct eeprom_write_t32 {
    362 	compat_uptr_t dbuffer;
    363 	uint32_t num_bytes;
    364 };
    365 
    366 struct msm_eeprom_cfg_data32 {
    367 	enum eeprom_cfg_type_t cfgtype;
    368 	uint8_t is_supported;
    369 	union {
    370 		char eeprom_name[MAX_SENSOR_NAME];
    371 		struct eeprom_get_t get_data;
    372 		struct eeprom_read_t32 read_data;
    373 		struct eeprom_write_t32 write_data;
    374 	} cfg;
    375 };
    376 
    377 struct msm_camera_i2c_seq_reg_setting32 {
    378 	compat_uptr_t reg_setting;
    379 	uint16_t size;
    380 	enum msm_camera_i2c_reg_addr_type addr_type;
    381 	uint16_t delay;
    382 };
    383 #endif
    384 
    385 enum msm_sensor_cfg_type_t {
    386 	CFG_SET_SLAVE_INFO,
    387 	CFG_SLAVE_READ_I2C,
    388 	CFG_WRITE_I2C_ARRAY,
    389 	CFG_SLAVE_WRITE_I2C_ARRAY,
    390 	CFG_WRITE_I2C_SEQ_ARRAY,
    391 	CFG_POWER_UP,
    392 	CFG_POWER_DOWN,
    393 	CFG_SET_STOP_STREAM_SETTING,
    394 	CFG_GET_SENSOR_INFO,
    395 	CFG_GET_SENSOR_INIT_PARAMS,
    396 	CFG_SET_INIT_SETTING,
    397 	CFG_SET_RESOLUTION,
    398 	CFG_SET_STOP_STREAM,
    399 	CFG_SET_START_STREAM,
    400 	CFG_SET_SATURATION,
    401 	CFG_SET_CONTRAST,
    402 	CFG_SET_SHARPNESS,
    403 	CFG_SET_ISO,
    404 	CFG_SET_EXPOSURE_COMPENSATION,
    405 	CFG_SET_ANTIBANDING,
    406 	CFG_SET_BESTSHOT_MODE,
    407 	CFG_SET_EFFECT,
    408 	CFG_SET_WHITE_BALANCE,
    409 	CFG_SET_AUTOFOCUS,
    410 	CFG_CANCEL_AUTOFOCUS,
    411 	CFG_SET_STREAM_TYPE,
    412 };
    413 
    414 enum msm_actuator_cfg_type_t {
    415 	CFG_GET_ACTUATOR_INFO,
    416 	CFG_SET_ACTUATOR_INFO,
    417 	CFG_SET_DEFAULT_FOCUS,
    418 	CFG_MOVE_FOCUS,
    419 	CFG_SET_POSITION,
    420 	CFG_ACTUATOR_POWERDOWN,
    421 	CFG_ACTUATOR_POWERUP,
    422 	CFG_ACTUATOR_INIT,
    423 };
    424 
    425 enum msm_ois_cfg_type_t {
    426 	CFG_OIS_INIT,
    427 	CFG_OIS_POWERDOWN,
    428 	CFG_OIS_POWERUP,
    429 	CFG_OIS_CONTROL,
    430 	CFG_OIS_I2C_WRITE_SEQ_TABLE,
    431 };
    432 
    433 enum msm_ois_i2c_operation {
    434 	MSM_OIS_WRITE = 0,
    435 	MSM_OIS_POLL,
    436 };
    437 
    438 struct reg_settings_ois_t {
    439 	uint16_t reg_addr;
    440 	enum msm_camera_i2c_reg_addr_type addr_type;
    441 	uint32_t reg_data;
    442 	enum msm_camera_i2c_data_type data_type;
    443 	enum msm_ois_i2c_operation i2c_operation;
    444 	uint32_t delay;
    445 };
    446 
    447 struct msm_ois_params_t {
    448 	uint16_t data_size;
    449 	uint16_t setting_size;
    450 	uint32_t i2c_addr;
    451 	enum msm_camera_i2c_reg_addr_type i2c_addr_type;
    452 	enum msm_camera_i2c_data_type i2c_data_type;
    453 	struct reg_settings_ois_t *settings;
    454 };
    455 
    456 struct msm_ois_set_info_t {
    457 	struct msm_ois_params_t ois_params;
    458 };
    459 
    460 struct msm_actuator_move_params_t {
    461 	int8_t dir;
    462 	int8_t sign_dir;
    463 	int16_t dest_step_pos;
    464 	int32_t num_steps;
    465 	uint16_t curr_lens_pos;
    466 	struct damping_params_t *ringing_params;
    467 };
    468 
    469 struct msm_actuator_tuning_params_t {
    470 	int16_t initial_code;
    471 	uint16_t pwd_step;
    472 	uint16_t region_size;
    473 	uint32_t total_steps;
    474 	struct region_params_t *region_params;
    475 };
    476 
    477 struct park_lens_data_t {
    478 	uint32_t damping_step;
    479 	uint32_t damping_delay;
    480 	uint32_t hw_params;
    481 	uint32_t max_step;
    482 };
    483 
    484 struct msm_actuator_params_t {
    485 	enum actuator_type act_type;
    486 	uint8_t reg_tbl_size;
    487 	uint16_t data_size;
    488 	uint16_t init_setting_size;
    489 	uint32_t i2c_addr;
    490 	enum msm_actuator_addr_type i2c_addr_type;
    491 	enum msm_actuator_data_type i2c_data_type;
    492 	struct msm_actuator_reg_params_t *reg_tbl_params;
    493 	struct reg_settings_t *init_settings;
    494 	struct park_lens_data_t park_lens;
    495 };
    496 
    497 struct msm_actuator_set_info_t {
    498 	struct msm_actuator_params_t actuator_params;
    499 	struct msm_actuator_tuning_params_t af_tuning_params;
    500 };
    501 
    502 struct msm_actuator_get_info_t {
    503 	uint32_t focal_length_num;
    504 	uint32_t focal_length_den;
    505 	uint32_t f_number_num;
    506 	uint32_t f_number_den;
    507 	uint32_t f_pix_num;
    508 	uint32_t f_pix_den;
    509 	uint32_t total_f_dist_num;
    510 	uint32_t total_f_dist_den;
    511 	uint32_t hor_view_angle_num;
    512 	uint32_t hor_view_angle_den;
    513 	uint32_t ver_view_angle_num;
    514 	uint32_t ver_view_angle_den;
    515 };
    516 
    517 enum af_camera_name {
    518 	ACTUATOR_MAIN_CAM_0,
    519 	ACTUATOR_MAIN_CAM_1,
    520 	ACTUATOR_MAIN_CAM_2,
    521 	ACTUATOR_MAIN_CAM_3,
    522 	ACTUATOR_MAIN_CAM_4,
    523 	ACTUATOR_MAIN_CAM_5,
    524 	ACTUATOR_WEB_CAM_0,
    525 	ACTUATOR_WEB_CAM_1,
    526 	ACTUATOR_WEB_CAM_2,
    527 };
    528 
    529 struct msm_ois_cfg_data {
    530 	int cfgtype;
    531 	union {
    532 		struct msm_ois_set_info_t set_info;
    533 		struct msm_camera_i2c_seq_reg_setting *settings;
    534 	} cfg;
    535 };
    536 
    537 struct msm_actuator_set_position_t {
    538 	uint16_t number_of_steps;
    539 	uint32_t hw_params;
    540 	uint16_t pos[MAX_NUMBER_OF_STEPS];
    541 	uint16_t delay[MAX_NUMBER_OF_STEPS];
    542 };
    543 
    544 struct msm_actuator_cfg_data {
    545 	int cfgtype;
    546 	uint8_t is_af_supported;
    547 	union {
    548 		struct msm_actuator_move_params_t move;
    549 		struct msm_actuator_set_info_t set_info;
    550 		struct msm_actuator_get_info_t get_info;
    551 		struct msm_actuator_set_position_t setpos;
    552 		enum af_camera_name cam_name;
    553 	} cfg;
    554 };
    555 
    556 enum msm_camera_led_config_t {
    557 	MSM_CAMERA_LED_OFF,
    558 	MSM_CAMERA_LED_LOW,
    559 	MSM_CAMERA_LED_HIGH,
    560 	MSM_CAMERA_LED_INIT,
    561 	MSM_CAMERA_LED_RELEASE,
    562 };
    563 
    564 struct msm_camera_led_cfg_t {
    565 	enum msm_camera_led_config_t cfgtype;
    566 	int32_t torch_current[MAX_LED_TRIGGERS];
    567 	int32_t flash_current[MAX_LED_TRIGGERS];
    568 	int32_t flash_duration[MAX_LED_TRIGGERS];
    569 };
    570 
    571 struct msm_flash_init_info_t {
    572 	enum msm_flash_driver_type flash_driver_type;
    573 	uint32_t slave_addr;
    574 	struct msm_sensor_power_setting_array *power_setting_array;
    575 	struct msm_camera_i2c_reg_setting_array *settings;
    576 };
    577 
    578 struct msm_flash_cfg_data_t {
    579 	enum msm_flash_cfg_type_t cfg_type;
    580 	int32_t flash_current[MAX_LED_TRIGGERS];
    581 	int32_t flash_duration[MAX_LED_TRIGGERS];
    582 	union {
    583 		struct msm_flash_init_info_t *flash_init_info;
    584 		struct msm_camera_i2c_reg_setting_array *settings;
    585 	} cfg;
    586 };
    587 
    588 /* sensor init structures and enums */
    589 enum msm_sensor_init_cfg_type_t {
    590 	CFG_SINIT_PROBE,
    591 	CFG_SINIT_PROBE_DONE,
    592 	CFG_SINIT_PROBE_WAIT_DONE,
    593 };
    594 
    595 struct sensor_init_cfg_data {
    596 	enum msm_sensor_init_cfg_type_t cfgtype;
    597 	struct msm_sensor_info_t        probed_info;
    598 	char                            entity_name[MAX_SENSOR_NAME];
    599 	union {
    600 		void *setting;
    601 	} cfg;
    602 };
    603 
    604 #define VIDIOC_MSM_SENSOR_CFG \
    605 	_IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct sensorb_cfg_data)
    606 
    607 #define VIDIOC_MSM_SENSOR_RELEASE \
    608 	_IO('V', BASE_VIDIOC_PRIVATE + 2)
    609 
    610 #define VIDIOC_MSM_SENSOR_GET_SUBDEV_ID \
    611 	_IOWR('V', BASE_VIDIOC_PRIVATE + 3, uint32_t)
    612 
    613 #define VIDIOC_MSM_CSIPHY_IO_CFG \
    614 	_IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct csiphy_cfg_data)
    615 
    616 #define VIDIOC_MSM_CSID_IO_CFG \
    617 	_IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct csid_cfg_data)
    618 
    619 #define VIDIOC_MSM_ACTUATOR_CFG \
    620 	_IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_actuator_cfg_data)
    621 
    622 #define VIDIOC_MSM_FLASH_LED_DATA_CFG \
    623 	_IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_camera_led_cfg_t)
    624 
    625 #define VIDIOC_MSM_EEPROM_CFG \
    626 	_IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_eeprom_cfg_data)
    627 
    628 #define VIDIOC_MSM_SENSOR_GET_AF_STATUS \
    629 	_IOWR('V', BASE_VIDIOC_PRIVATE + 9, uint32_t)
    630 
    631 #define VIDIOC_MSM_SENSOR_INIT_CFG \
    632 	_IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct sensor_init_cfg_data)
    633 
    634 #define VIDIOC_MSM_OIS_CFG \
    635 	_IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_ois_cfg_data)
    636 
    637 #define VIDIOC_MSM_FLASH_CFG \
    638 	_IOWR('V', BASE_VIDIOC_PRIVATE + 13, struct msm_flash_cfg_data_t)
    639 
    640 #ifdef CONFIG_COMPAT
    641 struct msm_camera_i2c_reg_setting32 {
    642 	compat_uptr_t reg_setting;
    643 	uint16_t size;
    644 	enum msm_camera_i2c_reg_addr_type addr_type;
    645 	enum msm_camera_i2c_data_type data_type;
    646 	uint16_t delay;
    647 };
    648 
    649 struct msm_actuator_tuning_params_t32 {
    650 	int16_t initial_code;
    651 	uint16_t pwd_step;
    652 	uint16_t region_size;
    653 	uint32_t total_steps;
    654 	compat_uptr_t region_params;
    655 };
    656 
    657 struct msm_actuator_params_t32 {
    658 	enum actuator_type act_type;
    659 	uint8_t reg_tbl_size;
    660 	uint16_t data_size;
    661 	uint16_t init_setting_size;
    662 	uint32_t i2c_addr;
    663 	enum msm_actuator_addr_type i2c_addr_type;
    664 	enum msm_actuator_data_type i2c_data_type;
    665 	compat_uptr_t reg_tbl_params;
    666 	compat_uptr_t init_settings;
    667 	struct park_lens_data_t park_lens;
    668 };
    669 
    670 struct msm_actuator_set_info_t32 {
    671 	struct msm_actuator_params_t32 actuator_params;
    672 	struct msm_actuator_tuning_params_t32 af_tuning_params;
    673 };
    674 
    675 struct sensor_init_cfg_data32 {
    676 	enum msm_sensor_init_cfg_type_t cfgtype;
    677 	struct msm_sensor_info_t        probed_info;
    678 	char                            entity_name[MAX_SENSOR_NAME];
    679 	union {
    680 		compat_uptr_t setting;
    681 	} cfg;
    682 };
    683 
    684 struct msm_actuator_move_params_t32 {
    685 	int8_t dir;
    686 	int8_t sign_dir;
    687 	int16_t dest_step_pos;
    688 	int32_t num_steps;
    689 	uint16_t curr_lens_pos;
    690 	compat_uptr_t ringing_params;
    691 };
    692 
    693 struct msm_actuator_cfg_data32 {
    694 	int cfgtype;
    695 	uint8_t is_af_supported;
    696 	union {
    697 		struct msm_actuator_move_params_t32 move;
    698 		struct msm_actuator_set_info_t32 set_info;
    699 		struct msm_actuator_get_info_t get_info;
    700 		struct msm_actuator_set_position_t setpos;
    701 		enum af_camera_name cam_name;
    702 	} cfg;
    703 };
    704 
    705 struct csiphy_cfg_data32 {
    706 	enum csiphy_cfg_type_t cfgtype;
    707 	union {
    708 		compat_uptr_t csiphy_params;
    709 		compat_uptr_t csi_lane_params;
    710 	} cfg;
    711 };
    712 
    713 struct sensorb_cfg_data32 {
    714 	int cfgtype;
    715 	union {
    716 		struct msm_sensor_info_t      sensor_info;
    717 		struct msm_sensor_init_params sensor_init_params;
    718 		compat_uptr_t                 setting;
    719 	} cfg;
    720 };
    721 
    722 struct msm_ois_params_t32 {
    723 	uint16_t data_size;
    724 	uint16_t setting_size;
    725 	uint32_t i2c_addr;
    726 	enum msm_camera_i2c_reg_addr_type i2c_addr_type;
    727 	enum msm_camera_i2c_data_type i2c_data_type;
    728 	compat_uptr_t settings;
    729 };
    730 
    731 struct msm_ois_set_info_t32 {
    732 	struct msm_ois_params_t32 ois_params;
    733 };
    734 
    735 struct msm_ois_cfg_data32 {
    736 	int cfgtype;
    737 	union {
    738 		struct msm_ois_set_info_t32 set_info;
    739 		compat_uptr_t settings;
    740 	} cfg;
    741 };
    742 
    743 struct msm_flash_init_info_t32 {
    744 	enum msm_flash_driver_type flash_driver_type;
    745 	uint32_t slave_addr;
    746 	compat_uptr_t power_setting_array;
    747 	compat_uptr_t settings;
    748 };
    749 
    750 struct msm_flash_cfg_data_t32 {
    751 	enum msm_flash_cfg_type_t cfg_type;
    752 	int32_t flash_current[MAX_LED_TRIGGERS];
    753 	int32_t flash_duration[MAX_LED_TRIGGERS];
    754 	union {
    755 		compat_uptr_t flash_init_info;
    756 		compat_uptr_t settings;
    757 	} cfg;
    758 };
    759 
    760 #define VIDIOC_MSM_ACTUATOR_CFG32 \
    761 	_IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_actuator_cfg_data32)
    762 
    763 #define VIDIOC_MSM_SENSOR_INIT_CFG32 \
    764 	_IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct sensor_init_cfg_data32)
    765 
    766 #define VIDIOC_MSM_CSIPHY_IO_CFG32 \
    767 	_IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct csiphy_cfg_data32)
    768 
    769 #define VIDIOC_MSM_SENSOR_CFG32 \
    770 	_IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct sensorb_cfg_data32)
    771 
    772 #define VIDIOC_MSM_EEPROM_CFG32 \
    773 	_IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_eeprom_cfg_data32)
    774 
    775 #define VIDIOC_MSM_OIS_CFG32 \
    776 	_IOWR('V', BASE_VIDIOC_PRIVATE + 11, struct msm_ois_cfg_data32)
    777 
    778 #define VIDIOC_MSM_CSID_IO_CFG32 \
    779 	_IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct csid_cfg_data32)
    780 
    781 #define VIDIOC_MSM_FLASH_CFG32 \
    782 	_IOWR('V', BASE_VIDIOC_PRIVATE + 13, struct msm_flash_cfg_data_t32)
    783 #endif
    784 
    785 #endif /* __LINUX_MSM_CAM_SENSOR_H */
    786