ITrustedCameraDriver.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #include "smcinvoke_object.h"
  6. /**
  7. * Struct containing values for programming of domain ID
  8. *
  9. * @version: Version info
  10. * @protect: To protect or reset the lanes
  11. * @csid_hw_idx_mask: Bit position denoting CSID in use
  12. * @cdm_hw_idx_mask: Bit position denoting CDM in use
  13. * @vc_mask: VC mask for identifying domain
  14. * @phy_lane_sel_mask: PHY lane info - contains CPHY, DPHY and PHY ID values
  15. * 0-15 bits -- PHY index
  16. * 16-23 bits -- CPHY lanes
  17. * 24-31 bits -- DPHY lanes
  18. * @reserved: Reserved bit
  19. */
  20. typedef struct {
  21. uint32_t version;
  22. uint32_t protect;
  23. uint32_t csid_hw_idx_mask;
  24. uint32_t cdm_hw_idx_mask;
  25. uint64_t vc_mask;
  26. uint64_t phy_lane_sel_mask;
  27. uint64_t reserved;
  28. } ITCDriverSensorInfo;
  29. #define ITrustedCameraDriver_OP_dynamicProtectSensor 0
  30. #define ITrustedCameraDriver_OP_getVersion 1
  31. static inline int32_t
  32. ITrustedCameraDriver_release(struct Object self)
  33. {
  34. return Object_invoke(self, Object_OP_release, 0, 0);
  35. }
  36. static inline int32_t
  37. ITrustedCameraDriver_retain(struct Object self)
  38. {
  39. return Object_invoke(self, Object_OP_retain, 0, 0);
  40. }
  41. static inline int32_t
  42. ITrustedCameraDriver_dynamicProtectSensor(struct Object self, const ITCDriverSensorInfo *phy_info_ptr)
  43. {
  44. union ObjectArg a[1]={{{0,0}}};
  45. a[0].bi = (struct ObjectBufIn) { phy_info_ptr, sizeof(ITCDriverSensorInfo) };
  46. return Object_invoke(self, ITrustedCameraDriver_OP_dynamicProtectSensor, a, ObjectCounts_pack(1, 0, 0, 0));
  47. }
  48. static inline int32_t
  49. ITrustedCameraDriver_getVersion(struct Object self, uint32_t *arch_ver_ptr, uint32_t *max_ver_ptr, uint32_t *min_ver_ptr)
  50. {
  51. union ObjectArg a[1]={{{0,0}}};
  52. int32_t result;
  53. struct {
  54. uint32_t m_arch_ver;
  55. uint32_t m_max_ver;
  56. uint32_t m_min_ver;
  57. } o;
  58. a[0].b = (struct ObjectBuf) { &o, 12 };
  59. result = Object_invoke(self, ITrustedCameraDriver_OP_getVersion, a, ObjectCounts_pack(0, 1, 0, 0));
  60. *arch_ver_ptr = o.m_arch_ver;
  61. *max_ver_ptr = o.m_max_ver;
  62. *min_ver_ptr = o.m_min_ver;
  63. return result;
  64. }