cam_jpeg_context.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. *
  45. */
  46. int cam_jpeg_context_init(struct cam_jpeg_context *ctx,
  47. struct cam_context *ctx_base,
  48. struct cam_hw_mgr_intf *hw_intf,
  49. uint32_t ctx_id);
  50. /**
  51. * cam_jpeg_context_deinit()
  52. *
  53. * @brief: Deinitialize function for the JPEG context
  54. *
  55. * @ctx: JPEG context obj to be deinitialized
  56. *
  57. */
  58. int cam_jpeg_context_deinit(struct cam_jpeg_context *ctx);
  59. #endif /* __CAM_JPEG_CONTEXT_H__ */