cam_sensor.h 36 KB

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