cam_sensor.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203
  1. /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef __UAPI_CAM_SENSOR_H__
  7. #define __UAPI_CAM_SENSOR_H__
  8. #include <linux/types.h>
  9. #include <linux/ioctl.h>
  10. #include <media/cam_defs.h>
  11. #define CAM_SENSOR_PROBE_CMD (CAM_COMMON_OPCODE_MAX + 1)
  12. #define CAM_FLASH_MAX_LED_TRIGGERS 2
  13. #define MAX_OIS_NAME_SIZE 32
  14. #define MAX_OIS_FW_COUNT 2
  15. #define CAM_CSIPHY_SECURE_MODE_ENABLED 1
  16. #define CAM_SENSOR_NAME_MAX_SIZE 32
  17. #define SKEW_CAL_MASK BIT(1)
  18. #define PREAMBLE_PATTEN_CAL_MASK BIT(2)
  19. /* CSIPHY driver cmd buffer meta types */
  20. #define CAM_CSIPHY_PACKET_META_LANE_INFO 0
  21. #define CAM_CSIPHY_PACKET_META_GENERIC_BLOB 1
  22. /* CSIPHY blob types */
  23. #define CAM_CSIPHY_GENERIC_BLOB_TYPE_CDR_CONFIG 0
  24. #define CAM_CSIPHY_GENERIC_BLOB_TYPE_AUX_CONFIG 1
  25. /* CSIPHY CDR tolerance operations */
  26. #define CAM_CSIPHY_CDR_ADD_TOLERANCE 1
  27. #define CAM_CSIPHY_CDR_SUB_TOLERANCE 2
  28. /* SENSOR driver cmd buffer meta types */
  29. #define CAM_SENSOR_PACKET_I2C_COMMANDS 0
  30. #define CAM_SENSOR_PACKET_GENERIC_BLOB 1
  31. /* SENSOR blob types */
  32. #define CAM_SENSOR_GENERIC_BLOB_RES_INFO 0
  33. enum camera_sensor_cmd_type {
  34. CAMERA_SENSOR_CMD_TYPE_INVALID,
  35. CAMERA_SENSOR_CMD_TYPE_PROBE,
  36. CAMERA_SENSOR_CMD_TYPE_PWR_UP,
  37. CAMERA_SENSOR_CMD_TYPE_PWR_DOWN,
  38. CAMERA_SENSOR_CMD_TYPE_I2C_INFO,
  39. CAMERA_SENSOR_CMD_TYPE_I2C_RNDM_WR,
  40. CAMERA_SENSOR_CMD_TYPE_I2C_RNDM_RD,
  41. CAMERA_SENSOR_CMD_TYPE_I2C_CONT_WR,
  42. CAMERA_SENSOR_CMD_TYPE_I2C_CONT_RD,
  43. CAMERA_SENSOR_CMD_TYPE_WAIT,
  44. CAMERA_SENSOR_FLASH_CMD_TYPE_INIT_INFO,
  45. CAMERA_SENSOR_FLASH_CMD_TYPE_FIRE,
  46. CAMERA_SENSOR_FLASH_CMD_TYPE_RER,
  47. CAMERA_SENSOR_FLASH_CMD_TYPE_QUERYCURR,
  48. CAMERA_SENSOR_FLASH_CMD_TYPE_WIDGET,
  49. CAMERA_SENSOR_CMD_TYPE_RD_DATA,
  50. CAMERA_SENSOR_FLASH_CMD_TYPE_INIT_FIRE,
  51. CAMERA_SENSOR_OIS_CMD_TYPE_FW_INFO,
  52. CAMERA_SENSOR_CMD_TYPE_MAX,
  53. };
  54. enum cam_actuator_packet_opcodes {
  55. CAM_ACTUATOR_PACKET_OPCODE_INIT,
  56. CAM_ACTUATOR_PACKET_AUTO_MOVE_LENS,
  57. CAM_ACTUATOR_PACKET_MANUAL_MOVE_LENS,
  58. CAM_ACTUATOR_PACKET_OPCODE_READ
  59. };
  60. enum cam_eeprom_packet_opcodes {
  61. CAM_EEPROM_PACKET_OPCODE_INIT,
  62. CAM_EEPROM_WRITE
  63. };
  64. enum cam_ois_packet_opcodes {
  65. CAM_OIS_PACKET_OPCODE_INIT,
  66. CAM_OIS_PACKET_OPCODE_OIS_CONTROL,
  67. CAM_OIS_PACKET_OPCODE_READ,
  68. CAM_OIS_PACKET_OPCODE_WRITE_TIME
  69. };
  70. enum camera_sensor_i2c_op_code {
  71. CAMERA_SENSOR_I2C_OP_INVALID,
  72. CAMERA_SENSOR_I2C_OP_RNDM_WR,
  73. CAMERA_SENSOR_I2C_OP_RNDM_WR_VERF,
  74. CAMERA_SENSOR_I2C_OP_CONT_WR_BRST,
  75. CAMERA_SENSOR_I2C_OP_CONT_WR_BRST_VERF,
  76. CAMERA_SENSOR_I2C_OP_CONT_WR_SEQN,
  77. CAMERA_SENSOR_I2C_OP_CONT_WR_SEQN_VERF,
  78. CAMERA_SENSOR_I2C_OP_RNDM_RD,
  79. CAMERA_SENSOR_I2C_OP_CONT_RD,
  80. CAMERA_SENSOR_I2C_OP_MAX,
  81. };
  82. enum camera_sensor_wait_op_code {
  83. CAMERA_SENSOR_WAIT_OP_INVALID,
  84. CAMERA_SENSOR_WAIT_OP_COND,
  85. CAMERA_SENSOR_WAIT_OP_HW_UCND,
  86. CAMERA_SENSOR_WAIT_OP_SW_UCND,
  87. CAMERA_SENSOR_WAIT_OP_MAX,
  88. };
  89. enum cam_tpg_packet_opcodes {
  90. CAM_TPG_PACKET_OPCODE_INVALID = 0,
  91. CAM_TPG_PACKET_OPCODE_INITIAL_CONFIG,
  92. CAM_TPG_PACKET_OPCODE_NOP,
  93. CAM_TPG_PACKET_OPCODE_MAX,
  94. };
  95. enum cam_sensor_packet_opcodes {
  96. CAM_SENSOR_PACKET_OPCODE_SENSOR_STREAMON,
  97. CAM_SENSOR_PACKET_OPCODE_SENSOR_UPDATE,
  98. CAM_SENSOR_PACKET_OPCODE_SENSOR_INITIAL_CONFIG,
  99. CAM_SENSOR_PACKET_OPCODE_SENSOR_PROBE,
  100. CAM_SENSOR_PACKET_OPCODE_SENSOR_CONFIG,
  101. CAM_SENSOR_PACKET_OPCODE_SENSOR_STREAMOFF,
  102. CAM_SENSOR_PACKET_OPCODE_SENSOR_READ,
  103. CAM_SENSOR_PACKET_OPCODE_SENSOR_FRAME_SKIP_UPDATE,
  104. CAM_SENSOR_PACKET_OPCODE_SENSOR_PROBE_V2,
  105. CAM_SENSOR_PACKET_OPCODE_SENSOR_REG_BANK_UNLOCK,
  106. CAM_SENSOR_PACKET_OPCODE_SENSOR_REG_BANK_LOCK,
  107. CAM_SENSOR_PACKET_OPCODE_SENSOR_BUBBLE_UPDATE,
  108. CAM_SENSOR_PACKET_OPCODE_SENSOR_NOP = 127,
  109. };
  110. enum cam_endianness_type {
  111. CAM_ENDIANNESS_BIG,
  112. CAM_ENDIANNESS_LITTLE,
  113. };
  114. enum tpg_command_type_t {
  115. TPG_CMD_TYPE_INVALID = 0,
  116. TPG_CMD_TYPE_GLOBAL_CONFIG,
  117. TPG_CMD_TYPE_STREAM_CONFIG,
  118. TPG_CMD_TYPE_ILLUMINATION_CONFIG,
  119. TPG_CMD_TYPE_SETTINGS_CONFIG,
  120. TPG_CMD_TYPE_MAX,
  121. };
  122. enum tpg_pattern_t {
  123. TPG_PATTERN_INVALID = 0,
  124. TPG_PATTERN_REAL_IMAGE,
  125. TPG_PATTERN_RANDOM_PIXL,
  126. TPG_PATTERN_RANDOM_INCREMENTING_PIXEL,
  127. TPG_PATTERN_COLOR_BAR,
  128. TPG_PATTERN_ALTERNATING_55_AA,
  129. TPG_PATTERN_ALTERNATING_USER_DEFINED,
  130. TPG_PATTERN_MAX,
  131. };
  132. enum tpg_color_bar_mode_t {
  133. TPG_COLOR_BAR_MODE_INVALID = 0,
  134. TPG_COLOR_BAR_MODE_NORMAL,
  135. TPG_COLOR_BAR_MODE_SPLIT,
  136. TPG_COLOR_BAR_MODE_ROTATING,
  137. TPG_COLOR_BAR_MODE_MAX,
  138. };
  139. enum tpg_image_format_t {
  140. TPG_IMAGE_FORMAT_INVALID = 0,
  141. TPG_IMAGE_FORMAT_BAYER,
  142. TPG_IMAGE_FORMAT_QCFA,
  143. TPG_IMAGE_FORMAT_YUV,
  144. TPG_IMAGE_FORMAT_JPEG,
  145. TPG_IMAGE_FORMAT_MAX,
  146. };
  147. enum tpg_phy_type_t {
  148. TPG_PHY_TYPE_INVALID = 0,
  149. TPG_PHY_TYPE_DPHY,
  150. TPG_PHY_TYPE_CPHY,
  151. TPG_PHY_TYPE_MAX,
  152. };
  153. enum tpg_pixel_type_t {
  154. TPG_PIXEL_TYPE_INVALID = 0,
  155. TPG_PIXEL_TYPE_RED,
  156. TPG_PIXEL_TYPE_GREEN,
  157. TPG_PIXEL_TYPE_BLUE,
  158. TPG_PIXEL_TYPE_IR,
  159. TPG_PIXEL_TYPE_MONO,
  160. };
  161. enum tpg_exposure_type_t {
  162. TPG_EXPOSUREL_TYPE_INVALID = 0,
  163. TPG_EXPOSURE_TYPE_LONG,
  164. TPG_EXPOSURE_TYPE_MIDDLE,
  165. TPG_EXPOSURE_TYPE_SHORT,
  166. };
  167. enum xcfa_type_t {
  168. XCFA_TYPE_BAYER = 0,
  169. XCFA_TYPE_QUADCFA,
  170. XCFA_TYPE_THREEXTHREECFA,
  171. XCFA_TYPE_FOURXFOURCFA,
  172. XCFA_TYPE_RGBIR,
  173. XCFA_TYPE_RGBWC,
  174. XCFA_TYPE_RGBWK,
  175. XCFA_TYPE_UNCONVENTIONAL_BAYER,
  176. };
  177. enum tpg_interleaving_format_t {
  178. TPG_INTERLEAVING_FORMAT_INVALID = 0,
  179. TPG_INTERLEAVING_FORMAT_FRAME,
  180. TPG_INTERLEAVING_FORMAT_LINE,
  181. TPG_INTERLEAVING_FORMAT_SHDR,
  182. TPG_INTERLEAVING_FORMAT_SPARSE_PD,
  183. TPG_INTERLEAVING_FORMAT_MAX,
  184. };
  185. enum tpg_shutter_t {
  186. TPG_SHUTTER_TYPE_INVALID = 0,
  187. TPG_SHUTTER_TYPE_ROLLING,
  188. TPG_SHUTTER_TYPE_GLOBAL,
  189. TPG_SHUTTER_TYPE_MAX,
  190. };
  191. enum tpg_stream_t {
  192. TPG_STREAM_TYPE_INVALID = 0,
  193. TPG_STREAM_TYPE_IMAGE,
  194. TPG_STREAM_TYPE_PDAF,
  195. TPG_STREAM_TYPE_META,
  196. TPG_STREAM_TYPE_MAX,
  197. };
  198. enum tpg_cfa_arrangement_t {
  199. TPG_CFA_ARRANGEMENT_TYPE_INVALID = 0,
  200. TPG_CFA_ARRANGEMENT_TYPE_MAX,
  201. };
  202. /**
  203. * struct cam_sensor_query_cap - capabilities info for sensor
  204. *
  205. * @slot_info : Indicates about the slotId or cell Index
  206. * @secure_camera : Camera is in secure/Non-secure mode
  207. * @pos_pitch : Sensor position pitch
  208. * @pos_roll : Sensor position roll
  209. * @pos_yaw : Sensor position yaw
  210. * @actuator_slot_id : Actuator slot id which connected to sensor
  211. * @eeprom_slot_id : EEPROM slot id which connected to sensor
  212. * @ois_slot_id : OIS slot id which connected to sensor
  213. * @flash_slot_id : Flash slot id which connected to sensor
  214. * @csiphy_slot_id : CSIphy slot id which connected to sensor
  215. *
  216. */
  217. struct cam_sensor_query_cap {
  218. __u32 slot_info;
  219. __u32 secure_camera;
  220. __u32 pos_pitch;
  221. __u32 pos_roll;
  222. __u32 pos_yaw;
  223. __u32 actuator_slot_id;
  224. __u32 eeprom_slot_id;
  225. __u32 ois_slot_id;
  226. __u32 flash_slot_id;
  227. __u32 csiphy_slot_id;
  228. } __attribute__((packed));
  229. /**
  230. * struct cam_csiphy_query_cap - capabilities info for csiphy
  231. *
  232. * @slot_info : Indicates about the slotId or cell Index
  233. * @version : CSIphy version
  234. * @clk lane : Of the 5 lanes, informs lane configured
  235. * as clock lane
  236. * @reserved
  237. */
  238. struct cam_csiphy_query_cap {
  239. __u32 slot_info;
  240. __u32 version;
  241. __u32 clk_lane;
  242. __u32 reserved;
  243. } __attribute__((packed));
  244. /**
  245. * struct cam_actuator_query_cap - capabilities info for actuator
  246. *
  247. * @slot_info : Indicates about the slotId or cell Index
  248. * @reserved
  249. */
  250. struct cam_actuator_query_cap {
  251. __u32 slot_info;
  252. __u32 reserved;
  253. } __attribute__((packed));
  254. /**
  255. * struct cam_eeprom_query_cap_t - capabilities info for eeprom
  256. *
  257. * @slot_info : Indicates about the slotId or cell Index
  258. * @eeprom_kernel_probe : Indicates about the kernel or userspace probe
  259. */
  260. struct cam_eeprom_query_cap_t {
  261. __u32 slot_info;
  262. __u16 eeprom_kernel_probe;
  263. __u16 is_multimodule_mode;
  264. } __attribute__((packed));
  265. /**
  266. * struct cam_ois_query_cap_t - capabilities info for ois
  267. *
  268. * @slot_info : Indicates about the slotId or cell Index
  269. */
  270. struct cam_ois_query_cap_t {
  271. __u32 slot_info;
  272. __u16 reserved;
  273. } __attribute__((packed));
  274. /**
  275. * struct cam_tpg_query_cap - capabilities info for tpg
  276. *
  277. * @slot_info : Indicates about the slotId or cell Index
  278. * @version : TPG version , in msb
  279. * @reserved : Reserved for future Use
  280. * @secure_camera : Camera is in secure/Non-secure mode
  281. * @csiphy_slot_id : CSIphy slot id which connected to sensor
  282. */
  283. struct cam_tpg_query_cap {
  284. __u32 slot_info;
  285. __u32 version;
  286. __u32 secure_camera;
  287. __u32 csiphy_slot_id;
  288. __u32 reserved[2];
  289. } __attribute__((packed));
  290. /**
  291. * struct cam_cmd_i2c_info - Contains slave I2C related info
  292. *
  293. * @slave_addr : Slave address
  294. * @i2c_freq_mode : 4 bits are used for I2c freq mode
  295. * @cmd_type : Explains type of command
  296. */
  297. struct cam_cmd_i2c_info {
  298. __u32 slave_addr;
  299. __u8 i2c_freq_mode;
  300. __u8 cmd_type;
  301. __u16 reserved;
  302. } __attribute__((packed));
  303. #define CAM_SENSOR_FEATURE_MASK BIT(0)
  304. #define CAM_SENSOR_FEATURE_NONE 0
  305. #define CAM_SENSOR_FEATURE_AEB_ON BIT(0)
  306. #define CAM_SENSOR_FEATURE_AEB_UPDATE BIT(1)
  307. #define CAM_SENSOR_FEATURE_AEB_OFF BIT(2)
  308. #define CAM_SENSOR_FEATURE_INSENSOR_HDR_3EXP_ON BIT(3)
  309. #define CAM_SENSOR_FEATURE_INSENSOR_HDR_3EXP_OFF BIT(4)
  310. /**
  311. * struct cam_cmd_sensor_res_info - Contains sensor res info
  312. *
  313. * res_index is the key property, it specifies the
  314. * combinations of other properties enclosed in this
  315. * structure.
  316. *
  317. * @res_index : The resolution index that gets updated
  318. * during a mode switch
  319. * @fps : Frame rate
  320. * @width : Pixel width to output to csiphy
  321. * @height : Pixel height to output to csiphy
  322. * @caps : Specifies capability sensor is configured
  323. * for, (eg, XCFA, HFR), num_exposures and
  324. * PDAF type
  325. * @num_valid_params : Number of valid params
  326. * @valid_param_mask : Valid param mask
  327. * @params : params
  328. */
  329. struct cam_sensor_res_info {
  330. __u16 res_index;
  331. __u32 fps;
  332. __u32 width;
  333. __u32 height;
  334. char caps[64];
  335. __u32 num_valid_params;
  336. __u32 valid_param_mask;
  337. __u16 params[3];
  338. } __attribute__((packed));
  339. /**
  340. * struct cam_ois_opcode - Contains OIS opcode
  341. *
  342. * @prog : OIS FW prog register address
  343. * @coeff : OIS FW coeff register address
  344. * @pheripheral : OIS pheripheral
  345. * @memory : OIS memory
  346. */
  347. struct cam_ois_opcode {
  348. __u32 prog;
  349. __u32 coeff;
  350. __u32 pheripheral;
  351. __u32 memory;
  352. } __attribute__((packed));
  353. /**
  354. * struct cam_cmd_ois_info - Contains OIS slave info
  355. *
  356. * @slave_addr : OIS i2c slave address
  357. * @i2c_freq_mode : i2c frequency mode
  358. * @cmd_type : Explains type of command
  359. * @ois_fw_flag : indicates if fw is present or not
  360. * @is_ois_calib : indicates the calibration data is available
  361. * @ois_name : OIS name
  362. * @opcode : opcode
  363. */
  364. struct cam_cmd_ois_info {
  365. __u32 slave_addr;
  366. __u8 i2c_freq_mode;
  367. __u8 cmd_type;
  368. __u8 ois_fw_flag;
  369. __u8 is_ois_calib;
  370. char ois_name[MAX_OIS_NAME_SIZE];
  371. struct cam_ois_opcode opcode;
  372. } __attribute__((packed));
  373. /**
  374. * struct cam_cmd_ois_fw_param - Contains OIS firmware param
  375. *
  376. * NOTE: if this struct is updated,
  377. * please also update version in struct cam_cmd_ois_fw_info
  378. *
  379. * @fw_name : firmware file name
  380. * @fw_start_pos : data start position in file
  381. * @fw_size : firmware size
  382. * @fw_len_per_write: data length per write in bytes
  383. * @fw_addr_type : addr type
  384. * @fw_data_type : data type
  385. * @fw_operation : type of operation
  386. * @reserved : reserved for 32-bit alignment
  387. * @fw_delayUs : delay in cci write
  388. * @fw_reg_addr : start register addr to write
  389. * @fw_init_size : size of fw download init settings
  390. * @fw_finalize_size: size of fw download finalize settings
  391. */
  392. struct cam_cmd_ois_fw_param {
  393. char fw_name[MAX_OIS_NAME_SIZE];
  394. __u32 fw_start_pos;
  395. __u32 fw_size;
  396. __u32 fw_len_per_write;
  397. __u8 fw_addr_type;
  398. __u8 fw_data_type;
  399. __u8 fw_operation;
  400. __u8 reserved;
  401. __u32 fw_delayUs;
  402. __u32 fw_reg_addr;
  403. __u32 fw_init_size;
  404. __u32 fw_finalize_size;
  405. } __attribute__((packed));
  406. /**
  407. * struct cam_cmd_ois_fw_info - Contains OIS firmware info
  408. *
  409. * @version : version info
  410. * NOTE: if struct cam_cmd_ois_fw_param is updated,
  411. * version here needs to be updated too.
  412. * @reserved : reserved
  413. * @cmd_type : Explains type of command
  414. * @fw_count : firmware count
  415. * @endianness : endianness combo:
  416. * bit[3:0] firmware data's endianness
  417. * bit[7:4] endian type of input parameter to ois driver, say QTime
  418. * @fw_param : includes firmware parameters
  419. * @num_valid_params: Number of valid params
  420. * @param_mask : Mask to indicate fields in params
  421. * @params : Additional Params
  422. */
  423. struct cam_cmd_ois_fw_info {
  424. __u32 version;
  425. __u8 reserved;
  426. __u8 cmd_type;
  427. __u8 fw_count;
  428. __u8 endianness;
  429. struct cam_cmd_ois_fw_param fw_param[MAX_OIS_FW_COUNT];
  430. __u32 num_valid_params;
  431. __u32 param_mask;
  432. __u32 params[4];
  433. } __attribute__((packed));
  434. /**
  435. * struct cam_cmd_probe - Contains sensor slave info
  436. *
  437. * @data_type : Slave register data type
  438. * @addr_type : Slave register address type
  439. * @op_code : Don't Care
  440. * @cmd_type : Explains type of command
  441. * @reg_addr : Slave register address
  442. * @expected_data : Data expected at slave register address
  443. * @data_mask : Data mask if only few bits are valid
  444. * @camera_id : Indicates the slot to which camera
  445. * needs to be probed
  446. * @reserved
  447. */
  448. struct cam_cmd_probe {
  449. __u8 data_type;
  450. __u8 addr_type;
  451. __u8 op_code;
  452. __u8 cmd_type;
  453. __u32 reg_addr;
  454. __u32 expected_data;
  455. __u32 data_mask;
  456. __u16 camera_id;
  457. __u16 reserved;
  458. } __attribute__((packed));
  459. /**
  460. * struct cam_cmd_probe_v2 - Contains sensor slave info version 2
  461. *
  462. * @data_type : Slave register data type
  463. * @addr_type : Slave register address type
  464. * @op_code : Don't Care
  465. * @cmd_type : Explains type of command
  466. * @reg_addr : Slave register address
  467. * @expected_data : Data expected at slave register address
  468. * @data_mask : Data mask if only few bits are valid
  469. * @camera_id : Indicates the slot to which camera
  470. * needs to be probed
  471. * @pipeline_delay : Pipeline delay
  472. * @logical_camera_id : Logical Camera ID
  473. * @sensor_name : Sensor's name
  474. * @reserved
  475. */
  476. struct cam_cmd_probe_v2 {
  477. __u8 data_type;
  478. __u8 addr_type;
  479. __u8 op_code;
  480. __u8 cmd_type;
  481. __u32 reg_addr;
  482. __u32 expected_data;
  483. __u32 data_mask;
  484. __u16 camera_id;
  485. __u16 pipeline_delay;
  486. __u32 logical_camera_id;
  487. char sensor_name[CAM_SENSOR_NAME_MAX_SIZE];
  488. __u32 reserved[4];
  489. } __attribute__((packed));
  490. /**
  491. * struct cam_power_settings - Contains sensor power setting info
  492. *
  493. * @power_seq_type : Type of power sequence
  494. * @reserved
  495. * @config_val_low : Lower 32 bit value configuration value
  496. * @config_val_high : Higher 32 bit value configuration value
  497. *
  498. */
  499. struct cam_power_settings {
  500. __u16 power_seq_type;
  501. __u16 reserved;
  502. __u32 config_val_low;
  503. __u32 config_val_high;
  504. } __attribute__((packed));
  505. /**
  506. * struct cam_cmd_power - Explains about the power settings
  507. *
  508. * @count : Number of power settings follows
  509. * @reserved
  510. * @cmd_type : Explains type of command
  511. * @power_settings : Contains power setting info
  512. */
  513. struct cam_cmd_power {
  514. __u32 count;
  515. __u8 reserved;
  516. __u8 cmd_type;
  517. __u16 more_reserved;
  518. struct cam_power_settings power_settings[1];
  519. } __attribute__((packed));
  520. /**
  521. * struct i2c_rdwr_header - header of READ/WRITE I2C command
  522. *
  523. * @ count : Number of registers / data / reg-data pairs
  524. * @ op_code : Operation code
  525. * @ cmd_type : Command buffer type
  526. * @ data_type : I2C data type
  527. * @ addr_type : I2C address type
  528. * @ reserved
  529. */
  530. struct i2c_rdwr_header {
  531. __u32 count;
  532. __u8 op_code;
  533. __u8 cmd_type;
  534. __u8 data_type;
  535. __u8 addr_type;
  536. } __attribute__((packed));
  537. /**
  538. * struct i2c_random_wr_payload - payload for I2C random write
  539. *
  540. * @ reg_addr : Register address
  541. * @ reg_data : Register data
  542. *
  543. */
  544. struct i2c_random_wr_payload {
  545. __u32 reg_addr;
  546. __u32 reg_data;
  547. } __attribute__((packed));
  548. /**
  549. * struct cam_cmd_i2c_random_wr - I2C random write command
  550. * @ header : header of READ/WRITE I2C command
  551. * @ random_wr_payload : payload for I2C random write
  552. */
  553. struct cam_cmd_i2c_random_wr {
  554. struct i2c_rdwr_header header;
  555. struct i2c_random_wr_payload random_wr_payload[1];
  556. } __attribute__((packed));
  557. /**
  558. * struct cam_cmd_read - I2C read command
  559. * @ reg_data : Register data
  560. * @ reserved
  561. */
  562. struct cam_cmd_read {
  563. __u32 reg_data;
  564. __u32 reserved;
  565. } __attribute__((packed));
  566. /**
  567. * struct cam_cmd_i2c_continuous_wr - I2C continuous write command
  568. * @ header : header of READ/WRITE I2C command
  569. * @ reg_addr : Register address
  570. * @ data_read : I2C read command
  571. */
  572. struct cam_cmd_i2c_continuous_wr {
  573. struct i2c_rdwr_header header;
  574. __u32 reg_addr;
  575. struct cam_cmd_read data_read[1];
  576. } __attribute__((packed));
  577. /**
  578. * struct cam_cmd_i2c_random_rd - I2C random read command
  579. * @ header : header of READ/WRITE I2C command
  580. * @ data_read : I2C read command
  581. */
  582. struct cam_cmd_i2c_random_rd {
  583. struct i2c_rdwr_header header;
  584. struct cam_cmd_read data_read[1];
  585. } __attribute__((packed));
  586. /**
  587. * struct cam_cmd_i2c_continuous_rd - I2C continuous continuous read command
  588. * @ header : header of READ/WRITE I2C command
  589. * @ reg_addr : Register address
  590. *
  591. */
  592. struct cam_cmd_i2c_continuous_rd {
  593. struct i2c_rdwr_header header;
  594. __u32 reg_addr;
  595. } __attribute__((packed));
  596. /**
  597. * struct cam_cmd_conditional_wait - Conditional wait command
  598. * @data_type : Data type
  599. * @addr_type : Address type
  600. * @op_code : Opcode
  601. * @cmd_type : Explains type of command
  602. * @timeout : Timeout for retries
  603. * @reserved
  604. * @reg_addr : Register Address
  605. * @reg_data : Register data
  606. * @data_mask : Data mask if only few bits are valid
  607. * @camera_id : Indicates the slot to which camera
  608. * needs to be probed
  609. *
  610. */
  611. struct cam_cmd_conditional_wait {
  612. __u8 data_type;
  613. __u8 addr_type;
  614. __u16 reserved;
  615. __u8 op_code;
  616. __u8 cmd_type;
  617. __u16 timeout;
  618. __u32 reg_addr;
  619. __u32 reg_data;
  620. __u32 data_mask;
  621. } __attribute__((packed));
  622. /**
  623. * struct cam_cmd_unconditional_wait - Un-conditional wait command
  624. * @delay : Delay
  625. * @op_code : Opcode
  626. * @cmd_type : Explains type of command
  627. */
  628. struct cam_cmd_unconditional_wait {
  629. __s16 delay;
  630. __s16 reserved;
  631. __u8 op_code;
  632. __u8 cmd_type;
  633. __u16 reserved1;
  634. } __attribute__((packed));
  635. /**
  636. * cam_csiphy_cdr_sweep_params : Provides cdr blob structre
  637. *
  638. * @cdr_tolerance : CDR tolerance param
  639. * @tolerance_op_type : Determines if the tolerance needs to be added/subtracted
  640. * from default CDR value
  641. * @configured_cdr : Configured CDR value for all the lanes for the
  642. * selected data rate, default +/- tolerance,
  643. * this is the output
  644. * @num_valid_params : Number of valid params
  645. * @valid_param_mask : Valid param mask
  646. * @params : params
  647. *
  648. */
  649. struct cam_csiphy_cdr_sweep_params {
  650. __u32 cdr_tolerance;
  651. __u32 tolerance_op_type;
  652. __u32 configured_cdr;
  653. __u32 num_valid_params;
  654. __u32 valid_param_mask;
  655. __u32 params[3];
  656. };
  657. /**
  658. * cam_csiphy_aux_settings_params : Provides aux blob structre
  659. *
  660. * @data_rate_aux_mask : Auxiliary settings update for different data rates,
  661. * this is the output
  662. * @num_valid_params : Number of valid params
  663. * @valid_param_mask : Valid param mask
  664. * @params : params
  665. *
  666. */
  667. struct cam_csiphy_aux_settings_params {
  668. __u64 data_rate_aux_mask;
  669. __u32 num_valid_params;
  670. __u32 valid_param_mask;
  671. __u32 params[2];
  672. };
  673. /**
  674. * cam_csiphy_info : Provides cmdbuffer structre
  675. * @lane_assign : Lane sensor will be using
  676. * @mipi_flags : Phy flags for different calibration operations
  677. * @lane_cnt : Total number of lanes
  678. * @secure_mode : Secure mode flag to enable / disable
  679. * @settle_time : Settling time in ms
  680. * @data_rate : Data rate
  681. *
  682. */
  683. struct cam_csiphy_info {
  684. __u16 reserved;
  685. __u16 lane_assign;
  686. __u16 mipi_flags;
  687. __u8 lane_cnt;
  688. __u8 secure_mode;
  689. __u64 settle_time;
  690. __u64 data_rate;
  691. } __attribute__((packed));
  692. /**
  693. * cam_csiphy_acquire_dev_info : Information needed for
  694. * csiphy at the time of acquire
  695. * @combo_mode : Indicates the device mode of operation
  696. * @cphy_dphy_combo_mode : Info regarding cphy_dphy_combo mode
  697. * @csiphy_3phase : Details whether 3Phase / 2Phase operation
  698. * @reserve
  699. *
  700. */
  701. struct cam_csiphy_acquire_dev_info {
  702. __u32 combo_mode;
  703. __u16 cphy_dphy_combo_mode;
  704. __u8 csiphy_3phase;
  705. __u8 reserve;
  706. } __attribute__((packed));
  707. /**
  708. * cam_sensor_acquire_dev : Updates sensor acuire cmd
  709. * @device_handle : Updates device handle
  710. * @session_handle : Session handle for acquiring device
  711. * @handle_type : Resource handle type
  712. * @reserved
  713. * @info_handle : Handle to additional info
  714. * needed for sensor sub modules
  715. *
  716. */
  717. struct cam_sensor_acquire_dev {
  718. __u32 session_handle;
  719. __u32 device_handle;
  720. __u32 handle_type;
  721. __u32 reserved;
  722. __u64 info_handle;
  723. } __attribute__((packed));
  724. /**
  725. * cam_tpg_acquire_dev : Updates tpg acuire cmd
  726. * @device_handle : Updates device handle
  727. * @session_handle : Session handle for acquiring device
  728. * @handle_type : Resource handle type
  729. * @reserved
  730. * @info_handle : Handle to additional info
  731. * needed for sensor sub modules
  732. */
  733. struct cam_tpg_acquire_dev {
  734. __u32 session_handle;
  735. __u32 device_handle;
  736. __u32 handle_type;
  737. __u32 reserved;
  738. __u64 info_handle;
  739. } __attribute__((packed));
  740. /**
  741. * cam_sensor_streamon_dev : StreamOn command for the sensor
  742. * @session_handle : Session handle for acquiring device
  743. * @device_handle : Updates device handle
  744. * @handle_type : Resource handle type
  745. * @reserved
  746. * @info_handle : Information Needed at the time of streamOn
  747. *
  748. */
  749. struct cam_sensor_streamon_dev {
  750. __u32 session_handle;
  751. __u32 device_handle;
  752. __u32 handle_type;
  753. __u32 reserved;
  754. __u64 info_handle;
  755. } __attribute__((packed));
  756. /**
  757. * stream_dimension : Stream dimension
  758. *
  759. * @left : left pixel locaiton of stream
  760. * @top : top pixel location of stream
  761. * @width : width of the image stream
  762. * @height : Height of the image stream
  763. */
  764. struct stream_dimension {
  765. uint32_t left;
  766. uint32_t top;
  767. uint32_t width;
  768. uint32_t height;
  769. };
  770. /**
  771. * tpg_command_header_t : tpg command common header
  772. *
  773. * @cmd_type : command type
  774. * @size : size of the command including header
  775. * @cmd_version : version of the command associated
  776. */
  777. struct tpg_command_header_t {
  778. __u32 cmd_type;
  779. ssize_t size;
  780. uint32_t cmd_version;
  781. } __attribute__((packed));
  782. /**
  783. * tpg_pixel_coordinate_t : pixel coordinate structure
  784. *
  785. * @xcoordinate : X coordinate
  786. * @ycoordinate : Y coordiante
  787. * @pixel_type : red green blue ir mono
  788. */
  789. struct tpg_pixel_coordinate_t {
  790. uint32_t xcoordinate;
  791. uint32_t ycoordinate;
  792. uint32_t exposure_type;
  793. uint32_t pixel_type;
  794. } __attribute__((packed));
  795. /**
  796. * tpg_cfa_information_t : tpg cfa information structure
  797. *
  798. * @number_of_pixel_per_color : number of pixel per color
  799. * @pattern_width : pattern width
  800. * @pattern_height : pattern height
  801. * @pixel_coordinate_count : pixel coordinate count
  802. * @pixel_coordinate : pixel coordinate array
  803. */
  804. struct tpg_cfa_information_t {
  805. uint32_t number_of_pixel_per_color;
  806. uint32_t pattern_width;
  807. uint32_t pattern_height;
  808. uint32_t pixel_coordinate_count;
  809. struct tpg_pixel_coordinate_t pixel_coordinate[64];
  810. } __attribute__((packed));
  811. /**
  812. * tpg_reg_settings : TPG register settings
  813. *
  814. * @reg_offset : register offset
  815. * @reg_value : register value
  816. * @operation : operation
  817. * @delay_us : delay in micro second
  818. */
  819. struct tpg_reg_settings {
  820. uint32_t reg_offset;
  821. uint32_t reg_value;
  822. uint32_t operation;
  823. uint32_t delay_us;
  824. uint32_t reserved[4];
  825. } __attribute__((packed));
  826. /**
  827. * tpg_settings_config_t : settings configuration command structure
  828. *
  829. * @header : common header
  830. * @settings_array_offset : settings array offset
  831. * @settings_array_size : settings array size
  832. * @active_count : active count
  833. * @param_mask : Mask to indicate fields in params
  834. * @params : Additional Params
  835. */
  836. struct tpg_settings_config_t {
  837. struct tpg_command_header_t header;
  838. uint32_t settings_array_offset;
  839. uint32_t settings_array_size;
  840. uint32_t active_count;
  841. uint32_t param_mask;
  842. uint32_t params[4];
  843. } __attribute__((packed));
  844. /**
  845. * tpg_global_config_t : global configuration command structure
  846. *
  847. * @header : common header
  848. * @phy_type : phy type , cpy , dphy
  849. * @lane_count : number of lanes used
  850. * @interleaving_format : interleaving format used
  851. * @phy_mode : phy mode of operation
  852. * @shutter_type : shutter type
  853. * @mode : if any specific mode needs to configured
  854. * @hbi : horizontal blanking intervel
  855. * @vbi : vertical blanking intervel
  856. * @skip_pattern : frame skip pattern
  857. * @tpg_clock : tpg clock
  858. * @reserved : reserved for future use
  859. */
  860. struct tpg_global_config_t {
  861. struct tpg_command_header_t header;
  862. enum tpg_phy_type_t phy_type;
  863. uint8_t lane_count;
  864. enum tpg_interleaving_format_t interleaving_format;
  865. uint8_t phy_mode;
  866. enum tpg_shutter_t shutter_type;
  867. uint32_t mode;
  868. uint32_t hbi;
  869. uint32_t vbi;
  870. uint32_t skip_pattern;
  871. uint64_t tpg_clock;
  872. uint32_t reserved[4];
  873. } __attribute__((packed));
  874. /**
  875. * tpg_old_stream_config_t : stream configuration command
  876. *
  877. * @header: common tpg command header
  878. * @pattern_type : tpg pattern type used in this stream
  879. * @cb_mode : tpg color bar mode used in this stream
  880. * @frame_count : frame count in case of trigger burst mode
  881. * @stream_type : type of stream like image pdaf etc
  882. * @stream_dimension : Dimension of the stream
  883. * @pixel_depth : bits per each pixel
  884. * @cfa_arrangement : color filter arragement
  885. * @output_format : output image format
  886. * @hbi : horizontal blanking intervel
  887. * @vbi : vertical blanking intervel
  888. * @vc : virtual channel of this stream
  889. * @dt : data type of this stream
  890. * @skip_pattern : skip pattern for this stream
  891. * @rotate_period : rotate period for this stream
  892. * @reserved : reserved for future use
  893. */
  894. struct tpg_old_stream_config_t {
  895. struct tpg_command_header_t header;
  896. enum tpg_pattern_t pattern_type;
  897. enum tpg_color_bar_mode_t cb_mode;
  898. uint32_t frame_count;
  899. enum tpg_stream_t stream_type;
  900. struct stream_dimension stream_dimension;
  901. uint8_t pixel_depth;
  902. enum tpg_cfa_arrangement_t cfa_arrangement;
  903. enum tpg_image_format_t output_format;
  904. uint32_t hbi;
  905. uint32_t vbi;
  906. uint16_t vc;
  907. uint16_t dt;
  908. uint32_t skip_pattern;
  909. uint32_t rotate_period;
  910. uint32_t reserved[4];
  911. } __attribute__((packed));
  912. /**
  913. * tpg_stream_config_t : stream configuration command
  914. *
  915. * @header: common tpg command header
  916. * @pattern_type : tpg pattern type used in this stream
  917. * @cb_mode : tpg color bar mode used in this stream
  918. * @frame_count : frame count in case of trigger burst mode
  919. * @stream_type : type of stream like image pdaf etc
  920. * @stream_dimension : Dimension of the stream
  921. * @pixel_depth : bits per each pixel
  922. * @cfa_arrangement : color filter arragement
  923. * @output_format : output image format
  924. * @hbi : horizontal blanking intervel
  925. * @vbi : vertical blanking intervel
  926. * @vc : virtual channel of this stream
  927. * @dt : data type of this stream
  928. * @skip_pattern : skip pattern for this stream
  929. * @rotate_period : rotate period for this stream
  930. * @xcfa_debug : for xcfa debug;
  931. * @shdr_line_offset0 : for shdr line offset0
  932. * @shdr_line_offset1 : for shdr line offset1
  933. * @reserved : reserved for future use
  934. */
  935. struct tpg_stream_config_t {
  936. struct tpg_command_header_t header;
  937. enum tpg_pattern_t pattern_type;
  938. enum tpg_color_bar_mode_t cb_mode;
  939. uint32_t frame_count;
  940. enum tpg_stream_t stream_type;
  941. struct stream_dimension stream_dimension;
  942. uint8_t pixel_depth;
  943. enum tpg_cfa_arrangement_t cfa_arrangement;
  944. enum tpg_image_format_t output_format;
  945. uint32_t hbi;
  946. uint32_t vbi;
  947. uint16_t vc;
  948. uint16_t dt;
  949. uint32_t skip_pattern;
  950. uint32_t rotate_period;
  951. uint32_t xcfa_debug;
  952. uint32_t shdr_line_offset0;
  953. uint32_t shdr_line_offset1;
  954. uint32_t reserved[4];
  955. } __attribute__((packed));
  956. /**
  957. * tpg_stream_config_t : stream configuration command
  958. *
  959. * @header: common tpg command header
  960. * @pattern_type : tpg pattern type used in this stream
  961. * @cb_mode : tpg color bar mode used in this stream
  962. * @frame_count : frame count in case of trigger burst mode
  963. * @stream_type : type of stream like image pdaf etc
  964. * @stream_dimension : Dimension of the stream
  965. * @pixel_depth : bits per each pixel
  966. * @cfa_arrangement : color filter arragement
  967. * @output_format : output image format
  968. * @hbi : horizontal blanking intervel
  969. * @vbi : vertical blanking intervel
  970. * @vc : virtual channel of this stream
  971. * @dt : data type of this stream
  972. * @skip_pattern : skip pattern for this stream
  973. * @rotate_period : rotate period for this stream
  974. * @shdr_line_offset0 : for shdr line offset0
  975. * @shdr_line_offset1 : for shdr line offset1
  976. * @cfa_info_exist : cfa info exists
  977. * @cfa_info : cfa information
  978. * @xcfa_type : xcfa type
  979. * @reserved : reserved for future use
  980. */
  981. struct tpg_stream_config_v3_t {
  982. struct tpg_command_header_t header;
  983. uint32_t pattern_type;
  984. uint32_t cb_mode;
  985. uint32_t frame_count;
  986. uint32_t stream_type;
  987. struct stream_dimension stream_dimension;
  988. uint32_t pixel_depth;
  989. uint32_t cfa_arrangement;
  990. uint32_t output_format;
  991. uint32_t hbi;
  992. uint32_t vbi;
  993. uint16_t vc;
  994. uint16_t dt;
  995. uint32_t skip_pattern;
  996. uint32_t rotate_period;
  997. uint32_t xcfa_debug;
  998. uint32_t shdr_line_offset0;
  999. uint32_t shdr_line_offset1;
  1000. uint32_t cfa_info_exist;
  1001. struct tpg_cfa_information_t cfa_info;
  1002. uint32_t xcfa_type;
  1003. uint32_t reserved[5];
  1004. } __attribute__((packed));
  1005. /**
  1006. * tpg_illumination_control : illumianation control command
  1007. *
  1008. * @header : common header for tpg command
  1009. * @vc : virtual channel to identify the stream
  1010. * @dt : dt to identify the stream
  1011. * @exposure_short : short exposure time
  1012. * @exposure_mid : mid exposure time
  1013. * @exposure_long : long exposure time
  1014. * @r_gain : r channel gain
  1015. * @g_gain : g channel gain
  1016. * @b_gain : b channel gain
  1017. * @reserved : reserved for future use
  1018. */
  1019. struct tpg_illumination_control {
  1020. struct tpg_command_header_t header;
  1021. uint16_t vc;
  1022. uint16_t dt;
  1023. uint32_t exposure_short;
  1024. uint32_t exposure_mid;
  1025. uint32_t exposure_long;
  1026. uint16_t r_gain;
  1027. uint16_t g_gain;
  1028. uint16_t b_gain;
  1029. uint32_t reserved[4];
  1030. } __attribute__((packed));
  1031. /**
  1032. * struct cam_flash_init : Init command for the flash
  1033. * @flash_type : flash hw type
  1034. * @reserved
  1035. * @cmd_type : command buffer type
  1036. */
  1037. struct cam_flash_init {
  1038. __u32 flash_type;
  1039. __u8 reserved;
  1040. __u8 cmd_type;
  1041. __u16 reserved1;
  1042. } __attribute__((packed));
  1043. /**
  1044. * struct cam_flash_set_rer : RedEyeReduction command buffer
  1045. *
  1046. * @count : Number of flash leds
  1047. * @opcode : Command buffer opcode
  1048. * CAM_FLASH_FIRE_RER
  1049. * @cmd_type : command buffer operation type
  1050. * @num_iteration : Number of led turn on/off sequence
  1051. * @reserved
  1052. * @led_on_delay_ms : flash led turn on time in ms
  1053. * @led_off_delay_ms : flash led turn off time in ms
  1054. * @led_current_ma : flash led current in ma
  1055. *
  1056. */
  1057. struct cam_flash_set_rer {
  1058. __u32 count;
  1059. __u8 opcode;
  1060. __u8 cmd_type;
  1061. __u16 num_iteration;
  1062. __u32 led_on_delay_ms;
  1063. __u32 led_off_delay_ms;
  1064. __u32 led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS];
  1065. } __attribute__((packed));
  1066. /**
  1067. * struct cam_flash_set_on_off : led turn on/off command buffer
  1068. *
  1069. * @count : Number of Flash leds
  1070. * @opcode : Command buffer opcodes
  1071. * CAM_FLASH_FIRE_LOW
  1072. * CAM_FLASH_FIRE_HIGH
  1073. * CAM_FLASH_OFF
  1074. * @cmd_type : Command buffer operation type
  1075. * @led_current_ma : Flash led current in ma
  1076. * @time_on_duration_ns : Flash time on duration in ns
  1077. * @led_on_wait_time_ns : Flash led turn on wait time in ns
  1078. *
  1079. */
  1080. struct cam_flash_set_on_off {
  1081. __u32 count;
  1082. __u8 opcode;
  1083. __u8 cmd_type;
  1084. __u16 reserved;
  1085. __u32 led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS];
  1086. __u64 time_on_duration_ns;
  1087. __u64 led_on_wait_time_ns;
  1088. } __attribute__((packed));
  1089. /**
  1090. * struct cam_flash_query_curr : query current command buffer
  1091. *
  1092. * @reserved
  1093. * @opcode : command buffer opcode
  1094. * @cmd_type : command buffer operation type
  1095. * @query_current_ma : battery current in ma
  1096. *
  1097. */
  1098. struct cam_flash_query_curr {
  1099. __u16 reserved;
  1100. __u8 opcode;
  1101. __u8 cmd_type;
  1102. __u32 query_current_ma;
  1103. } __attribute__ ((packed));
  1104. /**
  1105. * struct cam_flash_query_cap : capabilities info for flash
  1106. *
  1107. * @slot_info : Indicates about the slotId or cell Index
  1108. * @max_current_flash : max supported current for flash
  1109. * @max_duration_flash : max flash turn on duration
  1110. * @max_current_torch : max supported current for torch
  1111. *
  1112. */
  1113. struct cam_flash_query_cap_info {
  1114. __u32 slot_info;
  1115. __u32 max_current_flash[CAM_FLASH_MAX_LED_TRIGGERS];
  1116. __u32 max_duration_flash[CAM_FLASH_MAX_LED_TRIGGERS];
  1117. __u32 max_current_torch[CAM_FLASH_MAX_LED_TRIGGERS];
  1118. } __attribute__ ((packed));
  1119. #endif