cam_cpas_api.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _CAM_CPAS_API_H_
  6. #define _CAM_CPAS_API_H_
  7. #include <linux/device.h>
  8. #include <linux/platform_device.h>
  9. #include <media/cam_cpas.h>
  10. #include "cam_soc_util.h"
  11. #define CAM_HW_IDENTIFIER_LENGTH 128
  12. /* Default AXI Bandwidth vote */
  13. #define CAM_CPAS_DEFAULT_AXI_BW 1024
  14. #define CAM_CPAS_MAX_PATHS_PER_CLIENT 15
  15. #define CAM_CPAS_API_PATH_DATA_STD_START 512
  16. /**
  17. * enum cam_cpas_reg_base - Enum for register base identifier. These
  18. * are the identifiers used in generic register
  19. * write/read APIs provided by cpas driver.
  20. */
  21. enum cam_cpas_reg_base {
  22. CAM_CPAS_REG_CPASTOP,
  23. CAM_CPAS_REG_CAMNOC,
  24. CAM_CPAS_REG_CAMSS,
  25. CAM_CPAS_REG_MAX
  26. };
  27. /**
  28. * enum cam_cpas_camera_version Enum for Titan Camera Versions
  29. */
  30. enum cam_cpas_camera_version {
  31. CAM_CPAS_CAMERA_VERSION_NONE = 0,
  32. CAM_CPAS_CAMERA_VERSION_150 = 0x00010500,
  33. CAM_CPAS_CAMERA_VERSION_170 = 0x00010700,
  34. CAM_CPAS_CAMERA_VERSION_175 = 0x00010705,
  35. CAM_CPAS_CAMERA_VERSION_480 = 0x00040800,
  36. CAM_CPAS_CAMERA_VERSION_580 = 0x00050800,
  37. CAM_CPAS_CAMERA_VERSION_MAX
  38. };
  39. /**
  40. * enum cam_cpas_version Enum for Titan CPAS Versions
  41. */
  42. enum cam_cpas_version {
  43. CAM_CPAS_VERSION_NONE = 0,
  44. CAM_CPAS_VERSION_100 = 0x10000000,
  45. CAM_CPAS_VERSION_101 = 0x10000001,
  46. CAM_CPAS_VERSION_110 = 0x10010000,
  47. CAM_CPAS_VERSION_120 = 0x10020000,
  48. CAM_CPAS_VERSION_130 = 0x10030000,
  49. CAM_CPAS_VERSION_200 = 0x20000000,
  50. CAM_CPAS_VERSION_MAX
  51. };
  52. /**
  53. * enum cam_cpas_camera_version_map_id Enum for camera version map id
  54. * This enum is mapped with cam_cpas_camera_version
  55. */
  56. enum cam_cpas_camera_version_map_id {
  57. CAM_CPAS_CAMERA_VERSION_ID_150 = 0x0,
  58. CAM_CPAS_CAMERA_VERSION_ID_170 = 0x1,
  59. CAM_CPAS_CAMERA_VERSION_ID_175 = 0x2,
  60. CAM_CPAS_CAMERA_VERSION_ID_480 = 0x3,
  61. CAM_CPAS_CAMERA_VERSION_ID_580 = 0x4,
  62. CAM_CPAS_CAMERA_VERSION_ID_MAX
  63. };
  64. /**
  65. * enum cam_cpas_version_map_id Enum for cpas version map id
  66. * This enum is mapped with cam_cpas_version
  67. */
  68. enum cam_cpas_version_map_id {
  69. CAM_CPAS_VERSION_ID_100 = 0x0,
  70. CAM_CPAS_VERSION_ID_101 = 0x1,
  71. CAM_CPAS_VERSION_ID_110 = 0x2,
  72. CAM_CPAS_VERSION_ID_120 = 0x3,
  73. CAM_CPAS_VERSION_ID_130 = 0x4,
  74. CAM_CPAS_VERSION_ID_200 = 0x5,
  75. CAM_CPAS_VERSION_ID_MAX
  76. };
  77. /**
  78. * enum cam_cpas_hw_version - Enum for Titan CPAS HW Versions
  79. */
  80. enum cam_cpas_hw_version {
  81. CAM_CPAS_TITAN_NONE = 0,
  82. CAM_CPAS_TITAN_150_V100 = 0x150100,
  83. CAM_CPAS_TITAN_170_V100 = 0x170100,
  84. CAM_CPAS_TITAN_170_V110 = 0x170110,
  85. CAM_CPAS_TITAN_170_V120 = 0x170120,
  86. CAM_CPAS_TITAN_170_V200 = 0x170200,
  87. CAM_CPAS_TITAN_175_V100 = 0x175100,
  88. CAM_CPAS_TITAN_175_V101 = 0x175101,
  89. CAM_CPAS_TITAN_175_V120 = 0x175120,
  90. CAM_CPAS_TITAN_175_V130 = 0x175130,
  91. CAM_CPAS_TITAN_480_V100 = 0x480100,
  92. CAM_CPAS_TITAN_580_V100 = 0x580100,
  93. CAM_CPAS_TITAN_540_V100 = 0x540100,
  94. CAM_CPAS_TITAN_MAX
  95. };
  96. /**
  97. * enum cam_camnoc_irq_type - Enum for camnoc irq types
  98. *
  99. * @CAM_CAMNOC_IRQ_SLAVE_ERROR: Each slave port in CAMNOC (3 QSB ports and
  100. * 1 QHB port) has an error logger. The error
  101. * observed at any slave port is logged into
  102. * the error logger register and an IRQ is
  103. * triggered
  104. * @CAM_CAMNOC_IRQ_IFE_UBWC_STATS_ENCODE_ERROR: Triggered if any error detected
  105. * in the IFE UBWC-Stats encoder
  106. * instance
  107. * @CAM_CAMNOC_IRQ_IFE02_UBWC_ENCODE_ERROR : Triggered if any error detected
  108. * in the IFE0 UBWC encoder instance
  109. * @CAM_CAMNOC_IRQ_IFE13_UBWC_ENCODE_ERROR : Triggered if any error detected
  110. * in the IFE1 or IFE3 UBWC encoder
  111. * instance
  112. * @CAM_CAMNOC_IRQ_IFE0_UBWC_ENCODE_ERROR : Triggered if any error detected
  113. * in the IFE0 UBWC encoder instance
  114. * @CAM_CAMNOC_IRQ_IFE1_WR_UBWC_ENCODE_ERROR : Triggered if any error detected
  115. * in the IFE1 UBWC encoder
  116. * instance
  117. * @CAM_CAMNOC_IRQ_IPE1_BPS_UBWC_DECODE_ERROR: Triggered if any error detected
  118. * in the IPE1/BPS read path decoder
  119. * instance
  120. * @CAM_CAMNOC_IRQ_IPE0_UBWC_DECODE_ERROR : Triggered if any error detected
  121. * in the IPE0 read path decoder
  122. * instance
  123. * @CAM_CAMNOC_IRQ_IPE_BPS_UBWC_DECODE_ERROR: Triggered if any error detected
  124. * in the IPE/BPS UBWC decoder
  125. * instance
  126. * @CAM_CAMNOC_IRQ_IPE_BPS_UBWC_ENCODE_ERROR: Triggered if any error detected
  127. * in the IPE/BPS UBWC encoder
  128. * instance
  129. * @CAM_CAMNOC_IRQ_AHB_TIMEOUT : Triggered when the QHS_ICP slave
  130. * times out after 4000 AHB cycles
  131. */
  132. enum cam_camnoc_irq_type {
  133. CAM_CAMNOC_IRQ_SLAVE_ERROR,
  134. CAM_CAMNOC_IRQ_IFE_UBWC_STATS_ENCODE_ERROR,
  135. CAM_CAMNOC_IRQ_IFE_UBWC_STATS_1_ENCODE_ERROR,
  136. CAM_CAMNOC_IRQ_IFE02_UBWC_ENCODE_ERROR,
  137. CAM_CAMNOC_IRQ_IFE13_UBWC_ENCODE_ERROR,
  138. CAM_CAMNOC_IRQ_IFE0_UBWC_ENCODE_ERROR,
  139. CAM_CAMNOC_IRQ_IFE1_WRITE_UBWC_ENCODE_ERROR,
  140. CAM_CAMNOC_IRQ_IPE1_BPS_UBWC_DECODE_ERROR,
  141. CAM_CAMNOC_IRQ_IPE0_UBWC_DECODE_ERROR,
  142. CAM_CAMNOC_IRQ_IPE_BPS_UBWC_DECODE_ERROR,
  143. CAM_CAMNOC_IRQ_IPE_BPS_UBWC_ENCODE_ERROR,
  144. CAM_CAMNOC_IRQ_AHB_TIMEOUT,
  145. };
  146. /**
  147. * struct cam_camnoc_irq_slave_err_data : Data for Slave error.
  148. *
  149. * @mainctrl : Err logger mainctrl info
  150. * @errvld : Err logger errvld info
  151. * @errlog0_low : Err logger errlog0_low info
  152. * @errlog0_high : Err logger errlog0_high info
  153. * @errlog1_low : Err logger errlog1_low info
  154. * @errlog1_high : Err logger errlog1_high info
  155. * @errlog2_low : Err logger errlog2_low info
  156. * @errlog2_high : Err logger errlog2_high info
  157. * @errlog3_low : Err logger errlog3_low info
  158. * @errlog3_high : Err logger errlog3_high info
  159. *
  160. */
  161. struct cam_camnoc_irq_slave_err_data {
  162. union {
  163. struct {
  164. uint32_t stall_en : 1; /* bit 0 */
  165. uint32_t fault_en : 1; /* bit 1 */
  166. uint32_t rsv : 30; /* bits 2-31 */
  167. };
  168. uint32_t value;
  169. } mainctrl;
  170. union {
  171. struct {
  172. uint32_t err_vld : 1; /* bit 0 */
  173. uint32_t rsv : 31; /* bits 1-31 */
  174. };
  175. uint32_t value;
  176. } errvld;
  177. union {
  178. struct {
  179. uint32_t loginfo_vld : 1; /* bit 0 */
  180. uint32_t word_error : 1; /* bit 1 */
  181. uint32_t non_secure : 1; /* bit 2 */
  182. uint32_t device : 1; /* bit 3 */
  183. uint32_t opc : 3; /* bits 4 - 6 */
  184. uint32_t rsv0 : 1; /* bit 7 */
  185. uint32_t err_code : 3; /* bits 8 - 10 */
  186. uint32_t sizef : 3; /* bits 11 - 13 */
  187. uint32_t rsv1 : 2; /* bits 14 - 15 */
  188. uint32_t addr_space : 6; /* bits 16 - 21 */
  189. uint32_t rsv2 : 10; /* bits 22 - 31 */
  190. };
  191. uint32_t value;
  192. } errlog0_low;
  193. union {
  194. struct {
  195. uint32_t len1 : 10; /* bits 0 - 9 */
  196. uint32_t rsv : 22; /* bits 10 - 31 */
  197. };
  198. uint32_t value;
  199. } errlog0_high;
  200. union {
  201. struct {
  202. uint32_t path : 16; /* bits 0 - 15 */
  203. uint32_t rsv : 16; /* bits 16 - 31 */
  204. };
  205. uint32_t value;
  206. } errlog1_low;
  207. union {
  208. struct {
  209. uint32_t extid : 18; /* bits 0 - 17 */
  210. uint32_t rsv : 14; /* bits 18 - 31 */
  211. };
  212. uint32_t value;
  213. } errlog1_high;
  214. union {
  215. struct {
  216. uint32_t errlog2_lsb : 32; /* bits 0 - 31 */
  217. };
  218. uint32_t value;
  219. } errlog2_low;
  220. union {
  221. struct {
  222. uint32_t errlog2_msb : 16; /* bits 0 - 16 */
  223. uint32_t rsv : 16; /* bits 16 - 31 */
  224. };
  225. uint32_t value;
  226. } errlog2_high;
  227. union {
  228. struct {
  229. uint32_t errlog3_lsb : 32; /* bits 0 - 31 */
  230. };
  231. uint32_t value;
  232. } errlog3_low;
  233. union {
  234. struct {
  235. uint32_t errlog3_msb : 32; /* bits 0 - 31 */
  236. };
  237. uint32_t value;
  238. } errlog3_high;
  239. };
  240. /**
  241. * struct cam_camnoc_irq_ubwc_enc_data : Data for UBWC Encode error.
  242. *
  243. * @encerr_status : Encode error status
  244. *
  245. */
  246. struct cam_camnoc_irq_ubwc_enc_data {
  247. union {
  248. struct {
  249. uint32_t encerrstatus : 3; /* bits 0 - 2 */
  250. uint32_t rsv : 29; /* bits 3 - 31 */
  251. };
  252. uint32_t value;
  253. } encerr_status;
  254. };
  255. /**
  256. * struct cam_camnoc_irq_ubwc_dec_data : Data for UBWC Decode error.
  257. *
  258. * @decerr_status : Decoder error status
  259. * @thr_err : Set to 1 if
  260. * At least one of the bflc_len fields in the bit steam exceeds
  261. * its threshold value. This error is possible only for
  262. * RGBA1010102, TP10, and RGB565 formats
  263. * @fcl_err : Set to 1 if
  264. * Fast clear with a legal non-RGB format
  265. * @len_md_err : Set to 1 if
  266. * The calculated burst length does not match burst length
  267. * specified by the metadata value
  268. * @format_err : Set to 1 if
  269. * Illegal format
  270. * 1. bad format :2,3,6
  271. * 2. For 32B MAL, metadata=6
  272. * 3. For 32B MAL RGB565, Metadata != 0,1,7
  273. * 4. For 64B MAL RGB565, metadata[3:1] == 1,2
  274. *
  275. */
  276. struct cam_camnoc_irq_ubwc_dec_data {
  277. union {
  278. struct {
  279. uint32_t thr_err : 1; /* bit 0 */
  280. uint32_t fcl_err : 1; /* bit 1 */
  281. uint32_t len_md_err : 1; /* bit 2 */
  282. uint32_t format_err : 1; /* bit 3 */
  283. uint32_t rsv : 28; /* bits 4 - 31 */
  284. };
  285. uint32_t value;
  286. } decerr_status;
  287. };
  288. struct cam_camnoc_irq_ahb_timeout_data {
  289. uint32_t data;
  290. };
  291. /**
  292. * struct cam_cpas_irq_data : CAMNOC IRQ data
  293. *
  294. * @irq_type : To identify the type of IRQ
  295. * @u : Union of irq err data information
  296. * @slave_err : Data for Slave error.
  297. * Valid if type is CAM_CAMNOC_IRQ_SLAVE_ERROR
  298. * @enc_err : Data for UBWC Encode error.
  299. * Valid if type is one of below:
  300. * CAM_CAMNOC_IRQ_IFE02_UBWC_ENCODE_ERROR
  301. * CAM_CAMNOC_IRQ_IFE13_UBWC_ENCODE_ERROR
  302. * CAM_CAMNOC_IRQ_IPE_BPS_UBWC_ENCODE_ERROR
  303. * @dec_err : Data for UBWC Decode error.
  304. * Valid if type is CAM_CAMNOC_IRQ_IPE_BPS_UBWC_DECODE_ERROR
  305. * @ahb_err : Data for Slave error.
  306. * Valid if type is CAM_CAMNOC_IRQ_AHB_TIMEOUT
  307. *
  308. */
  309. struct cam_cpas_irq_data {
  310. enum cam_camnoc_irq_type irq_type;
  311. union {
  312. struct cam_camnoc_irq_slave_err_data slave_err;
  313. struct cam_camnoc_irq_ubwc_enc_data enc_err;
  314. struct cam_camnoc_irq_ubwc_dec_data dec_err;
  315. struct cam_camnoc_irq_ahb_timeout_data ahb_err;
  316. } u;
  317. };
  318. /**
  319. * struct cam_cpas_register_params : Register params for cpas client
  320. *
  321. * @identifier : Input identifier string which is the device label
  322. * from dt like vfe, ife, jpeg etc
  323. * @cell_index : Input integer identifier pointing to the cell index
  324. * from dt of the device. This can be used to form a
  325. * unique string with @identifier like vfe0, ife1,
  326. * jpeg0, etc
  327. * @dev : device handle
  328. * @userdata : Input private data which will be passed as
  329. * an argument while callback.
  330. * @cam_cpas_callback : Input callback pointer for triggering the
  331. * callbacks from CPAS driver.
  332. * @client_handle : CPAS client handle
  333. * @userdata : User data given at the time of register
  334. * @event_type : event type
  335. * @event_data : event data
  336. * @client_handle : Output Unique handle generated for this register
  337. *
  338. */
  339. struct cam_cpas_register_params {
  340. char identifier[CAM_HW_IDENTIFIER_LENGTH];
  341. uint32_t cell_index;
  342. struct device *dev;
  343. void *userdata;
  344. bool (*cam_cpas_client_cb)(
  345. uint32_t client_handle,
  346. void *userdata,
  347. struct cam_cpas_irq_data *irq_data);
  348. uint32_t client_handle;
  349. };
  350. /**
  351. * enum cam_vote_type - Enum for voting type
  352. *
  353. * @CAM_VOTE_ABSOLUTE : Absolute vote
  354. * @CAM_VOTE_DYNAMIC : Dynamic vote
  355. */
  356. enum cam_vote_type {
  357. CAM_VOTE_ABSOLUTE,
  358. CAM_VOTE_DYNAMIC,
  359. };
  360. /**
  361. * struct cam_ahb_vote : AHB vote
  362. *
  363. * @type : AHB voting type.
  364. * CAM_VOTE_ABSOLUTE : vote based on the value 'level' is set
  365. * CAM_VOTE_DYNAMIC : vote calculated dynamically using 'freq'
  366. * and 'dev' handle is set
  367. * @level : AHB vote level
  368. * @freq : AHB vote dynamic frequency
  369. *
  370. */
  371. struct cam_ahb_vote {
  372. enum cam_vote_type type;
  373. union {
  374. enum cam_vote_level level;
  375. unsigned long freq;
  376. } vote;
  377. };
  378. /**
  379. * struct cam_axi_vote : AXI vote
  380. *
  381. * @num_paths: Number of paths on which BW vote is sent to CPAS
  382. * @axi_path: Per path BW vote info
  383. *
  384. */
  385. struct cam_axi_vote {
  386. uint32_t num_paths;
  387. struct cam_axi_per_path_bw_vote axi_path[CAM_CPAS_MAX_PATHS_PER_CLIENT];
  388. };
  389. /**
  390. * cam_cpas_register_client()
  391. *
  392. * @brief: API to register cpas client
  393. *
  394. * @register_params: Input params to register as a client to CPAS
  395. *
  396. * @return 0 on success.
  397. *
  398. */
  399. int cam_cpas_register_client(
  400. struct cam_cpas_register_params *register_params);
  401. /**
  402. * cam_cpas_unregister_client()
  403. *
  404. * @brief: API to unregister cpas client
  405. *
  406. * @client_handle: Client handle to be unregistered
  407. *
  408. * @return 0 on success.
  409. *
  410. */
  411. int cam_cpas_unregister_client(uint32_t client_handle);
  412. /**
  413. * cam_cpas_start()
  414. *
  415. * @brief: API to start cpas client hw. Clients have to vote for minimal
  416. * bandwidth requirements for AHB, AXI. Use cam_cpas_update_ahb_vote
  417. * to scale bandwidth after start.
  418. *
  419. * @client_handle: client cpas handle
  420. * @ahb_vote : Pointer to ahb vote info
  421. * @axi_vote : Pointer to axi bandwidth vote info
  422. *
  423. * If AXI vote is not applicable to a particular client, use the value exposed
  424. * by CAM_CPAS_DEFAULT_AXI_BW as the default vote request.
  425. *
  426. * @return 0 on success.
  427. *
  428. */
  429. int cam_cpas_start(
  430. uint32_t client_handle,
  431. struct cam_ahb_vote *ahb_vote,
  432. struct cam_axi_vote *axi_vote);
  433. /**
  434. * cam_cpas_stop()
  435. *
  436. * @brief: API to stop cpas client hw. Bandwidth for AHB, AXI votes
  437. * would be removed for this client on this call. Clients should not
  438. * use cam_cpas_update_ahb_vote or cam_cpas_update_axi_vote
  439. * to remove their bandwidth vote.
  440. *
  441. * @client_handle: client cpas handle
  442. *
  443. * @return 0 on success.
  444. *
  445. */
  446. int cam_cpas_stop(uint32_t client_handle);
  447. /**
  448. * cam_cpas_update_ahb_vote()
  449. *
  450. * @brief: API to update AHB vote requirement. Use this function only
  451. * between cam_cpas_start and cam_cpas_stop in case clients wants
  452. * to scale to different vote level. Do not use this function to de-vote,
  453. * removing client's vote is implicit on cam_cpas_stop
  454. *
  455. * @client_handle : Client cpas handle
  456. * @ahb_vote : Pointer to ahb vote info
  457. *
  458. * @return 0 on success.
  459. *
  460. */
  461. int cam_cpas_update_ahb_vote(
  462. uint32_t client_handle,
  463. struct cam_ahb_vote *ahb_vote);
  464. /**
  465. * cam_cpas_update_axi_vote()
  466. *
  467. * @brief: API to update AXI vote requirement. Use this function only
  468. * between cam_cpas_start and cam_cpas_stop in case clients wants
  469. * to scale to different vote level. Do not use this function to de-vote,
  470. * removing client's vote is implicit on cam_cpas_stop
  471. *
  472. * @client_handle : Client cpas handle
  473. * @axi_vote : Pointer to axi bandwidth vote info
  474. *
  475. * @return 0 on success.
  476. *
  477. */
  478. int cam_cpas_update_axi_vote(
  479. uint32_t client_handle,
  480. struct cam_axi_vote *axi_vote);
  481. /**
  482. * cam_cpas_reg_write()
  483. *
  484. * @brief: API to write a register value in CPAS register space
  485. *
  486. * @client_handle : Client cpas handle
  487. * @reg_base : Register base identifier
  488. * @offset : Offset from the register base address
  489. * @mb : Whether to do reg write with memory barrier
  490. * @value : Value to be written in register
  491. *
  492. * @return 0 on success.
  493. *
  494. */
  495. int cam_cpas_reg_write(
  496. uint32_t client_handle,
  497. enum cam_cpas_reg_base reg_base,
  498. uint32_t offset,
  499. bool mb,
  500. uint32_t value);
  501. /**
  502. * cam_cpas_reg_read()
  503. *
  504. * @brief: API to read a register value from CPAS register space
  505. *
  506. * @client_handle : Client cpas handle
  507. * @reg_base : Register base identifier
  508. * @offset : Offset from the register base address
  509. * @mb : Whether to do reg read with memory barrier
  510. * @value : Value to be red from register
  511. *
  512. * @return 0 on success.
  513. *
  514. */
  515. int cam_cpas_reg_read(
  516. uint32_t client_handle,
  517. enum cam_cpas_reg_base reg_base,
  518. uint32_t offset,
  519. bool mb,
  520. uint32_t *value);
  521. /**
  522. * cam_cpas_get_hw_info()
  523. *
  524. * @brief: API to get camera hw information
  525. *
  526. * @camera_family : Camera family type. One of
  527. * CAM_FAMILY_CAMERA_SS
  528. * CAM_FAMILY_CPAS_SS
  529. * @camera_version : Camera platform version
  530. * @cpas_version : Camera cpas version
  531. * @cam_caps : Camera capability
  532. *
  533. * @return 0 on success.
  534. *
  535. */
  536. int cam_cpas_get_hw_info(
  537. uint32_t *camera_family,
  538. struct cam_hw_version *camera_version,
  539. struct cam_hw_version *cpas_version,
  540. uint32_t *cam_caps);
  541. /**
  542. * cam_cpas_get_cpas_hw_version()
  543. *
  544. * @brief: API to get camera cpas hw version
  545. *
  546. * @hw_version : Camera cpas hw version
  547. *
  548. * @return 0 on success.
  549. *
  550. */
  551. int cam_cpas_get_cpas_hw_version(
  552. uint32_t *hw_version);
  553. /**
  554. * cam_cpas_is_feature_supported()
  555. *
  556. * @brief: API to get camera features
  557. *
  558. * @flag : Camera hw features to check
  559. *
  560. * @return 1 if feature is supported
  561. *
  562. */
  563. int cam_cpas_is_feature_supported(
  564. uint32_t flag);
  565. /**
  566. * cam_cpas_axi_util_path_type_to_string()
  567. *
  568. * @brief: API to get string for given path type
  569. *
  570. * @path_data_type : Path type
  571. *
  572. * @return string.
  573. *
  574. */
  575. const char *cam_cpas_axi_util_path_type_to_string(
  576. uint32_t path_data_type);
  577. /**
  578. * cam_cpas_axi_util_trans_type_to_string()
  579. *
  580. * @brief: API to get string for given transaction type
  581. *
  582. * @path_data_type : Transaction type
  583. *
  584. * @return string.
  585. *
  586. */
  587. const char *cam_cpas_axi_util_trans_type_to_string(
  588. uint32_t path_data_type);
  589. #endif /* _CAM_CPAS_API_H_ */