cam_jpeg_context.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2017-2018, 2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _CAM_JPEG_CONTEXT_H_
  6. #define _CAM_JPEG_CONTEXT_H_
  7. #include <media/cam_jpeg.h>
  8. #include "cam_context.h"
  9. #include "cam_jpeg_hw_mgr_intf.h"
  10. #define CAM_JPEG_HW_EVENT_MAX 20
  11. /**
  12. * struct cam_jpeg_context - Jpeg context
  13. * @base : Base jpeg cam context object
  14. * @jpeg_req : Jpeg reguest data stored during prepare update
  15. * @req_base : Common request structure
  16. */
  17. struct cam_jpeg_context {
  18. struct cam_context *base;
  19. struct cam_jpeg_request_data jpeg_req[CAM_CTX_REQ_MAX];
  20. struct cam_ctx_request req_base[CAM_CTX_REQ_MAX];
  21. };
  22. /* cam jpeg context irq handling function type */
  23. typedef int (*cam_jpeg_hw_event_cb_func)(
  24. struct cam_jpeg_context *ctx_jpeg,
  25. void *evt_data);
  26. /**
  27. * struct cam_jpeg_ctx_irq_ops - Function table for handling IRQ callbacks
  28. *
  29. * @irq_ops: Array of handle function pointers.
  30. *
  31. */
  32. struct cam_jpeg_ctx_irq_ops {
  33. cam_jpeg_hw_event_cb_func irq_ops[CAM_JPEG_HW_EVENT_MAX];
  34. };
  35. /**
  36. * cam_jpeg_context_init()
  37. *
  38. * @brief: Initialization function for the JPEG context
  39. *
  40. * @ctx: JPEG context obj to be initialized
  41. * @ctx_base: Context base from cam_context
  42. * @hw_intf: JPEG hw manager interface
  43. * @ctx_id: ID for this context
  44. * @img_iommu_hdl: IOMMU HDL for image buffers
  45. *
  46. */
  47. int cam_jpeg_context_init(struct cam_jpeg_context *ctx,
  48. struct cam_context *ctx_base,
  49. struct cam_hw_mgr_intf *hw_intf,
  50. uint32_t ctx_id,
  51. int img_iommu_hdl);
  52. /**
  53. * cam_jpeg_context_deinit()
  54. *
  55. * @brief: Deinitialize function for the JPEG context
  56. *
  57. * @ctx: JPEG context obj to be deinitialized
  58. *
  59. */
  60. int cam_jpeg_context_deinit(struct cam_jpeg_context *ctx);
  61. #endif /* __CAM_JPEG_CONTEXT_H__ */