msm_cam_sensor_ll.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. #ifndef __LINUX_MSM_CAM_SENSOR_H
  2. #define __LINUX_MSM_CAM_SENSOR_H
  3. #ifdef MSM_CAMERA_BIONIC
  4. #include <sys/types.h>
  5. #endif
  6. #include <linux/types.h>
  7. #include <linux/v4l2-mediabus.h>
  8. #include <linux/i2c.h>
  9. #define I2C_SEQ_REG_SETTING_MAX 5
  10. #define I2C_SEQ_REG_DATA_MAX 20
  11. #define MAX_CID 16
  12. #define I2C_USER_REG_DATA_MAX 1024
  13. #define MSM_SENSOR_MCLK_8HZ 8000000
  14. #define MSM_SENSOR_MCLK_16HZ 16000000
  15. #define MSM_SENSOR_MCLK_24HZ 24000000
  16. #define GPIO_OUT_LOW (0 << 1)
  17. #define GPIO_OUT_HIGH (1 << 1)
  18. #define CSI_EMBED_DATA 0x12
  19. #define CSI_RESERVED_DATA_0 0x13
  20. #define CSI_YUV422_8 0x1E
  21. #define CSI_RAW8 0x2A
  22. #define CSI_RAW10 0x2B
  23. #define CSI_RAW12 0x2C
  24. #define CSI_DECODE_6BIT 0
  25. #define CSI_DECODE_8BIT 1
  26. #define CSI_DECODE_10BIT 2
  27. #define CSI_DECODE_DPCM_10_8_10 5
  28. #define MAX_SENSOR_NAME 32
  29. #define MAX_ACT_MOD_NAME_SIZE 32
  30. #define MAX_ACT_NAME_SIZE 32
  31. #define NUM_ACTUATOR_DIR 2
  32. #define MAX_ACTUATOR_SCENARIO 8
  33. #define MAX_ACTUATOR_REGION 5
  34. #define MAX_ACTUATOR_INIT_SET 12
  35. #define MAX_ACTUATOR_REG_TBL_SIZE 8
  36. #define MAX_ACTUATOR_AF_TOTAL_STEPS 1024
  37. #define MOVE_NEAR 0
  38. #define MOVE_FAR 1
  39. #define MSM_ACTUATOR_MOVE_SIGNED_FAR -1
  40. #define MSM_ACTUATOR_MOVE_SIGNED_NEAR 1
  41. #define MAX_EEPROM_NAME 32
  42. #define MAX_EEPROM_NAME 32
  43. #define MAX_NUMBER_OF_STEPS 47
  44. #define MAX_POWER_CONFIG 12
  45. //************************************* Native functionalities for YUV sensor added by jai.prakash
  46. #define EXT_CAM_EV 1
  47. #define EXT_CAM_WB 2
  48. #define EXT_CAM_METERING 3
  49. #define EXT_CAM_ISO 4
  50. #define EXT_CAM_EFFECT 5
  51. #define EXT_CAM_SCENE_MODE 6
  52. #define EXT_CAM_SENSOR_MODE 7
  53. //Exposure Compensation
  54. #define CAMERA_EV_M4 0
  55. #define CAMERA_EV_M3 1
  56. #define CAMERA_EV_M2 2
  57. #define CAMERA_EV_M1 3
  58. #define CAMERA_EV_DEFAULT 4
  59. #define CAMERA_EV_P1 5
  60. #define CAMERA_EV_P2 6
  61. #define CAMERA_EV_P3 7
  62. #define CAMERA_EV_P4 8
  63. //White Balance
  64. #define CAMERA_WHITE_BALANCE_OFF 0
  65. #define CAMERA_WHITE_BALANCE_AUTO 1
  66. #define CAMERA_WHITE_BALANCE_INCANDESCENT 2
  67. #define CAMERA_WHITE_BALANCE_FLUORESCENT 3
  68. #define CAMERA_WHITE_BALANCE_DAYLIGHT 5
  69. #define CAMERA_WHITE_BALANCE_CLOUDY_DAYLIGHT 6
  70. //Metering
  71. #define CAMERA_AVERAGE 0
  72. #define CAMERA_CENTER_WEIGHT 1
  73. #define CAMERA_SPOT 2
  74. //ISO
  75. #define CAMERA_ISO_MODE_AUTO 0
  76. #define CAMERA_ISO_MODE_50 1
  77. #define CAMERA_ISO_MODE_100 2
  78. #define CAMERA_ISO_MODE_200 3
  79. #define CAMERA_ISO_MODE_400 4
  80. #define CAMERA_ISO_MODE_800 5
  81. //Effect
  82. #define CAMERA_EFFECT_OFF 0
  83. #define CAMERA_EFFECT_MONO 1
  84. #define CAMERA_EFFECT_NEGATIVE 2
  85. #define CAMERA_EFFECT_SOLARIZE 3
  86. #define CAMERA_EFFECT_SEPIA 4
  87. #define CAMERA_EFFECT_POSTERIZE 5
  88. #define CAMERA_EFFECT_WHITEBOARD 6
  89. #define CAMERA_EFFECT_BLACKBOARD 7
  90. #define CAMERA_EFFECT_AQUA 8
  91. #define CAMERA_EFFECT_EMBOSS 9
  92. #define CAMERA_EFFECT_SKETCH 10
  93. #define CAMERA_EFFECT_NEON 11
  94. #define CAMERA_EFFECT_WASHED 12
  95. #define CAMERA_EFFECT_VINTAGE_WARM 13
  96. #define CAMERA_EFFECT_VINTAGE_COLD 14
  97. #define CAMERA_EFFECT_POINT_COLOR_1 15
  98. #define CAMERA_EFFECT_POINT_COLOR_2 16
  99. #define CAMERA_EFFECT_POINT_COLOR_3 17
  100. #define CAMERA_EFFECT_POINT_COLOR_4 18
  101. #define CAMERA_EFFECT_CARTOONIZE 19
  102. #define CAMERA_EFFECT_MAX 20
  103. //scene mode
  104. #define CAMERA_SCENE_AUTO 0
  105. #define CAMERA_SCENE_LANDSCAPE 3
  106. #define CAMERA_SCENE_SPORT 9
  107. #define CAMERA_SCENE_PARTY 13
  108. #define CAMERA_SCENE_BEACH 7
  109. #define CAMERA_SCENE_SUNSET 12
  110. #define CAMERA_SCENE_DAWN 21 //need to check
  111. #define CAMERA_SCENE_FALL 17
  112. #define CAMERA_SCENE_CANDLE 14
  113. #define CAMERA_SCENE_FIRE 11
  114. #define CAMERA_SCENE_AGAINST_LIGHT 16
  115. #define CAMERA_SCENE_NIGHT 6
  116. #define CAMERA_SCENE_PORTRAIT 7
  117. #define CAMERA_SCENE_TEXT 19
  118. #define CAMERA_MODE_INIT 0
  119. #define CAMERA_MODE_PREVIEW 1
  120. #define CAMERA_MODE_CAPTURE 2
  121. #define CAMERA_MODE_RECORDING 3
  122. //**************************************
  123. enum msm_camera_i2c_reg_addr_type {
  124. MSM_CAMERA_I2C_BYTE_ADDR = 1,
  125. MSM_CAMERA_I2C_WORD_ADDR,
  126. MSM_CAMERA_I2C_3B_ADDR,
  127. MSM_CAMERA_I2C_ADDR_TYPE_MAX,
  128. };
  129. enum msm_camera_i2c_data_type {
  130. MSM_CAMERA_I2C_BYTE_DATA = 1,
  131. MSM_CAMERA_I2C_WORD_DATA,
  132. MSM_CAMERA_I2C_SET_BYTE_MASK,
  133. MSM_CAMERA_I2C_UNSET_BYTE_MASK,
  134. MSM_CAMERA_I2C_SET_WORD_MASK,
  135. MSM_CAMERA_I2C_UNSET_WORD_MASK,
  136. MSM_CAMERA_I2C_SET_BYTE_WRITE_MASK_DATA,
  137. MSM_CAMERA_I2C_BURST_DATA,
  138. MSM_CAMERA_I2C_DATA_TYPE_MAX,
  139. };
  140. enum msm_sensor_power_seq_type_t {
  141. SENSOR_CLK,
  142. SENSOR_GPIO,
  143. SENSOR_VREG,
  144. SENSOR_I2C_MUX,
  145. #if defined(CONFIG_MACH_MONTBLANC) || defined(MONTBLANC_CAMERA) || defined(CONFIG_MACH_VIKALCU) || defined(VIKAL_CAMERA)
  146. SENSOR_ADDITIONAL_LDO,
  147. #endif
  148. };
  149. enum msm_sensor_clk_type_t {
  150. SENSOR_CAM_MCLK,
  151. SENSOR_CAM_CLK,
  152. SENSOR_CAM_CLK_MAX,
  153. };
  154. enum msm_sensor_power_seq_gpio_t {
  155. SENSOR_GPIO_RESET,
  156. SENSOR_GPIO_STANDBY,
  157. SENSOR_GPIO_VT_RESET,
  158. SENSOR_GPIO_VT_STANDBY,
  159. SENSOR_GPIO_EXT_VANA_POWER,
  160. SENSOR_GPIO_EXT_VIO_POWER,
  161. SENSOR_GPIO_EXT_VCORE_POWER,
  162. SENSOR_GPIO_EXT_CAMIO_EN,
  163. SENSOR_GPIO_MAX,
  164. };
  165. enum msm_camera_vreg_name_t {
  166. CAM_VDIG,
  167. CAM_VIO,
  168. CAM_VAF,
  169. CAM_VANA,
  170. CAM_VREG_MAX,
  171. };
  172. enum msm_sensor_resolution_t {
  173. MSM_SENSOR_RES_FULL,
  174. MSM_SENSOR_RES_QTR,
  175. MSM_SENSOR_RES_2,
  176. MSM_SENSOR_RES_3,
  177. MSM_SENSOR_RES_4,
  178. MSM_SENSOR_RES_5,
  179. MSM_SENSOR_RES_6,
  180. MSM_SENSOR_RES_7,
  181. MSM_SENSOR_RES_8,
  182. MSM_SENSOR_RES_9,
  183. MSM_SENSOR_RES_10,
  184. MSM_SENSOR_RES_11,
  185. MSM_SENSOR_RES_12,
  186. MSM_SENSOR_RES_13,
  187. MSM_SENSOR_INVALID_RES,
  188. };
  189. enum sensor_sub_module_t {
  190. SUB_MODULE_SENSOR,
  191. SUB_MODULE_CHROMATIX,
  192. SUB_MODULE_ACTUATOR,
  193. SUB_MODULE_EEPROM,
  194. SUB_MODULE_LED_FLASH,
  195. SUB_MODULE_STROBE_FLASH,
  196. SUB_MODULE_CSIPHY,
  197. SUB_MODULE_CSIPHY_3D,
  198. SUB_MODULE_CSID,
  199. SUB_MODULE_CSID_3D,
  200. SUB_MODULE_MAX,
  201. };
  202. enum csid_cfg_type_t {
  203. CSID_INIT,
  204. CSID_CFG,
  205. CSID_RELEASE,
  206. };
  207. enum csiphy_cfg_type_t {
  208. CSIPHY_INIT,
  209. CSIPHY_CFG,
  210. CSIPHY_RELEASE,
  211. };
  212. enum camera_vreg_type {
  213. REG_LDO,
  214. REG_VS,
  215. REG_GPIO,
  216. };
  217. struct msm_sensor_gpio_config {
  218. enum msm_sensor_power_seq_gpio_t gpio_name;
  219. uint8_t config_val;
  220. };
  221. struct msm_sensor_power_setting {
  222. enum msm_sensor_power_seq_type_t seq_type;
  223. uint16_t seq_val;
  224. long config_val;
  225. uint16_t delay;
  226. void *data[10];
  227. };
  228. struct msm_sensor_power_setting_array {
  229. struct msm_sensor_power_setting *power_setting;
  230. uint16_t size;
  231. struct msm_sensor_power_setting *power_off_setting;
  232. uint16_t off_size;
  233. };
  234. struct msm_sensor_id_info_t {
  235. uint16_t sensor_id_reg_addr;
  236. uint16_t sensor_id;
  237. };
  238. enum msm_sensor_camera_id_t {
  239. CAMERA_0,
  240. CAMERA_1,
  241. CAMERA_2,
  242. CAMERA_3,
  243. MAX_CAMERAS,
  244. };
  245. enum cci_i2c_master_t {
  246. MASTER_0,
  247. MASTER_1,
  248. MASTER_MAX,
  249. };
  250. struct msm_sensor_info_t {
  251. char sensor_name[MAX_SENSOR_NAME];
  252. int32_t session_id;
  253. int32_t subdev_id[SUB_MODULE_MAX];
  254. uint8_t is_mount_angle_valid;
  255. uint32_t sensor_mount_angle;
  256. };
  257. struct msm_camera_sensor_slave_info {
  258. char sensor_name[32];
  259. enum msm_sensor_camera_id_t camera_id;
  260. uint16_t slave_addr;
  261. enum msm_camera_i2c_reg_addr_type addr_type;
  262. enum msm_camera_i2c_data_type data_type;
  263. struct msm_sensor_id_info_t sensor_id_info;
  264. struct msm_sensor_power_setting_array power_setting_array;
  265. uint8_t is_probe_succeed;
  266. char subdev_name[32];
  267. struct msm_sensor_info_t sensor_info;
  268. };
  269. struct msm_camera_i2c_reg_array {
  270. uint16_t reg_addr;
  271. uint16_t reg_data;
  272. uint32_t delay;
  273. };
  274. struct msm_camera_i2c_burst_reg_array {
  275. uint16_t reg_addr;
  276. uint8_t *reg_data;
  277. uint16_t reg_data_size;
  278. };
  279. struct msm_camera_i2c_reg_setting {
  280. void *reg_setting;
  281. uint16_t size;
  282. enum msm_camera_i2c_reg_addr_type addr_type;
  283. enum msm_camera_i2c_data_type data_type;
  284. uint16_t delay;
  285. };
  286. struct msm_camera_i2c_seq_reg_array {
  287. uint16_t reg_addr;
  288. uint8_t reg_data[I2C_SEQ_REG_DATA_MAX];
  289. uint16_t reg_data_size;
  290. };
  291. struct msm_camera_i2c_seq_reg_setting {
  292. struct msm_camera_i2c_seq_reg_array *reg_setting;
  293. uint16_t size;
  294. enum msm_camera_i2c_reg_addr_type addr_type;
  295. uint16_t delay;
  296. };
  297. struct msm_camera_i2c_read_config {
  298. uint16_t slave_addr;
  299. uint16_t reg_addr;
  300. enum msm_camera_i2c_data_type data_type;
  301. uint16_t *data;
  302. };
  303. struct msm_camera_csid_vc_cfg {
  304. uint8_t cid;
  305. uint8_t dt;
  306. uint8_t decode_format;
  307. };
  308. struct msm_camera_csid_lut_params {
  309. uint8_t num_cid;
  310. struct msm_camera_csid_vc_cfg *vc_cfg[MAX_CID];
  311. };
  312. struct msm_camera_csid_params {
  313. uint8_t lane_cnt;
  314. uint16_t lane_assign;
  315. uint8_t phy_sel;
  316. struct msm_camera_csid_lut_params lut_params;
  317. };
  318. struct msm_camera_csiphy_params {
  319. uint8_t lane_cnt;
  320. uint8_t settle_cnt;
  321. uint16_t lane_mask;
  322. uint8_t combo_mode;
  323. uint8_t csid_core;
  324. };
  325. struct msm_camera_csi2_params {
  326. struct msm_camera_csid_params csid_params;
  327. struct msm_camera_csiphy_params csiphy_params;
  328. };
  329. struct msm_camera_csi_lane_params {
  330. uint16_t csi_lane_assign;
  331. uint16_t csi_lane_mask;
  332. };
  333. struct csi_lane_params_t {
  334. uint16_t csi_lane_assign;
  335. uint8_t csi_lane_mask;
  336. uint8_t csi_if;
  337. uint8_t csid_core[2];
  338. uint8_t csi_phy_sel;
  339. };
  340. struct camera_vreg_t {
  341. const char *reg_name;
  342. enum camera_vreg_type type;
  343. int min_voltage;
  344. int max_voltage;
  345. int op_mode;
  346. uint32_t delay;
  347. };
  348. enum camb_position_t {
  349. BACK_CAMERA_B,
  350. FRONT_CAMERA_B,
  351. };
  352. enum camerab_mode_t {
  353. CAMERA_MODE_2D_B = (1<<0),
  354. CAMERA_MODE_3D_B = (1<<1)
  355. };
  356. struct sensorb_cfg_data {
  357. int cfgtype;
  358. union {
  359. struct msm_sensor_info_t sensor_info;
  360. void *setting;
  361. } cfg;
  362. };
  363. struct csid_cfg_data {
  364. enum csid_cfg_type_t cfgtype;
  365. union {
  366. uint32_t csid_version;
  367. struct msm_camera_csid_params *csid_params;
  368. } cfg;
  369. };
  370. struct csiphy_cfg_data {
  371. enum csiphy_cfg_type_t cfgtype;
  372. union {
  373. struct msm_camera_csiphy_params *csiphy_params;
  374. struct msm_camera_csi_lane_params *csi_lane_params;
  375. } cfg;
  376. };
  377. enum eeprom_cfg_type_t {
  378. CFG_EEPROM_GET_INFO,
  379. CFG_EEPROM_GET_CAL_DATA,
  380. CFG_EEPROM_READ_CAL_DATA,
  381. CFG_EEPROM_READ_DATA,
  382. CFG_EEPROM_READ_COMPRESSED_DATA,
  383. CFG_EEPROM_WRITE_DATA,
  384. CFG_EEPROM_GET_ERASESIZE,
  385. CFG_EEPROM_ERASE,
  386. CFG_EEPROM_POWER_ON,
  387. CFG_EEPROM_POWER_OFF,
  388. };
  389. struct eeprom_get_t {
  390. uint32_t num_bytes;
  391. };
  392. struct eeprom_read_t {
  393. uint8_t *dbuffer;
  394. uint32_t num_bytes;
  395. uint32_t addr;
  396. uint32_t comp_size;
  397. };
  398. struct eeprom_write_t {
  399. uint8_t *dbuffer;
  400. uint32_t num_bytes;
  401. uint32_t addr;
  402. uint32_t *write_size;
  403. uint8_t compress;
  404. };
  405. struct eeprom_erase_t {
  406. uint32_t num_bytes;
  407. uint32_t addr;
  408. };
  409. struct msm_eeprom_cfg_data {
  410. enum eeprom_cfg_type_t cfgtype;
  411. uint8_t is_supported;
  412. union {
  413. char eeprom_name[MAX_EEPROM_NAME];
  414. struct eeprom_get_t get_data;
  415. struct eeprom_read_t read_data;
  416. struct eeprom_write_t write_data;
  417. struct eeprom_erase_t erase_data;
  418. } cfg;
  419. };
  420. enum msm_sensor_cfg_type_t {
  421. CFG_SET_SLAVE_INFO,
  422. CFG_SLAVE_READ_I2C,
  423. CFG_WRITE_I2C_ARRAY,
  424. CFG_WRITE_I2C_SEQ_ARRAY,
  425. CFG_POWER_UP,
  426. CFG_POWER_DOWN,
  427. CFG_SET_STOP_STREAM_SETTING,
  428. CFG_GET_SENSOR_INFO,
  429. CFG_SET_INIT_SETTING,
  430. CFG_SET_RESOLUTION,
  431. CFG_SET_STOP_STREAM,
  432. CFG_SET_START_STREAM,
  433. CFG_SET_GPIO_STATE,
  434. CFG_SET_SENSOR_OTP_CAL, // Randy 10.08
  435. };
  436. enum msm_actuator_cfg_type_t {
  437. CFG_GET_ACTUATOR_INFO,
  438. CFG_SET_ACTUATOR_INFO,
  439. CFG_SET_DEFAULT_FOCUS,
  440. CFG_SET_POSITION,
  441. CFG_MOVE_FOCUS,
  442. };
  443. enum actuator_type {
  444. ACTUATOR_VCM,
  445. ACTUATOR_PIEZO,
  446. ACTUATOR_HALL_EFFECT,
  447. ACTUATOR_HVCM,
  448. };
  449. enum msm_actuator_data_type {
  450. MSM_ACTUATOR_BYTE_DATA = 1,
  451. MSM_ACTUATOR_WORD_DATA,
  452. };
  453. enum msm_actuator_addr_type {
  454. MSM_ACTUATOR_BYTE_ADDR = 1,
  455. MSM_ACTUATOR_WORD_ADDR,
  456. };
  457. struct reg_settings_t {
  458. uint16_t reg_addr;
  459. uint16_t reg_data;
  460. };
  461. struct region_params_t {
  462. /* [0] = ForwardDirection Macro boundary
  463. [1] = ReverseDirection Inf boundary
  464. */
  465. uint16_t step_bound[2];
  466. uint16_t code_per_step;
  467. };
  468. struct damping_params_t {
  469. uint32_t damping_step;
  470. uint32_t damping_delay;
  471. uint32_t hw_params;
  472. };
  473. struct msm_actuator_move_params_t {
  474. int8_t dir;
  475. int8_t sign_dir;
  476. int16_t dest_step_pos;
  477. int32_t num_steps;
  478. struct damping_params_t *ringing_params;
  479. };
  480. struct msm_actuator_tuning_params_t {
  481. int16_t initial_code;
  482. uint16_t pwd_step;
  483. uint16_t region_size;
  484. uint32_t total_steps;
  485. struct region_params_t *region_params;
  486. };
  487. struct msm_actuator_params_t {
  488. enum actuator_type act_type;
  489. uint8_t reg_tbl_size;
  490. uint16_t data_size;
  491. uint16_t init_setting_size;
  492. uint32_t i2c_addr;
  493. enum msm_actuator_addr_type i2c_addr_type;
  494. enum msm_actuator_data_type i2c_data_type;
  495. struct msm_actuator_reg_params_t *reg_tbl_params;
  496. struct reg_settings_t *init_settings;
  497. };
  498. struct msm_actuator_set_info_t {
  499. struct msm_actuator_params_t actuator_params;
  500. struct msm_actuator_tuning_params_t af_tuning_params;
  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. enum af_camera_name {
  517. ACTUATOR_MAIN_CAM_0,
  518. ACTUATOR_MAIN_CAM_1,
  519. ACTUATOR_MAIN_CAM_2,
  520. ACTUATOR_MAIN_CAM_3,
  521. ACTUATOR_MAIN_CAM_4,
  522. ACTUATOR_MAIN_CAM_5,
  523. ACTUATOR_WEB_CAM_0,
  524. ACTUATOR_WEB_CAM_1,
  525. ACTUATOR_WEB_CAM_2,
  526. };
  527. struct msm_actuator_set_position_t {
  528. uint16_t number_of_steps;
  529. uint16_t pos[MAX_NUMBER_OF_STEPS];
  530. uint16_t delay[MAX_NUMBER_OF_STEPS];
  531. };
  532. struct msm_actuator_cfg_data {
  533. int cfgtype;
  534. uint8_t is_af_supported;
  535. union {
  536. struct msm_actuator_move_params_t move;
  537. struct msm_actuator_set_info_t set_info;
  538. struct msm_actuator_get_info_t get_info;
  539. struct msm_actuator_set_position_t setpos;
  540. enum af_camera_name cam_name;
  541. } cfg;
  542. };
  543. enum msm_actuator_write_type {
  544. MSM_ACTUATOR_WRITE_HW_DAMP,
  545. MSM_ACTUATOR_WRITE_DAC,
  546. };
  547. struct msm_actuator_reg_params_t {
  548. enum msm_actuator_write_type reg_write_type;
  549. uint32_t hw_mask;
  550. uint16_t reg_addr;
  551. uint16_t hw_shift;
  552. uint16_t data_shift;
  553. };
  554. enum msm_camera_led_config_t {
  555. MSM_CAMERA_LED_OFF,
  556. MSM_CAMERA_LED_LOW,
  557. MSM_CAMERA_LED_HIGH,
  558. MSM_CAMERA_LED_INIT,
  559. MSM_CAMERA_LED_RELEASE,
  560. };
  561. struct msm_camera_led_cfg_t {
  562. enum msm_camera_led_config_t cfgtype;
  563. };
  564. /* sensor init structures and enums */
  565. enum msm_sensor_init_cfg_type_t {
  566. CFG_SINIT_PROBE,
  567. };
  568. struct sensor_init_cfg_data {
  569. enum msm_sensor_init_cfg_type_t cfgtype;
  570. union {
  571. void *setting;
  572. } cfg;
  573. };
  574. struct ioctl_native_cmd {
  575. unsigned short mode;
  576. unsigned short address;
  577. unsigned short value_1;
  578. unsigned short value_2;
  579. unsigned short value_3;
  580. };
  581. #define VIDIOC_MSM_SENSOR_CFG \
  582. _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct sensorb_cfg_data)
  583. #define VIDIOC_MSM_SENSOR_RELEASE \
  584. _IO('V', BASE_VIDIOC_PRIVATE + 2)
  585. #define VIDIOC_MSM_SENSOR_GET_SUBDEV_ID \
  586. _IOWR('V', BASE_VIDIOC_PRIVATE + 3, uint32_t)
  587. #define VIDIOC_MSM_CSIPHY_IO_CFG \
  588. _IOWR('V', BASE_VIDIOC_PRIVATE + 4, struct csid_cfg_data)
  589. #define VIDIOC_MSM_CSID_IO_CFG \
  590. _IOWR('V', BASE_VIDIOC_PRIVATE + 5, struct csiphy_cfg_data)
  591. #define VIDIOC_MSM_ACTUATOR_CFG \
  592. _IOWR('V', BASE_VIDIOC_PRIVATE + 6, struct msm_actuator_cfg_data)
  593. #define VIDIOC_MSM_FLASH_LED_DATA_CFG \
  594. _IOWR('V', BASE_VIDIOC_PRIVATE + 7, struct msm_camera_led_cfg_t)
  595. #define VIDIOC_MSM_EEPROM_CFG \
  596. _IOWR('V', BASE_VIDIOC_PRIVATE + 8, struct msm_eeprom_cfg_data)
  597. #define VIDIOC_MSM_SENSOR_INIT_CFG \
  598. _IOWR('V', BASE_VIDIOC_PRIVATE + 9, struct sensor_init_cfg_data)
  599. #define VIDIOC_MSM_SENSOR_NATIVE_CMD \
  600. _IOWR('V', BASE_VIDIOC_PRIVATE + 10, struct ioctl_native_cmd)
  601. #define MSM_V4L2_PIX_FMT_META v4l2_fourcc('M', 'E', 'T', 'A') /* META */
  602. #endif /* __LINUX_MSM_CAM_SENSOR_H */