cam_cre_dev.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _CAM_CRE_DEV_H_
  6. #define _CAM_CRE_DEV_H_
  7. #include "cam_subdev.h"
  8. #include "cam_hw_mgr_intf.h"
  9. #include "cam_context.h"
  10. #include "cam_cre_context.h"
  11. /**
  12. * struct cam_cre_dev - Camera CRE V4l2 device node
  13. *
  14. * @sd: Commone camera subdevice node
  15. * @node: Pointer to cre subdevice
  16. * @ctx: CRE base context storage
  17. * @ctx_cre: CRE private context storage
  18. * @cre_mutex: CRE dev mutex
  19. * @open_cnt: Open device count
  20. */
  21. struct cam_cre_dev {
  22. struct cam_subdev sd;
  23. struct cam_node *node;
  24. struct cam_context ctx[CAM_CRE_CTX_MAX];
  25. struct cam_cre_context ctx_cre[CAM_CRE_CTX_MAX];
  26. struct mutex cre_mutex;
  27. int32_t open_cnt;
  28. };
  29. /**
  30. * @brief : API to register CRE dev to platform framework.
  31. * @return struct platform_device pointer on success, or ERR_PTR() on error.
  32. */
  33. int cam_cre_dev_init_module(void);
  34. /**
  35. * @brief : API to remove CRE dev from platform framework.
  36. */
  37. void cam_cre_dev_exit_module(void);
  38. #endif /* __CAM_CRE_DEV_H__ */