cam_sensor.h 36 KB

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