cam_cpas_api.h 18 KB

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