cam_cre_context.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _CAM_CRE_CONTEXT_H_
  6. #define _CAM_CRE_CONTEXT_H_
  7. #include <media/cam_cre.h>
  8. #include "cam_context.h"
  9. #include "cam_cre_hw_mgr_intf.h"
  10. #define CAM_CRE_HW_EVENT_MAX 20
  11. /**
  12. * struct cam_cre_context - CRE context
  13. * @base: Base cre cam context object
  14. * @req_base: Common request structure
  15. */
  16. struct cam_cre_context {
  17. struct cam_context *base;
  18. struct cam_ctx_request req_base[CAM_CTX_REQ_MAX];
  19. };
  20. /* cam cre context irq handling function type */
  21. typedef int (*cam_cre_hw_event_cb_func)(
  22. struct cam_cre_context *ctx_cre,
  23. void *evt_data);
  24. /**
  25. * struct cam_cre_ctx_irq_ops - Function table for handling IRQ callbacks
  26. *
  27. * @irq_ops: Array of handle function pointers.
  28. *
  29. */
  30. struct cam_cre_ctx_irq_ops {
  31. cam_cre_hw_event_cb_func irq_ops[CAM_CRE_HW_EVENT_MAX];
  32. };
  33. /**
  34. * cam_cre_context_init()
  35. *
  36. * @brief: Initialization function for the CRE context
  37. *
  38. * @ctx: CRE context obj to be initialized
  39. * @hw_intf: CRE hw manager interface
  40. * @ctx_id: ID for this context
  41. * @img_iommu_hdl: IOMMU HDL for image buffers
  42. *
  43. */
  44. int cam_cre_context_init(struct cam_cre_context *ctx,
  45. struct cam_hw_mgr_intf *hw_intf,
  46. uint32_t ctx_id,
  47. int img_iommu_hdl);
  48. /**
  49. * cam_cre_context_deinit()
  50. *
  51. * @brief: Deinitialize function for the CRE context
  52. *
  53. * @ctx: CRE context obj to be deinitialized
  54. *
  55. */
  56. int cam_cre_context_deinit(struct cam_cre_context *ctx);
  57. #endif /* __CAM_CRE_CONTEXT_H__ */